Repository navigation
feat: 冲突任务在合并结果之上重做; 修复成功运行多挂 15 分钟 - #18
Conversation
…anging for 15 minutes - scheduler: a task whose commit conflicts is run again in a fresh worktree from the current base branch with a note naming the conflicting files (conflictRetries, default 1, 0 = off). The conflicting attempt is kept as fsc/<id>-attemptN until a retry merges. Retried tasks that touch files another merged task also touched are listed in report.retryOverlaps and printed as a WARNING: a clean merge does not prove the retry kept the other task's change. - local execution: clear the agent timeout timer when the agent exits. It was never cleared, so a successful run kept the process alive until the timer fired (15 min); failing runs exited via process.exit(1) and hid it. Measured: 2-task run 15m28s -> 1m18s. Regression test included. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016FSVfwwP6TVxGLUWatWM53
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016FSVfwwP6TVxGLUWatWM53
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Caution Review failedThe pull request is closed. Finishing Touches
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 |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa8e2bc8db
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const r = await this.execution.execute({ ...unit, id: task.ID, repoPath }); | ||
| await this.worktrees.removeWorktree(r.worktreePath, repoPath); | ||
| retryResults.push(r); | ||
| executionResults.push(r); | ||
| retries[task.ID] = round; |
There was a problem hiding this comment.
Update task state from the retry execution result
If a retry exits nonzero or times out after changing files, LocalExecution can return a failure result with an auto-committed partial change. This loop merges that commit without updating the task's original completed state. Reproducing with a retry that appends a line and exits 1 yields completed: 2, failed: 0, and two successful merges, so the CLI reports success and exits 0 despite the failed agent. Update the state and error from the latest execution result so retry failures cannot be reported as successful completion.
Useful? React with 👍 / 👎.
| const unit = this.buildUnit(task, repoPath, undefined, note); | ||
| const r = await this.execution.execute({ ...unit, id: task.ID, repoPath }); |
There was a problem hiding this comment.
Restore the task-specific Salacia plugin for retries
When Salacia is enabled, retries are built without their scope contract and execute using whichever plugin remains in this.execution.salaciaPlugin from the initial batch. For example, with concurrency 1, if task b conflicts and task c executes afterward, b's retry uses c's plugin; SalaciaPlugin.checkDrift finds no contract for b and returns blocked: false. Consequently, a retry that commits changes to protected paths can bypass the protection enforced on its original attempt. Preserve or recreate the task-specific plugin and use it both when building and executing the retry.
Useful? React with 👍 / 👎.
1. 冲突任务在合并结果之上重做(
conflictRetries,默认 1,0 为关闭)main)里再跑一次 agent,并在提示里写明哪些文件冲突、那些改动已经在工作区里。fsc/<id>-attemptN,重试合并成功后才删除。report.retryOverlaps,CLI 打印 WARNING,让人去确认。2. 修复:成功的运行会多挂 15 分钟
每个 agent 的超时定时器(默认 15 分钟)从来不清除,Bun 要等它触发才退出进程。失败的运行通过
process.exit(1)退出,所以只有成功的运行慢。我此前把这个现象归因于用户级 hook,是错的(#17 已更正)。清除定时器后,同一个两任务运行总耗时从 15 分 28 秒降到 1 分 18 秒,进程在报告打印后立即退出。实测
claude,三个任务(两个改同一行):greet-b冲突后重试合并成功,3/3 合并,69 秒。但最终GREETING = "good day",greet-a的"hi there"被覆盖,这正是上面 WARNING 要提示的情况。claude,两任务冒烟:总耗时 1 分 18 秒,退出码 0。测试
conflictRetries: 0保持旧行为;重试再次输掉竞争时如实报告并保留两次尝试;retryOverlaps;定时器回归测试(不加修复时失败)。tsc --noEmit退出码 0;bun test(packages/core)188 通过 / 45 跳过 / 0 失败没做 / 没验证
claude测过;gemini、codex 未测。🤖 Generated with Claude Code
https://claude.ai/code/session_016FSVfwwP6TVxGLUWatWM53