Repository navigation
fix(cli-runner): credit final WebChat internal-sink sends as the source reply - #167736
Conversation
…ce reply claude-cli WebChat turns run in automatic reply mode while targetless message sends always use the internal-ui sink. The CLI tracker only credited such a send as the source reply in message_tool_only runs, so message(final=true) followed by NO_REPLY failed as an empty response after the answer was delivered. The embedded runner already credits these sends. Fixes openclaw#167709
|
🦞👀 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: needs maintainer review before merge. What this changesThe CLI runner credits a confirmed final internal WebChat send as the completed source reply. Example: Claude CLI sends DELIVERED-ANSWER-167736 using message(action=send, final=true), then returns NO_REPLY.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a concrete WebChat completion-accounting bug that remains on current main; no actionable patch defect was found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe CLI runner combines captured message-tool delivery results with terminal model output to determine whether the source conversation received its required reply. flowchart TD
A[WebChat user turn] --> B[Claude CLI]
B --> C[Message tool over MCP]
C --> D[Internal WebChat sink]
D --> E[CLI delivery tracking]
B --> F[Terminal NO_REPLY]
E --> G[Reply completion]
F --> G
Technical reviewBest possible solution: Land the focused completion-accounting repair while preserving automatic text selection and the progress and inter-session exclusions. Do we have a high-confidence way to reproduce the issue? Current-main source and the supplied baseline trace establish the automatic-mode delivery-credit gap followed by required NO_REPLY rejection; this read-only review did not execute a reproduction. Is this the best way to solve the issue? The patch corrects the CLI evidence consumer using the existing internal-sink delivery contract, without replaying delivery or replacing automatic final text. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 81ad3bf71935. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +80. Total +80 across 2 files. Added test files: 0. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed October 12, 2026, 7:00 PM ET / 23:00 UTC (Revision 3). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Landed in a2fd4c5. Thanks @Oldrich333, delivered Claude CLI answers no longer show an empty-response error. |
…ce reply (openclaw#167736) In WebChat, a Claude CLI turn that delivered its final answer through the message tool and then ended with NO_REPLY was also reported as an empty-response failure, so chat history showed the answer followed by an error. Tool tracking now records that delivery, so the turn counts as answered. A genuinely empty turn still fails, and the answer isn't duplicated. Proof: built candidate and main parent 454a12c in Docker; WebChat chat.send through the real MCP message tool, then NO_REPLY. On main, history held one answer followed by an error; with the PR, one answer and no error. An empty-result control errored on both, and a normal text answer was identical. Excerpts are in the PR description. Fixes openclaw#167709. Thanks @Oldrich333. Co-authored-by: Ayaan Zaidi <[email protected]>
Closes #167709
What Problem This Solves
A Claude CLI WebChat turn can deliver its final answer with
message(action=send, final=true)and then returnNO_REPLY. The answer reaches the conversation, but the CLI runner still marks the turn as an empty response and WebChat adds an error underneath it.Credit a confirmed final internal-sink delivery as the source reply without changing automatic final-text selection or replaying the send. Progress sends and transcript-only inter-session sends remain insufficient to complete a required reply. Thanks to @Oldrich333 for reporting the bug and contributing the fix.
Current-main integration
Merged current main before re-proving because the Claude CLI runtime changed substantially since the original contribution. Candidate:
3e1966656ea0fb7c4d528ab0bb4f8962e09e179d. Baseline: exact main parent232083d2c835b93736e2ef437b8c36a509e6dcf0. The original pinned baselinec3d6aa1aa41a2ae480ce4c05aef4016b92340ad9was also built and showed the same results.No overlap with Pash/Sarah changes in either changed file.
Evidence
Built both source snapshots in secretless Docker. Started separate isolated Gateways with explicit profiles, state/config/database paths, and drove the same
chat.sendRPC used by Control UI. The fake Claude CLI replaces only the CLI process: Gateway startup, MCP HTTP transport, the realmessagetool, internal WebChat delivery, persistence, and terminal completion are exercised.The replay emits a real message-tool call with
final: true, executes it over MCP, and returns terminalNO_REPLY. Controls emit an actually empty result or normal final text.NO_REPLYCLI backend returned an empty response.FAKE-OK turn 1Focused
cli-runner.reliability.test.ts: 59/59 passed, Vitest 28.22 s, complete command 43.17 s. Changed-fileoxfmt --checkandoxlintpassed. Both builds passed. The focused cases include final, progress, and inter-session internal-sink sends.Observed WebChat excerpts
Identifiers and timestamps omitted; message text and terminal states are unchanged.
Each history contains exactly one copy of
DELIVERED-ANSWER-167736; neither replays the send. Both actual-empty controls emitstate=errorwitherrorMessage="CLI backend returned an empty response.". Both normal-text controls emitstate=finalwithFAKE-OK turn 1.Additional real-provider check on the built candidate returned
LIVE_OK_167736from OpenAIgpt-5-mini(2,731 input / 23 output tokens). The CLI printed its complete result but remained alive until the harness's 120-second process timeout; this is not reported as a clean process-exit pass.Merge risk
Two-way door: reverting restores the old completion accounting without a data/config migration. Blast radius is CLI-backed turns with confirmed final internal-sink delivery; ordinary text selection and send execution are unchanged.