Skip to content

fix(agents): Astra answer dropped for a generic warning when its follow-up is NO_REPLY - #164774

Merged
obviyus merged 18 commits into
mainfrom
fix/dropped-final-answer
Oct 5, 2026
Merged

obviyus merged 18 commits into
mainfrom
fix/dropped-final-answer

Conversation

@obviyus

@obviyus obviyus commented Oct 4, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

With GPT-6 Astra async tools, an answer the model had already finished was dropped. The user got "⚠️ Agent couldn't generate a response. Note: some tool actions may have already been executed" instead.

This happened on our setup (Telegram, openai/gpt-6-astra over openai-responses). One model response emitted async web_search/web_fetch calls and then a final_answer message with the full answer. OpenClaw sent the async results in a follow-up request, the model replied NO_REPLY ("nothing to add"), and the answer never reached Telegram.

User Impact

An answer the model finished is delivered exactly once, even when the model's follow-up after the async results is NO_REPLY or empty. There are no new messages, notices, or settings. A later answer still replaces the earlier one, a later attachment, voice reply or cut-off response still supersedes it, a repeated answer is sent once, text written before or alongside a tool call stays silent, and quiet mode stays quiet. Responses that end in two final_answer items, or in an answer followed by hidden commentary, are no longer re-sent after their streamed blocks.

