fix(plan): 完成门只拦 executing plan,不拦 approved-only(修死锁) - #21
Merged
Conversation
…only An approved-but-not-started plan (status=approved, steps still pending) was blocked by the gate, which then told the model to plan_step skip the remaining steps. But skipStep rejects plans that aren't executing (a step must be in_progress), so the model retried until the tool-loop guard halted the run -> crashed runs (is_error:true). Discovered end-to-end with a real model. Fix: the gate fires only on status==='executing'. An approved-only plan hasn't begun execution, so ending there isn't mid-run slacking — and the gate must not create the deadlock. Executing plans (started, 0/N) are still guarded. Verified: Case 10 (approved-only -> pass); 4 regression specs pass; typecheck clean. Co-Authored-By: Claude <noreply@anthropic.com>
1-ztc
added a commit
that referenced
this pull request
Jul 26, 2026
The regex /(?:supported|available)\s+models?\s*[:\-]?\s*([^\n.]{5,})/i (added
in 44a03d9) used \- inside a character class, which eslint no-useless-escape
flags. \- is unnecessary there (a trailing - in [] is literal). CI failed on
main after merging #21 because that commit was the first to run the full
lint pipeline over 44a03d9's change. Change [:\-]? -> [:-]? — identical
match behavior (optional : or -), just no useless escape.
Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
完成门拦了
approved-但-未-start的 plan,导致死锁崩 run。死锁链:
发现方式: critic 真 A/B 裸跑时,模型 approve 了 plan 后按指令不执行就 end_turn,触发完成门,模型想 skip 兜底,skip 报错,崩 run。真实模型场景暴露,非单测能覆盖。
Fix
完成门只拦
status === executing,不拦approved(plan-completion-gate.ts:51)。理由: 完成门职责是"执行中没做完不许声称完成"。
approved-未-start是"计划已批、还没开始执行",这种状态下 end_turn 不是"执行到一半偷懒",是模型还没开始/选择不执行——完成门拦它越界。且拦了就死锁(skip 在非 executing 拒)。executing(已 start,0/N)仍照拦,不变。测试
plan-completion-gate-integ集成测试,它用 approve+start 进 executing,仍被拦,证明 executing 路径没受影响)关联
🤖 Generated with Claude Code