-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
pi-embedded-runner: reasoning-only retry short-circuited in group chats by silentReplyPolicy default #85684
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper 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 does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper 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 does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Summary
In group chats,
DEFAULT_SILENT_REPLY_POLICY.group = "allow"causesemptyAssistantReplyIsSilent = truefor 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
openai-completionsoranthropic-messagesAPI.silentReplyPolicy.group = "allow", no override in config).stopReason: "stop"withcontent: [{ type: "thinking", thinking: "..." }]— all answer content is in the thinking block, no text block.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):emptyAssistantReplyIsSilentistruewhen:allowEmptyAssistantReplyAsSilentistrue(which is always the case in group chats due to the default policy), ANDThis conflates two semantically different cases:
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):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:
No
reasoning-only assistant turn detectedorempty response detectedlog appears between agent-end and run-done, confirming the retry path was never entered.Environment
sub2api-completions(openai-completions API) → qwen3.7-maxsilentReplyoverride (using defaults)Related issues
isSignedThinkingBlockmisses unsigned thinking blocks (different gap — our thinking blocks ARE signed)silentReplyPolicy="allow"(opposite direction, closed)