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
Follow-on to PR openclaw#69472 (auto-reply silent-reply suppressor for reasoning- prefaced sentinels like "think\n...\nNO_REPLY"). The outbound suppressor correctly stripped these from delivery, but the runner's incomplete-turn classifier and three retry resolvers (planning-only / reasoning-only / empty-response) saw payloadCount=0 + assistantTexts=[] and re-prompted the model on every spam decision. Each retry burned LLM tokens and the final classifier surfaced a "Agent couldn't generate a response" warning to the channel even though the original silence was intentional. Three minimal call-site changes in src/agents/pi-embedded-runner/run/ incomplete-turn.ts: - hasOnlySilentAssistantReply now also reads lastAssistant.content text parts (assistantTexts can be empty when streaming/chunker filters drop the assistant text before the run wrapper records it). - isReasoningOnlyAssistantTurn returns false when the message text is a silent reply payload — silent NO_REPLY is intentional silence, not an unfinished reasoning turn that should be retried. - isEmptyResponseAssistantTurn returns false for the same reason — gates the empty-response retry resolver against firing on intentional silence. Regression test in run.incomplete-turn.test.ts uses the exact Discord session payload that triggered this on April 24 and 27. Closes openclaw#69470 (follow-on)
Greptile SummaryThis PR adds end-to-end suppression of reasoning-prefaced silent replies (e.g. The logic is correct: Confidence Score: 5/5Safe to merge — no correctness issues found and both code paths are well-tested. No P0 or P1 issues identified. Logic for regex construction, iterative token stripping, duplicate-source collection, and all three runner guard sites is correct. The #19537 substantive-reply contract is preserved. Test coverage includes the exact production incident payload, doubled-token forms, edge cases for each reasoning heading word, and integration tests for isSilentReplyPayloadText. No files require special attention. Reviews (1): Last reviewed commit: "incomplete-turn: don't surface 'couldn't..." | Re-trigger Greptile |
|
Codex review: needs real behavior proof before merge. Reviewed May 26, 2026, 12:58 AM ET / 04:58 UTC. Summary PR surface: Source +142, Tests +128. Total +270 across 4 files. Reproducibility: yes. from source: current main's shared silent-reply payload gate does not classify Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance: Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge Security Review findings
Review detailsBest possible solution: Refresh the branch on current main, fix the unresolved type, preserve the shared classifier plus runner regression coverage, and require redacted live proof that the reasoning-prefaced silent reply is neither delivered nor retried into a warning. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main's shared silent-reply payload gate does not classify Is this the best way to solve the issue? No, not as submitted: the design direction is a narrow fit for the bug, but the branch needs the missing type import, a current-main rebase, and real after-fix proof before it is the best merge path. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 23e9bc8c0b61. Label changesLabel justifications:
Evidence reviewedPR surface: Source +142, Tests +128. Total +270 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
|
Closing due to inactivity. |
Summary
Reasoning-prone models (notably Gemini 3.x) sometimes leak their chain-of-thought as plain text content that looks like
think\n<analysis>\nNO_REPLY— a silent-reply sentinel preceded by a bare reasoning preamble. Two layers need to recognize this as intentional silence:This PR fixes both.
Supersedes / combines #69472. The first commit is the auto-reply suppressor from that PR; the second commit extends the same fix into the embedded runner so the incomplete-turn / reasoning-only / empty-response retry paths short-circuit the same way. Each commit is independently reviewable; the runner change depends on the auto-reply change to compile correctly (
isReasoningPrefacedSilentReplyis exported fromauto-reply/tokens.ts).Closes #69470, #69191 (silent-reply leak class).
Production evidence
pdd-publicagent on Discord with Gemini 3.1 Pro produced this exact assistant text on every spam-in-#general decision:Before this PR:
payloads=0 stopReason=stopand:Both symptoms are gone with this PR.
What's in each commit
Commit 1 —
auto-reply: suppress reasoning-prefaced silent repliessrc/auto-reply/tokens.tsandsrc/auto-reply/tokens.test.ts. AddsisReasoningPrefacedSilentReplyand wires it intoisSilentReplyPayloadText. Uses a tolerant trailing-strip helper that handles doubled tokens (NO_REPLY.NO_REPLY) and reasoning preambles (think/thinking/thought/reasoning/analysis) on their own line. PublicstripSilentTokenis unchanged so the existinginterject.NO_REPLYno-op contract is preserved (the existing test attokens.test.ts:64continues to pass).Commit 2 —
incomplete-turn: don't surface 'couldn't generate' for silent repliessrc/agents/pi-embedded-runner/run/incomplete-turn.tsandsrc/agents/pi-embedded-runner/run.incomplete-turn.test.ts. Three call-site changes so the silent-reply classification flows into every code path that examines the assistant turn:hasOnlySilentAssistantReplynow also readslastAssistant.contenttext parts (assistantTextscan be empty when the streaming chunker filters drop the assistant text before the run wrapper records it).isReasoningOnlyAssistantTurnreturnsfalsewhen the message text classifies as a silent reply payload — silent NO_REPLY is intentional silence, not unfinished reasoning.isEmptyResponseAssistantTurnreturnsfalsefor the same reason — gates the empty-response retry resolver against firing on intentional silence.Regression test uses the exact production assistant payload from the Discord incident.
Test plan
pnpm test src/auto-reply/tokens.test.ts— passes (38 tests, includes new reasoning-preface and doubled-token cases).pnpm test src/agents/pi-embedded-runner/run.incomplete-turn.test.ts— passes (84 tests, includes new regression for the runner false positive).Notes for review
isSilentReplyPayloadTextreturns true. Without this PR's commit 1, the runner change is a no-op for the reasoning-prefaced case (and an exact-NO_REPLYalready short-circuits via existing logic, so behavior on that path is unchanged).#19537semantics: substantive replies that happen to end withNO_REPLYare still delivered.🤖 Generated with Claude Code