MCPcopy Index your code
hub / github.com/codehamr/codehamr / TestActiveContextSizePrefersLiveValue

Function TestActiveContextSizePrefersLiveValue

internal/tui/tui_test.go:1342–1353  ·  view source on GitHub ↗

TestActiveContextSizePrefersLiveValue: packing reads liveContextSize first, then Profile.ContextSize, then the floor. Cloud profiles ship ContextSize=0, so without a live value the floor must apply.

(t *testing.T)

Source from the content-addressed store, hash-verified

1340 }
1341}
1342
1343// TestProbeBudgetSnapshotIgnoredForStaleProfile: a budget snapshot from a
1344// probe that lost the /models race (msg.profile != m.cfg.Active) must not
1345// overwrite the live profile's m.budget. Mirrors the stale-probe guard the
1346// connected flag already has.
1347func TestProbeBudgetSnapshotIgnoredForStaleProfile(t *testing.T) {
1348 m := newTestModel(t, func(http.ResponseWriter, *http.Request) {})
1349 m.cfg.Active = "local"
1350 m.budget = cloud.BudgetStatus{Set: true, Remaining: 0.88}
1351 out, _ := m.handleProbe(probeMsg{
1352 profile: "hamrpass",
1353 budget: cloud.BudgetStatus{Set: true, Remaining: 0},
1354 silent: true,
1355 err: cloud.ErrBudgetExhausted,
1356 })

Callers

nothing calls this directly

Calls 2

newTestModelFunction · 0.85
activeContextSizeMethod · 0.80

Tested by

no test coverage detected