chore: MCP 自启 + 预备编队画面建档 + harness 两仓协同 - #2618
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (11)
🚧 Files skipped from review as they are similar to previous changes (9)
📝 WalkthroughWalkthrough本次变更新增测试仓协同提交规则、预备编队相关文档,以及 Windows 登录时启动 MCP Server 的 PowerShell 脚本和配置说明。 Changes测试仓协同流程
预备编队文档
MCP Server 登录自启
Estimated code review effort: 2 (Simple) | ~15 minutes Sequence Diagram(s)sequenceDiagram
participant WindowsStartup
participant create_mcp_server_startup_shortcut.ps1
participant start_mcp_server.ps1
participant MCPServer
WindowsStartup->>create_mcp_server_startup_shortcut.ps1: 创建 Startup 快捷方式
create_mcp_server_startup_shortcut.ps1->>start_mcp_server.ps1: 登录后启动 MCP Server 脚本
start_mcp_server.ps1->>MCPServer: 使用 uv run 启动主服务
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 7
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/develop/zzz/application/predefined_team_checker.md`:
- Line 5: 将 PredefinedTeamChecker 的首次说明中的“devtools
app”改为直白中文定义,明确其为开发工具应用、不参与玩法流程,仅用于校准并回写 team_config;保留 PredefinedTeamChecker
这一代码标识符,并补充一个简短使用例子以符合术语首次出现规范。
- Around line 13-15: 更新文档中头像识别区域的描述,明确其实际范围为横坐标 x - 10 至 x + 800、纵坐标 y 至 y +
250,并保留 800×250 区域的上下边界含义;以 predefined_team_checker.py 中 avatar_rect 的实现为准,避免描述为
x 至 x + 800。
In `@docs/game/screens/预备编队.md`:
- Line 19: 统一两个文档中的核心技计数格式:在 docs/game/screens/预备编队.md 第19行将“核心技 X/3”改为“核心技
X/Y”,并引用第28行定义 Y 为队伍人数;在 docs/develop/zzz/application/predefined_team_checker.md
第21行同步改为“核心技 X/Y”。
- Line 60: 将该文档中的描述限定为“选择子态的卡片元素”:仅说明 ChoosePredefinedTeam
负责选择子态的硬编码坐标识别,并补充管理态由 PredefinedTeamChecker 通过队名 OCR 定位队伍后计算 avatar_rect
识别头像,避免将整个预备编队画面的识别都归因于选择逻辑。
In `@skills/zzz-od-dev-pr-finishing/design.md`:
- Line 31: 在设计文档第 11 条的测试仓 PR 查询步骤中,为 gh pr list --head <分支>
明确指定测试仓仓库上下文,使用测试仓对应的 --repo 参数或等效的测试仓目录查询方式;保留后续 git 分支差异检查及其“不以 open PR
判定是否有配套改动”的流程。
In `@skills/zzz-od-dev-pr-finishing/SKILL.md`:
- Line 66: Update the test-repository verification guidance around the git
fetch/log command to explicitly identify the remote and source branch used for
the test-repository PR branch. Align that branch with the one consumed by
.github/workflows/test-check.yml, and ensure the instructions account for
fetching or otherwise validating the local same-named branch before comparing it
with https/main.
In `@tools/mcp/start_mcp_server.ps1`:
- Around line 44-47: Update the command in the try block of the PowerShell
startup script so `--env-file .env` is included only when the `.env` file
exists; otherwise run the same `uv` server command without that option. Preserve
the existing host, port, logging redirection, and server module behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 702f7535-f1e9-4f89-8b15-795a40efa980
📒 Files selected for processing (11)
AGENTS.mddocs/develop/development_workflow.mddocs/develop/zzz/application/predefined_team_checker.mddocs/develop/zzz/backend/entry.mddocs/develop/zzz/backend/remote-ssh.mddocs/game/screens/README.mddocs/game/screens/预备编队.mdskills/zzz-od-dev-pr-finishing/SKILL.mdskills/zzz-od-dev-pr-finishing/design.mdtools/mcp/create_mcp_server_startup_shortcut.ps1tools/mcp/start_mcp_server.ps1
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tools/mcp/start_mcp_server.ps1`:
- Around line 44-45: Update the $EnvArg assignment to pass --env-file .env only
when Test-Path ".env" uses -PathType Leaf, while preserving the empty argument
when .env is missing or is a directory.
- Around line 46-52: 在启动命令的 try 块中,紧接着 `cmd /c` 调用检查
`$LASTEXITCODE`;当其为非零时输出包含退出码的错误信息,并使用该退出码退出脚本,确保启动失败不会继续报告成功。保留现有 `catch` 处理未捕获
PowerShell 异常的逻辑。
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: a9c2d932-86cf-4ffb-9b8f-5611c1d121d8
📒 Files selected for processing (3)
docs/develop/zzz/application/predefined_team_checker.mddocs/game/screens/预备编队.mdtools/mcp/start_mcp_server.ps1
🚧 Files skipped from review as they are similar to previous changes (2)
- docs/develop/zzz/application/predefined_team_checker.md
- docs/game/screens/预备编队.md
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tools/mcp/start_mcp_server.ps1 (1)
34-35: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win仅在日志路径是目录时跳过创建。
Test-Path $LogDir对普通文件和目录都返回$true。如果.debug\zzz_od_mcp被普通文件占用,脚本会跳过Line 35;Line 49把 stdout/stderr 重定向到.debug\zzz_od_mcp\main_server.log时无法创建日志文件,MCP Server 启动失败。请使用-PathType Container。建议修改
-if (-not (Test-Path $LogDir)) { +if (-not (Test-Path -Path $LogDir -PathType Container)) {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tools/mcp/start_mcp_server.ps1` around lines 34 - 35, Update the LogDir existence check in the MCP server startup script to use Test-Path with -PathType Container, so directory creation is skipped only when $LogDir is an existing directory; preserve the New-Item behavior when the path is missing or occupied by a file.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@tools/mcp/start_mcp_server.ps1`:
- Around line 34-35: Update the LogDir existence check in the MCP server startup
script to use Test-Path with -PathType Container, so directory creation is
skipped only when $LogDir is an existing directory; preserve the New-Item
behavior when the path is missing or occupied by a file.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: cb6de958-89ae-4afc-9445-e1f81687b8b2
📒 Files selected for processing (1)
tools/mcp/start_mcp_server.ps1
tools/mcp/create_mcp_server_startup_shortcut.ps1 在 Startup 文件夹建快捷方式,登录后直接起主 server(Session 1,不经 daemon,仍能被 daemon 按进程命令行发现并管理 status/stop/restart);start_mcp_server.ps1 把日志重定向到 .debug/zzz_od_mcp/main_server.log(与 GUI/daemon start 一致)。entry.md/remote-ssh.md 补开机自启说明。 Co-Authored-By: Claude Code <noreply@anthropic.com> Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
预备编队是多玩法共用的通用画面(实战模拟室/防卫战/恶名狩猎/管理编辑),独立建档: - docs/game/screens/预备编队.md:两子态(选择=准备出战,有 SELECT/预备出战;编辑=PredefinedTeamChecker 管理,只能编辑),布局(2×3 卡片+1P/2P/3P+核心技X/3+等级),选队点队名右侧+300px - docs/develop/zzz/application/predefined_team_checker.md:识别预备编队角色校准工具 app doc(菜单→预备编队→OCR队名+模板代理人→写回 team_config→翻页) Co-Authored-By: Claude Code <noreply@anthropic.com> Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
实拍编辑/管理子态(PredefinedTeamChecker 从菜单-更多功能进):主体布局同选择子态(2×3 卡片+1P/2P/3P+核心技X/3+等级),但无 SELECT/预备出战/TEAM 选中态(只能编辑不能选出战),印证两子态区别。 Co-Authored-By: Claude Code <noreply@anthropic.com> Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
主仓 PR 合并后才发现测试仓 11 个未合 commit(分支有改动但没开 PR), 收尾时查 open PR 为空误判"无配套"。根因:两仓协同方法论困在 development_workflow「游戏自动化功能」章节,backend / 重构等非游戏 流程改动覆盖不到。 - AGENTS.md「提交流程与协作边界」加两仓协同指令(通用,不限游戏流程) - development_workflow.md §4 泛化适用范围到所有涉及测试仓改动 - pr-finishing §6 加 git 验证兜底(open PR 空 ≠ 无配套)+ design.md 决策 11 Co-Authored-By: Claude Code <noreply@anthropic.com> Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
AGENTS.md「同开关联 PR」补:跨仓链接用 OneDragon-Anything/<repo>#<N> 或完整 URL,禁裸 #N(GitHub 识别成本仓而非目标仓)。 Co-Authored-By: Claude Code <noreply@anthropic.com> Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
- start_mcp_server.ps1(Major):.env 不存在时不传 --env-file,避免 uv 启动失败导致自启起不来。 - predefined_team_checker.md:定义 devtools app + 写实际坐标(x-10 到 x+800)。 - 预备编队.md:核心技统一 X/Y(分母=人数)+ 备注补充管理子态 PredefinedTeamChecker 也用 avatar_rect。 Co-Authored-By: Claude Code <noreply@anthropic.com> Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
CodeRabbit 增量 review 2 条: - .env 用 Test-Path -PathType Leaf(排除 .env 是目录的边界,目录会让 uv 失败)。 - cmd /c 后检查 $LASTEXITCODE 非零则 exit(ErrorActionPreference 对原生命令无效,非零退出码不进 catch,否则启动失败仍报成功)。 Co-Authored-By: Claude Code <noreply@anthropic.com> Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
cc8be62 to
d0146bd
Compare
变更
1. MCP 主 server 开机自启(
b508aa14)tools/mcp/create_mcp_server_startup_shortcut.ps1在 Startup 建快捷方式,登录后直接起主 server(Session 1,不经 daemon,仍能被 daemon 发现管理);start_mcp_server.ps1重定向日志。backend doc 补自启说明。2. 预备编队通用画面建档(
9e4cc185+2a7c9d92)预备编队列表是多玩法共用的通用画面(实战模拟室/防卫战/恶名狩猎/管理编辑),独立建档:
docs/game/screens/预备编队.md:两子态——选择(准备出战,有 SELECT/预备出战)/ 编辑管理(PredefinedTeamChecker 进,只能编辑不能选)。主体布局(2×3 卡片+1P/2P/3P+核心技 X/3+等级)、选队(+300px)、X/Y OCR 连写坑。docs/develop/zzz/application/predefined_team_checker.md:识别预备编队角色校准工具 app doc。3. harness 两仓协同(
4d4abb20,cherry-pick 自 pr-2574)docs(harness):两仓协同 git 验证 + 泛化非游戏流程(AGENTS.md / development_workflow.md / pr-finishing)。配套测试仓
zzz-od-test #36:预备编队画面归档截图(选择/编辑两态)。
验证
Summary by CodeRabbit
新功能
文档