Files
AgentScript/agent/backend/start_backend.dev.ps1
T
HenryandClaude Code 26e13ff032 feat: Agent 工作区初始提交(源码+文档+Skills)
包含 CodeAgent 前后端源码、SKILLS、MCP、demo 代码与工作区文档。
排除依赖缓存、运行数据、备份与二进制附件,规则见 .gitignore。

Co-Authored-By: Claude Code <[email protected]>
2026-11-13 13:48:41 +08:00

32 lines
1.4 KiB
PowerShell
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 后端启动脚本 —— 开发模式(限定热重载监听范围)
# ============================================================
# 用途:改后端代码时用这个,保存即热重载。
#
# 【关键】--reload-dir app:只监听 app/ 源码目录。
# 不加它的话 uvicorn 默认监听整个 backend/,
# Claude 往 backend/ 根目录丢一个临时脚本(如 _verify_zentao.py)
# 就会触发重启 → 任务被杀(Agent问题排查手册 13.9)。
#
# ⚠️ 仍然注意:改码任务会改 app/ 下的源码,照样会触发重载。
# 要跑改码任务请用 start_backend.ps1(无 reload)。
# ============================================================
$ErrorActionPreference = "Stop"
Set-Location $PSScriptRoot
# 依赖缓存统一走 D:\env 公共依赖区(uv 下载缓存 / 解释器安装位)
$env:UV_CACHE_DIR = 'D:\env\uv-cache'
$env:UV_PYTHON_INSTALL_DIR = 'D:\env\uv-python'
Write-Host "[启动] 后端(开发模式:仅监听 app/ 目录)..." -ForegroundColor Yellow
Write-Host "[启动] 目录: $PSScriptRoot" -ForegroundColor DarkGray
Write-Host "[提醒] 执行改码任务请改用 start_backend.ps1" -ForegroundColor DarkYellow
& .\.venv\Scripts\python.exe -m uvicorn app.main:app `
--host 127.0.0.1 --port 8002 `
--reload `
--reload-dir app `
--reload-exclude "*.py.tmp" `
--reload-exclude "_*.py" `
--reload-exclude "tests/*"