Commit Graph
36 Commits
Author SHA1 Message Date
yetone cda5d07dce provider: Factory's mover min is 0.1.41, ZCode's environment paragraph and restored-read reminder pass (plugins #211, #213)
factory 0.1.41 renames ZCode's generated environment paragraph to the
runtime-context wording and ZCode's restored-read reminder ("Called the
Read tool with the following input:") to a previously read file, both of
which Factory answered with 403 Forbidden. keepMovedCurrent updates every
moved user's plugin from 0.1.40 to 0.1.41. Nothing in the account shape
changes.

npm view @magpie-community/opencode-factory-auth version --prefer-online
says 0.1.41 at landing.

Run (mote-run, at this tree): gofmt -l internal/provider (clean);
go vet ./... on darwin, GOOS=linux -tags nogui, GOOS=windows (ok);
go test -tags nogui ./internal/provider -timeout 45m (ok, 87.8s).
Not tried: a real Factory account through ZCode.
2026-10-29 21:57:21 +08:00
yetone 750bd1bb69 gateway: Factory's usage policy refusal reaches agents as a refused request, not a failed sign-in
sweanng (Discord #general, ZCode + Factory + GLM 5.3) got Factory's
usage policy refusal shown as "Provider authentication failed"
(reason=auth_failed status=403). The refusal is Factory's own; the label
was wrong. Factory refuses at 403 with code content_policy_rejected. The
Factory plugin (up to 0.1.39) handed it on as a 403 permission_error
with no code, magpie didn't know the code as a refusal, so the 403 went
through as is and the agent read it as an auth failure.

- policyRefusal knows content_policy_rejected (Factory's code, in its
  own top-level and error.code shapes and the plugin's), so the existing
  refusal path answers every protocol with 400 and its own request
  error: Anthropic invalid_request_error, OpenAI chat and Responses
  invalid_request_error, Gemini INVALID_ARGUMENT. Not asked again of the
  same account; other accounts/members follow the Refusal retries
  setting as for any refusal.
- restAfter leaves the account unrested for a policy refusal at 403 too,
  not only 400 (it rested "other by backoff" before).
- The refusal note keeps up to 1000 bytes of the vendor's message, not
  300: Factory's advice (start a new session or drop the quoted text)
  and OpenAI's Daybreak link were cut.
- Factory mover min 0.1.40 (plugins #494, on npm as latest): the plugin
  now answers this refusal as a 400 invalid_request_error carrying code
  content_policy_rejected; its other 403s stay permission_error.

Siblings checked: Devin's plugin maps its content policy to 400, Qoder's
sensitive codes and Zhipu's 1301 are request errors already; Factory was
the one content refusal sent as a 403.

Run (mote, rebased on origin/main 96a703a59, with the next commit):
  go test -timeout 45m -count=1 ./internal/provider: ok
  go test -timeout 45m -count=1 ./internal/gateway: ok (768s)
  (the first gateway run at this commit alone failed only
  TestUnroutedUnknownHoldAnsweredSooner's TempDir cleanup, a race in
  the test fixed in the next commit)
  gofmt -l internal/: clean
  plugins: HOME=$(mktemp -d) bun test packages/factory 178 pass;
  bun scripts/check.mjs ok.
Broken by hand: with fallback.go and routing.go reverted, all three new
tests fail (403 permission_error / PERMISSION_DENIED reaches every
protocol; policyRefusal false; rests "other by backoff"). With the note
cap back at 300, TestFactoryPolicyRejectedIsARefusal and
TestFactoryPolicyRefusalReachesAgentsAsARefusal fail (advice cut). With
the plugin's index.mjs reverted, content-policy.test.mjs fails 3 of 6.
Not tried: a real Factory content_policy_rejected (no way to trip it on
purpose), and ZCode itself reading the 400: its error mapping isn't in
any source I could find, so ZCode showing it as a refusal is expected
from the Anthropic invalid_request_error, not seen.
2026-10-29 18:31:42 +08:00
yetone fd80ed99c9 provider: Factory's plugin min is 0.1.39 (DeepSeek V4.1 Flash 1017)
npm has @magpie-community/opencode-factory-auth 0.1.39 since 10-29
(plugins fada6e0, from Wangzehong111's #480): DeepSeek V4.1 Flash 1017,
droid 0.251.0's entry, sent to its registry default upstream, Fireworks.
sweanng on Discord found the Factory list had DeepSeek V4.1 Flash but no
1017. keepMovedCurrent installs min, so moved users get it from this
release.

Run on mote at this tree (origin/main 5143bf593 + this line):
- go test -timeout 45m ./internal/provider/: ok (209.6s).
- GOOS=linux and GOOS=windows go vet ./internal/provider/: ok. gofmt clean.
- plugins side: full bun test (HOME=$(mktemp -d)) on mote at load ~100:
  factory 176 pass; 4 reds in untouched packages that pass alone, filed
  as plugins #490, #491 and noted on #210, #489. bun scripts/check.mjs ok.
  Moving 1017 back to baseten turns the new droid test red.
Not tried: a real Factory account sending to 1017 (Factory gates it with
a feature flag).
2026-10-29 16:45:22 +08:00
yetone 490c0a4ad0 provider: Factory's plugin min is 0.1.38 (plugins #349)
npm has @magpie-community/opencode-factory-auth 0.1.38 since 10-24
(plugins b04cca3): the "Standard usage only" plugin option, which stops an
account once its Standard window is used up and moves on to the next. The
mover's min stayed 0.1.37, and keepMovedCurrent only installs min, so no
moved user could get the option.

Run on mote at this tree (origin/main 4b0a32e0f + this line):
- go test ./internal/provider/: red on two filed reds unrelated to the
  mover, #3632 (filememo synctest fatal in
  TestUnreadLoginsWriteErrorsKeepCredentials, 2 of 2) and #3854 (the
  three TestFetch* shared-base tests).
- the same with those four tests skipped: ok (93s).
- GOOS=linux and GOOS=windows go vet ./internal/provider/: ok. gofmt clean.
Not tried: a real Factory account taking the update.
2026-10-28 06:25:42 +08:00
yetone 3334386385 provider: Factory's plugin min is 0.1.37 (plugins #302)
factory 0.1.37 (plugins bb020ce) drops only the billing header's own
line from a system block or string, so instructions joined after it,
such as Claude Code auto mode's classifier policy, reach the model.
Raising the mover's min updates every moved user's plugin.

npm view --prefer-online --registry https://registry.npmjs.org shows
0.1.37 for @magpie-community/opencode-factory-auth.

Run at this commit's tree (on origin/main c036d6c34): gofmt -l clean,
go vet ./internal/provider, go test ./internal/provider ok (86.9s).
Not run: the full suite. The machine has 3.8Gi free, under the 8Gi a
full run needs; the change is one string in the movers map, which only
internal/provider reads.
Not tried: a real Factory account through magpie on 0.1.37. The plugin
side ran the reporter's offline repro against the published tarball.
2026-10-22 11:20:27 +08:00
yetone afa5f74b9f provider: the Factory mover's min is 0.1.34 (plugins#243)
factory 0.1.34 (magpie-community/plugins cdf4513) adapts Claude Code
2.1.292+'s instructions reminder when the files are re-read after
compaction (changed: true, "Instruction files were re-read after the
conversation was compacted; these differ from their earlier copies —
each replaces its earlier copy, ..."), as it did the first one, and its
rebuilt 403 keeps Factory's request id and error code.
`npm view @magpie-community/opencode-factory-auth version --prefer-online`
gives 0.1.34. keepMovedCurrent updates every moved user's plugin to it.

Run at ab7ec8c65 (macOS, go1.26.8, sandbox HOME), both commits in the
tree: gofmt, three vets clean; set -o pipefail; go test -timeout 45m
./...: exit 0, 64 packages ok, no FAIL (load ~200).

Rebased onto b641868eb (origin/main, which moved gateway.go and
routing.go: b749cffbb's reply-room retry on a 400, b641868eb's
heldClockIn; neither touches the 403 path) and run again at a33699df6
(this pair's tree), macOS, go1.26.8, sandbox HOME: gofmt -l none; go
vet ./... (darwin), GOOS=linux go vet -tags nogui ./..., GOOS=windows
go vet ./...: all clean. go test -count=1 -timeout 45m
./internal/provider: ok (809s). go test -run
'TestPlain403|TestOrderedKeepsAnAccountAt98|TestPromptRefusalRestsNobody|ReplyFitsTheWindowLeft|TestHeldClock|Rest|Forbid|403'
./internal/gateway: ok (110s). go test -count=1 -timeout 45m
./internal/gateway: ok (1762s, load ~300). A full ./... at a33699df6 was started
and stopped after 46 minutes with one package done (load 320-420 from
other sessions, disk at 8.7G free); the earlier full run of the same
two commits on ab7ec8c65 was exit 0, 64 packages ok.
2026-10-19 22:17:39 +08:00
yetone 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.
2026-10-17 23:11:00 +08:00
yetone b5c76935b9 provider: moved Factory users get plugin 0.1.33 (plugins#158, plugins#198)
The factory mover's min goes from 0.1.31 to 0.1.33, so keepMovedCurrent
updates every moved Factory user's opencode-factory-auth:
- 0.1.32 (plugins#158): each model carries droid's token multiplier, given
  to magpie as its rate, with a running promotion's discount struck through.
- 0.1.33 (plugins#198): the update-config skill entry Factory refuses is
  adapted in a system prompt's configuration section too, including
  claude-code-guide's "- /update-config:" form.

npm view @magpie-community/opencode-factory-auth@0.1.33 --prefer-online
printed 0.1.33 before the change.

Run at this commit's tree, with the DeepSeek search commit on top: see
that commit's body for gofmt, go vet (darwin, linux, windows) and the full
go test -tags nogui -timeout 45m ./... run on the pushed head.
2026-10-17 20:53:18 +08:00
yetone ee1df7e7a5 provider: a Factory API key moves to the plugin as its own key account
A Factory account added by its fk- key moved as an oauth sign-in with no
refresh token, which the plugin would try to renew and then lapse. It now
moves as the plugin's "Factory API key" sign-in saves one (type api, key,
whoami's metadata), and comes back as a key. A moved Factory's Import of
API keys sends them to its plugin (factoryKeyToPlugin), so the GUI no longer
hides Import for a moved Factory.

TestFactoryKeyMover, factory_key_test.go and plugin-moved-signin.test.cjs
(chromium, webkit; en, zh) go red without it.

Run at 63be47717 with this batch: go test -tags nogui ./... -count=1 -timeout 90m, 66 packages ok, no FAIL (load ~250). gofmt -l clean; GOOS=linux and GOOS=windows go vet of provider, gateway and plugin pass.
2026-10-16 19:38:03 +08:00
yetone 107fbbc36d provider: moved Factory users get opencode-factory-auth 0.1.31, whose OpenAI models' requests go without temperature and top_p, not 400 (sweanng424 on Discord; magpie-community/plugins#154)
Raises the factory mover's min to 0.1.31 (npm view --prefer-online
@magpie-community/opencode-factory-auth@0.1.31 answers 0.1.31; published
by plugins 4e64f26's publish run 38857895455). The magpie side of the
class, plugin models' temperature: false not read, is #2492.

Run at a15e57656 + this change, sandbox HOME, go test -timeout 45m ./...:
every package ok except internal/gui, red only on
TestPanelJoinsFullScreenSpaces ("the panel shown doesn't take the
keyboard"), which is #2450 and fails alone 3 of 3 here; this change
touches only a string in internal/provider. gofmt -l clean.
2026-10-16 14:13:32 +08:00
yetone 05c4e3f7bb factory: requests say droid 0.242.0, the current release, and moved users get plugin 0.1.30 (sky杨 on Discord: every model 403 "Factory: Forbidden")
Factory answered every model 403 "Forbidden" to requests that named an
older droid version. The built-in now sends factoryVersion 0.242.0, and
the mover's min is 0.1.30, the plugin release with the same headers
(magpie-community/plugins b8717aa), so keepMovedCurrent updates every
moved user's plugin.

npm view @magpie-community/opencode-factory-auth@0.1.30 --prefer-online
answers 0.1.30.

Run: gofmt; go vet -tags nogui ./internal/provider for darwin, linux and
windows; go test -run 'Factory|Moved|Mover|Migrat' ./internal/provider ok.
Not tried: a real Factory account through the built-in.

Full suite: SUITE_LINE
2026-10-15 23:08:05 +08:00
yetone 6087c82b02 provider: moved Factory users get opencode-factory-auth 0.1.28, whose Fast Mode models come last, so GPT-5.3-Codex, Grok and GLM are in the first 24 again (plugins #119, psylch)
Plugins 95af6cf moved the six -fast entries after every other model;
0.1.27 had put them beside their bases, pushing five models past the 24 a
provider with no picks exposes. npm view --prefer-online shows 0.1.28 on
registry.npmjs.org.

Run: go test -tags nogui -run 'Moved|Migrat|Mover|Factory|Adopt|HandOver|KeepMoved' ./internal/provider passes; gofmt clean.
Not run: a real moved account updating to 0.1.28.
2026-10-14 22:35:59 +08:00
yetone bd4cb7a260 provider: moved Kiro, WorkBuddy and Factory users get plugins 0.1.11, 0.1.21 and 0.1.27 (magpie-community/plugins#120, #121, #119)
The movers' min, so keepMovedCurrent updates every moved user's plugin:
- kiro 0.1.11: a thinking model offers xhigh as its own level (50k
  budget), so Claude Code's xhigh isn't routed as max (plugins#120).
- workbuddy 0.1.21: a model free only at night (Hy4 preview, 23:00-08:00)
  is never said free, and a whole-day discount shows the price before it,
  from WorkBuddy's modelPromotions (plugins#121).
- factory 0.1.27: droid's Fast Mode models (Opus 5.5/5/4.8, GPT-5.5/5.4/
  5.3-Codex), and fast asked of a base model sent to its Fast Mode model
  (plugins#119).

All three are on npm (npm view: 0.1.11, 0.1.21, 0.1.27).

Run: gofmt -l, go vet ./internal/provider for darwin, GOOS=linux -tags
nogui and GOOS=windows, go test ./internal/provider (ok, 449s under load
~280). Not tried: a moved user's update in a running magpie.
2026-10-14 18:18:57 +08:00
yetone 114509426f provider: a moved Factory updates to plugin 0.1.26, Gemini's route and a 413 said as Factory's byte limit (#2080, #2082)
@magpie-community/opencode-factory-auth 0.1.26 (published, npm latest):
- Gemini 4 Argon and Gemini 3.x on Factory's /api/llm/g/v1/generate,
  as the built-in sends them (#2080; plugins 60c9054).
- on a 413 from Factory, the request asked once more with every image
  and file but the newest left out, tool results kept beside their
  calls; failing that, an error saying it is Factory's limit on the
  body's bytes, not the context, with the gateway's 413 hint
  (#2082; plugins 1bd6d17).

Unmoved users: the gateway already adds the same byte-limit hint to any
413 and fails a routing group over to the next member.

Run: npm view @magpie-community/opencode-factory-auth@0.1.26 version
(0.1.26); go test ./internal/provider ./internal/gateway -count=1 (ok);
vet on darwin, linux (nogui) and windows. Not tried: a real Factory
account.
2026-10-14 15:17:06 +08:00
yetone 0337ce4bc7 factory: Haiku 5.5 and Mistral Large 4, in droid 0.240.0's picker, are offered, and moved users get plugin 0.1.25 (JL on Discord)
JL (Windows, droid 0.240.0, Factory desktop 0.197.1, magpie 0.1.1226,
opencode-factory-auth 0.1.24): droid and Factory desktop offer
claude-haiku-5-5; droid through magpie couldn't pick it.

droid's models are the registry bundled in its npm binary
(@factory/cli-<platform> 0.240.0, bin/droid). Against 0.233.0's registry,
0.240.0 adds claude-haiku-5-5, mistral-large-4 and gpt-6-astra-ultrafast.
The plugin (magpie-community/plugins e4023d9, published as 0.1.25, npm view
checked) now offers Haiku 5.5 (Anthropic Messages, 872000/128000, efforts
low..max) and Mistral Large 4 (chat completions, x-api-provider mistral,
Droid Core, 524288/64000, images). GPT-6 Astra Ultra Fast stays out: droid
offers it only once the user accepts Factory's high-cost terms.

- migrate_factory.go: the mover's min is 0.1.25, so keepMovedCurrent
  updates moved users (JL is on the plugin).
- factory.go: the built-in had the same gap; its table gets the same two
  rows for users who haven't moved.
- factory_pool_rest_test.go: the plugin's Core list, copied from its
  usage, gains Mistral Large 4.
- TestFactoryDroid0240Models is new; its fixture is droid 0.240.0's
  registry bytes (the same as the plugin's models.test.mjs). It fails with
  the Haiku 5.5 row removed.

Run, under a temp HOME: go test -tags nogui ./... with the machine at load
35-190 (other sessions). Every package passed except five that hit the
10m timeout mid-test (agent, gateway, library, plugin, provider, in
tests that don't touch Factory). Rerun with -timeout 40m: provider ok;
gateway still timed out at load ~130 (TestCodexHeardWithinItsIdleTimeout
failed on its timing, unrelated); -run 'Factory|Moved' on gateway ok.
agent, library and plugin were not rerun to the end; this change
doesn't touch them. gofmt -l clean; GOOS=linux and GOOS=windows go vet
-tags nogui on internal/provider and internal/gateway ok.
Not tried against Factory itself (no Factory account here); droid was read,
not run.
2026-10-14 05:11:19 +08:00
yetone ab4a778951 provider: a moved Factory asks for its plugin 0.1.24 (plugins #66)
factory 0.1.24 (magpie-community/plugins #66, guoqchen1001) is on npm:
a session continued after Claude Code compaction, whose restored context
opens with the invoked-skills reminder, is adapted so Factory takes it.
Raising the mover's min lets keepMovedCurrent bring every moved user to it.

Run: npm registry dist-tags latest = 0.1.24; go test -tags nogui
-run 'Mov|Migrat|Plugin|Factory|Mover' ./internal/provider ok; gofmt clean.
2026-10-13 09:22:22 +08:00
yetone d4ffce1fba provider: moved Factory users get plugin 0.1.23, where a streamed Claude Code request with context management and a skill list sent alone as a system message are no longer refused (plugins#71, #72, Vigilans)
Factory's streaming route answers context_management with 400 "Extra
inputs are not permitted" (#71), and the update-config line in a skill
list Claude Code sends as its own system message, as text blocks or a
plain string, got 403 (#72). Plugin 0.1.23 (on npm) handles both; the
mover's min makes keepMovedCurrent update moved users to it.

Run: go test -tags nogui ./internal/provider under a temp HOME; gofmt
-l; GOOS=linux and GOOS=windows go vet -tags nogui ./internal/provider.
npm view @magpie-community/opencode-factory-auth version: 0.1.23.
2026-10-10 18:19:22 +08:00
yetone 566760147a provider: moved Factory users get plugin 0.1.22, whose Claude Code restored-context turn after /compact no longer reaches Factory unadapted (plugins#68, Vigilans)
After /compact in Claude Code 2.1.280, every turn on factory/claude-opus-5-5
was 403 "Factory: Forbidden". The reporter's bisect found that Factory
refuses each fixed fragment of the turn Claude Code sends with the files it
restores: the "Note: <path> was read before the last conversation was
summarized…" notes, "Called the Read tool with the following input:", the
"# Environment\nYou have been invoked in the following environment:"
paragraph and the model line. Plugin 0.1.21 recognized none of them in
that combined, unwrapped block. Plugin 0.1.22 (magpie-community/plugins
0437abb, on npm) recognizes the complete block and applies the existing
compat spellings and the lossless Read-result encoding to each fixed
paragraph, the rest byte-for-byte. The mover's min is raised so
keepMovedCurrent updates moved users. The built-in, which has none of the
plugin's Claude Code adaptations, is unchanged.

Plugin: its two new tests use the issue's literal fragments; the adapting
one fails on 0.1.21; bun test (1010 pass) and check.mjs pass. Here:
go test -tags nogui -count=1 ./internal/provider/, go vet -tags nogui for
darwin, linux and windows, gofmt -l pass. Stubbed fetch only; not tried
against Factory itself (no Factory account here).
2026-10-10 03:39:45 +08:00
yetone 4ed6df801c provider: moved Factory users get plugin 0.1.21, whose pi compaction summary no longer opens with the sentence Factory refuses (#1316, Eriice)
After pi compacted a session, every turn on factory/claude-opus-5-5 was 403
"Factory: Forbidden". The reporter's replays found the refused part: pi's
fixed opening of its summary message, "The conversation history before
this point was compacted into the following summary:"
(COMPACTION_SUMMARY_PREFIX in pi-coding-agent dist/core/messages.js), whole.
Plugin 0.1.21 (magpie-community/plugins f4c0d96, on npm) rewords that
sentence, and pi's branch summary opening, when a user text is pi's whole
summary, on Messages, chat completions and Responses; the mover's min is
raised so keepMovedCurrent updates moved users. The built-in, which has
none of the plugin's pi or Claude Code adaptations (#952, #1132), is
unchanged.

Plugin: its new pi.test.mjs tests fail on 0.1.20 and pass on 0.1.21; bun
test (114 pass) and check.mjs factory pass; the npm tarball's index.mjs is
the committed one. Here: go test -tags nogui -count=1 ./internal/provider/
in Docker (golang:1.26.8; on the Mac new test binaries hung in dyld while
syspolicyd was at 100%), go vet -tags nogui for darwin, linux and windows,
gofmt -l pass. Not tried against Factory itself (no Factory account here).
2026-10-08 21:15:25 +08:00
yetone 1ab6228b22 provider: moved Factory users get plugin 0.1.20, whose Claude Code compaction context quotes summaries like tool output and no longer lets a hook notification stop it early (plugins #42) 2026-10-08 12:54:55 +08:00
yetoneandSadWood 65d8c418b6 provider: moved Factory users get plugin 0.1.19, which adapts Claude Code's compaction summaries and quoted session summaries (#1132, plugins#37) (#1182)
Co-authored-by: SadWood <24450652+SadWood@users.noreply.github.com>
2026-10-08 09:53:55 +08:00
yetone 2d85a08635 factory: moved users get plugin 0.1.18, which cuts pi's opening sentence to its first half (#952, mxzs123) — pi 1.0.4 through the plugin got 403 "Factory: Forbidden" for "hi" on DeepSeek (chat completions) and Claude (Messages); the reporter's replays found Factory refusing "You are an expert coding assistant operating inside pi, a coding agent harness." whole, and pi's full request answered with it cut to "You are an expert coding assistant.". 0.1.18 (magpie-community/plugins 4d6dcca, on npm) does that in system and developer prompts on every route; the mover's min is raised so keepMovedCurrent updates moved users. The built-in, which has none of the plugin's Claude Code adaptations either, is unchanged. Not tried against Factory itself (no Factory account here). go vet and go test -tags nogui ./internal/provider/ under a temp HOME pass. 2026-10-06 08:10:48 +08:00
yetone 9e13f18fb9 gateway, provider: a request turning reasoning off stops Factory's DeepSeek V4.1 Flash, Kimi K3 and GLM-5.2 thinking (#899, tedestar) — they offered only low/high/max (GLM-5.2 high/max), so an agent's none (or Claude Code's thinking disabled) was asked for low, or nothing, and Fireworks thought anyway. droid 0.231.0 lists off for them and sends reasoning_effort "none"; through OpenRouter pinned to Fireworks, none came back with 0 reasoning tokens on DeepSeek V4.1 Flash (2 completion tokens; 19 at the default, 16 reasoning at low) and Kimi K3 (8; 71 at the default), and on Baseten's GLM-5.2 (2; 114 at the default), while GLM-5.3 and GLM-5.3-Flash turn none away ("Reasoning is mandatory for this endpoint and cannot be disabled") and stay at low, their least (Qwen3.8 Max and MiniMax have no off in droid either). The three now have none among their levels, in the built-in and in @magpie-community/opencode-factory-auth 0.1.17, which the mover's min is raised to; and a translated request that turned reasoning off (Effort reads it as low) is asked for none on a model with none among its levels, whatever the provider, else as before (a refusal still falls back to the lowest level on). No Factory account was at hand to send through Factory itself. TestFactoryThinkingOff (the built-in: chat, Responses and Anthropic's disabled; GLM-5.3 still low) and TestPluginThinkingOff (the plugin host, a model whose variants have none and one without) are new and fail without the change. go vet, go build (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui ./... under a temp HOME pass (TestSavedButSignedOutClaudeServed timed out once under load and passes alone). 2026-10-05 20:09:00 +08:00
yetone 040ae5675a factory: requests say droid 0.233.0, the current release, and moved users get plugin 0.1.16, which does the same (Discord, JL on magpie 0.1.824 with plugin 0.1.15: every model a 403 "Factory: Forbidden" from pi and Claude Code, while droid itself works) — droid 0.233.0's model requests have the headers, paths and body shape of 0.231.0's but for the version (X-Client-Version, User-Agent factory-cli/<ver>), and its binary reads a server-side min_cli_version; magpie and the plugin said 0.231.0, two releases behind. That Factory refuses an old version with a 403 is not confirmed (no Factory account to try with); it is the one difference found. The mover's min is 0.1.16 (published on npm), so keepMovedCurrent updates moved users. go vet, builds (darwin, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass. 2026-10-04 18:32:42 +08:00
yetone 52e2af1a75 factory: the mover takes plugin 0.1.14, which adapts Claude Code 2.1.288's runtime context sent as a system message of text blocks (#658)
tedestar found it: anthropicBody adapted a role:"system" message only when its
content was a string, so Claude Code 2.1.288's context as an array of text
blocks reached Factory unadapted and came back 403 Forbidden (shown by Claude
Code as Please run /login). @magpie-community/opencode-factory-auth 0.1.14
(magpie-community/plugins 16ec1b8) adapts each text block as the string one,
keeping the blocks' other fields and non-text blocks; keepMovedCurrent moves
every moved user onto it. bun test in packages/factory passes (the new #658
test fails on 0.1.13). No live Factory account: tried with the captured shape
against a stubbed fetch only. go vet, builds (darwin, GOOS=linux,
GOOS=windows) and go test -tags nogui -count=1 ./internal/provider/ under a
temp HOME pass.
2026-10-03 16:34:07 +08:00
yetone 52ac04d8da gateway: a tool whose input_schema has anyOf/oneOf/allOf at its root reaches Anthropic-protocol vendors as an object, and moved Factory users get the plugin that keeps its constraints (#646, tedestar; magpie-community/plugins#12, SadWood)
Codex's codex_app automation_update takes an anyOf of objects at its root, and Claude models behind Factory answered every request offering it with 400 "input_schema does not support oneOf, allOf, or anyOf at the top level". Factory is a moved subscription, so the fix that reaches users is the plugin: factory 0.1.13 (SadWood's #12) nests such a schema under one "arguments" property, constraints intact, and unwraps the calls on the way back; migrate_factory.go's min is 0.1.13, so keepMovedCurrent updates moved users. The built-in Anthropic outbound (buildAnthropic) now does what Grok's objectRoot did: provider.ObjectRoot, shared, merges a root allOf's branches and the object branches of a root anyOf/oneOf (a field each requires stays required), following local $refs; a schema without a root combinator is sent byte for byte. TestAnthropicToolSchemaRoot fails on the old code. go vet, builds (darwin, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass but TestClaudeSignInOverStaleCredentials, a timing test that passes alone (3/3). Not tried against a real Factory account.
2026-10-03 15:02:58 +08:00
yetone 65c0c346fd provider: moved Factory takes plugin 0.1.12, which reaches Factory again from Claude Code with a global CLAUDE.md or a SessionStart hook, and from Claude Desktop (#634) — Factory refused the instructions reminder's "(user's private global instructions for all projects)", Claude 5's runtime context after a SessionStart hook's output (as a system message or folded into the user's turn), and the model line inside Claude Desktop's system prompt; plugins f28aac3 adapts the three, published. keepMovedCurrent updates moved users. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build and go test -tags nogui -count=1 ./... under a temp HOME pass. 2026-10-03 13:34:12 +08:00
yetone 3e024957a5 provider: moved Factory, Grok, Kiro, MiMo, Qoder and WorkBuddy take the plugin versions that renew their sign-ins ahead of time through auth.refresh (owner: 把社区插件都迁移到 auth.refresh) — factory 0.1.11, grok 0.1.6, kiro 0.1.6, mimo 0.1.6, qoder 0.2.3, workbuddy 0.1.7 (plugins c64f555..319eee2, published): each gives auth.refresh with a refreshLead above its own check before a request, under the same one-refresh-at-a-time as that check, so magpie renews an account once before its requests, models and usage ask, and a refresh token is never spent twice. Kiro and WorkBuddy throw every failure plainly, as their built-ins never marked an account; the others mark a refusal signIn "expired" as their request paths already did. keepMovedCurrent updates moved users to them. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build pass; go test -tags nogui -count=1 ./... under a temp HOME passes but TestProvidersAnswerWhileListsComeIn, TestUserPath and TestClaudeSignedOut, timing tests that failed under load 11 and pass alone. 2026-10-03 12:13:18 +08:00
yetone 4bc7d6c00d provider: moved Factory users get opencode-factory-auth 0.1.10 (magpie-community/plugins#10) — a tool result quoting Claude Code's fixed phrases is sent so Factory's check takes it, and Claude Code's # Environment update carrying a model is adapted as its model-switch updates are. The mover's min is raised from 0.1.9, so keepMovedCurrent updates every moved user's plugin. go build -tags nogui and go test ./internal/provider/... under a temp HOME pass. 2026-10-03 00:42:16 +08:00
yetone 5a4c427630 plugins: moving a subscription onto the Factory plugin installs factory 0.1.9 (Claude Code's standalone model-switch system updates in the form Factory takes, magpie-community/plugins#9) — on npm now. go test -tags nogui ./internal/provider ./internal/plugin under a temp HOME pass. 2026-10-02 23:33:14 +08:00
yetone e194f97731 plugins: moving a subscription onto its plugin installs the plugin's newest fixes — cursor 0.1.7 (a model Cursor runs only in Max Mode is asked again in Max Mode, glm-5.3 and glm-5.3-flash listed), qoder 0.2.2 and workbuddy 0.1.6 (each model's credit rate, which magpie shows by it since v0.1.667), zcode 0.1.7, factory 0.1.8 (Claude 5's system-role metadata in the form Factory takes) — all on npm now. go test -tags nogui ./internal/provider ./internal/plugin under a temp HOME pass. 2026-10-02 23:21:58 +08:00
yetone 475a55a702 migrate: built-ins move onto plugins that fail and mark the sign-in as they did — each mover now asks the plugin version that answers with its built-in's status and words and says through X-Magpie-Sign-In when the account's sign-in expired, stayed or renewed, in requests and usage reads alike: Command Code, Cursor, Devin, Kiro, MiMo, WorkBuddy and Zed 0.1.5, Factory and ZCode 0.1.4, Grok and Qoder 0.1.3, each published and installed from npm before this. go vet, go build -tags nogui (GOOS=linux), GOOS=windows go build, go test -tags nogui ./internal/provider ./internal/gateway ./internal/plugin pass. 2026-10-01 06:04:01 +08:00
yetone a170b909c9 plugins: a moved built-in's plugin comes up to date with magpie, as the built-in did — the fixes that bring each plugin in line with its built-in (plans, windows, lapsed sign-ins, refusals, bodies in bytes) are in @magpie-community's new releases, but a plugin was updated only by a click in Plugins, so an account moved before kept the old one. The magpie serving the gateway now updates, a little after it starts and every hour, the plugin of each built-in moved onto one to the version its move needs, and a move needs those versions: mimo 0.1.4, workbuddy 0.1.4, grok and qoder 0.1.2, the rest 0.1.3. One turned off, run from a folder or moved back is left alone. TestKeepMovedCurrent fails without the change. 2026-10-01 03:34:22 +08:00
yetone 566ae09db1 plugins: a moved provider's accounts keep what the built-in's had (你确保插件版的订阅 provider 和内置的一模一样了吗) — each account of a plugin provider has its own plan's models, not the first account's; a move carries each account's plan and a lapsed mark; a usage read that finds the sign-in gone marks the account and a clean one clears it, a network failure shows the last reading; a plugin that fails to load keeps its providers rather than taking them away; Kiro's API key is named and an OAuth account beside it stays off as in the built-in; Command Code Plan keeps its name. TestUnloadedPluginKeepsProviders, TestPluginUsageLapse, TestPluginAccountModels, TestMovedProviderName, TestKiroMover and the move test fail without the change. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./internal/provider ./internal/plugin ./internal/gateway pass. 2026-10-01 03:27:47 +08:00
yetone 94ba560257 plugins: a move installs the plugin as it now matches its built-in (插件版…保持一模一样) — each mover asks for the version published with the parity fixes (WorkBuddy 0.1.3; Command Code, Cursor, Devin, Factory, Kiro, MiMo, Zed, ZCode 0.1.2), updating an older one first, so a failed sign-in says why, a CLI's own account follows its key, refusals read as the built-in's. ZCode's own sign-in on its session alone (the Start Plan) no longer stops the move: zcode-auth 0.1.2 reads ZCode's credentials anew for each request, the session ZCode renews included, so the account goes marked as ZCode's and with no expiry of its own. TestCursorPluginContext and TestMoveDevin no longer lean on the machine: the first seeds its catalog (it failed wherever models.dev's cache wasn't there), the second waits for the fake CLI however loaded the machine. TestZCodeMover fails without the change. Each package installed from npm in an empty HOME comes at the version asked. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass but for TestUserPath and TestClaudeSignedOut, 5s timeouts under the whole run's load that pass alone. 2026-10-01 02:12:43 +08:00
yetone 3bec6c0e40 providers: a built-in subscription moves onto its community plugin and back, its accounts with it (the user: 慢慢下掉内置的那些 Subscription Provider…不要让用户一升级完之后,突然发现他的所有服务都不可用了) — eleven built-ins (Zed, Qoder, Factory, MiMo, Devin, Grok, Command Code Plan, Cursor, Kiro, WorkBuddy, ZCode) each get a mover to their @magpie-community package. A move installs the plugin (updated when older than the mover needs), hands it every account in the plugin's shape, checks the plugin lists models for them, and only then lets the plugin serve the same provider id, so agents' model ids don't change; any failure rolls back and the built-in keeps serving. The built-in's accounts are kept as a backup, and "Run built-in again" (magpie plugin move-back <id>) takes the plugin's current sign-ins back, never copying a rotating token: they are taken out of the plugin in one step, and an account the built-in renewed meanwhile keeps its newer token. An account only the plugin can hold (Cursor's browser sign-in) stays with it. The provider editor shows "Runs on" with the button, a failed move's reason, and the CLI has magpie plugin move / move-back. Automatic moves (Retiring) are wired in but the list stays empty until the packages are on npm. Checked with real accounts in a sandbox HOME: Command Code Plan and Devin moved, answered a chat through the gateway on the plugin, moved back and answered again on the built-in. TestMove*, TestPutBackKeepsNewer, the movers' round-trip tests and plugin-move.test.cjs (Chromium, WebKit, en/zh) are new. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass; click-scroll, old-webkit pass. 2026-09-30 21:21:58 +08:00