buildTools exposes the four local tools every turn: bash, read_file, write_file, edit_file. No loop/control tool; a turn ends when the model stops emitting tool calls (see handleStreamClosed).
()
| 684 | m.turnStart = time.Now() |
| 685 | m.lastOutcome = outcomeNone // the new run replaces the prior frozen summary |
| 686 | m.phase = phaseThinking |
| 687 | return m.startChat() |
| 688 | } |
| 689 | |
| 690 | // appendUserTurn appends a user-role message to history and starts a turn. |
| 691 | // The only path that does so; used by submit. |
| 692 | func (m *Model) appendUserTurn(content string) tea.Cmd { |
| 693 | m.history = append(m.history, chmctx.Message{Role: chmctx.RoleUser, Content: content}) |
| 694 | return m.beginTurn() |
| 695 | } |
| 696 |