Repository navigation
fix(agent-core-v2): scope verification to the change and stop repeating passed checks - #4451
Conversation
…ng passed checks The delivery verification rule in the default system prompt applied to every turn, required the project's standard build and test commands regardless of what changed, and had no point at which checking stops. After compaction, the summary prefix also told the agent to re-verify everything the summary reported as done or passed, contradicting the system prompt's instruction not to redo work the summary reports as done. - Apply the build-and-test requirement to changes, and only to the standard build and test commands that cover the change; keep verifying the deliverable itself with real calls. - Once those checks pass, repeat or broaden them only for a new change, a failure, or an unresolved concern. - After compaction, rely on what the summary reports as done or passed and re-check only what it marks as unverified. - Have the compaction summary mark a passed check as unverified when the code it covers changed afterwards.
|
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
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. |
commit: |
The red-tests rule in the delivery paragraph applied to any failing test, and nothing said what to do with bugs or broken tests the change did not cause. Read literally, a pre-existing failure left the agent two options: fix code outside the task or never call the work complete. - Only tests that cover the change keep the work from being marked complete. - Do not attempt to fix unrelated bugs or broken tests; mention them in the final message instead. - Drop the changeset; this PR ships without one.
MoonshotAI#4410 MoonshotAI#4413 MoonshotAI#4431 MoonshotAI#4450 MoonshotAI#4451 MoonshotAI#4485 MoonshotAI#4524 were each implemented earlier — the compaction prefix suite, the media-recovery case, the OAuth callback socket drain, the split delivering-work section, the compaction wording, the reasoning-key order and the 10-step todo reminder are all in the tree and pinned by their own tests. Each row now carries that probe. Only MoonshotAI#4410 needed care: upstream patched paths that this fork renamed (`human/llm/builtin/protocol` versus `human/llm/requester/bases`), so the matching was done on the behaviour — stripDynamicToolContext is gone and extractEventUsage already reads usage only on terminal response events. Ledger: closed 22 -> 28, remaining 71.
Requirement or Bug
交付验证对所有任务一刀切、通过后没有停止条件、压缩后又要求全部复验,导致没有新信息的重复验证;遇到与改动无关的失败也没有处理规则。
Bug Reproduction Steps
Delivering work段:每个回合宣布完成前(包括只回答问题、做诊断,以及 explore / plan 子 agent),都要求"项目标准的 build 和 test 在交付物上通过",并且没有任何"什么时候停止验证"的说明。Context management段写的是"把摘要当作准确记录,不要重做它报告已完成的工作"。两处指令直接矛盾。Root Cause
system.md的验证句以 "the work" 为对象、以"项目标准 build 和 test"为固定范围:既不区分有没有改动,也不区分改动范围,同时缺少停止条件。于是验证向"完整工程实现"的强度靠拢,通过之后还会继续叠加。Code Changes
只改提示词文本和对应测试,不改代码逻辑。
Behavior Changes and Affected Users
the work→a change)that cover the change)受影响人群:
system.md的四行变化):所有使用内置系统提示的会话,包括 TUI、print 模式(kimi -p)、desktop 与 web(kap-server)、VS Code、ACP;默认 agent,以及 coder / explore / plan 子 agent 和 Tower worker。自定义SYSTEM.md或自定义 agent 只有在模板里包含${base_prompt}时才受影响。/compact)的会话。旧版本写的会话里已有的摘要保持原文,下次压缩起使用新文本;识别摘要消息靠origin.kind,不依赖文本,读取旧会话不受影响。测试覆盖:
profile-shared.test.ts:计划模式说明位置的断言改用新首句作锚点。fullCompaction.test.ts:4 处前缀、3 处压缩指令的内联快照更新;手动压缩用例的input_tokens从 1192 改为 1215,即新增那句的估算增量(94 个字符,约 23 个 token)。npm test全部通过;只问问题的任务两组都没有改文件,也没跑 build / test。Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.