Skip to content

pi-embedded-runner: reasoning-only retry short-circuited in group chats by silentReplyPolicy default #85684

Description

@iFwu

Summary

In group chats, DEFAULT_SILENT_REPLY_POLICY.group = "allow" causes emptyAssistantReplyIsSilent = true for any turn with no visible text — including turns where the model produced a reasoning-only response (thinking blocks but no text blocks). This short-circuits the reasoning-only retry mechanism, causing the turn to be silently absorbed instead of retried with a visible-answer continuation.

Repro

  1. Use a reasoning-capable model (e.g. qwen3.7-max, DeepSeek V4, MiMo v2.5-pro) on the openai-completions or anthropic-messages API.
  2. Send a message in a group chat (default silentReplyPolicy.group = "allow", no override in config).
  3. The model returns stopReason: "stop" with content: [{ type: "thinking", thinking: "..." }] — all answer content is in the thinking block, no text block.
  4. Expected: reasoning-only retry fires (visible-answer continuation instruction).
  5. Actual: turn is silently absorbed. No message delivered, no error, no retry. The ack reaction is never removed, so the user sees the message "stuck."

In a direct chat with the same model/config, the same reasoning-only response correctly triggers the retry.

Root cause

In src/agents/pi-embedded-runner/run.ts (around L2360):

const nextReasoningOnlyRetryInstruction = emptyAssistantReplyIsSilent
  ? null                    // ← always short-circuited in group chats
  : resolveReasoningOnlyRetryInstruction({...});

emptyAssistantReplyIsSilent is true when:

  • allowEmptyAssistantReplyAsSilent is true (which is always the case in group chats due to the default policy), AND
  • The turn has no visible text / no tool calls / no delivery evidence

This conflates two semantically different cases:

  • Deliberate silence: model explicitly chose not to reply (NO_REPLY, empty content, etc.) → should be absorbed in group chats.
  • Reasoning-only error: model produced reasoning/thinking output but failed to produce visible text → should be retried regardless of chat type.

Suggested fix

The reasoning-only retry should not be gated behind emptyAssistantReplyIsSilent. Instead, it should independently check whether the turn is truly reasoning-only (vs. deliberate silence):

// Deliberate silence: no content at all, or explicit NO_REPLY
const isDeliberateSilence = /* existing emptyAssistantReplyIsSilent logic */;

// Reasoning-only: has thinking blocks but no text blocks
const isReasoningOnlyTurn = /* assessLastAssistantMessage returns "incomplete-text" */;

const nextReasoningOnlyRetryInstruction = isDeliberateSilence && !isReasoningOnlyTurn
  ? null
  : resolveReasoningOnlyRetryInstruction({...});

This preserves the group-chat silent-reply semantics for legitimate silence while still retrying reasoning-only failures.

Logs

Gateway log shows the run completing without any reasoning-only retry:

17:24:54 embedded run start: runId=... provider=sub2api-completions model=qwen3.7-max thinking=high
17:25:04 embedded run agent end: runId=... isError=false
17:25:05 embedded run done: runId=... durationMs=11684 aborted=false
17:25:05 telegram turn ended without visible final response

No reasoning-only assistant turn detected or empty response detected log appears between agent-end and run-done, confirming the retry path was never entered.

Environment

  • OpenClaw 2026.5.x (source build, ifwu-fork)
  • Provider: sub2api-completions (openai-completions API) → qwen3.7-max
  • Chat type: Telegram group
  • Thinking level: high
  • Config: no silentReply override (using defaults)

Related issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions