When a conversation was compacted natively, only the key or account that
sealed the compaction can read it (#1099), so checkpointReaders keeps the
candidates to that one. When that account was at its usage cap, the 429
and the call record said "every account that serves X is held at the
usage cap", although the other accounts were never candidates. That sent
lm0711 looking at routing modes, which can't change it.
checkpointHeld tells this case apart: the plan held only the sealer's
account(s), and others were left out for the checkpoint. The error then
names the account and its window, says the compaction it sealed is what
keeps the conversation there, that routing mode and stays don't change
that, and to raise the cap / spend credits or start a new conversation.
The record reads "native compaction's account at its usage cap" (or its
credits / both variants). cappedError and cappedRecord are unchanged for
every other 429; their text is split into heldReasons and heldAdvice so
both share it. docs/subsystems/gateway-routing.md says so.
Test: TestNativeCompactionWriterAtItsCap seals a checkpoint on one
account, caps it, and checks the 429 body and the record. Broken by hand
(checkpointHeld returning nil), it fails with the old "every account"
text.
Run on origin/main d9b943555 (head 663db0ecf), with the #2517,
#2521 and #2522 changes, load ~240:
- gofmt -l clean; go vet -tags nogui for darwin, linux and windows: ok.
- go test -timeout 120m -count=1 ./... (pipefail): exit 0, every package
ok (gateway 1416.8s, agent 1535.5s). Before the rebase, on 63be47717:
- The 45m run had agent and gateway past 45m (#2544, #2108).
- TestMainWindowCorners was killed at its deadline (#1936).
- TestSkillRelinkKeepsUnreadableCopy failed (#2555; it passes alone).
- gateway alone with 120m was ok.
- GUI, the 41 Requests/Usage files in serial, both engines, before the
rebase: 493 pass, 3 fail. The 3 were usage-refresh "not yet 2 !== 1",
the same on 63be47717 alone (1 of 3); seen again on #2184.
- Rebased, these all pass, 102/102: i18n-keys, usage-ledger-ttft,
usage-ledger-key-split, usage-ledger, usage-speed, usage-ledger-detail,
gui-ja, gui-de and gui-zh-tw.
- Rebased again onto 9b04c4e20, which touches ledger.go, request_page.go
and gateway.go:
- vet ×3: ok.
- internal/usage, internal/usageapi and internal/cli: ok.
- internal/gateway -run 'NativeCompaction|UsageOverGateway|Capped|Cap':
ok.
- usage-ledger-ttft, usage-ledger-key-split, usage-ledger and
usage-speed: 86 pass. i18n-keys was red from main's own words (#2586,
fixed in the next commit).