Repository navigation
fix(agents): preserve silent reply after settled tools - #130675
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
54f6738 to
21c2651
Compare
21c2651 to
f8d8058
Compare
|
Codex review: needs maintainer review before merge. Reviewed August 27, 2026, 12:27 AM ET / 04:27 UTC. ClawSweeper reviewWhat this changesThe PR stops reply-optional settled-tool runs from requesting an extra final response when the preserved assistant result is a deliberate Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open for explicit maintainer handling: the source-level repair is focused and plausible, but the PR’s stated final-head behavior evidence and cited Codex contract remain unverified. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherEmbedded agent runs collect assistant output and tool results, then terminal recovery decides whether another model call is needed before output can reach a channel. Background runs that deliberately end silently should finish without creating an extra model response. flowchart LR
A[Heartbeat or user run] --> B[Embedded agent attempt]
B --> C[Tools settle]
C --> D[Terminal recovery]
D --> E{Reply required?}
E -->|Optional and silent| F[Finish silently]
E -->|Required or not silent| G[Request final answer]
G --> H[Outbound channel delivery]
Decision needed
Why: Repository policy requires explicit maintainer handling for the label, while the submitted evidence defers the real-flow proof and its external-contract rationale could not be directly checked. Before merge
Agent review detailsSecurityNone. PR surfaceSource +1, Tests +54. Total +55 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge only after redacted final-head evidence shows a settled heartbeat ending in Do we have a high-confidence way to reproduce the issue? Yes at the source decision point: current main lacks this guard and the focused regression models the heartbeat/tool/silent-terminal sequence. A final-head channel-flow reproduction has not yet been supplied. Is this the best way to solve the issue? Yes, provisionally: the change belongs in the settled-tool finalization owner, reuses the canonical silent-reply classifier, and retains the required-reply branch. Direct Codex-contract and final-flow proof remain needed before approval. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6b842df52e5c. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Final-head Telegram real-user proof for
Interpretation: a tool-using heartbeat now terminates silently on exact |
…-retirement-v13 * origin/main: (243 commits) fix: preserve Gateway error reasons in text logs (#130645) refactor(video): deduplicate generation contracts (#130635) fix(agents): preserve direct-message sender identity (#124548) fix(agents): preserve silent reply after settled tools (#130675) fix(talk): preserve replacement speech when an old utterance is canceled (#130687) fix(browser): preserve literal names and formatter-owned snapshot refs (#130599) fix(auth): reset only the profile replaced by a successful login (#124014) fix: bind session creation to admitted Gateway (#130686) refactor(qa-lab): reuse model reference splitter (#130317) docs(gateway): clarify independent HTTP endpoint switches (#130690) fix(ui): Control UI smooth scrolling ignores the reduced-motion preference (#130428) refactor(lmstudio): remove unreachable catalog merge (#130689) fix(crabbox): restore cloud machine CPU and RAM (#130684) fix(secrets): compare proxy bearer tokens directly (#127054) fix(matrix): show recovery key availability in text status (#128051) fix(ios): restore approval settings navigation and remove duplicate shell state (#130651) refactor(agents): use fixed tool-loop defaults directly (#130681) refactor(qa-lab): share process tree metric reader (#130419) refactor(models): simplify prepared owner access (#130683) fix(parallels): main install and update smoke cannot complete (#130658) ...
Prevent reply-optional tool turns ending in NO_REPLY from triggering an extra model call and user-visible junk. Required direct turns still finalize normally. Co-authored-by: Ayaan Zaidi <[email protected]>
Problem
An embedded heartbeat can use tools, finish with the exact silent token
NO_REPLY, and still trigger settled-turn finalization. The extra model call can produce unrelated prose that OpenClaw then sends to the user.Root cause
Reply payload preparation correctly removes
NO_REPLYfrom outbound payloads. Settled-tool recovery then sees zero visible payloads, selects the earlier tool-use assistant as the completed batch, and treats the turn as missing a final answer. It ignored the preserved assistant text that already proved deliberate silence.Codex treats a completed assistant message as terminal when no tool follow-up remains (
codex-rs/core/src/session/turn.rs:395-501). OpenClaw owns the additionalNO_REPLYdelivery contract.Fix
Proof
null.nullinstead of the finalization prompt.terminal-resolution.test.tsandsettled-tool-evidence.test.tspass, 73 tests total.readtool → model call returningNO_REPLY→ separate isolated model trace → Telegram delivery.Final-head Telegram result
The canonical local
telegram-e2e-userbotrecorder drove heartbeat → tool →NO_REPLYonf8d8058a6a0410d5c29fba900c5af91c27a7535e. The provider received exactly two requests, the second carried the matching tool output, no finalization request occurred, and Telegram observed no SUT message, edit, or deletion.Scope