Skip to content

Subagent announce fails after sessions_yield: adapter unavailable during yield suspension #88042

@ksiyuna-claw

Description

@ksiyuna-claw

Bug Description

After sessions_yield, subagent completion announcements fail with telegram outbound adapter is unavailable. The retry mechanism (3 retries within ~5 seconds) is too short for the yield suspension window, causing silent message loss.

Root Cause

When a parent agent calls sessions_yield, the session enters a suspended state. When the child completes and triggers announce, the outbound adapter is unavailable because the session is suspended. The external retry loop (maxAnnounceRetryCount=3 in subagent-registry-helpers.ts, line 827) retries 3 times with exponential backoff (1s → 2s → 4s), completing all retries within ~5 seconds.

However, the yield suspension typically lasts minutes (until the child finishes), so the adapter remains unavailable throughout all retry attempts. After 3 failures, the message is silently dropped.

Contrast with #56347

Issue #56347 (fixed in v2026.4.22) addressed a registry mismatch where the wrong registry was consulted. That fix correctly routes through the pinned channel registry.

This is a different problem: the registry is correct, but the adapter is genuinely unavailable because the session is in a yielded/suspended state. The fix for #56347 does not help here.

Evidence

Gateway logs (OpenClaw v2026.5.27):

21:26:50 [telegram] sendMessage ok chat=8560173586 message=14485   ← last successful TG send (parent yields)
...  (parent session is yielded, child agent runs for ~8 minutes)
21:34:31 [ws] agent.wait 465718ms                                  ← child completes
21:34:47 [warn] Subagent completion direct announce failed: OutboundDeliveryError: telegram outbound adapter is unavailable
21:34:50 [warn] Subagent completion direct announce failed: (same error, retry 2/3)
21:34:52 [warn] Subagent completion direct announce failed: (same error, retry 3/3)
21:34:52 [warn] Subagent announce give up (retry-limit) retries=3 endedAgo=21s
21:35:16 [telegram] reconnect drain: 1 pending message(s) - refusing blind replay without adapter reconciliation

Note: 21:35:16 shows the adapter eventually recovers and detects the pending message, but refuses to replay it (safety mechanism against duplicates).

5 minutes later, a normal user message triggers the parent session to resume, and the response delivers successfully — confirming the adapter itself is fine, just temporarily unavailable during yield suspension.

Workaround

Parent agents should not rely on auto-announce after sessions_yield. Instead, after yield resumes, the parent should explicitly re-output the child result to ensure delivery.

Suggested Fix

  1. Increase retry window for announce after yield: When the parent session is in a yielded state, the announce retry window should be extended (e.g., match the yield timeout or use a longer backoff).

  2. Queue mechanism: Instead of dropping the message after 3 retries, queue it for delivery when the adapter becomes available (similar to how the reconnect drain already detects pending messages).

  3. At minimum: Log the dropped message content or provide a recovery API so the parent can retrieve and resend the lost message.

Environment

  • OpenClaw: v2026.5.27 (27ae826)
  • Channel: Telegram (polling mode)
  • Node: v22.22.2
  • OS: WSL2 (Ubuntu) on Windows

Metadata

Metadata

Assignees

Labels

P1High-priority user-facing bug, regression, or broken workflow.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.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions