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 | func (m *Model) buildMessages() []chmctx.Message { |
| 685 | ctxSize := m.activeContextSize() |
| 686 | budget := chmctx.Budget(ctxSize) |
| 687 | r := chmctx.Pack(m.history, budget) |
| 688 | out := make([]chmctx.Message, 0, len(r.Messages)+1) |
| 689 | out = append(out, chmctx.Message{Role: chmctx.RoleSystem, Content: m.system}) |
| 690 | out = append(out, r.Messages...) |
| 691 | dbgWriteRequest(m.cfg.ActiveProfile().LLM, ctxSize, budget, len(m.history), out) |
| 692 | return out |
| 693 | } |
| 694 | |
| 695 | // buildTools exposes the four local tools every turn: bash, read_file, |
| 696 | // write_file, edit_file. No loop/control tool; a turn ends when the model |