fix(core): stop Goal retries after evidence catalog exhaustion - #8430
Conversation
|
@qwen-code /takeover |
|
🤝 Takeover engaged: the autofix loop now manages this PR — it will address new review feedback and resolve base conflicts until the label is removed or the round cap is reached. This is a fork PR, so the first round comes from the next scheduled scan (usually within minutes). Remove the 中文说明🤝 已接管:autofix 循环现在管理此 PR —— 将持续处理新的评审反馈与 base 冲突,直到移除标签或达到轮次上限。本 PR 来自 fork,首轮处理将由下一次定时扫描执行(通常几分钟内)。移除 |
|
Thanks for the PR! Template looks good ✓ Problem: real and demonstrable in the current code — no linked issue, but I verified the mechanism in the base tree. When a Goal's evidence catalog is truncated (>100 entries or 24 KB of records after the pinned cursor), Direction: aligned. The fix reuses the existing Size: core paths touched ( Approach: scope feels right. The decision moves from the worker (which cannot change lifecycle) to the verification boundary (which can), direct resume is gated until the revision changes, and the diff carries nothing beyond that minimal set — no drive-by changes, tests updated with the behavior. Risk: no elevated risk signals — no high-risk paths matched. Moving on to code review. 🔍 中文说明感谢贡献! 模板完整 ✓ 问题: 真实存在,且可以在当前代码中直接验证——没有关联 issue,但我在基线代码中核实了机制。当 Goal 的证据目录被截断(固定 cursor 之后超过 100 条记录或 24 KB)时, 方向: 对齐。修复复用了现有 规模: 触及核心路径( 方案: 范围合理。判定从 worker(无法变更生命周期)移到验证边界(可以),直接 resume 被拦截到 revision 变更为止,diff 中没有超出最小改动集的内容——无顺手改动,测试与行为同步更新。 风险: 无升级风险信号——未命中高风险路径。 进入代码审查 🔍 — Qwen Code · qwen3.8-max Reviewed at |
Code reviewI traced the loop in the base tree first, then compared against the diff. The fix matches the approach I would have proposed independently: remove the rejection the worker cannot enforce, and let the verification boundary — the only place that can change lifecycle — classify the exhaustion. The PR goes one step further and closes the direct-resume path, which is correct: re-authorizing turns on an exhausted revision would just re-run the same dead loop. What I verified:
sequenceDiagram
participant P1 as update_goal tool
participant P2 as Goal runtime
participant P3 as evidence validation
participant P4 as goal reducer
P1->>P2: record completion proposal (truncated catalog)
P2->>P2: finishTurn, begin verification
P2->>P3: validate cited evidence
P3-->>P2: catalog_truncated
P2->>P2: usage_limited, no continuation queued
P1->>P2: resume same revision
P2->>P4: reduceGoalControl
P4-->>P2: rejected until edit or replace
Test evidenceQuoted from the checks API for the reviewed commit — triage never builds or runs PR code: Final CI results for
One row per check name (latest run); skipped checks omitted; failures sort first. / 每个检查名一行(取最新一次运行),省略 skipped,失败项排在最前。 The green Ubuntu unit suite includes the new 中文说明代码审查我先在基线代码中追踪了这个循环,再对照 diff。修复与我的独立方案一致:移除 worker 无法强制执行的拒绝逻辑,交给唯一能变更生命周期的验证边界来判定耗尽。PR 还更进一步关闭了直接 resume 的路径——这是对的:在已耗尽的 revision 上重新授权续跑只会重跑同一个死循环。 已验证:
(时序图见上方英文版:提案 → 结束 turn → 证据校验抛出 catalog_truncated → usage_limited 且不再续跑;同 revision resume 被 reducer 拒绝,edit/replace 后恢复。) 测试证据以上表格引用的是受审 commit 的 checks API 结果——triage 从不构建或运行 PR 代码。Ubuntu 单元测试为绿色,且包含新增的 runtime 测试和改写后的 goal-tools 测试,行为变更由 CI 固定而非仅凭声称。macOS/Windows 矩阵与 CLI 集成测试在本 PR 的 CI 中被跳过;改动是与平台无关的状态机逻辑,不涉及 OS 特定代码,因此这里不视为缺口。有一条 — Qwen Code · qwen3.8-max Reviewed at |
|
Confidence: 4/5 — clean, minimal fix for a loop I verified in the base code; the only nit is the string-keyed resume gate, which is acceptable at this scale. Going in, my independent read of the bug was that the worker-side rejection is unenforceable — the worker cannot shrink the catalog, so the decision belongs at the verification boundary. The PR does exactly that, and correctly adds the resume gate: re-authorizing turns on an exhausted revision would re-run the same dead loop, and the recovery path (edit or replace → fresh evidence cursor → resume) matches how revisions already work. The diff is 55 production lines in one module with no drive-by changes, tests move with the behavior, and CI is green at the reviewed commit including the new load-bearing tests. I found no correctness, safety, or scope concern — the one design nit is documented in the review above and doesn't block. One standing, non-blocking observation for the future: a Approving, pinned to the reviewed commit. ✅ — Qwen Code · qwen3.8-max Reviewed at |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅
|
🤖 Reviewed the latest feedback — no changes needed. Why, point by point: · 已审阅最新反馈——无需改动。逐点说明原因如下: Autofix review round — no action taken (PR #8430)Triage result: there is no actionable feedback in this round.
The single listed item — Evidence from the workflow definitions:
A cancelled check needs no code change, and this bot holds no GitHub credentials to re-run CI — the next workflow run for this PR is the authoritative gate. The empty "Still-red checks" section confirms no check is persistently failing. No changes were made this round. The PR head remains the previously pushed commit 中文说明Autofix 审查轮次 — 未采取任何操作(PR #8430)分诊结果: 本轮没有可处理的反馈。
唯一列出的条目 —— 来自工作流定义的证据:
被取消的检查不需要任何代码修改,本机器人也没有 GitHub 凭据去重跑 CI —— 该 PR 的下一次工作流运行才是权威的门禁。"Still-red checks" 部分为空,进一步证实没有任何检查处于持续失败状态。 本轮没有做任何代码改动。PR 的 head 仍然是之前已推送的提交 Base-conflict check · 基分支冲突检查: no conflict with main. · 与 main 无冲突。 🧠 Handled by Qwen Code · model/模型 |
|
Released in v0.21.5. |
What this PR does
This PR stops Goal mode from scheduling endless synthetic continuation turns after a completion attempt exceeds the bounded evidence catalog. The completion proposal now reaches the verification boundary, where catalog exhaustion transitions the Goal to
usage_limited; direct resume is rejected until the user edits the Goal revision or replaces the Goal.Why it's needed
In long-running Goal sessions, the evidence catalog can exceed its entry or byte limit. The previous worker-side check rejected every completion proposal while leaving the Goal active, and each automatic continuation added more transcript evidence, making recovery impossible and creating an unbounded retry loop.
Reviewer Test Plan
How to verify
usage_limited, the verifier is not called, and no second synthetic continuation starts.Evidence (Before & After)
Before: completion returned
proposalRecorded: falsebecause the catalog was truncated, the Goal remained active, and automatic continuation retried indefinitely.After: the proposal terminates the current turn once, catalog exhaustion records
usage_limited, and the host does not start another continuation. Focused verification passed with 159 tests across the evidence, tool, runtime, and reducer suites.Tested on
Environment (optional)
Node.js 24.14.1; focused Vitest suites, Core typecheck/build, ESLint, Prettier, and
git diff --checkpassed locally.Risk & Scope
Linked Issues
N/A
中文说明
本 PR 做了什么
本 PR 修复 Goal 模式在完成提案超过有界证据目录后不断创建 synthetic continuation turn 的问题。现在完成提案会进入验证边界,目录耗尽会把 Goal 转为
usage_limited;同一 revision 不能直接恢复,用户需要编辑 Goal revision 或替换 Goal。为什么需要
长时间运行的 Goal 会话可能超过证据目录的条数或字节限制。此前 worker 侧会拒绝每一次完成提案,但仍保持 Goal active;每次自动续跑又会增加 transcript 证据,使会话无法恢复并形成无界重试循环。
Reviewer 测试计划
如何验证
usage_limited,verifier 未被调用,且不会启动第二个 synthetic continuation。Before / After 证据
修复前:目录截断时完成提案返回
proposalRecorded: false,Goal 保持 active,自动续跑会无限重试。修复后:提案只结束当前 turn 一次,目录耗尽被记录为
usage_limited,host 不再启动后续 continuation。证据、工具、runtime 和 reducer 的 159 个聚焦测试全部通过。测试平台
环境
Node.js 24.14.1;聚焦 Vitest、Core typecheck/build、ESLint、Prettier 和
git diff --check均在本地通过。风险与范围
关联 Issue
N/A