Repository navigation
Conversation
When switching providers, the outgoing agent is asked for a recap. If that turn fails (the account lost access, a usage limit, the CLI exiting), the provider often streams its error as assistant text first, and that text became the brief the incoming agent received. Treat a turn that reported session.error or usage.limited, or threw, as failed and return nothing, so the caller falls back to the deterministic recap built from the transcript.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
What changed
requestOutgoingHandoffreturns an empty recap when the outgoing turn fails: it reportedsession.errororusage.limited, orsendHarnessTurnthrew. The caller (chooseHandoffBrief) then uses the deterministic recap built from the transcript, which is what the existingcatchcomment already intended.Why
When a session switches providers, the outgoing agent is asked to write the recap. If that turn fails, providers often stream the error as assistant text before failing, e.g. Claude Code with "Your organization has disabled Claude subscription access for Claude Code".
requestOutgoingHandoffkept whatevermessage.deltatext it had collected, and since such a message is longer thanMIN_AGENT_BRIEF,chooseHandoffBriefused it as the brief. The incoming agent then received the outgoing provider's error message instead of a summary of the conversation. The same applied to partial text from a turn that threw midway.UI
No layout changes. After a failed outgoing recap, the handoff card shows the transcript-based recap instead of the provider's error text.
Validation
handoffTurn.test.ts: a streamed recap is returned; an error streamed as assistant text followed bysession.erroryields""; partial text from a turn that throws yields"". The last two fail onmain.npm run check:web: vitest (5287 passed, 13 skipped) andtsc --noEmit. No Rust changes.Checklist
npm run check(check:web; no Rust files changed)Summary by CodeRabbit