A reply that said nothing is a failure of the model or request, not the
account: the account doesn't rest (lateRests skips emptyReply), and the
group's other members of the same model, likely to end empty too, are
asked last (matesLast) while the next member is tried.
From PR #1222 by SnowGlow-aww, reviewed at 9037dd84f. Put onto main
5b14ebf49 by hand: gateway.go's failover loop had main's codexReset block
(#1628) where this one goes, so the empty-reply branch follows it; the new
test file's trailing blank line (the review's only blocker, gofmt) is gone.
Run (-tags nogui, sandbox HOME, private GOCACHE):
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows;
build on all three.
- -race: TestGeminiEmptyReplyGroupFailover, TestLateRestsEmptyReply,
TestGeminiEmptyRepliesAskedAgain, TestGeminiEmptyReplyIsAnError,
Antigravity*, CodexReset*: pass.
- Broken by hand: the failover branch off -> TestGeminiEmptyReplyGroupFailover
red; lateRests' emptyReply clause removed -> TestLateRestsEmptyReply red.
- go test ./...: all pass; internal/provider timed out at 10m under the
machine's load (other suites running) and passed alone with -timeout 30m
(666s). It's untouched here.
antigravity/gemini-3.8-flash, deep into a long Pi session, ended its turn with only its reasoning three times in a row; the request's own tries (3, 1s and 2s apart) ran out, Pi got "an empty reply" and stopped until the user typed continue. streamTranslated now asks such a reply again in place: once while the stream is still held (the request's tries and the next account still follow), up to twice once the agent has the stream, when nothing else would. A model that never answers is asked at most 6 times and still ends with the error. What reasoning the agent already has stays; the next try's follows it in the same message.
TestGeminiEmptyRepliesAskedAgain (chat and Anthropic: three empties running end in "hello", one message_start; one that never answers errors within 6 calls) is new and fails without the change. go vet, go build (GOOS=linux nogui, GOOS=windows) and go test -tags nogui ./... under a temp HOME pass.