openclaw - 💡(How to fix) Fix Bug: NO_REPLY token leaks as visible text when model generates trailing content after NO_REPLY [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#63054Fetched 2026-04-09 07:59:07
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
closed ×1labeled ×1

When a model generates NO_REPLY followed by additional text (e.g. leaked thinking/reasoning content), OpenClaw's silent reply detection fails and the entire output — including repeated NO_REPLY tokens plus leaked reasoning — gets sent to the user as visible messages.

Observed with fireworks/kimi-k2p5-turbo via openai-completions API on the peppershrimp agent. The output contained 151 NO_REPLY occurrences in 24KB of text, resulting in 7+ Telegram messages of raw internal tokens sent to a group chat.

Root Cause

isSilentReplyText() in tokens-CgHHhFXy.js uses exact match regex: /^\s*NO_REPLY\s*$/i

When the model outputs NO_REPLYThe user (GARY) is saying... (NO_REPLY immediately followed by reasoning text without whitespace), the exact match fails. isSilentReplyPrefixText() also fails because it requires the entire text to be uppercase.

The model then continues generating in a loop until hitting maxTokens (8192), producing 24KB of repeated NO_REPLY + reasoning text. stopReason was length, not a natural stop.

RAW_BUFFERClick to expand / collapse

Summary

When a model generates NO_REPLY followed by additional text (e.g. leaked thinking/reasoning content), OpenClaw's silent reply detection fails and the entire output — including repeated NO_REPLY tokens plus leaked reasoning — gets sent to the user as visible messages.

Observed with fireworks/kimi-k2p5-turbo via openai-completions API on the peppershrimp agent. The output contained 151 NO_REPLY occurrences in 24KB of text, resulting in 7+ Telegram messages of raw internal tokens sent to a group chat.

Root Cause

isSilentReplyText() in tokens-CgHHhFXy.js uses exact match regex: /^\s*NO_REPLY\s*$/i

When the model outputs NO_REPLYThe user (GARY) is saying... (NO_REPLY immediately followed by reasoning text without whitespace), the exact match fails. isSilentReplyPrefixText() also fails because it requires the entire text to be uppercase.

The model then continues generating in a loop until hitting maxTokens (8192), producing 24KB of repeated NO_REPLY + reasoning text. stopReason was length, not a natural stop.

Contributing Factors

  1. No stop sequence support for openai-completions providers — the stop key in model config is rejected as unrecognized, so there's no way to configure NO_REPLY as a stop sequence for these models.
  2. Agent-level thinkingDefault overrides model-level params.thinking — when thinkingDefault: low is set on the agent, it overrides params.thinking: "none" on the model config. Models that don't support thinking properly (like kimi via fireworks) then leak thinking content into the text output.
  3. No length-based safety check — when stopReason is length and the output contains NO_REPLY anywhere, there's no fallback detection.

Expected Behavior

  • isSilentReplyText or the delivery layer should detect text that starts with NO_REPLY and suppress it, rather than requiring an exact match.
  • Alternatively, NO_REPLY should be added as a stop sequence when calling openai-completions API providers.
  • Agent-level thinkingDefault should not override an explicit model-level params.thinking: "none".

Environment

  • OpenClaw 2026.4.8
  • Model: fireworks/accounts/fireworks/routers/kimi-k2p5-turbo (openai-completions API)
  • Agent: peppershrimp (thinkingDefault: low)

extent analysis

TL;DR

Modify the isSilentReplyText() function to detect text that starts with NO_REPLY instead of requiring an exact match.

Guidance

  • Update the regex in isSilentReplyText() to /^\s*NO_REPLY/i to match text that starts with NO_REPLY regardless of trailing characters.
  • Consider adding NO_REPLY as a stop sequence when calling openai-completions API providers to prevent excessive output.
  • Review agent-level thinkingDefault settings to ensure they do not override explicit model-level params.thinking: "none" configurations.
  • Implement a length-based safety check to detect and handle cases where stopReason is length and the output contains NO_REPLY.

Example

// Updated isSilentReplyText function
function isSilentReplyText(text) {
  return /^\s*NO_REPLY/i.test(text);
}

Notes

The provided solution focuses on updating the isSilentReplyText() function to correctly identify and suppress text starting with NO_REPLY. However, addressing the contributing factors, such as adding stop sequence support for openai-completions providers and reviewing agent-level settings, is also crucial for a comprehensive fix.

Recommendation

Apply the workaround by updating the isSilentReplyText() function to detect text starting with NO_REPLY, as this directly addresses the root cause of the issue and can be implemented without waiting for broader changes to the openai-completions API or agent settings.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING