Bug Description
During a heartbeat check, the agent's internal reasoning process leaked entirely into the user-visible reply instead of being kept internal. The result was hundreds of lines of repeated, incoherent output sent to the user's Telegram chat.
What happened
The heartbeat asked the agent to reply with HEARTBEAT_OK if all checks passed. All checks did pass. Instead of outputting the single word, the agent:
- Began outputting its internal reasoning chain verbatim into the reply
- Got stuck in a loop trying (and failing) to produce the word
HEARTBEAT_OK — repeatedly generating HEARTHEART_OK (with HEART duplicated) instead
- Continued looping for what appears to be hundreds of tokens of visible output
- Never successfully produced the correct word
Observed output (excerpt)
Done. Goodbye. Final. The end. Truly done. Absolutely done. 100% done. No more thoughts. No more attempts. Sending now.
HEARTHEART_OK
Actually, wait. I just had one more thought...
HEARTHEART_OK
...
The full output was several hundred lines of this loop delivered directly to the user via Telegram.
Environment
- OpenClaw version: 2026.4.14 (323493f)
- Model:
openrouter/anthropic/claude-sonnet-4-6
- Channel: Telegram (direct)
- Session:
agent:main:telegram:direct:1960998089
- Reasoning mode: adaptive (enabled)
- Time: 2026-04-14 ~18:34 CST
Expected behavior
Agent outputs exactly: HEARTBEAT_OK — nothing else.
Actual behavior
Agent reasoning process became visible output. Model appeared unable to produce the token sequence HEARTBEAT_OK and looped on a corrupted variant (HEARTHEART_OK) for hundreds of lines.
Hypothesis
- Reasoning/thinking content leaked — the adaptive thinking mode may have caused internal chain-of-thought to bleed into the final assistant message content, especially during a very short/simple task where the reasoning context dominated.
- Token generation corruption — something in the model's token sampling caused
HEARTBEAT to consistently decode as HEARTHEART, possibly a context contamination or sampling issue at the OpenRouter layer.
Impact
High — user received hundreds of lines of garbage output to their Telegram chat. Unacceptable UX for a production assistant.
Suggested investigation
- Check if adaptive thinking mode has a guard preventing reasoning from leaking into message content
- Check if there is a max-output-length guard on heartbeat/short responses
- Investigate the
HEARTHEART token corruption — may be reproducible
Bug Description
During a heartbeat check, the agent's internal reasoning process leaked entirely into the user-visible reply instead of being kept internal. The result was hundreds of lines of repeated, incoherent output sent to the user's Telegram chat.
What happened
The heartbeat asked the agent to reply with
HEARTBEAT_OKif all checks passed. All checks did pass. Instead of outputting the single word, the agent:HEARTBEAT_OK— repeatedly generatingHEARTHEART_OK(with HEART duplicated) insteadObserved output (excerpt)
The full output was several hundred lines of this loop delivered directly to the user via Telegram.
Environment
openrouter/anthropic/claude-sonnet-4-6agent:main:telegram:direct:1960998089Expected behavior
Agent outputs exactly:
HEARTBEAT_OK— nothing else.Actual behavior
Agent reasoning process became visible output. Model appeared unable to produce the token sequence
HEARTBEAT_OKand looped on a corrupted variant (HEARTHEART_OK) for hundreds of lines.Hypothesis
HEARTBEATto consistently decode asHEARTHEART, possibly a context contamination or sampling issue at the OpenRouter layer.Impact
High — user received hundreds of lines of garbage output to their Telegram chat. Unacceptable UX for a production assistant.
Suggested investigation
HEARTHEARTtoken corruption — may be reproducible