Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@adam91holt
Copy link
Contributor

@adam91holt adam91holt commented Jan 17, 2026

Fixes #1058

Summary

When a subagent completes, the announce flow now properly routes delivery through the correct channel account (e.g., WhatsApp account kev instead of falling back to default).

Problem

The announce delivery was failing with:

Delivery failed (whatsapp to +64273991111): Error: No active WhatsApp Web listener (account: default)

accountId was not being threaded through the subagent spawn → announce → delivery chain.

Solution

Thread accountId through the entire lifecycle:

  1. sessions-spawn-tool.ts: Accept agentAccountId, pass to registerSubagentRun()
  2. subagent-registry.ts: Store requesterAccountId in run record, pass to announce flow
  3. subagent-announce.ts: Pass channel + accountId to gateway agent call
  4. gateway/agent.ts: Accept accountId param, resolve with session fallback
  5. delivery.ts: Use opts.accountId with session-based fallback
  6. agent schema: Add accountId to AgentParamsSchema

Testing

Tested manually on WhatsApp:

  • Before: Subagent announce delivery fails with "account: default" error
  • After: Delivery succeeds via correct account (kev)

Fixes openclaw#1058

When a subagent completes, the announce flow now properly routes delivery
through the correct channel account (e.g., WhatsApp account 'kev' instead
of falling back to 'default').

Changes:
- sessions-spawn-tool: accept agentAccountId, pass to registry
- subagent-registry: store requesterAccountId in run record
- subagent-announce: pass channel + accountId to gateway agent call
- gateway agent handler: accept accountId param, use for delivery
- delivery.ts: use opts.accountId with session fallback
- agent schema: add accountId to AgentParamsSchema
@steipete steipete self-requested a review January 17, 2026 01:44
@steipete steipete self-assigned this Jan 17, 2026
@steipete
Copy link
Contributor

Closed — fix landed on main.

  • 0291105: thread accountId through subagent announce delivery.
  • bc7d603: add coverage for accountId routing (direct/queued/implicit) and refactor origin normalization.

Thanks @adam91holt — credited in CHANGELOG and as co-author.

@steipete steipete closed this Jan 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Subagent announce delivery fails with wrong WhatsApp account (multi-account routing)

2 participants