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

Method installTurnContext

internal/tui/model.go:620–625  ·  view source on GitHub ↗

installTurnContext cancels any in-flight turn context and installs a fresh per-turn root on m.turnCtx / m.cancel. Cancel-old-then-install-new keeps Ctrl+C consistent: one m.cancel() always unwinds the whole current cascade.

()

Source from the content-addressed store, hash-verified

618 ch := m.cli.Chat(m.turnCtx, msgs, m.buildTools())
619 m.stream = ch
620 return readEvent(ch)
621}
622
623// installTurnContext cancels any in-flight turn context and installs a fresh
624// per-turn root on m.turnCtx / m.cancel. Cancel-old-then-install-new keeps
625// Ctrl+C consistent: one m.cancel() always unwinds the whole current cascade.
626func (m *Model) installTurnContext() {
627 if m.cancel != nil {
628 m.cancel()

Calls

no outgoing calls