MCPcopy Index your code
hub / github.com/codehamr/codehamr / readEvent

Function readEvent

internal/tui/commands.go:40–48  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
40func 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

Callers 3

updateMethod · 0.85
startChatMethod · 0.85
handleStreamMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected