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

Method beginTurn

internal/tui/model.go:630–636  ·  view source on GitHub ↗

beginTurn installs a fresh per-turn context, flips phase to thinking, and returns the chat stream-reader Cmd. Every path starting a new LLM round funnels through here so one m.cancel() cancels the whole cascade.

()

Source from the content-addressed store, hash-verified

628 m.cancel()
629 }
630 m.turnCtx, m.cancel = context.WithCancel(context.Background())
631}
632
633// beginTurn installs a fresh per-turn context, flips phase to thinking, and
634// returns the chat stream-reader Cmd. Every path starting a new LLM round
635// funnels through here so one m.cancel() cancels the whole cascade.
636func (m *Model) beginTurn() tea.Cmd {
637 m.installTurnContext()
638 m.turnStart = time.Now()
639 m.lastOutcome = outcomeNone // the new run replaces the prior frozen summary

Callers 1

appendUserTurnMethod · 0.95

Calls 2

installTurnContextMethod · 0.95
startChatMethod · 0.95

Tested by

no test coverage detected