fix(agent): release activeRequests before publishing TypeAgentFinished
Sven Olsen
created
I keep hitting a bug where a turn finishes -- desktop notification
fires, agent is clearly done -- but the terminal stays stuck on
the spinner with input blocked until something unrelated wakes
the TUI up.
The TUI polls IsSessionBusy() inside its TypeAgentFinished
handler and only re-evaluates on incoming tea.Msgs. Run() right
now publishes the notification while activeRequests still holds
the session's cancel func, so the poll on receipt sees true and
the busy gates stay stuck. Reorder so cleanup runs first.
💘 Generated with Crush
Assisted-by: Claude Opus 4.7 via Crush <crush@charm.land>