Root cause (with provenance)

  1. Stop reason (agent-core). The Responses transport maps a completed response that contains any call to toolUse (packages/ai/src/transports/openai-responses-stream-internal.ts:690-695). The async splitter (feat(openai): support Astra async tools, steering, and effort updates #138046) commits each call as its own toolUse fragment (packages/agent-core/src/agent-stream-response.ts:347-373), and the call-free tail inherited the whole-response toolUse (:400-412). The tail now gets stop. The loop still continues because of the executed calls (agent-loop.ts:325-330), so the results still reach the model.

  2. One owner for the kept answer, within one attempt. buildEmbeddedRunPayloads treats the input's last assistant message as the answer (Telegram direct replies can duplicate because accumulated assistantTexts are emitted as separate messages after context-engine maintenance #79621) and honors a silent one (fix(agents): deliver one answer per steered user input #149925). The subscriber (handleMessageEnd) now records, once per message: inputAnswer, the input's latest answer that ended its response (stop, not endTurn: false, visible, not silent), and keptAnswer, that answer while the latest assistant message is a NO_REPLY or empty stop with no media, voice (parsed or already stored by persistence) or TTS. Every other assistant message clears keptAnswer. Any other outcome except tool-call progress and an interim endTurn: false stop (a silent attachment, speech, a cut-off length response) also clears inputAnswer, so a later NO_REPLY cannot bring back a superseded answer. A new user input and a compaction retry clear both. Consumers:

    • payloads.ts uses keptAnswer for the answer lane and its message index. Reasoning still comes from the terminal message, because the kept answer's reasoning was already emitted at its own message_end.
    • terminal-preparation.ts derives finalAssistantVisibleText/RawText (and so terminalReply for subagent announce, A2A and run-wait) from keptAnswer ?? terminal.

    This mirrors src/agents/AGENTS.md "Source Reply Completion" (a final: false send becomes the reply when the terminal response is empty or NO_REPLY).

  3. Warning. With zero payloads and a required reply, the incomplete-turn path posted the generic warning (reply-completion.ts:52-59, incomplete-turn-resolution.ts). With the answer in the payloads that path is not reached. It is unchanged for turns that have no answer.

  4. Dedupe. The subscriber streams each Responses text item under its own assistantMessageIndex, but a message's final payload joins every item under the last index, so block-reply-pipeline.ts failed to match a two-item answer against its streamed blocks and sent it again. This was already true on base for plain two-final_answer responses with block streaming on. Block replies now record their physical message start (assistantMessageStartIndex), and matchingAttempts matches item runs ending at the payload's index, bounded by that start and skipping the indexes of hidden commentary items, so another message's delivered text never covers an unsent answer.

  5. Trailing commentary. Each streamed item rotates the subscriber's text baseline. When hidden commentary followed the answer in the same message, message_end saw no text "added during the message" and re-added the answer under the commentary's index; the final payload then missed the streamed blocks and the answer was sent twice. This also happens on base for a plain terminal [final_answer, commentary] response. message_end now treats the last visible item as already recorded, and the kept answer takes its last recorded text index, the same index the terminal reply uses.

  6. Sub-agent announce hydration. The parent's announcement re-reads the child's answer from the latest visible-final transcript row of the run (readSubagentRunAnnounceResultUsing → isVisibleAssistantResultEventForRun, src/sessions/transcript-visible-record.ts). That classifier accepted an endTurn: false interim stop, so after [async-tail answer, interim progress, NO_REPLY] the parent got the progress text instead of the kept answer. The classifier now rejects endTurn: false rows, the same rule as the subscriber and attempt-decision-context.ts. Its only production readers are sub-agent announce (live session and the deletion-archive fallback); history views use isVisibleTranscriptRecord, and run-wait and A2A read the terminalReply snapshot, so neither changes. resolveTerminalAssistantTranscriptRunId is left as is: its transcript-update runId (narration, chat dedupe, abort identity) and the aborted-partial check must keep attributing the last interim row of a run aborted mid-continuation.

Design decision: A (this PR) vs B (end the turn at final_answer)

  • (A) Correct the stop reason, then keep the earlier answer when the follow-up adds nothing. One subscriber rule. fix(agents): stop replaying obsolete replies after tool continuations #141444's supersession contract stays as it is.
  • (B) "Codex mailbox" parity: end the turn at a completed final_answer and carry the async results to the next turn. Rejected on evidence. Codex does not do this. Any tool call sets needs_follow_up and the turn samples again (../codex c248f6d48b: codex-rs/core/src/stream_events_utils.rs:356, session/turn.rs:2780,566,653). Codex's next-turn deferral (stream_events_utils.rs:122-135, session/input_queue.rs:275-296) applies only to inter-agent mailbox mail. A tool call even re-accepts mail for the current turn (stream_events_utils.rs:332-338). OpenClaw also has no late async results to carry: agent-core awaits every async execution before the response ends (agent-stream-response.ts:425). sessions_yield requires earlier async results to reach a follow-up request ("Finish this response to receive them", fix(agents): recover yielded subagents and preserve sidebar nesting #146667/fix(agents): report deferred sessions_yield as a normal outcome #149983). B would hide tool results and failures from the model until the user writes again.
  • What Codex does show: each completed non-commentary item as soon as it completes (stream_events_utils.rs:383-397). That is why the model's final_answer should not be lost to a later NO_REPLY.

Evidence

Live runs: Telegram Test Server DM, real gpt-6-astra, isolated gateway state; a logging HTTPS proxy in front of api.openai.com only forwarded and logged (no shaping). Same prompt both times: fetch example.com, answer in the same response without waiting, reply NO_REPLY if the fetch confirms it.

  • Before (origin/main a6b9da2bdee). Request 2 returned [function_call tool_search, web_search_call, function_call tool_call(web_fetch), message:final_answer "It is almost certainly the IANA “Example Domain” placeholder page used in documentation…"]; request 5 returned NO_REPLY. Telegram: progress draft, then "⚠️ Agent couldn't generate a response. Note: some tool actions may have already been executed — please verify before retrying.", then the draft was deleted. The gateway logged incomplete turn detected … payloads=0.
  • After (4d86dd72d77b, rerun on 164e94c7cc68). Request 2 had the same shape and request 5 was NO_REPLY. Telegram: progress draft, then one bot message "It is almost certainly the IANA “Example Domain” placeholder page used in documentation. The page says it is for documentation examples. (example.com)", then the draft was deleted. No warning, 0 incomplete turn log lines. The later commits change handleMessageEnd decisions only when hidden commentary follows the answer in its message, or when a non-tool, non-interim message adds an outcome other than an answer (attachment, speech, cut-off). The live sequence (call fragments, the final_answer tail as the last item, then NO_REPLY) contains neither; an instrumented run of the matching table row showed the same text-baseline and index decisions as 164e94c.
  • Regressions through the real path (embedded-agent-subscribe.subscribe-embedded-agent-session.final-answer-delivery.test.ts, "Astra async response tails"): real Responses wire events → processResponsesStream → runAgentLoop async splitting → subscriber → real block-reply handler and pipeline → prepareEmbeddedRunTerminal → buildReplyPayloads, asserting what the user receives and the terminalReply snapshot:
    • NO_REPLY follow-up: answer delivered once (deferred delivery; heartbeat with block streaming off); terminalReply visible. Fails on base.
    • Two-item tail answer, two-item answer split by hidden commentary, and two-item terminal answer under live block streaming: not re-sent.
    • An answer followed by hidden commentary, both as the terminal response and before NO_REPLY, under live block streaming: sent once. The terminal variant also fails on base.
    • Exact repeat delivered once; a later answer supersedes; a silent attachment supersedes; a voice NO_REPLY that persistence normalized before the subscriber supersedes.
    • A silent attachment, completed or cut off at max_output_tokens, followed by another async round and NO_REPLY: only the attachment is delivered and the terminal reply is silent, the same as on base.
    • Progress before a call plus NO_REPLY, and an end_turn:false interim stop plus NO_REPLY, stay silent.
    • Answer, then an end_turn:false interim stop, then NO_REPLY: the answer is delivered once, and the sub-agent announcement hydrated from the run's persisted rows (real readSubagentRunAnnounceResultUsing and matchesTranscriptEvent) carries the answer, not the progress. Fails on 031ad79.
    • Quiet mode (message_tool_only) stays private.
    • Reasoning streamed with the answer is not repeated after NO_REPLY.
  • block-reply-pipeline.multi-message.test.ts: an unsent later message's answer that matches an earlier delivered message is still delivered.
  • Each review fix was checked failing-before by reverting only that fix (or running the row on the pre-fix head).
  • pnpm tsgo:core and pnpm tsgo:core:test pass. Focused suites pass: src/agents/embedded-agent-subscribe* (479 agents-core + the unit shards), src/agents/embedded-agent-runner/ (all shards), src/auto-reply/reply/ (all shards), packages/agent-core/src (276). The only red is 2 auth-controller.test.ts OAuth cases, which fail identically on this PR's base 8a0b0c458bbd and pass on current origin/main (unrelated to this diff).
  • On 25dc7e4: pnpm tsgo:core and pnpm tsgo:core:test pass; the final-answer delivery table, src/agents/subagents/announce/, src/sessions/transcript-events.test.ts, session-transcript-match.worker.test.ts and session-accessor.sqlite-archive-read.test.ts pass (32 files, 528 tests).
  • Changed-test wall time (pnpm test <file> --maxWorkers=1, local): the final-answer delivery file (35 tests) about 18 s, mostly transform (tests about 2 s); block-reply-pipeline.multi-message.test.ts (6 tests) about 16 s, nearly all transform.

Rebased head 9756e05 re-run

Head 9756e0514426: clean worktree, git rev-parse HEAD and dist/build-info.json match, built with scripts/build-all.mts. Base comparison: merge base 7de09d5a2337, built the same way, with build-info matching. Each run used a fresh isolated gateway on built dist, the Telegram Test Server, and real gpt-6-astra. A logging HTTPS proxy in front of api.openai.com only forwarded and logged.

  1. Incident shape (same prompt as Before/After). Request 2 returned [function_call tool_search, web_search_call, function_call tool_call(web_fetch), message:final_answer "It is almost certainly the IANA “Example Domain” placeholder page used in documentation…"]. Request 5 returned NO_REPLY. Telegram: progress draft, then one bot message at +14.7 s, "It is almost certainly the IANA “Example Domain” placeholder page used in documentation. The page identifies itself as intended for documentation examples. (example.com)", then the draft was deleted. No warning. Gateway log has 0 incomplete turn, 0 settled post-tool turn lacked a final answer and 0 before_agent_finalize lines. First attempt.
  2. Bare NO_REPLY, DM ("Reply with exactly NO_REPLY and nothing else."). Request 2 returned NO_REPLY. The empty-response retry ran once, and the retry also returned NO_REPLY. Telegram showed "⚠️ Agent couldn't generate a response. Please try again." The merge base 7de09d5a2337 does the same with the same prompt: two NO_REPLY requests, the same empty response detected → incomplete turn detected … payloads=0 tools=0 lines, and the same warning. A user DM turn requires a reply, so this is not a regression.
    • Group, bot mentioned (head). This is also a required-reply user turn. The result is the same as the DM: retry, then the warning.
    • Group, unmentioned room event (head; messages.groupChat.unmentionedInbound: "room_event", where a reply is optional). One request returned NO_REPLY. There was no retry and no warning, and the bot produced no Telegram events at all. 0 incomplete turn lines.
  3. Quiet mode (messages.visibleReplies: "message_tool", prompt asking for step narration). The model wrote 4 message tool sends (3 short step notes and the summary), then one message edit, and every final_answer was empty. Telegram showed exactly those 4 messages and the edit, plus the tool-progress draft, which was deleted. No commentary or answer text was sent outside the message tool.
  4. Multi-tool turn (fetch two URLs, summarize). Request 2 ended with a tail final_answer after the two fetch calls. Request 5 returned a different final summary. Telegram: progress draft, then exactly one bot message (the request-5 summary), then the draft was deleted. The earlier tail answer was superseded as documented. 0 incomplete turn lines.

The earlier live proof stays valid. The rebase was clean, and the only behavior change since (9756e051, below) applies only when the subscriber kept an answer. Run 1 confirms the incident path on the exact head.

Regressions added in 9756e051 (embedded-agent-subscribe.astra-async-tails.test.ts; the PR's Astra suite moved here from final-answer-delivery.test.ts for the test-file line cap):

  • The suite now runs the real resolveSettledTurnFinalizationRequest with the subscription's real toolMetas and item lifecycle. For "a later NO_REPLY keeps the completed answer" (deferred, required user turn), it requested isolated finalization before the fix, which could replace the kept answer. Fails on 69b4a7b8.
  • For deferred rows, the onBeforeTerminalDelivery input, which before_agent_finalize projects into lastAssistantMessage, now carries the delivered answer. Three rows got NO_REPLY before the fix. Fails on 69b4a7b8.

Bounded cost

  • Per assistant message: one structured clone of a message that ends its response with a visible answer, plus two optional references on subscriber state and one index comparison at message_end. Block-dedupe run matching walks only the indexes of one physical message. No new requests, storage, or settings.
  • Live proof: 3 Telegram runs (before; after on 4d86dd7 and on 164e94c), each with 2 gpt-6-astra requests, 2 gpt-5.6-luna utility requests and a few embedding requests.

Not changed / deferred

  • An answer before an overflow compaction retry, then NO_REPLY, behaves exactly as origin/main (maintainer decision: cross-attempt retries are deferred). An in-session retry resets the subscriber's answer state (origin/main f0a63179594: src/agents/embedded-agent-subscribe.ts:248-261, called from embedded-agent-subscribe.handlers.compaction.ts:171; this PR clears inputAnswer/keptAnswer there too, src/agents/embedded-agent-subscribe.ts:261-262), and a run-loop retry starts a fresh subscriber (src/agents/embedded-agent-runner/run/attempt-stream-prepare.ts:328). A cross-attempt carryover was tried and removed; it also carried message indexes across attempts that restart at 0.
  • An errored follow-up still hides the answer (maintainer decision: out of scope). Error finalization is exactly as on main: the error terminal never keeps (the keep rule requires stop), and payloads.ts (lastAssistantNeedsErrorSurface, origin/main payloads.ts:167) skips the answer block.
  • A later different answer still supersedes an earlier tail answer (fix(agents): stop replaying obsolete replies after tool continuations #141444: "Earlier answers could still be sent after a newer accepted answer or terminal NO_REPLY… including normal-stop tails of async responses"). We saw this a second time on our setup: a tail answer with a link, followed by more tool work and a new answer written as if the first had been seen; only the second was delivered. The trade-off is written up in the dependent draft fix(agents): deliver final answers that end a response before more same-input work #164803.
  • Text written before or alongside a tool call (progress), including on heartbeat turns, is still superseded (fix(agents): stop replaying obsolete replies after tool continuations #141444/fix(agents): deliver one answer per steered user input #149925). Heartbeat dispatch still picks the last payload (src/auto-reply/heartbeat-reply-payload.ts:30-42).
  • Terminal meta reports the kept answer, exactly as if it had ended the turn. In message_tool_only with no message-tool send, a substantive kept answer reaches the existing stranded-reply one-shot retry, the same as that answer as a terminal.

Review

  • Earlier heads: several BLOCK rounds; fixes include silent terminal media superseding, the two-item dedupe, the end_turn:false interim stop, subagent/A2A terminal snapshots, and commentary clearing the kept answer.

  • Fresh reviewers, exact heads: 2076441 BLOCK (reasoning replayed with a kept answer; stored voice intent missed) → fixed in 211f30c; 211f30c BLOCK (joined-answer dedupe crossed physical messages) → fixed in 4d86dd7; 4d86dd7 LAND, no findings, plus two extra passes (delivery/duplicates/quiet mode across Telegram, Slack, Web UI, subagent/A2A; stop-reason mapping and Codex parity), both LAND.

  • ClawSweeper on 4d86dd7: hidden commentary between two answer items broke the dedupe walk → fixed in 164e94c.

  • 164e94c BLOCK (commentary trailing the answer sent it twice) → root cause fixed in 2a7e56f; 2a7e56f BLOCK (a silent attachment did not supersede the earlier answer for a later NO_REPLY) → fixed in b1885b4; b1885b4 BLOCK (same, for a length response) → fixed in 031ad79; 031ad79 LAND-WITH-CHANGES (announce hydration picked endTurn:false progress) → fixed in 25dc7e4.

  • Rebased onto main 7de09d5a2337 with no conflicts. A fresh review at 69b4a7b8 returned BLOCK with two findings, both fixed in 9756e051:

    • P1: settled-turn recovery (countSettledTurnDeliveryPayloads) didn't count a kept answer that precedes the last tool result, so a deferred required turn could run isolated finalization over it. A kept answer now counts as the turn's composed answer.
    • P2: before_agent_finalize saw the terminal NO_REPLY instead of the kept answer it delivers. handleAgentEnd now passes the kept answer as lastAssistant.
  • Fresh review at 9756e051: LAND, no findings.

  • CI: checks-node-changed-compact-large-22 fails only in src/agents/embedded-agent-runner/run.plugin-runtime-refresh.integration.test.ts ("real workspace consumer was exercised: expected 0 to be greater than 0"). The same file fails the same way locally on clean origin/main 7de09d5a233. This PR does not touch it or its workspace/plugin-metadata path.

LOC vs merge base 7de09d5a2337: production +131/−18; tests and test support +664/−0.

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: M labels Oct 4, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 4, 2026
@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 4, 2026, 10:22 AM ET / 14:22 UTC (Revision 20).

ClawSweeper review

What this changes

The PR preserves completed agent answers after empty or NO_REPLY follow-ups, prevents duplicate streamed delivery, and carries the retained answer through finalization and subagent announcements.

Merge readiness

✅ Ready for maintainer review

The fix remains necessary on current main. The pinned patch has no remaining actionable findings, and the matching exact-head live evidence supports its intended behavior.

Priority: P1
Reviewed head: 9756e0514426bed795a913bd28b4b6f9be0c1f63

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Exact-head live evidence, baseline comparisons, and focused production-boundary regressions support a coherent patch with no remaining actionable findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The captured, hash-matched body records an exact-head built-dist Gateway run through the real Responses provider and Telegram Test Server: the async-tail answer survives NO_REPLY and arrives once without a warning. Quiet-mode and later-answer controls supplement the production-boundary regressions. No stored-data format or schema changes require migration.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured, hash-matched body records an exact-head built-dist Gateway run through the real Responses provider and Telegram Test Server: the async-tail answer survives NO_REPLY and arrives once without a warning. Quiet-mode and later-answer controls supplement the production-boundary regressions. No stored-data format or schema changes require migration.
Evidence reviewed 11 items Pinned introduced change: Reviewed the merge-base-to-head production and test hunks. The checkout is the original PR head, not a synthetic merge; the supplied test merge is stale and was not used to infer removal of main-branch behavior.
Current main still needs the repair: Current main still copies the whole response's stop reason into the remaining async fragment and lacks the subscriber's retained-answer selection. The tool loop independently continues for executed tool batches, so correcting a call-free tail does not prevent results reaching the model.
Latest-release check: The v2026.9.8 source also copies remainingFragment(result) without the introduced call-free-tail correction. No merged fixing PR establishes that this submission is obsolete.
Findings None None.
Security None None.

How this fits together

OpenClaw's built-in agent runtime turns model responses and tool results into channel replies. Its subscriber records answer boundaries, which finalization and delivery consume to select and send the user's answer.

flowchart TD
  A[Model response] --> B[Async tool splitting]
  B --> C[Answer subscriber]
  D[Tool results and follow-up] --> C
  C --> E{Follow-up adds an outcome?}
  E -->|No| F[Retain completed answer]
  E -->|Yes| G[Use newer outcome]
  F --> H[Finalization and channel delivery]
  G --> H
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +113, Tests +664. Total +777 across 19 files.

View PR surface stats
Area Files Added Removed Net
Source 13 131 18 +113
Tests 6 664 0 +664
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 19 795 18 +777

Review metrics

Metric Value Why it matters
Production versus regression coverage production +113 net lines; tests and support +664 Production growth records one retained-answer decision and message boundaries; most added code exercises delivery and supersession regressions.

Root-cause cluster

Relationship: canonical
Canonical: #164774
Summary: This PR owns completed-answer retention after silent follow-ups; the stacked drafts address broader delivery policy and plan-check wording.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep one subscriber-owned answer decision across payload selection, finalization, and delivery, with later substantive outcomes retaining supersession precedence.

Do we have a high-confidence way to reproduce the issue?

Yes: async tool calls followed by a completed answer and a NO_REPLY continuation establish a concrete failing path in current source, backed by reported live baseline runs. This review did not execute it.

Is this the best way to solve the issue?

Yes: the patch repairs response classification and uses the existing subscriber as the answer owner, while preserving tool continuation and later-answer supersession.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 15e6a60139df.

Labels

Label changes:

No label changes.

Label justifications:

  • P1: The reported real agent workflow loses a completed answer and substitutes a generic warning after an async-tool continuation.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured, hash-matched body records an exact-head built-dist Gateway run through the real Responses provider and Telegram Test Server: the async-tail answer survives NO_REPLY and arrives once without a warning. Quiet-mode and later-answer controls supplement the production-boundary regressions. No stored-data format or schema changes require migration.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured, hash-matched body records an exact-head built-dist Gateway run through the real Responses provider and Telegram Test Server: the async-tail answer survives NO_REPLY and arrives once without a warning. Quiet-mode and later-answer controls supplement the production-boundary regressions. No stored-data format or schema changes require migration.
  • proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. The change visibly affects whether Telegram receives the completed answer or a warning; matching Test Server proof is supplied.

Evidence

What I checked:

  • Pinned introduced change: Reviewed the merge-base-to-head production and test hunks. The checkout is the original PR head, not a synthetic merge; the supplied test merge is stale and was not used to infer removal of main-branch behavior. (9756e0514426)
  • Current main still needs the repair: Current main still copies the whole response's stop reason into the remaining async fragment and lacks the subscriber's retained-answer selection. The tool loop independently continues for executed tool batches, so correcting a call-free tail does not prevent results reaching the model. (packages/agent-core/src/agent-stream-response.ts:400, 15e6a60139df)
  • Latest-release check: The v2026.9.8 source also copies remainingFragment(result) without the introduced call-free-tail correction. No merged fixing PR establishes that this submission is obsolete. (packages/agent-core/src/agent-stream-response.ts:377, fc23bc864e45)
  • Single answer owner and invalidation: The subscriber records completed answers, retains them only for silent outcomes without media or speech intent, and invalidates superseded answers. User boundaries and compaction retries clear the state; payloads, terminal snapshots, recovery classification, and the finalization callback consume that recorded fact. (src/agents/embedded-agent-subscribe.handlers.messages.lifecycle.ts:293, 9756e0514426)
  • Prior findings addressed: The reviewed code bounds joined-text deduplication to a physical assistant message, skips hidden-commentary gaps, avoids re-adding trailing-commentary text, and invalidates retained text after silent media or cut-off outcomes. The boundary regression suite also checks settled-turn recovery and the answer presented to before_agent_finalize. (src/agents/embedded-agent-subscribe.astra-async-tails.test.ts:520, 9756e0514426)
  • Captured proof identity and exact-head live result: The full fetched PR body matches the captured 20,535 UTF-16 units and SHA-256 4460eb76d3fb565642ead9dfd0684a499392f2ecab490b1be394f40302b6105d. Its exact-head built-dist rerun uses an isolated Gateway, real Responses provider, forwarding-only logging proxy, and Telegram Test Server. An async-call response ends in a completed answer, the follow-up returns NO_REPLY, and Telegram receives one answer with no incomplete-turn warning. Additional live scenarios cover required bare silence, optional room-event silence, quiet mode, and later-answer supersession. (9756e0514426)

Likely related people:

  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (19 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-04T09:05:59.505Z sha 4d86dd7 :: blocked before merge. :: [P2] Match retained answer items across hidden commentary gaps
  • reviewed 2026-10-04T09:15:57.028Z sha 164e94c :: blocked before merge. :: [P2] Resolve the message boundary when its last item emits no block | [P2] Invalidate saved text after a superseding silent media response
  • reviewed 2026-10-04T09:51:47.576Z sha 2a7e56f :: blocked before merge. :: [P2] Invalidate saved text after a superseding silent media response
  • reviewed 2026-10-04T10:07:05.719Z sha 031ad79 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-04T10:31:40.362Z sha 25dc7e4 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-04T10:49:53.005Z sha 25dc7e4 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-04T13:19:30.867Z sha 69b4a7b :: needs maintainer review before merge. :: none
  • reviewed 2026-10-04T13:41:27.457Z sha 9756e05 :: needs maintainer review before merge. :: none

@obviyus

obviyus commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 4, 2026
@obviyus

obviyus commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 4, 2026
@obviyus

obviyus commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

obviyus added 12 commits October 4, 2026 18:40
… retries

The subscriber now records once, at message_end, whether a NO_REPLY or
empty terminal keeps the input's completed answer. Payloads and the
terminal snapshot (finalAssistantVisibleText/RawText, terminalReply for
subagents and A2A) consume that fact instead of re-parsing the terminal.
The input's answer survives an in-attempt overflow compaction retry and
is carried into run-loop retry attempts, which continue the transcript
after it.
Remove the cross-attempt carryover of the input's answer (createAttemptCarryover,
dispatch input, initialInputAnswer, subscriber seed). A compaction retry clears
the answer again, so retries behave as on main. Within one attempt the subscriber
stays the single owner of keptAnswer.
A kept answer no longer regenerates its reasoning in the final payloads; the
reasoning was already emitted at its own message_end. The keep rule also reads
the stored audioAsVoice fact, so a voice NO_REPLY that persistence normalized
before the subscriber still supersedes the earlier answer.
… message

Block replies now record their physical message start, and final-payload
dedupe walks per-item indexes only back to that start. An unsent answer of a
later message is no longer covered by an earlier message's delivered text.
Hidden commentary takes a per-item index without a block, so the joined-answer
dedupe stopped at that gap and re-sent a streamed answer. Runs now skip empty
indexes down to the physical message start.
Hidden commentary after the answer rotated the text baseline, so message_end
re-added the answer under the commentary's index. The final reply then missed
the streamed blocks and sent the answer twice. message_end now treats the last
visible item as recorded, and a kept answer takes its last recorded text index.
… later NO_REPLY

A completed silent attachment or speech cleared only the kept answer, so a
later plain NO_REPLY restored the superseded text answer. Any response end that
adds its own outcome now clears the input's earlier answer.
…later NO_REPLY

Only a stop could replace the input's earlier answer, so a length-limited
attachment left it in place and a later NO_REPLY restored it. Every outcome
except tool-call progress and an interim stop now supersedes it.
@obviyus
obviyus force-pushed the fix/dropped-final-answer branch from 25dc7e4 to 69b4a7b Compare October 4, 2026 13:14
@obviyus

obviyus commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@obviyus

obviyus commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@obviyus
obviyus merged commit 83e6cb9 into main Oct 5, 2026
217 of 222 checks passed
@obviyus
obviyus deleted the fix/dropped-final-answer branch October 5, 2026 06:25
@obviyus

obviyus commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

Landed as 83e6cb9.

Checked on the exact head 9756e05: fresh gpt-6-astra reviewer LAND, ClawSweeper ready, live Telegram E2E in the body. Admin merge past one inherited red: checks-node-changed-compact-large-22 fails only run.plugin-runtime-refresh.integration.test.ts ("real workspace consumer was exercised"), which fails the same way on clean origin/main 7de09d5 and is untouched by this PR. Every other check is green.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 6, 2026
…ow-up is NO_REPLY (openclaw#164774)

When a split OpenAI Responses response ends in a call-free final answer, that fragment ends with stop. If the turn then ends in NO_REPLY or empty, the completed answer is kept and delivered once instead of the "couldn't generate a response" warning; subagent/A2A terminal snapshots carry the same answer. Also fixes duplicate block delivery for multi-item answers with trailing commentary.
RomneyDa pushed a commit that referenced this pull request Oct 6, 2026
…ow-up is NO_REPLY (#164774)

When a split OpenAI Responses response ends in a call-free final answer, that fragment ends with stop. If the turn then ends in NO_REPLY or empty, the completed answer is kept and delivered once instead of the "couldn't generate a response" warning; subagent/A2A terminal snapshots carry the same answer. Also fixes duplicate block delivery for multi-item answers with trailing commentary.

(cherry picked from commit 83e6cb9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant