ac4af582301a4e8a29245dbba767eba31334ddf9
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
6da19bf181 |
provider: Factory's built-in is retired; its plugin serves it
"factory" joins retiredBuiltins: every Factory account is served by
@magpie-community/opencode-factory-auth, and the hourly MoveRetiring
moves the ones still on the built-in.
Removed: the built-in's sign-in (factory_signin.go, WorkOS's device
flow), keeping the sign-in (renew, lapse, org reconcile and mend,
headers, factoryGet), its provider and account (factoryProvider,
factoryAccount, factoryAlsoOn), its login list, switch, on/off and
forget, its usage card (factoryLoginQuota), droid's prompt and body
rewriting (factory_client.go), and its rows in signin.go, logins.go,
logins_on.go, login_usage.go, subscription_usage.go and account.go.
zcodeDecode/Encode, kept in zcode.go only for factory_client.go, go
with it. An API key always goes to the plugin now (factoryAddKey), and
`magpie accounts import factory` keeps saying to add it with accounts
add factory; its dead import branches are gone.
Kept: the mover and what it reads (factoryLogins, factorySaved,
factoryCreds, factoryMu); ImportFactoryKeys, factory_key.go and
factoryWhoami, for "Use an API key instead"; droid's model table with
factoryAPIs and factoryCore, since the plugin's provider is named
"factory" (account.go APIs, FactoryGemini and servedByFactory still
answer for it); factoryAPI for the moved provider's host
(builtinHost); factory_usage.go's limits reader behind
FactoryAllowanceForTest, which the gateway's pool tests use; the
gateway's "factory" lists (estimatedMoved, the account check), as the
Zed commit kept zed's; the parity tests.
Tests:
- git rm'd, built-in only: factory_test.go (sign-in, refresh, accounts,
orgs), factory_client_test.go, gateway factory_agents_test.go
(droid's line on every wire, the generate route to chat) and
factory_think_off_test.go (TestPluginThinkingOff covers the plugin);
TestFactoryAPIKey, TestFactoryKeyAgainReadsUsageAfresh,
TestFactoryServesModelsAddedSinceItsFetch, TestUserAgentAccountUntouched
(TestUserAgentFor still covers an account's User-Agent).
- Changed meaning: TestGeminiEmptyReplyIsAnError,
TestGeminiEmptyRepliesAskedAgain and TestGeminiImageModelReturnsItsImage
used Factory's generate route as a fake-able Gemini upstream; they now
use a Gemini API of the user's own (saveGem), the same decoder, and the
image test checks :streamGenerateContent instead of /api/llm/g/v1/generate.
TestMovedShowsBuiltinHost's first check is now a plain plugin
(fakeco), and a retired Factory with no migration record shows
api.factory.ai. TestFactoryAPIKeyMoved checks factoryLogins() is empty
instead of the removed factoryLookup. factorySite/factoryJSON moved
into factory_key_test.go.
Run in this worktree:
gofmt -l internal: nothing
go vet -tags nogui ./internal/provider ./internal/gateway ./internal/cli
./internal/gui, GOOS=darwin, linux, windows: clean
staticcheck -checks U1000 -tests=false (darwin, windows) on
internal/provider: nothing new
go test -tags nogui -count=1 -run 'Factory|Gemini|PaymentRequired|
ResetsInWords|UserAgent|UsedWindow|Vertex|PayloadTooLarge|UsageCache|
AnthropicImage|ThinkingOff|Moved|Retired|Mover|Migrat|Move|
SayTheirPlugin|Allowance|Discovery|ClaudeModels|GrokPrice|
LoopbackSignIns|AsksOwnBackend|SideLogin|Import|Accounts|ZCode|MiMo'
on the four packages: ok (all four); TestFactoryAPIKeyMoved ran with
Bun (PASS), not skipped.
Not run: whole packages, the full suite, the GUI suite (machine load
~300). Not tried with a real Factory account. docs/subsystems not
changed, as for Zed.
|
||
|
|
8d224796aa |
gateway: an empty reply from Gemini/Antigravity asks the next member and rests no account (#1221)
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
|
||
|
|
8d3cf5f86e |
gateway: a Gemini reply that says nothing is asked again on the same account before it fails, so a long conversation that ends with only reasoning a few times running goes on instead of stopping the agent (#667, tianshuo886)
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. |
||
|
|
a742ee10b3 | antigravity: a Gemini reply that says nothing is an error, asked again, not a turn ended as it should (#667: antigravity/gemini-3.8-flash handed pi content [] and zero usage as a normal stop, the agent's run ending mid-task; #636 Bug 3) — Antigravity's Code Assist stream (and any Gemini one) now and then ends with a STOP and no parts, with only reasoning, or with no candidate at all. translate passed the decoder's KStop on and finished the client's stream as it does any reply: Chat's finish_reason "stop" and [DONE], Anthropic's end_turn and message_stop, Responses' response.completed, and a non-streamed reply of 200 with no content — nothing an agent can tell from an answer, and nothing the holdWriter took for a failure, so nobody asked again. Now a reply from a Gemini upstream (CodeAssist, Gemini) holds its end (KStop, KUsage) until something is said in it — text, a call, a search, an image — and one that ended with nothing said, not cut at its length nor by a safety filter (still a refusal, #248), ends with an error event, "<provider>: an empty reply (the model answered nothing; try again)", or a 502 when not streamed. As a 502 before any content it is held, asked again of the same account (lastRetries) or of the next one, and an agent told it retries rather than ends its turn, as Cursor's and Devin's empty replies already are. Other upstreams aren't changed: Claude ending a turn with nothing after a tool's result is its answer. TestGeminiEmptyReplyIsAnError (Factory's Gemini route, which shares the decoder and translate: STOP with no parts, only reasoning, no candidate; Chat, Anthropic and Responses streamed and Chat not; asked again; text and reasoning cut at MAX_TOKENS still go as they came) fails on the old code with the issue's wire shape and passes. Against the owner's real Antigravity account in a sandbox gateway (temp HOME, port 3488): a prompt asking gemini-3.8-flash-low for no output gave, on the old build, finish_reason stop with no content 3/3, and on this one the error event after the retries 3/3; ordinary replies on Chat (streamed and not), Anthropic and Responses, and a bash tool call, are unchanged. go vet, builds (darwin, GOOS=linux -tags nogui, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass (a first run had TestClaudeAccountNamedAsItsLogin and an internal/gui fetching test fail, timing tests that passed on the rerun). |