Repository navigation
feat: let message-tool deployments keep unsent finals private - #203501
jzmudzinski wants to merge 2 commits into
Conversation
|
🦞👀 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. What this changesAdds messages.strandedReplyRecovery so operators can disable stranded-final retries and their missing-answer notices while preserving recovery by default. Example: A message-tool turn ends with “PRIVATE NOTE: The capital of France is Paris.” without calling message(action=send).
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Partial Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open: it provides a focused opt-out that current main lacks, but adding this recovery policy still needs a maintainer decision. Reviewed head: Decision needed
Before merge
FindingsNone. Agent review detailsHow this fits togetherThe shared reply-recovery owner consumes terminal reply facts, delivery evidence, and configuration; foreground and queued reply paths consume its recovery decision before source delivery. flowchart TD
A[Agent terminal result] --> B[Reply completion facts]
B --> C[Shared stranded recovery decision]
D[Messages configuration] --> C
C --> E[Recovery retry or notice]
C --> F[Private final and operator warning]
E --> G[Source conversation]
Technical reviewBest possible solution: Approve the narrowly documented opt-out while retaining default recovery and tracking isolated finalization separately. Do we have a high-confidence way to reproduce the issue? Current-main source deterministically retries an eligible unsent final; the contributor also supplies isolated real-model Gateway output demonstrating that behavior. Is this the best way to solve the issue? The existing shared recovery owner is the smallest appropriate implementation boundary, and the documentation accurately limits the guarantee to this recovery path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against dbb18eb3aeda. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +18, Tests +61, Docs +1, Generated +1. Total +81 across 17 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 HistoryReview history (4 earlier review cycles)
Reviewed November 29, 2026, 5:48 AM ET / 10:48 UTC (Revision 5). |
|
@clawsweeper re-review Addressed: the help text and both config docs now limit |
|
🦞👀 Re-review progress:
|
d78be73 to
3ff8827
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@steipete decision needed: |
3ff8827 to
2e0941d
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Add messages.strandedReplyRecovery ("retry" default, "off"). With "off", a message_tool run that ends with final text but no message(action=send) keeps that text private: no recovery turn re-prompts the model to publish it, and no missing-answer notice is posted to the chat. The Gateway still logs the metadata-only private-final warning.
Related: openclaw#159230
2e0941d to
7e5b32d
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Related: #159230
What Problem This Solves
With
messages.visibleReplies: "message_tool", final assistant text is private: onlymessage(action=send)reaches the chat. When a required turn ends with a final but no send, OpenClaw runs one recovery turn that quotes the private final back to the model and asks it to send it, then posts a fixed English notice ("No answer was returned. Ask again if you still need one.") if that also fails. Deployments that use the final as a private scratchpad (support agents, ambient Slack/Telegram rooms) have no way to turn this off, so private notes can be republished into DMs and channel threads, and customers get an English system notice in their own-language chat. Reports in the issue cover WhatsApp/Telegram DMs and Slack channel threads on 2026.9.x–2026.10.8.User Impact
User impact: operators can set
messages.strandedReplyRecovery: "off"to keep unsent finals private. The turn then ends quietly: no recovery turn, no missing-answer notice, and the existing metadata-onlysource-reply/private-finalwarning in the Gateway log. The default ("retry") is unchanged, so existing deployments behave exactly as before; no migration.Why This Change Was Made
Product direction (the issue is labeled
needs-product-decision): this follows the ClawSweeper recommendation, an explicit opt-in strict privacy setting that keeps today's recovery default.resolveStrandedReplyRecoverynow reads the setting and returnskept-private; all three callers (direct reply, queued follow-up, and the second-miss diagnostic) already go through it, so no caller re-implements the policy.deliverFollowupDecisionto the decision itself (as the direct path already does), so"off"and"retry"log the same metadata-only line. This also keepsfollowup-delivery.tsunder the 700-line cap.Alternatives considered:
"off"the default formessage_tool. Rejected for now: weaker tool-callers rely on the retry to avoid silently lost answers, and changing upgrade behavior is a maintainer call. The new key makes flipping the default a one-line change later.visibleRepliesvalue (for example"message_tool_strict"). Rejected: it couples two concerns and touches everyvisibleRepliescomparison, the group override, and Doctor previews.visibleRepliesitself is root-level only; it can follow the same shape if needed.Scope of the guarantee:
"off"covers stranded-final recovery only. An answer produced by isolated settled-turn finalization (#184830) is a separate path and can still be delivered; the help text and docs say so explicitly. Localization of host notices is also out of scope.Evidence
Real model on an isolated Gateway
Built from this branch (
pnpm build:runtime, Node 26.13.1). Each run used a fresh isolated Gateway: its ownHOME,OPENCLAW_STATE_DIRand config in a temp dir, a free loopback port, token auth, started with a clean environment (env -i). No other Gateway or state was touched. Modelopenai/gpt-5.4-mini(via the Codex harness the Gateway auto-enabled). The workspaceAGENTS.mdtold the agent never to callmessageand to end every turn with a final startingPRIVATE NOTE:. One WebChat turn (chat.send, "Hi! What is the capital of France?"), thenchat.historyafter 75 s.visibleReplies: "message_tool"(defaultretry)message(send): "The capital of France is Paris." (the private final, republished)private-finalwarningstrandedReplyRecovery: "off"private-finalwarningchat.history readout
Not covered live: Slack/Telegram channels (the decision is channel-independent and the same code path runs for WebChat), and the second-miss diagnostic for a retry that was already queued before the setting changed (covered by the
retry=trueregression below).Upgrade from the latest stable (2026.11.6)
One isolated state directory and config, used by both versions in turn:
[email protected]installed from npm into a temp prefix, then this branch's build (d63cd7ccab8; the follow-up commit only changes help text and docs). Same isolated setup as above (ownHOME, state, config, port,env -i), same model and workspaceAGENTS.md, configmessages.visibleReplies: "message_tool"with nostrandedReplyRecoverykey.message(send)"The capital of France is Paris." (the reported behavior)state/openclaw.sqlitev36, agent database v38, previous files kept as*.pre-2026.11.6-…). Phase 1 history intact. With no new key, default recovery still runs: "The capital of Italy is Rome." republishedopenclaw config set messages.strandedReplyRecovery off[reload] config change applied (dynamic reads: messages.strandedReplyRecovery …)). The turn ends with the private final only: no recovery turn, no send, no notice. Phases 1–2 history intactchat.history after phase 3
Regression tests
New cases fail on
origin/mainand pass with this change:agent-runner.private-final.runreplyagent.test.ts— "keeps the final private with no retry or notice when recovery is off" for a first miss (base: retry enqueued) and a leftover retry run (base: missing-answer notice).followup-delivery.test.ts— "keeps a stranded final private when strandedReplyRecovery is off" with and without final payloads (base:retry-source-delivery; without the fix the payload-less case also gets the notice and a failed operation).Commands