bug: InterAgentBus async fails silently when named session ID is stale (after CLI update/cache clear)
Summary
When Claude CLI is updated or its session cache is cleared, named session IDs stored in named_sessions.json become invalid. The InterAgentBus attempts to resume these stale sessions and fails silently — the calling agent receives no response and no error.
Steps to Reproduce
- Use
ask_agent_async.pyto send a message between agents (e.g., main → sonic) - Update Claude CLI or clear its session cache
- Send another async message — it appears to succeed (returns task_id) but no response is ever delivered
Observed Behavior
ask_agent_async.pyreturns a task_id immediately (looks like success)- Bus internally attempts
claude --resume <stale_session_id> - Claude CLI outputs:
No conversation found with session ID: <id> - Bus exits with empty output (exit=1), delivers nothing to the caller's Telegram chat
- No error or warning is shown to either agent
Expected Behavior
When No conversation found with session ID is returned, the bus should:
- Discard the stale session ID
- Start a fresh session (without
--resume) - Deliver the response normally
Workaround
Manually reset session_id to "" in:
~/.ductor/named_sessions.json— sessions from main agent~/.ductor/agents/<name>/named_sessions.json— sessions from each sub-agent
After reset, the next call creates a fresh session automatically.
Environment
- Ductor: v0.15.0
- Claude CLI: updated from 2.1.76 → 2.1.79 (triggered the issue)
- Multi-agent setup: main + sonic agents
Impact
All async inter-agent communication breaks silently after any Claude CLI update. The only symptom visible to the user is that async responses never arrive.
Co-Authored-By: Claude Sonnet 4.6 [email protected]
Fixed in v0.16.0 (commit 9782e32). InterAgentBus.send_async now detects SessionNotFound-class errors from the provider CLI, falls back to a fresh session, and emits a visible warning instead of failing silently. Recovery is capped at one retry (v0.16.0 MED fix) so there's no silent cascade — if the retry also fails, you get an explicit session.recovery_failed message in your chat language.
Fixed in v0.16.0 (commit 9782e32).
InterAgentBus.send_async now detects SessionNotFound-class errors from the provider CLI, falls back to a fresh session, and emits a visible warning instead of failing silently. No more mysterious no-ops after a CLI cache clear / update. The recovery is per-attempt (not retry-forever), so you'll see a warning in logs once, the fresh session starts, and the message is delivered. A v0.16.0 late-stage fix also added a circuit-breaker: recovery is capped at one retry, so if the retry also fails you get an explicit user-facing error instead of silent cascade.