Skip to content

fix(auto-reply): suppress punctuated silent reasoning placeholders - #168571

Merged
steipete merged 4 commits into
openclaw:mainfrom
liwenjie200543:fix/auto-reply-silent-body-mention-165025
Oct 14, 2026
Merged

steipete merged 4 commits into
openclaw:mainfrom
liwenjie200543:fix/auto-reply-silent-body-mention-165025

Conversation

@liwenjie200543

@liwenjie200543 liwenjie200543 commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Related: #165025, #138662

What Problem This Solves

Fixes reasoning-only reply placeholders leaking to users when a local model appends ., !, or ? to a trailing NO_REPLY control token.

User Impact

Recognized reasoning placeholders remain silent with punctuation attached to their final control token. NO_REPLY stays 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

  • New punctuation/custom-token regressions fail on the original main matcher: four expected failures in 5.50s. Fixed token and reply-normalization suites: 75 passed in 151.09s, including media preservation.
  • Scoped production/test types, lint, formatting, and all seven applicable baseline ratchets passed. Codex autoreview: no actionable P0–P2 findings.
  • macOS baseline through 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.
  • The same Gateway/native-provider path preserved fenced command-looking prose without tool execution (8.93s), executed a separately structured native tool call (10.19s), and received normalization-live-ok from real Ollama qwen3:8b (14.91s).
  • Current-head Gateway HTTP proof: an ordinary fixture answer returns HTTP 200 unchanged (2.18s); the punctuated reasoning placeholder is suppressed, then this required-reply entry point returns HTTP 500/incomplete-turn (0.77s warm). This is not successful silent delivery: optional-reply channel delivery and Telegram remain unproven on this head. Required-reply policy was not changed.
  • Current-head controls: substantive answer HTTP 200 (2.85s); mixed answer HTTP 200 (0.33s); literal fenced command HTTP 200 with no marker created (0.37s); native structured command completed and created its marker (1.39s); real qwen3:8b returned normalization-live-ok through the Gateway HTTP agent entry point (11.04s). Bare NO_REPLY has 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).
  • Exact-head CI: run 38506883160 passed, including openclaw/ci-gate. ClawSweeper reviewed 6d90265639be8f2f652fa1c396d17eab9c8627e7 with no code findings; its remaining optional-reply/Telegram proof hold is recorded above for maintainer review.

@clawsweeper

clawsweeper Bot commented Oct 10, 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.

@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: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 10, 2026
@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

This 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.".

  • Before: The punctuated placeholder is not classified as silent and can reach delivery.
  • After: The placeholder text is classified as silent and suppressed.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The focused patch appears correct and exact-head CI passed, but the supplied error-path observations do not satisfy the changed channel behavior's proof gate.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: Otherwise recognized silent reasoning placeholders can appear in chat when their trailing control token has sentence punctuation.
Reason: The focused repair restores established silence handling without changing answer classification; Related correctly leaves the broader linked reports unresolved.

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
Reviewed head: 6d90265639be8f2f652fa1c396d17eab9c8627e7

Before merge

  • Add real behavior proof - The body reports current-head Gateway HTTP and CLI suppression, but the changed silent case ends in HTTP 500/incomplete-turn rather than successful optional-reply completion. Supply redacted logs, live output, or a recording through an optional-reply Gateway channel and Telegram Test Server showing punctuated placeholders suppressed, substantive replies preserved, and normal completion; remove IPs, API keys, phone numbers, and non-public endpoints, then update the PR body for re-review.

Findings

None.

Tests

  • Missing end-to-end proof: The reported regressions and Gateway runs do not demonstrate successful optional-reply channel completion and Telegram suppression with a substantive-answer preservation control.
Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Reasoning-prefixed silence classification keeps the original intent (0c493a1: Suppress recognized reasoning-prefixed silent finals before delivery while preserving substantive replies containing trailing tokens, as recorded in merged auto-reply: suppress reasoning-prefixed NO_REPLY #80930.)
  • Media preservation during silent-text normalization keeps the original intent (17479ce: Remove silent control text without dropping accompanying media.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • zunkai Zhao: Raw commit 0c493a1 adds src/auto-reply/tokens.ts:91 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 0c493a161fa5; files: src/auto-reply/tokens.ts)

PR surface

Source 0, Tests +34. Total +34 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 2 44 10 +34
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 45 11 +34

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded parsing repair for punctuated silent placeholders, with no demonstrated urgent regression introduced by the patch.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.
  • proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. Telegram Test Server can observe whether punctuated silent placeholders disappear while substantive replies remain visible.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record successful optional-reply channel and Telegram suppression with a substantive-answer preservation control.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (4 earlier review cycles)
  • reviewed 2026-10-10T17:37:58.350Z sha 271a48d :: needs real behavior proof before merge. :: [P1] Preserve substantive replies that merely mention the silent token | [P2] Cover the reported payload without adding a reasoning prefix
  • reviewed 2026-10-10T17:46:25.003Z sha 271a48d :: needs real behavior proof before merge. :: [P1] Preserve substantive replies that merely mention the silent token | [P2] Cover the reported payload without adding a reasoning prefix
  • reviewed 2026-10-13T08:14:26.529Z sha 3cd042b :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-14T03:40:54.669Z sha 6d90265 :: needs real behavior proof before merge. :: none

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.
@liwenjie200543

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. and removed P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Oct 13, 2026
@steipete steipete changed the title fix(auto-reply): reasoning leaks into the chat when the model's NO_REPLY closing line is phrased unusually fix(auto-reply): suppress punctuated silent reasoning placeholders Oct 14, 2026
@steipete
steipete merged commit 30fb4fe into openclaw:main Oct 14, 2026
143 of 145 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

vincentkoc added a commit that referenced this pull request Oct 14, 2026
…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)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 15, 2026
…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]>
RomneyDa pushed a commit that referenced this pull request Oct 16, 2026
…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)
obviyus added a commit that referenced this pull request Oct 16, 2026
…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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
…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]>
wheakerd pushed a commit to wheakerd/clawdbot that referenced this pull request Oct 22, 2026
obviyus added a commit that referenced this pull request Nov 22, 2026
…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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 23, 2026
…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]>
tideclaw-bot pushed a commit that referenced this pull request Nov 28, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants