Repository navigation
Conversation
When a model emits its chain-of-thought as plain text content (a bare "think"/"thinking"/"thought"/"reasoning"/"analysis" heading followed by prose) and concludes with the NO_REPLY sentinel, the channel-agnostic silent-reply gate at src/auto-reply/reply/reply-directives.ts previously treated the whole message as substantive and delivered it to users. Add isReasoningPrefacedSilentReply, wire it into isSilentReplyPayloadText, and include a dedicated tolerant trailing-strip helper so that doubled token forms like "NO_REPLY.NO_REPLY" (observed with Gemini 3.x) collapse. stripSilentToken keeps its existing conservative contract so no other caller behavior shifts (preserves the "interject.NO_REPLY" no-op test). Covered by new unit tests in src/auto-reply/tokens.test.ts. Closes openclaw#69470
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6b034b1662
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // src/shared/text/reasoning-tags.ts cannot catch this form because there are | ||
| // no tags to match. | ||
| const BARE_REASONING_PREAMBLE_RE = | ||
| /^\s*(?:think(?:ing)?|thought|reasoning|analysis)\s*:?\s*(?:\r?\n|$)/i; |
There was a problem hiding this comment.
Narrow preamble match before dropping NO_REPLY-suffixed messages
isReasoningPrefacedSilentReply now treats any payload whose post-token text merely starts with think|thinking|thought|reasoning|analysis as silent, so substantive replies like Analysis:\n<actual answer>\nNO_REPLY are discarded instead of being delivered with the trailing token stripped (the prior #19537 behavior). This creates a user-visible false positive whenever a model formats a normal response under an “Analysis” heading and accidentally appends NO_REPLY, causing complete message loss.
Useful? React with 👍 / 👎.
Greptile SummaryThis PR adds Confidence Score: 5/5Safe to merge — logic is sound, tests are comprehensive, and the change is correctly scoped to the silent-reply gate. No P0 or P1 issues found. The regex design correctly restricts suppression to messages where the first line is a bare heading word (not inline prose), collapsing doubled tokens iteratively with a well-bounded loop. The only theoretical edge is very-short single-word strings like 'analysis.NO_REPLY' being suppressed without a newline, but that pattern cannot arise from any realistic model output and the trade-off is explicitly accepted in the PR design. No files require special attention. Reviews (1): Last reviewed commit: "auto-reply: suppress reasoning-prefaced ..." | Re-trigger Greptile |
|
Superseded by #73153 — that PR includes this commit plus a follow-on fix in the embedded runner so the incomplete-turn / reasoning-only / empty-response retry paths recognize reasoning-prefaced silent replies as intentional silence (otherwise the runner re-prompts and surfaces a "couldn't generate a response" warning despite the auto-reply suppressor correctly stripping the leak from delivery). Reviewing #73153 instead is recommended; happy to close this one if maintainers prefer. |
|
Closing this as duplicate or superseded after Codex automated review. This PR is superseded by open PR #73153 from the same author. Current main still lacks the requested reasoning-prefaced silent-reply handling, but #73153 carries the same auto-reply work plus the embedded-runner follow-on needed for the retry/warning path, so maintainer review should continue there. Best possible solution: Close this narrower PR as superseded and focus maintainer review on #73153, where the same auto-reply suppressor is paired with the embedded-runner retry/warning fix needed for the full user-visible behavior. What I checked:
So I’m closing this here and keeping the remaining discussion on the canonical linked item. Codex Review notes: model gpt-5.5, reasoning high; reviewed against 0835f9409aac. |
Summary
think,thinking,thought,reasoning, oranalysison its own line) followed by theNO_REPLYsentinel, instead of delivering the chain-of-thought verbatim to users.NO_REPLY.NO_REPLY(observed with Gemini 3.x) inside the new check, while keeping the existingstripSilentTokencontract unchanged.NO_REPLYare still delivered.Closes #69470.
Problem
When a reasoning-prone model emits its chain-of-thought as plain text content (not via structured
thinking_*stream events or<thinking>XML tags) and concludes with the silent-reply sentinel,isSilentReplyPayloadTextreturnsfalseand the whole message — reasoning plusNO_REPLY— is delivered to the messaging channel.Observed Discord output:
The proper XML tag stripper in
src/shared/text/reasoning-tags.tscannot catch this form — there are no tags — andstripSilentTokenintentionally leavesinterject.NO_REPLY-style glued suffixes alone (per existing test atsrc/auto-reply/tokens.test.ts:64).Fix
All changes localized to
src/auto-reply/tokens.ts:isReasoningPrefacedSilentReply(text, token)returnstruewhen the message ends with the silent token and the preceding content is a bare reasoning preamble.isSilentReplyPayloadText, so the single channel-agnostic gate atsrc/auto-reply/reply/reply-directives.ts:34catches the leak for every channel.stripTrailingSilentTokensToleranthelper with its own regex (getSilentReasoningTrailingRegex) iterates to collapse doubled trailing tokens separated by punctuation. Kept out of the publicstripSilentTokenpath so no other caller behavior shifts.Test plan
pnpm test src/auto-reply/tokens.test.ts— 38 tests pass (16 new).pnpm test src/auto-reply— 1086 tests pass.NO_REPLY.NO_REPLY, preserves isSilentReplyText regex too permissive — suppresses substantive replies ending with NO_REPLY #19537 substantive replies, rejects inline "think the answer is X" natural language, handles whitespace-only and undefined inputs.🤖 Generated with Claude Code