MCPcopy Create free account
hub / github.com/codehamr/codehamr / TestBuildToolsExposesExactlyFourTools

Function TestBuildToolsExposesExactlyFourTools

internal/tui/tui_test.go:1102–1119  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
1112func 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

Callers

nothing calls this directly

Calls 2

newTestModelFunction · 0.85
buildToolsMethod · 0.80

Tested by

no test coverage detected