refactor: 拆分 run_subtask 为多个辅助函数 (Issue #3)#21
Conversation
Code Review — PR #21: 拆分 run_subtask 为多个辅助函数🔴 Critical1. 原代码使用 后果: git commit 消息将永远不包含 issue 引用(如 修复: 给 🟡 Major2. 函数签名接受 修复: 移除 3. 原代码中,context 生成使用的 修复: 在 4. 函数签名包含 修复: 移除 🟢 Minor
|
✅ Review 问题已修复修复提交已推送,4 个问题全部解决:
测试结果:163 passed |
拆分为: _create_worktree(), _build_task_md(), _run_claude(), _verify_changes(), _generate_context() Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1. _verify_changes 添加 issue_ref 参数,调用方传入(修复 commit 消息丢失 issue 引用) 2. 移除 _verify_changes 的 has_changes 死代码参数 3. 保存原始 verification 值传给 _generate_context(修复路径重写问题) 4. 移除 _build_task_md 未使用的 upstream_worktrees 参数 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
67edd3a to
5512fed
Compare
…sue #7) Rebased onto main (after PRs #20, #21, #27), conflicts resolved. Key changes: - 14 modules: type annotations added to all public functions - cli.py: argparse code preserved from PR #20 - executor.py: refactored functions preserved from PR #21, security functions from PR #27 - Fixed: logger definitions in eval.py, tui.py, git_utils.py Tests: 277 passed.
Summary
修复 Issue #3: 拆分 run_subtask() 函数
修复
将 ~380 行的
run_subtask拆分为5个辅助函数:_create_worktree()- worktree 创建_build_task_md()- TASK.md 构建和 Skill 注入_run_claude()- Claude 执行_verify_changes()- 变更验证和重试逻辑_generate_context()- 下游共享上下文生成测试
Checklist