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 | m.cfg.ActiveProfile().Key = token |
| 1101 | m.cli.Token = token |
| 1102 | } |
| 1103 | mm, cmd := m.submit(text, text, promptEntry{display: text}) |
| 1104 | out, _ := drain(mm, cmd) |
| 1105 | return out.(Model) |
| 1106 | } |
| 1107 | |
| 1108 | // TestStalePingForOldBackendDoesNotOverwriteConnectedFlag: a ping launched |
| 1109 | // against the old profile's URL can land after the user /models'd to a new |
| 1110 | // reachable profile. Without the URL tag, the stale "unreachable" ping flickers |
| 1111 | // connected false and shows a bogus "!" warning for the live backend. |
| 1112 | func TestStalePingForOldBackendDoesNotOverwriteConnectedFlag(t *testing.T) { |
| 1113 | m := newTestModel(t, func(http.ResponseWriter, *http.Request) {}) |
| 1114 | m.connected = true |
| 1115 | live := m.cli.BaseURL |
| 1116 | |
| 1117 | // pingMsg from a stale URL (different from the live client's BaseURL): |
| 1118 | out, _ := m.Update(pingMsg{ok: false, baseURL: "http://stale-prior-backend"}) |
| 1119 | if !out.(Model).connected { |
| 1120 | t.Fatal("stale ping for old backend overwrote live connected=true") |
| 1121 | } |
| 1122 |
nothing calls this directly
no test coverage detected