readEvent drains one event from the LLM stream as a tea.Msg, re-scheduled until the channel closes. Tags ch so Update can spot stale prior-turn events.
(ch <-chan llm.Event)
| 38 | // readEvent drains one event from the LLM stream as a tea.Msg, re-scheduled |
| 39 | // until the channel closes. Tags ch so Update can spot stale prior-turn events. |
| 40 | func readEvent(ch <-chan llm.Event) tea.Cmd { |
| 41 | return func() tea.Msg { |
| 42 | e, ok := <-ch |
| 43 | if !ok { |
| 44 | return streamClosedMsg{ch: ch} |
| 45 | } |
| 46 | return streamEventMsg{ch: ch, e: e} |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | // runToolCall executes one tool call off the UI goroutine. parent is the |
| 51 | // per-turn root: Ctrl+C aborts the tool mid-run, and the toolResultMsg carries |
no outgoing calls
no test coverage detected