fix(byoa): show "typing…" for poll-driven and coalesced turns (#51)
The typing indicator is gated on the turn having a conversation id, and that id
only ever came from an SSE wake payload. Two very common paths therefore ran
with no indicator at all:
- a POLL-driven turn never has one — and polling is the ONLY path left
whenever the wake-stream is down;
- a wake arriving mid-turn is coalesced through scheduleWake's busy branch,
which re-kicks the turn without a conversation.
Both are exactly when a human IS waiting, so the agent reads as dead. Observed
in a group chat: an agent was @mentioned, ran a 3-minute turn (engine spawned,
`turn DONE … exit 0`, reply posted) and the room showed nothing for the entire
turn — indistinguishable from "it never woke up". Meanwhile a peer whose
wake-stream happened to be healthy showed "typing…" normally, so the room looked
like only one of the two mentioned agents had responded.
The daemon already knows where the work came from: `seen` from snapshotUnread is
keyed by conversation_id. So fall back to it when the wake carried none. With
exactly one unread conversation that's unambiguous; with several, stay silent
rather than light up an arbitrary room — a wrong indicator is worse than none,
and the reply lands correctly either way.
Extracted as `typingConversation` so the choice is unit-testable, matching how
isStaleResumeError is covered. The phantom-typing case the original comment
guarded against still can't happen: the fallback is derived from CURRENTLY
unread messages, not a leftover wake value.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> B
BillyKing committed
026d1a69372cf6d7bd4c9123d9519b91acb53582
Parent: 1d59393
Committed by GitHub <noreply@github.com>
on 8/21/2026, 9:44:32 AM