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

Function TestSlashModelSwitchClearsStaleBudget

internal/tui/tui_test.go:815–829  ·  view source on GitHub ↗

TestSlashModelSwitchClearsStaleBudget: after a hamrpass turn leaves m.budget set, switching to a profile that emits no X-Budget-* headers (local Ollama) would keep rendering the old percentage forever; StatusSuffix only checks .Set, not which profile produced it. rebuildClient must drop the cached s

(t *testing.T)

Source from the content-addressed store, hash-verified

813}
814
815// TestArgPopoverSkipsConfigReloadMidTurn: typing is allowed mid turn, but the
816// cmd→arg popover transition must not reload config then: a reload can
817// rebuildClient and swap the live llm.Client under the
818// in flight turn. The stale list is fine; submit is phase gated and runSlash
819// reloads once the turn is over.
820func TestArgPopoverSkipsConfigReloadMidTurn(t *testing.T) {
821 m := newTestModel(t, func(http.ResponseWriter, *http.Request) {})
822 yaml := []byte(`active: local
823models:
824 local:
825 llm: local-model
826 url: ` + m.cfg.Models["local"].URL + `
827 key: ""
828 context_size: 256000
829 remote:
830 llm: cloud-model
831 url: http://remote:9000
832 key: sk-r

Callers

nothing calls this directly

Calls 3

newTestModelFunction · 0.85
runSlashMethod · 0.80
StatusSuffixMethod · 0.80

Tested by

no test coverage detected