TestBuildToolsExposesExactlyFourTools pins the tool roster: bash, read_file, write_file, edit_file, in that order, with no loop/control tool. Order is part of the contract: the model sees the tools in the payload in this sequence.
(t *testing.T)
| 1100 | // write_file, edit_file, in that order, with no loop/control tool. Order is |
| 1101 | // part of the contract: the model sees the tools in the payload in this sequence. |
| 1102 | func TestBuildToolsExposesExactlyFourTools(t *testing.T) { |
| 1103 | m := newTestModel(t, func(http.ResponseWriter, *http.Request) {}) |
| 1104 | got := m.buildTools() |
| 1105 | want := []string{ |
| 1106 | tools.BashName, |
| 1107 | tools.ReadFileName, |
| 1108 | tools.WriteFileName, |
| 1109 | tools.EditFileName, |
| 1110 | } |
| 1111 | if len(got) != len(want) { |
| 1112 | t.Fatalf("buildTools returned %d tools, want %d: %+v", len(got), len(want), got) |
| 1113 | } |
| 1114 | for i, name := range want { |
| 1115 | if got[i].Function.Name != name { |
| 1116 | t.Fatalf("tool[%d] = %q, want %q (order matters)", i, got[i].Function.Name, name) |
| 1117 | } |
| 1118 | } |
| 1119 | } |
| 1120 | |
| 1121 | // TestTurnEndsWhenAssistantEmitsNoToolCalls pins the turn-end contract: a final |
| 1122 | // assistant message with no tool calls returns to phaseIdle and hands control |
nothing calls this directly
no test coverage detected