Repository navigation
Conversation
… more same-input work" This reverts commit e22b377.
|
🦞👀 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. |
|
Codex review: blocked before merge. Reviewed October 5, 2026, 2:31 AM ET / 06:31 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch preserves completed answers across further work on the same input and changes streamed-answer matching so those answers can reach channels in order. Merge readiness⛔ Blocked before merge - 5 items remain Keep this draft open for the requested delivery-policy decision. Its distinct behavior remains absent from main, and the unchanged head still contains the prior cross-input defect plus another concrete delivery-suppression defect. Priority: P2 Review scores
Verification
How this fits togetherThe agent runtime turns model responses and asynchronous tool results into answer segments. Reply construction and channel delivery consume those segments to select, order, and deduplicate outgoing answers. flowchart TD
A[User input] --> B[Model response and tools]
B --> C[Assistant message subscriber]
C --> D[Answer segments]
D --> E[Reply payload selection]
E --> F[Streamed reply matching]
F --> G[Channel messages]
Decision needed
Why: The draft intentionally changes an established delivery policy, trading suppression of obsolete answers for preservation of context the model assumes was delivered. Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +63, Tests +342. Total +405 across 7 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve main's supersession contract unless maintainers approve delivering both answers; an approved implementation should retain user-input identity and physical-message delivery boundaries. Do we have a high-confidence way to reproduce the issue? Yes, source establishes both patch defects: continue input A before steering input B, or fail delivery of a later answer whose text matches an earlier delivered message. No target code or tests were executed during this read-only review. Is this the best way to solve the issue? No, the sketch is not ready as written: it conflates continuation history with current-input identity and matches delivery across physical messages. Main already provides the narrower silent-follow-up fix. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d7f9ebd8de66. LabelsLabel changes: No label 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
HistoryReview history (1 earlier review cycle)
|
25dc7e4 to
69b4a7b
Compare
|
Closing: design C (deliver every response-ending answer) was not pursued. #164774 covers the dropped-answer case that motivated it. |
Question
When one model response ends in a completed
final_answerand the model then keeps working on the same input (async tool results arrive, it calls more tools, and it writes a new answer), should OpenClaw deliver the earlier answer as well?NO_REPLYor empty).Two real occurrences (our setup,
openai/gpt-6-astraoveropenai-responses, Telegram)NO_REPLY. One response: asyncweb_search, commentary +sessions_yield, asyncweb_fetch, thenfinal_answerwith the full answer. The follow-up after the async results wasNO_REPLY. On main the answer is lost and the user gets "view_image, asyncprocess, thenfinal_answerwith the main answer and a link to an official document. The follow-up response polled again, read an image (async), and produced an emptyfinal_answertail. The next response wrote a short new answer that reads as if the first had been seen ("Here's the official close-up…"). Only the second answer reached the user; the link was lost. fix(agents): Astra answer dropped for a generic warning when its follow-up is NO_REPLY #164774 does not change this; it is listed there under "Not changed".Both have the same transcript shape: a call-free tail fragment of a split async response whose text is
phase: final_answer.Why the current behavior exists (#141444)
docs/concepts/streaming.md(from #141444): "A later answer supersedes deferred text from earlier tool turns, including when the final answer isNO_REPLY." Related: #149925 ("Final answers still replace progress within one input; silent answers do not leak progress"), #150539, and #152786 (text written beside the last tool call is not promoted; recovery uses the tool-free finalizer).The trade-off
NO_REPLYfollow-up (occurrence 1)NO_REPLYadds nothing.Codex (
../codexc248f6d48b) does the second. A non-commentary message item is finalized and shown when it completes (codex-rs/core/src/stream_events_utils.rs:383-397). Any tool call still setsneeds_follow_upand the turn samples again (:356;session/turn.rs:2780,:566,:653), so nothing the model said is retracted. Codex's next-turn deferral (stream_events_utils.rs:122-135,session/input_queue.rs:275-296) applies only to inter-agent mailbox mail, not to tool results.#141444's scenarios under this draft
text+toolCallin one message, with stoptoolUseorstop), followed by a terminal answer orNO_REPLY: unchanged, still superseded. Only a call-freephase: final_answermessage withstopReason: stopis sealed. Text in a message that carries a call is progress.final_answerwith media, then commentary, then the final answer): intended change for real async tails. After fix(agents): Astra answer dropped for a generic warning when its follow-up is NO_REPLY #164774 that message hasstopReason: stop, so its caption is a completed answer and is delivered with the media. The model wrote it as the answer. fix(agents): stop replaying obsolete replies after tool continuations #141444's fixture usesstopReason: toolUse, which is not sealed.toolUseand has no phase).Sketch (this commit)
message_start, a previous message that isstop,phase: final_answer, call-free, with visible non-silent text is pushed as a fix(agents): deliver one answer per steered user input #149925 answer segment markedcontinued(no new state store). An exact repeat at a latermessage_endpops the seal.payloads.tskeeps one rule: segments are answers.continuedsegments do not getprecedingInputAnswer, so voice consult and transcript-truncation recovery treat them as the current input's answer. fix(agents): Astra answer dropped for a generic warning when its follow-up is NO_REPLY #164774'sinputAnswer/answerStandsspecial case goes away.settled-turn-finalization.tskeeps the current input's delivery floor at the last user-boundary segment.reply-delivery.ts) is unchanged: segment boundaries already protect sealed answers from supersession.Sketch-level evidence only. Through the real Responses →
runAgentLoop→ subscriber → block pipeline → payload path, both occurrence shapes deliver both answers once, an exact repeat is delivered once, commentary or text beside a call is not delivered, and #141444's beside-a-call cases are still superseded. A live Telegram Test Server run with realgpt-6-astrafor occurrence 2's shape (fetch, answer without waiting, then fetch again and write a new message) showed a progress draft, then the first answer, then the second answer, with the draft deleted and no warning.Decision needed
Should a completed
final_answerthat ended its model response be delivered when the model keeps working on the same input? If yes, this replaces #164774's payload special case and partly reverses #141444 for call-free async tails. If no, close this draft and keep #164774 as is.