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