Repository navigation
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: needs real behavior proof before merge. What this changesThis PR suppresses recognized silent reasoning placeholders whose trailing control token ends with sentence punctuation. Example: An optional-reply conversation receives model output "think\ninternal reasoning\nNO_REPLY.".
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open: it contains a useful punctuation fix absent from current main, preserves the existing answer contract, and has no identified code defects. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe shared auto-reply classifier receives model output and supplies silence decisions to directive parsing, agent payload preparation, and reply normalization before channel delivery. flowchart TD
A[Model output] --> B[Shared silent classifier]
B --> C[Directive parsing]
B --> D[Agent payload preparation]
B --> E[Reply normalization]
C --> E
D --> E
E --> F[Channel delivery]
Technical reviewBest possible solution: Land the focused punctuation repair while leaving broader reasoning classification to its existing discussion. Do we have a high-confidence way to reproduce the issue? Current-main source rejects "think\ninternal reasoning\nNO_REPLY." before the existing placeholder rule can suppress it; the body also reports a baseline Gateway reproduction, but no target code was executed during this review. Is this the best way to solve the issue? The existing shared token parser is the appropriate repair boundary, and the narrow syntax change preserves substantive-answer and media contracts without expanding semantic heuristics. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2c97d7c4dc34. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource 0, Tests +34. Total +34 across 3 files. Added test files: 0. View PR surface stats
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 October 14, 2026, 12:04 AM ET / 04:04 UTC (Revision 5). |
… contract A standalone in-body mention of the silent token is no longer treated as a silence decision, so mixed reasoning + prose bodies stay deliverable under the answer-preservation contract. Punctuation-attached trailing tokens (for example `NO_REPLY.`) remain recognized for reasoning-prefixed silent replies. Refs openclaw#165025. The untagged production path remains tracked by openclaw#138662.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…is-desktop-smoke-tiny-20261014 * commit '920ab440dc8290c5d679557524b14c625da9b42c': (60 commits) fix(state): restore database reader typecheck fix(auto-reply): suppress punctuated silent reasoning placeholders (#168571) fix(ui): place context ring beside model picker (#170370) fix(ui): document attachments hide their download action until hover (#171171) fix: recover accepted agent updates after Gateway restart (#171717) chore(ui): refresh control ui locales (#171771) fix(state): admit same-version columns before session readers (#171634) fix(state): release read seal after failed resource drainage (#171709) fix(process): settle attached broker child cleanup once the captured tree exits (#171725) fix(compaction): prevent low context counts after server compaction (#141341) test(infra): scope Windows census fixture assertions to its own process (#171747) fix(ui): stop invitation E2E timing out without a sidebar footer (#171748) fix: include SQLite reader pool in PR wrapper inventory fix: preserve separate one-shot occurrences after interrupted manual runs (#171727) perf(shared): reject mutable snapshots before allocating (#171674) fix(sqlite): keep worker admission deadlines on the shared monotonic clock (#171715) fix(cloud): use global Crabbox defaults and quiet Corepack downloads (#171706) perf(gateway): reduce allocations in repeated session lists (#171724) fix(x): refresh generated Control UI manifest (#171746) refactor(state): engine-neutral state database handles (#171521) ...
…penclaw#168571) * fix(auto-reply): suppress reasoning bodies that declare the silent token mid-text * fix(auto-reply): drop mention-based suppression, restore mixed-answer contract A standalone in-body mention of the silent token is no longer treated as a silence decision, so mixed reasoning + prose bodies stay deliverable under the answer-preservation contract. Punctuation-attached trailing tokens (for example `NO_REPLY.`) remain recognized for reasoning-prefixed silent replies. Refs openclaw#165025. The untagged production path remains tracked by openclaw#138662. * fix(auto-reply): keep punctuated silent-token matching narrow --------- Co-authored-by: Peter Steinberger <[email protected]>
…168571) * fix(auto-reply): suppress reasoning bodies that declare the silent token mid-text * fix(auto-reply): drop mention-based suppression, restore mixed-answer contract A standalone in-body mention of the silent token is no longer treated as a silence decision, so mixed reasoning + prose bodies stay deliverable under the answer-preservation contract. Punctuation-attached trailing tokens (for example `NO_REPLY.`) remain recognized for reasoning-prefixed silent replies. Refs #165025. The untagged production path remains tracked by #138662. * fix(auto-reply): keep punctuated silent-token matching narrow --------- Co-authored-by: Peter Steinberger <[email protected]> (cherry picked from commit 30fb4fe)
…lies (#170534) Fixes the source-chat forms of #170147 (fabricated and forced replies after deliberate silence); the Anthropic runtime-context form is handled by #170438. Related: #150539, #85714. ## Problem OpenClaw conflated deliberate silence, missing output, and an undelivered answer. Canned assistant replies masked missing results, required turns overrode explicit `NO_REPLY`, and consumers used different silence heuristics. ## Fix and user impact - A final is silent only when its trimmed raw text is exactly `NO_REPLY`. A leading `NO_REPLY` followed by a newline and text delivers that text. Punctuation, lowercase, quotes, JSON, reasoning wrappers, and prose remain visible. - `prepareAgentRunTerminalReply` classifies once and publishes `meta.terminalReply`. Consumers use that fact; stored-row readers use one exact helper. - External chats honor `NO_REPLY`, including required turns. Subagents, private completions, and WebChat/Control UI require a result by default. Trusted input handling can explicitly mark result consumption optional, avoiding a duplicate answer to a late peer result. - When a result is owed, an empty final goes through recovery, then fallback, then one system notice: **"No answer was returned. Ask again if you still need one."** The notice is never an assistant row. External recovery permits an answer or `NO_REPLY`; result-required recovery requires an answer. - A required, undelivered final in message-tool-only mode gets one hidden retry (send it or choose `NO_REPLY`), then the notice. Optional turns keep private finals quiet. - Optional turns owe no result: an empty final ends quietly without recovery or notice. Native and CLI results retain the reply obligation through fallback; a clean empty result without an explicitly optional policy still remains fallback-eligible. - A yielded CLI turn returns its paused continuation metadata even when a result is required. Merely spawning a child without yielding still requires a real private result. - Canned stand-ins are removed. Authored acknowledgments, classified failure guidance, restart/session-recovery notices, tool warnings, uncertain-delivery notices, media no-ack behavior, and retention warnings remain. This reverses #168571's suppression of punctuated reasoning placeholders. Replies rejected by narrowed permissions report failure rather than completion. Yields without an authored acknowledgment stay quiet. Out of scope: run-wait full-result hydration, child-result retention and the `truncated` snapshot field, and the broader waiting-status redesign. ## Evidence [Before/after Control UI screenshots and synthetic QA-channel receipts](#170534 (comment)). The [published-driver upgrade proof from v2026.10.3](#170534 (comment)) remains applicable: this PR adds no schema or stored-row changes since that proof; its later repairs change runtime reply policy and test fixtures only. | Check | Observed result | |---|---| | Fleet replay: 90 days, 4 production installs, 21,344 terminal finals, 29 provider/model pairs | 0 silent/visible classification differences; 0 newly visible control text | | Mutation checks on 15 guarantees | All 15 regressions fail when their fix is removed | | Live Telegram matrix: 352 turns, 6 models | 205 of 212 non-empty silent-scenario finals were exact `NO_REPLY`; no punctuated, wrapped, lowercase, or trailing near-misses; cross-chat sends 48/48; reactions 48/48; required answers 79/80 (one pre-existing steering overlap) | | Targeted live re-check at `cc0a8c8` | Cross-chat 16/16 (was 3/8); yields 16/16 without canned status; empty-first recovery 20/20 real answers with no wrong `NO_REPLY`; Control UI 5/5 results | | Forgotten message tool (#85714) | Scripted 6/6; real required turns: OpenAI 10/10, Anthropic 10/10 | | Earlier integration at `068b53b8ca2` | 13/13 focused files, 833 tests pass; direct format/lint and diff checks pass | | Main integration at `063436cbde5` | Merged `8d4e374169b`; conflict owners and terminal/retry/replay/CLI/followup boundaries: 12/12 focused files, 580 tests pass; direct format/lint and diff checks pass | | Integration repairs at `16b7f78ef93` | 11 repaired files pass (236 tests); core and affected test type lanes, direct lint, and mock-export ratchet pass. The local trusted-obligation Gateway test stopped before startup on stale runtime-artifact publication; fresh-build CI covers that entry point. | | Optional completion at `9041ced336c` | 11 focused assertions across 4 files pass: optional empty completion, no recovery/fallback, unchanged exact silence, and preserved genuine heartbeat failure; core types and direct lint pass. | | Empty fallback repair at `3ccbec7ea0b` | 12 targeted files pass (709 tests, including focused reruns of corrected fixtures); required/default clean-empty fallback, optional no-fallback, native/CLI obligation metadata, Codex finalization, and dispatch boundaries covered. Direct format/lint and diff checks pass. | | Conflict integration and collector proof at `4841cf797c5` | Integrated `20b5969cd83` only after GitHub reported a merge conflict. Collector lifecycle: 230 tests pass, checking captured text in the durable row rather than the lightweight runtime projection. Unchanged plugin-reload suite: 5 tests pass locally. Direct format/lint and diff checks pass. | | CLI and final CI repairs at `0479f1981de` | CLI reliability 62/62, Gateway agent 394/394, announce fencing 9/9, targeted Slack progress 1/1, versions UI 1/1, and plugin borrowing 5/5 pass. Optional empty CLI output now settles quietly. Announcement fixtures use current run owners; geometry is measured atomically; the plugin fixture joins existing startup catalog work before measuring run custody. | | Final integration at `a6d4bc7ae0c` | Five focused files pass (71 tests): configured model picker, exact Codex terminal routing, one-shot cleanup, and test-type shard ownership. The UI chat type lane, direct type-aware lint, formatting, and diff checks pass. Updated fixtures follow raw native terminal facts, await accepted startup before inspecting auto-answered requests, and track the renamed Solid avatar test. | | Yielded CLI handoff at `7e6b53d1c1c` | The WebChat yield regression failed before repair and passes afterward; CLI reliability passes 64/64, including non-yielded child-result rejection, terminal empty/silent rejection, and optional-empty quiet settlement. Agent-root test types, direct type-aware lint, formatting, and diff checks pass. | | Published v2026.10.3 to `068b53b8ca2` upgrade | [Upgrade proof](#170534 (comment)): settings and 32 transcript events retained; exact `NO_REPLY` hidden and `NO_REPLY.` visible; retained fallback-notice state does not block a new turn; Gateway readiness HTTP 200 | Co-authored-by: Ayaan Zaidi <[email protected]>
…lies (openclaw#170534) Fixes the source-chat forms of openclaw#170147 (fabricated and forced replies after deliberate silence); the Anthropic runtime-context form is handled by openclaw#170438. Related: openclaw#150539, openclaw#85714. ## Problem OpenClaw conflated deliberate silence, missing output, and an undelivered answer. Canned assistant replies masked missing results, required turns overrode explicit `NO_REPLY`, and consumers used different silence heuristics. ## Fix and user impact - A final is silent only when its trimmed raw text is exactly `NO_REPLY`. A leading `NO_REPLY` followed by a newline and text delivers that text. Punctuation, lowercase, quotes, JSON, reasoning wrappers, and prose remain visible. - `prepareAgentRunTerminalReply` classifies once and publishes `meta.terminalReply`. Consumers use that fact; stored-row readers use one exact helper. - External chats honor `NO_REPLY`, including required turns. Subagents, private completions, and WebChat/Control UI require a result by default. Trusted input handling can explicitly mark result consumption optional, avoiding a duplicate answer to a late peer result. - When a result is owed, an empty final goes through recovery, then fallback, then one system notice: **"No answer was returned. Ask again if you still need one."** The notice is never an assistant row. External recovery permits an answer or `NO_REPLY`; result-required recovery requires an answer. - A required, undelivered final in message-tool-only mode gets one hidden retry (send it or choose `NO_REPLY`), then the notice. Optional turns keep private finals quiet. - Optional turns owe no result: an empty final ends quietly without recovery or notice. Native and CLI results retain the reply obligation through fallback; a clean empty result without an explicitly optional policy still remains fallback-eligible. - A yielded CLI turn returns its paused continuation metadata even when a result is required. Merely spawning a child without yielding still requires a real private result. - Canned stand-ins are removed. Authored acknowledgments, classified failure guidance, restart/session-recovery notices, tool warnings, uncertain-delivery notices, media no-ack behavior, and retention warnings remain. This reverses openclaw#168571's suppression of punctuated reasoning placeholders. Replies rejected by narrowed permissions report failure rather than completion. Yields without an authored acknowledgment stay quiet. Out of scope: run-wait full-result hydration, child-result retention and the `truncated` snapshot field, and the broader waiting-status redesign. ## Evidence [Before/after Control UI screenshots and synthetic QA-channel receipts](openclaw#170534 (comment)). The [published-driver upgrade proof from v2026.10.3](openclaw#170534 (comment)) remains applicable: this PR adds no schema or stored-row changes since that proof; its later repairs change runtime reply policy and test fixtures only. | Check | Observed result | |---|---| | Fleet replay: 90 days, 4 production installs, 21,344 terminal finals, 29 provider/model pairs | 0 silent/visible classification differences; 0 newly visible control text | | Mutation checks on 15 guarantees | All 15 regressions fail when their fix is removed | | Live Telegram matrix: 352 turns, 6 models | 205 of 212 non-empty silent-scenario finals were exact `NO_REPLY`; no punctuated, wrapped, lowercase, or trailing near-misses; cross-chat sends 48/48; reactions 48/48; required answers 79/80 (one pre-existing steering overlap) | | Targeted live re-check at `cc0a8c8` | Cross-chat 16/16 (was 3/8); yields 16/16 without canned status; empty-first recovery 20/20 real answers with no wrong `NO_REPLY`; Control UI 5/5 results | | Forgotten message tool (openclaw#85714) | Scripted 6/6; real required turns: OpenAI 10/10, Anthropic 10/10 | | Earlier integration at `068b53b8ca2` | 13/13 focused files, 833 tests pass; direct format/lint and diff checks pass | | Main integration at `063436cbde5` | Merged `615711778d4`; conflict owners and terminal/retry/replay/CLI/followup boundaries: 12/12 focused files, 580 tests pass; direct format/lint and diff checks pass | | Integration repairs at `16b7f78ef93` | 11 repaired files pass (236 tests); core and affected test type lanes, direct lint, and mock-export ratchet pass. The local trusted-obligation Gateway test stopped before startup on stale runtime-artifact publication; fresh-build CI covers that entry point. | | Optional completion at `9041ced336c` | 11 focused assertions across 4 files pass: optional empty completion, no recovery/fallback, unchanged exact silence, and preserved genuine heartbeat failure; core types and direct lint pass. | | Empty fallback repair at `3ccbec7ea0b` | 12 targeted files pass (709 tests, including focused reruns of corrected fixtures); required/default clean-empty fallback, optional no-fallback, native/CLI obligation metadata, Codex finalization, and dispatch boundaries covered. Direct format/lint and diff checks pass. | | Conflict integration and collector proof at `4841cf797c5` | Integrated `4344a4b4aec` only after GitHub reported a merge conflict. Collector lifecycle: 230 tests pass, checking captured text in the durable row rather than the lightweight runtime projection. Unchanged plugin-reload suite: 5 tests pass locally. Direct format/lint and diff checks pass. | | CLI and final CI repairs at `0479f1981de` | CLI reliability 62/62, Gateway agent 394/394, announce fencing 9/9, targeted Slack progress 1/1, versions UI 1/1, and plugin borrowing 5/5 pass. Optional empty CLI output now settles quietly. Announcement fixtures use current run owners; geometry is measured atomically; the plugin fixture joins existing startup catalog work before measuring run custody. | | Final integration at `a6d4bc7ae0c` | Five focused files pass (71 tests): configured model picker, exact Codex terminal routing, one-shot cleanup, and test-type shard ownership. The UI chat type lane, direct type-aware lint, formatting, and diff checks pass. Updated fixtures follow raw native terminal facts, await accepted startup before inspecting auto-answered requests, and track the renamed Solid avatar test. | | Yielded CLI handoff at `7e6b53d1c1c` | The WebChat yield regression failed before repair and passes afterward; CLI reliability passes 64/64, including non-yielded child-result rejection, terminal empty/silent rejection, and optional-empty quiet settlement. Agent-root test types, direct type-aware lint, formatting, and diff checks pass. | | Published v2026.10.3 to `068b53b8ca2` upgrade | [Upgrade proof](openclaw#170534 (comment)): settings and 32 transcript events retained; exact `NO_REPLY` hidden and `NO_REPLY.` visible; retained fallback-notice state does not block a new turn; Gateway readiness HTTP 200 | Co-authored-by: Ayaan Zaidi <[email protected]>
…8571) Co-authored-by: RomneyDa <[email protected]>
…re NO_REPLY (#203432) Root cause: `src/agents/agent-run-terminal-reply.ts:62` classifies silence on the whole raw reply, so `…reasoning…`, a line break, `</think>`, a blank line, then `NO_REPLY` is not silent; line 65 then strips only the trailing `NO_REPLY` line and the reasoning becomes the visible terminal reply that the automation announces. Fixes #203424 Thanks @nousclawds4 for the report and the exact trace. ## What Problem This Solves Some local models (the report uses `ollama/qwen3:30b` with thinking off) write their reasoning into the reply and end it with `</think>` followed by `NO_REPLY`. Automations with announce delivery treated that reply as a visible answer, so every quiet heartbeat sent the model's private reasoning (about 1 KB) to the destination chat. ## User Impact When a model closes its reasoning and then answers with exactly `NO_REPLY`, the automation stays silent and records the run as silent. Replies with a real answer after the reasoning are delivered as before. ## Why This Change Was Made #170534 made silence an exact classification on the raw reply and kept reasoning wrappers and near-miss tokens visible, reversing the broad suppression from #168571. This change keeps that contract and applies the same exact check to the answer part only: the text after the last closing reasoning tag, found by the existing reasoning-tag scanner, must be exactly the token, and the existing reasoning reducer must leave only that token. So reasoning the model closed is dropped, while text outside a matched `<think>` block stays a visible answer. Punctuated, glued, unclosed or mid-text tokens stay visible. ## Evidence Isolated `ocx src` Gateway, scripted native Ollama `/api/chat` model streaming the reporter's shape with thinking off (`think: false` on the wire), one heartbeat automation per case with announce delivery to a recording Nostr relay. Observed deliveries: | Reply shape | Before (main 2aab24f) | After | |---|---|---| | reasoning + `</think>` + `NO_REPLY` (reporter) | 802-char reasoning delivered | nothing delivered, `deliverySuppressionReason: silent` | | reasoning + `</think>` + answer | answer delivered | answer delivered | | reasoning mentioning NO_REPLY + `</think>` + answer mentioning NO_REPLY | answer delivered | answer delivered | | `NO_REPLY` | silent | silent | | `<think>…</think>` + answer | answer delivered | answer delivered | | `<think>…</think>` + `NO_REPLY` | nothing delivered, recorded `empty` | nothing delivered, recorded `silent` | | visible alert + `<think>…</think>` + `NO_REPLY` | alert delivered | alert delivered | Proof comment: #203432 (comment) The new regression in `agent-run-terminal-reply.test.ts` fails on main (2 of 4 cases). Stored `chat.history` projection is unchanged. and passes with the fix. Merge danger: two-way door. Runtime classification only; no stored rows, config or contract change. A revert restores the old behavior. Blast radius: terminal replies containing a closing reasoning tag followed by exactly the silent token, across every producer that uses `prepareAgentRunTerminalReply`. Co-authored-by: Ayaan Zaidi <[email protected]>
…re NO_REPLY (openclaw#203432) Root cause: `src/agents/agent-run-terminal-reply.ts:62` classifies silence on the whole raw reply, so `…reasoning…`, a line break, `</think>`, a blank line, then `NO_REPLY` is not silent; line 65 then strips only the trailing `NO_REPLY` line and the reasoning becomes the visible terminal reply that the automation announces. Fixes openclaw#203424 Thanks @nousclawds4 for the report and the exact trace. ## What Problem This Solves Some local models (the report uses `ollama/qwen3:30b` with thinking off) write their reasoning into the reply and end it with `</think>` followed by `NO_REPLY`. Automations with announce delivery treated that reply as a visible answer, so every quiet heartbeat sent the model's private reasoning (about 1 KB) to the destination chat. ## User Impact When a model closes its reasoning and then answers with exactly `NO_REPLY`, the automation stays silent and records the run as silent. Replies with a real answer after the reasoning are delivered as before. ## Why This Change Was Made openclaw#170534 made silence an exact classification on the raw reply and kept reasoning wrappers and near-miss tokens visible, reversing the broad suppression from openclaw#168571. This change keeps that contract and applies the same exact check to the answer part only: the text after the last closing reasoning tag, found by the existing reasoning-tag scanner, must be exactly the token, and the existing reasoning reducer must leave only that token. So reasoning the model closed is dropped, while text outside a matched `<think>` block stays a visible answer. Punctuated, glued, unclosed or mid-text tokens stay visible. ## Evidence Isolated `ocx src` Gateway, scripted native Ollama `/api/chat` model streaming the reporter's shape with thinking off (`think: false` on the wire), one heartbeat automation per case with announce delivery to a recording Nostr relay. Observed deliveries: | Reply shape | Before (main 51cbe35) | After | |---|---|---| | reasoning + `</think>` + `NO_REPLY` (reporter) | 802-char reasoning delivered | nothing delivered, `deliverySuppressionReason: silent` | | reasoning + `</think>` + answer | answer delivered | answer delivered | | reasoning mentioning NO_REPLY + `</think>` + answer mentioning NO_REPLY | answer delivered | answer delivered | | `NO_REPLY` | silent | silent | | `<think>…</think>` + answer | answer delivered | answer delivered | | `<think>…</think>` + `NO_REPLY` | nothing delivered, recorded `empty` | nothing delivered, recorded `silent` | | visible alert + `<think>…</think>` + `NO_REPLY` | alert delivered | alert delivered | Proof comment: openclaw#203432 (comment) The new regression in `agent-run-terminal-reply.test.ts` fails on main (2 of 4 cases). Stored `chat.history` projection is unchanged. and passes with the fix. Merge danger: two-way door. Runtime classification only; no stored rows, config or contract change. A revert restores the old behavior. Blast radius: terminal replies containing a closing reasoning tag followed by exactly the silent token, across every producer that uses `prepareAgentRunTerminalReply`. Co-authored-by: Ayaan Zaidi <[email protected]>
…re NO_REPLY (#203432) Root cause: `src/agents/agent-run-terminal-reply.ts:62` classifies silence on the whole raw reply, so `…reasoning…`, a line break, `</think>`, a blank line, then `NO_REPLY` is not silent; line 65 then strips only the trailing `NO_REPLY` line and the reasoning becomes the visible terminal reply that the automation announces. Fixes #203424 Thanks @nousclawds4 for the report and the exact trace. ## What Problem This Solves Some local models (the report uses `ollama/qwen3:30b` with thinking off) write their reasoning into the reply and end it with `</think>` followed by `NO_REPLY`. Automations with announce delivery treated that reply as a visible answer, so every quiet heartbeat sent the model's private reasoning (about 1 KB) to the destination chat. ## User Impact When a model closes its reasoning and then answers with exactly `NO_REPLY`, the automation stays silent and records the run as silent. Replies with a real answer after the reasoning are delivered as before. ## Why This Change Was Made #170534 made silence an exact classification on the raw reply and kept reasoning wrappers and near-miss tokens visible, reversing the broad suppression from #168571. This change keeps that contract and applies the same exact check to the answer part only: the text after the last closing reasoning tag, found by the existing reasoning-tag scanner, must be exactly the token, and the existing reasoning reducer must leave only that token. So reasoning the model closed is dropped, while text outside a matched `<think>` block stays a visible answer. Punctuated, glued, unclosed or mid-text tokens stay visible. ## Evidence Isolated `ocx src` Gateway, scripted native Ollama `/api/chat` model streaming the reporter's shape with thinking off (`think: false` on the wire), one heartbeat automation per case with announce delivery to a recording Nostr relay. Observed deliveries: | Reply shape | Before (main 2aab24f) | After | |---|---|---| | reasoning + `</think>` + `NO_REPLY` (reporter) | 802-char reasoning delivered | nothing delivered, `deliverySuppressionReason: silent` | | reasoning + `</think>` + answer | answer delivered | answer delivered | | reasoning mentioning NO_REPLY + `</think>` + answer mentioning NO_REPLY | answer delivered | answer delivered | | `NO_REPLY` | silent | silent | | `<think>…</think>` + answer | answer delivered | answer delivered | | `<think>…</think>` + `NO_REPLY` | nothing delivered, recorded `empty` | nothing delivered, recorded `silent` | | visible alert + `<think>…</think>` + `NO_REPLY` | alert delivered | alert delivered | Proof comment: #203432 (comment) The new regression in `agent-run-terminal-reply.test.ts` fails on main (2 of 4 cases). Stored `chat.history` projection is unchanged. and passes with the fix. Merge danger: two-way door. Runtime classification only; no stored rows, config or contract change. A revert restores the old behavior. Blast radius: terminal replies containing a closing reasoning tag followed by exactly the silent token, across every producer that uses `prepareAgentRunTerminalReply`. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 44f7c52) Co-authored-by: RomneyDa <[email protected]>
Related: #165025, #138662
What Problem This Solves
Fixes reasoning-only reply placeholders leaking to users when a local model appends
.,!, or?to a trailingNO_REPLYcontrol token.User Impact
Recognized reasoning placeholders remain silent with punctuation attached to their final control token.
NO_REPLYstays supported. Substantive answers that mention the token, mixed-content answers, untagged prose, and media attachments retain their existing behavior.Why This Change Was Made
Extend the existing trailing-token matcher at the reply-normalization owner; keep the existing reasoning-placeholder classification and narrow token boundary. This continues @liwenjie200543's work and preserves their commits. Production changes: +1/-1 lines; tests: +44/-10 lines relative to the merged main baseline.
The broader untagged reasoning leak reported in #165025/#138662 is outside this change. No configuration, prompt, or migration changes.
Evidence
pnpm openclaw ... agent, an isolated Gateway, and a native Ollama response fixture reproduced visible.,!, and?placeholders in 13.01s, 6.43s, and 7.86s. Substantive and mixed-content controls were preserved.normalization-live-okfrom real Ollamaqwen3:8b(14.91s).qwen3:8breturnednormalization-live-okthrough the Gateway HTTP agent entry point (11.04s). BareNO_REPLYhas the same required-reply error as the punctuated cases. The CLI agent path likewise suppresses the placeholder and reports incomplete-turn under required-reply policy (62.57s including cold CLI startup).openclaw/ci-gate. ClawSweeper reviewed6d90265639be8f2f652fa1c396d17eab9c8627e7with no code findings; its remaining optional-reply/Telegram proof hold is recorded above for maintainer review.