Repository navigation
fix(agents): answer replaced by a restated blocker after the plan completion check - #164896
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed October 5, 2026, 3:03 AM ET / 07:03 UTC (Revision 4). ClawSweeper reviewWhat this changesThe agent’s plan completion check can end silently when the preceding answer already explains the blocker, with updated documentation and regression coverage. Merge readiness✅ Ready for maintainer review This PR remains useful: current main still requests a fresh blocker report, while the proposed bounded prompt change preserves an already-complete answer. No actionable introduced defect was found, and the supplied live evidence covers both legitimate stopping and continued authorized work. Priority: P1 Review scores
Verification
How this fits togetherThe built-in agent checks unfinished progress-card plans before ending a run. Its follow-up response passes through the existing answer-retention and reply-payload owners to determine what reaches the user. flowchart TD
A[Saved unfinished plan] --> B[Agent produces answer]
B --> C[One completion check]
C --> D[Authorized work remains]
D --> E[Continue work]
C --> F[Blocker already explained]
F --> G[Silent follow-up]
G --> H[Deliver retained answer]
E --> H
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -1, Tests +66, Docs +1. Total +66 across 3 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the existing bounded completion check and let its silent follow-up preserve an answer that already explains why work cannot proceed. Do we have a high-confidence way to reproduce the issue? Yes: an unfinished saved plan followed by an answer requesting approval triggers the completion check, whose fresh blocker response replaces the answer. Source inspection and the supplied live base/head comparison establish this path; the reviewer did not execute it. Is this the best way to solve the issue? Yes: the change repairs the existing prompt owner and reuses merged answer retention without bypassing completion checks or adding competing state. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against dce3f8b0450a. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
25dc7e4 to
69b4a7b
Compare
bdb8e05 to
807e2cb
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…pletion check (openclaw#164896) The plan-completion check now lets the model end with NO_REPLY when its previous reply already reported the blocker, so the original answer stays the only reply instead of a restatement bubble. Unfinished plans still get their check and continue working. Co-authored-by: Ayaan Zaidi <[email protected]>
…pletion check (#164896) The plan-completion check now lets the model end with NO_REPLY when its previous reply already reported the blocker, so the original answer stays the only reply instead of a restatement bubble. Unfinished plans still get their check and continue working. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 4af2bb9)
…pletion check (openclaw#164896) The plan-completion check now lets the model end with NO_REPLY when its previous reply already reported the blocker, so the original answer stays the only reply instead of a restatement bubble. Unfinished plans still get their check and continue working. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 4af2bb9) (cherry picked from commit 07c6e42) Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Fixes: after a multi-step turn that ends by asking the user for approval, the answer is replaced (or followed) by a short restatement of the blocker when the run's progress card still has a pending step.
On our setup (Telegram forum topic,
openai/gpt-6-astra) the topic showed the answer and then a second bubble: "The remaining step is getting the seller's confirmation and quote. That requires your permission to contact them; I haven't sent an enquiry or placed an order." On a Telegram Test Server DM with origin/main, the same shape delivers only the restatement. The answer with the actual results never arrives.User Impact
A reply that already explains why work stopped (approval, user input, an external dependency) stays the turn's only reply. A plan that the agent genuinely abandoned early still gets the completion check and the agent keeps working. No new messages, notices, or settings.
Why This Change Was Made
Root cause, with provenance:
attempt-stream-prepare.ts,openclaw.plan-completion-check) tells the model: "If user input, approval, an external dependency, or an explicit pause prevents further work, report that concrete limitation." When the stop was legitimate and the reply already asked for approval, the model obeys and writes a fresh report.Fix: one bounded edit to the existing check text: "…report that concrete limitation; if your previous reply already reported it, end with only
NO_REPLY." With #164774 (now on main), an answer followed by aNO_REPLYstop keeps the earlier answer as the reply. The check's follow-up is a custom message, not user input, so it doesn't reset that answer. Continuing, reconciling, and reporting a blocker that wasn't mentioned all work as before.Not changed (decisions kept from #160297): the check's gates, its once-per-run budget, cancellation/steering/approval/child/media precedence, and "a checkpoint already shown in chat stays in the conversation".
Rejected alternative: skipping the check when an answer was already delivered or kept. Without deferred terminal delivery the stop answer is already visible on streaming channels, so that would turn the check off there. It also depends on the response's split shape, not on whether the work is done.
Evidence
Live: Telegram Test Server DM, isolated gateway, real
openai/gpt-6-astraoveropenai-responsesthrough a forwarding proxy (forwards and logs only), Telegramstreaming.progresswithtoolProgress+commentary(as on our setup). Prompt: "tidy your workspace with a three-step progress card: list files, report sizes, delete the largest; do steps 1–2, ask me before deleting." Bubble counts are the recorder's SUTmessagerows after the sent message, excluding the progress draft that is deleted when the answer lands.BOOTSTRAP.md?"BOOTSTRAP.md?"openclaw.plan-completion-checkinjectedBOOTSTRAP.md(7,479 bytes) requires your explicit approval. Your latest message does not grant it, so nothing has been deleted. Do you approve deletingBOOTSTRAP.md?" (53 output tokens)NO_REPLY(6 output tokens)#164774 alone doesn't fix this: current main includes it and still delivers only the restatement, because the check's reply is a real answer, not
NO_REPLY.#160297's intent still holds, live on this PR head 807e2cb. Prompt: three file steps, "do the work yourself, without subagents. Do step 1 only, then end this reply with a one-line checkpoint; steps 2 and 3 are authorized and required". The model stopped with "Checkpoint: 1/3 complete—
notes/a.txtcontains exactlyalpha(5 bytes)…; steps 2 and 3 remain pending." The check was injected. The model then read, wrotenotes/b.txt, verified, completed the card (3/3), and answered "All 3 steps complete and committed … Total file content innotes/: 9 bytes". Telegram showed exactly one SUT message: that final answer. The checkpoint never reached chat on its own.Regression (
attempt-plan-completion.test.ts, real session loop + real progress-card tool + payload builder): the stand-in model restates the blocker unless the check text offers silence, which matches the live behavior above. It fails without this change (payload is the restatement) and passes with it (payload is the original answer).pnpm test src/agents/embedded-agent-runner/run/attempt-plan-completion.test.ts --maxWorkers=1on 807e2cb: 21 passed, 34.5 s local.LOC vs origin/main: production +1/−2 (one string, reformatted), docs +3/−2, tests +66.
Review: a fresh adversarial
reviewerpass (gpt-6-astra) on 807e2cb, after the rebase onto main, returnedVERDICT: LANDwith no findings.Bounded cost
Not the progress narrator
The stray text is the main model's reply to the injected check (transcript seq after
openclaw.plan-completion-check, plus itsdelivery-mirrorrow). Telegram never wiresonNarrationUpdate, so the utility-model narrator can't post there. A separate burst of ~40 utility-model calls after a reply in an earlier proof run was the gateway Activity recap paging a seeded backlog (src/gateway/session-activity-summaries.ts,MAX_CALLS_PER_HOUR = 40). It is unrelated to this PR.