Silent NO_REPLY on a sessions_send turn to a WebChat session fails as empty_response
Hi, thanks for OpenClaw. We hit a small one and found where it comes from.
What happens: a turn sent with sessions_send (input provenance inter_session) to a WebChat session, where the agent ends silently with NO_REPLY. With the Claude CLI runtime the run exits 0 but fails with FailoverError: CLI backend returned an empty response. (reason=empty_response), and the chat shows an error.
Why (2026.10.5): resolveCommandReplyExpectation (dist session-history-*.mjs:46, src attempt-execution.helpers.ts) returns "required" for an inter_session turn unless resolveSilentReplySettings(...).policy === "allow". That policy is "disallow" for anything but a group (silent-reply-*.mjs:13), and a webchat surface is classified direct (:9). So a WebChat inter-session turn is always reply-required, and cli-runner-*.mjs:1164 throws when the CLI returns no text. The generic rule at reply-completion-*.mjs:5 (inter_session is a synthetic turn, so "optional") is never reached because the explicit value wins.
Repro: a stand-in claude binary that answers every user turn with NO_REPLY, Gateway 2026.10.5, agent call with inputProvenance: {kind: "inter_session", sourceTool: "sessions_send", sourceChannel: "webchat"} and channel: "webchat": the call returns UNAVAILABLE: CLI backend returned an empty response. Log: cli empty response diagnostics: backend=claude-cli reason=exit exitCode=0 ... stdoutBytes=1519.
Suggestion: treat an inter_session turn as "optional" in resolveCommandReplyExpectation for direct/webchat too. Nobody is waiting for a reply to another session's message.
Related, same shape: #169614 (cron repair turn on WebChat) and #175645 (announce run).
Codex review: this still needs some work.
Summary Keep open: current main retains the reported failure path, but allowing ordinary inter-session WebChat turns to complete silently changes an intentional result obligation and needs a scoped product decision.
Reproducibility: Current source establishes sessions_send → internal WebChat → result-required → NO_REPLY rejection, and existing CLI tests pin that rejection; this read-only review ran no live reproduction.
Maintainer decision needed
- Question: May sessions_send explicitly request optional completion for notification-only turns that currently owe an internal result?
- Recommendation: Permit an explicit optional-completion request: Specify eligible sends and precedence over existing obligations, preserve current defaults, and carry the choice through the existing admission and completion owners.
- Why: Source, tests, and merged history deliberately enforce internal results, while production reports show useful relays that need no answer; existing producer-specific waivers do not define a public peer-send contract.
Next step Decide whether notification-only sessions_send turns may explicitly waive their result obligation, then establish admission-to-CLI coverage for the approved boundary.
Review details
Best possible solution:
Define an explicit optional-completion contract for notification-only peer turns through the existing reply-expectation owner while preserving delegated result obligations.
Do we have a high-confidence way to reproduce the issue?
Current source establishes sessions_send → internal WebChat → result-required → NO_REPLY rejection, and existing CLI tests pin that rejection; this read-only review ran no live reproduction.
Is this the best way to solve the issue?
An explicit optional-completion choice is more precise than making every inter-session turn optional, but its eligibility and precedence require approval because current behavior intentionally protects owed results.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
- A blanket inter_session exemption would also waive results that a requesting session is waiting to receive.
- The scheduled-current-session variant has not been traced through its producer and admission path, so it may require a separate producer-specific repair.
Codex review notes: model internal, reasoning medium; reviewed against c30d95148e24.
Label changes
Label changes:
- add
impact:auth-provider: Missing-result classification can invoke fallback models, including a separately billed provider. - add
clawsweeper:fix-shape-clear: Current issue advisory state selects this label.
Label justifications:
P2: Repeated failures affect unattended peer coordination, with a reported forced-text mitigation and no demonstrated core outage.impact:ux-friction: Completed silent work is reported to users as a failed turn.impact:auth-provider: Missing-result classification can invoke fallback models, including a separately billed provider.
Evidence reviewed
What I checked:
- Current source establishes the central failure path: Ordinary inter-session input bypasses the human-WebChat exception and resolves as result-required on the internal WebChat channel; explicit trusted optional expectations take precedence. (
src/agents/reply-completion.ts:115, c30d95148e24) - The sender supplies no optional-completion waiver: buildSessionsSendAgentParams selects INTERNAL_MESSAGE_CHANNEL and carries inter-session provenance without replyExpectation; the model-facing sessions_send schema also exposes no reply-expectation parameter. (
src/agents/tools/sessions-send-tool.delivery.ts:77, c30d95148e24) - CLI enforcement and regression contract: The CLI runner rejects a nonvisible result-required completion as empty_response unless an existing completion exception applies; reliability coverage explicitly expects result-required NO_REPLY to fail. (
src/agents/cli-runner.ts:452, c30d95148e24) - Intentional policy and feature history: Merged https://github.com/openclaw/openclaw/pull/162567 deliberately required meaningful internal and direct inter-session results. The later https://github.com/openclaw/openclaw/pull/170534 consolidated that policy under result-required while permitting trusted optional consumption; its commit patch introduces the retained internal-channel return. (
src/agents/reply-completion.ts:121, bd5f760aecae) - Documented distinction between results and optional consumption: The silent-reply contract requires internal results and permits trusted input handling to waive them, including late peer-result consumption: https://docs.openclaw.ai/concepts/messages#silent-replies. (
docs/concepts/messages.md:233, c30d95148e24) - Recent affected-release reports: Bars92 reports repeated production failures and a forced-text workaround; e-jung confirms failures on official 2026.11.5 and 2026.11.6, including fallback usage and a scheduled-current-session variant. These reports establish continuing user impact but are not a live reproduction performed by this review.
How this review workflow works
- 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-reviewcomments, 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-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only. - Maintainers can also comment
@clawsweeper reviewto request a fresh review only. - Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge; those execution lanes are retired.
- Maintainers can comment
@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.
Reviewed November 20, 2026, 9:54 PM ET / November 21, 2026, 02:54 UTC.
This issue has been automatically marked as stale after 7 days without qualifying human activity. Without new human activity, Barnacle may close it as not planned 7 days after this message was posted. This is administrative inactivity cleanup, not a claim that the problem is fixed. A human update restarts the inactivity clock; a new PR head also restarts it. A maintainer can add no-stale for a durable hold, or bad-barnacle to suppress Barnacle. Remove the hold when work can resume.
Another production data point for this, on 2026.11.3 (847611d), plus a note on the "deliberate contract" reading.
Same cause, confirmed on a phone/webchat owner session. A cron run relayed a status update with sessions_send(mode: "followup"). The receiving model, which had already told the user everything, answered NO_REPLY (cli turn ... outBytes=8). Then cli empty response diagnostics: backend=claude-cli reason=exit exitCode=0 ... useResume=true, cli terminal failure ... CLI backend returned an empty response, FailoverError on the session lane, model_fallback_decision ... reason=empty_response candidate_failed. The transcript gets a run-failed-before-reply entry ("Your request couldn't be completed"), and that is all the user sees. We reproduced the resolution by calling resolveCommandReplyExpectation from session-history-*.mjs directly: inter_session returns required for a webchat/direct session and for an internal session, and optional only for a whatsapp group with agents.defaults.silentReply.group = "allow". Seen on 7 days since 2026-11-05, 4 runs in one night.
Why the contract is awkward for the sender. sessions_send has no way to say whether a reply is wanted (agent-step passes replyExpectation: "optional", sessions_send does not), and resolveSilentReplyPolicyFromPolicies returns disallow for every non-group conversation, so no config setting can make a direct session accept a silent answer. The relays here are reports from unattended jobs; the model's honest answer to "nothing for me to add" is the silent token, and the runtime turns that into a user-visible failure plus a failover attempt on every candidate model.
Either of these would resolve it: (a) treat inter_session as optional for direct/webchat too (what resolveReplyExpectation already does when no explicit value is set), or (b) let sessions_send carry replyExpectation (or a silentOk flag) so the sender decides. Independent of that choice, a silent token on a required turn should end the run with a quiet "no reply" status rather than empty_response plus failover, since the failover candidates cannot do better.
Our side now appends a one-line "answer in words, never NO_REPLY" rule to every relay message as a mitigation.
Still reproduces on 2026.11.5 (e13cf15) with claude-cli: a sessions_send nudge to a WebChat dashboard session that ends with NO_REPLY fails as empty_response, even though the turn's tool work completed. It's frequent here: 23 claude-cli empty_response failures in the gateway log over 5 days, with sessions_send delivery-failure notices in five different sessions plus several cron jobs. Two of those turns made no tool calls and also reran on our fallback model (openai/gpt-6.1-sol), so it costs quota as well as showing a false error.
#200710 (fixed by #200741) handled the same symptom for device session events. Could inter-session turns get the same treatment, or could sessions_send take an explicit replyOptional flag?
Still reproduces on 2026.11.6 (06afb10), released after the last comment. The reply-required check in cli-runner is unchanged (resolveReplyExpectation(...) === "result-required" && terminalReply.disposition !== "visible" → createCliFailoverError("CLI backend returned an empty response.", "empty_response")).
One variant not covered above: it doesn't need sessions_send. A scheduled job whose session target is the WebChat main session (sessionTarget: current, owner agent:main:main) does its work and ends with NO_REPLY, which is the right answer for an unattended job with nothing to report. That fails the same way. In this case it was a 31-minute, tool-heavy run (194 assistant messages):
18:32:41.693 [agent/cli-backend] cli turn: provider=claude-cli model=claude-opus-5-5 durationMs=1864594 outBytes=4156 outHash=b06ea4286ff0
18:32:41.694 [agent/cli-backend] cli empty response diagnostics: backend=claude-cli reason=exit exitCode=0 exitSignal=null durationMs=1864587 stdoutBytes=2658676 stderrBytes=0
18:32:41.694 [agent/cli-backend] cli terminal failure: provider=claude-cli model=claude-opus-5-5 durationMs=1864852 runId=5fc2d7ce-… error=CLI backend returned an empty response.
outBytes counts all assistant text across the turn, so a large value here doesn't mean a visible reply was lost. The final assistant message in Claude Code's own session JSONL (~/.claude/projects/<workspace>/<session>.jsonl, last type: "assistant" entry, stop_reason: "end_turn") is exactly NO_REPLY. I checked 3 of the 32 empty response diagnostics we logged in 72h (the job above, plus two WebChat main-session turns at 19:20 and 19:23 on 11.6), and all 3 end in exactly NO_REPLY. One of the two WebChat turns had already delivered its answer with sessions_send before ending silently.
Environment: npm global install, Linux arm64 (Ubuntu), Node 24.22.3, Claude Code 2.1.326, native login with historyRecovery.attestNativeLogin: true.