dgqyushen on Discord: OpenCode Zen's free DeepSeek V4.1 Flash (200K)
first in a group and a 1M DeepSeek subscription second, so that the
first 200K go free and past that go to the subscription.
The gateway fell over only on a refusal it reads as too long (#700,
withRoom/failOverflow, tooLongUnsaid past 1.2x the window). A vendor that
refuses a request just past its window without saying why (between 1.0x
and 1.2x) reached the agent as that error while the next member had
room, and every doomed request spent one against the free tier's limits.
roomy (fallback.go), in serve after rules, affinity, the image filter and
pinTo and before probeOne, estimates the request as the overflow path
does (estimate) and leaves out the candidates whose known window
(windowOf: Contexts, the catalog, ContextOf) is no larger, and their
order rows with them. It is a check before sending, not a retry. Kept:
a window not known, a body that doesn't parse, a single model, and a
request no candidate holds (the first is asked, its overflow told to the
agent to compact). A conversation stuck to the small member by affinity
moves once it outgrows it. count_tokens (a count on the first member) and
System One's decision models don't go through serve's candidate path and
are left alone; every generation route (middleware, classify, search,
vision, codex titles/backend, auto groups) goes through serve. No UI
change: a member left out is absent from the route's order.
TestPayloadTooLargeOverWindowTriesMemberWithRoom now expects the members
too small not to be asked at all (c only, one try).
Run:
- go test -tags nogui -p 1 ./internal/gateway -run
'TestMemberTooSmallIsNotAsked|TestConversationOutgrowingItsMemberMoves|
TestRoomyLeavesWhatItCantJudge|TestPayloadTooLarge': ok
- the overflow tests (TestPayloadTooLarge, TestOverflow,
TestContextOverflow, TestEveryVendorsOverflow, TestCodexOverflowInGroup,
TestStreamOverflow, TestRateLimitNotContextOverflow) with the new ones:
ok
- gofmt -l clean; go vet ./internal/gateway (darwin); GOOS=linux and
GOOS=windows go vet -tags nogui ./...: clean; go build darwin, linux,
windows: ok.
Broken by hand: the roomy call in serve commented out:
TestMemberTooSmallIsNotAsked red (400 "FREE: Invalid request
parameters"), TestConversationOutgrowingItsMemberMoves red (free 2,
paid 0), TestPayloadTooLargeOverWindowTriesMemberWithRoom red (a 1, c 1,
2 tries); restored, all green.
Not run: the whole internal/gateway package (the run failed to build,
"no space left on device", the disk at 0 GB free) and the full suite
(left to the batch's run). Not tried against the real OpenCode Zen.
Known: the estimate is bytes/4, so mostly-CJK text counts high and a
member may be passed over a little early.
Full suite: SUITE_LINE