Files
AgentScript/agent/backend/start_backend.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

24 lines
1.1 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**。
#
# 原因(Agent问题排查手册 13.9):
# Claude 干活会写文件,WatchFiles 检测到就自动重启后端,
# 正在执行的任务被杀、session_id 与对话历史落库丢失、SSE 断开。
# 这是自毁反馈回路,必须靠「跑任务时关掉 reload」打断。
#
# 开发调试请用 start_backend.dev.ps1(--reload-dir app 限定监听范围)。
# ============================================================
$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 "[启动] 后端(无热重载,适合执行改码任务)..." -ForegroundColor Green
Write-Host "[启动] 目录: $PSScriptRoot" -ForegroundColor DarkGray
& .\.venv\Scripts\python.exe -m uvicorn app.main:app --host 127.0.0.1 --port 8002