e4e9eb0928becfa4e48484dde85ef5032671d582
2191
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
992f88d634 |
usage: a stand-in reading says why the read behind it failed
@tmr11235 on X (tweet 2123334817991520577, magpie v0.1.4520): agy-cli's card showed "截至 2026/11/15 14:19:19,暂时无法获取最新额度" days later, with nothing to say why. keepLast stands the last good reading in for a read that fails with a passing error (timeout, 429, 5xx, network) and dropped that error, so a stand-in that lasted four days read the same as one a minute old. The reading now carries the error as readError (SubscriptionQuota, and Quota for `magpie quota --json` and the gateway report), and asOfText puts it after the date: "… 暂时无法获取最新额度 · agy usage query timed out." A deferred read (not asked) has none, and the short "As of" line on cards stays short. Every provider's stand-in gets it, not only agy-cli's. Run (mote, at origin/main |
||
|
|
c01988e439 |
routing: a group's Small context first sends a request to the smallest window that holds it
yg6888 on X (tweet 2123308968848379920): in a group routed Smart, Cursor Plus's Composer and Grok 4.7 were never used. Not a bug: Smart orders by allowance tier, then soonest renewal, then listed order, and never weighs the context window, so the 1M members listed ahead always answered. The small ones were only ever reached as a fallback. Smart itself is unchanged; changing its order would move every Smart user's traffic. A group gets a new routing instead, `fit` (Small context first; 小上下文优先, 小上下文優先, 小さいコンテキスト優先, Kleiner Kontext zuerst): - routes.SmallFirst takes Smart's order and sorts it stably by band (a provider set to be used first, the rest with room, the all but used up) and then by window, the smaller known first, an unknown one last. - Its strategy sets ByWindow, so weighRouted fills Seat.Window from windowIn (the provider's own Contexts, else the catalog's). - roomy already leaves out every member the request is estimated past, so the first left is the smallest that holds it: a small model is never asked for a request too long for it, and keeps its last-resort place as under every routing. - The trace's rows carry `context`; the Routing page says "its 200K context window is the smallest that holds this request". - A group's only: provider.normalize already drops it from a provider and the CLI refuses it there. GUI menu, hint, why-lines, TUI and CLI (`routing=fit`, small-first) carry it; docs/reference.md, the gateway-routing and plugin-runtime pages and the en/zh/ja start pages say it, with the search index rebuilt (via docs-index.mjs; #7065). Run first at the tree rebased on origin/main |
||
|
|
8564238065 |
remote magpie: a model is asked on the API the remote asks it on best (OoopsHh on X)
With another magpie as the provider, Pi's models.json had only codex/* on openai-responses; an OpenAI key's openai/* and a routing group's auto/* went on openai-completions, and effort max was turned away there while Responses takes it. Cause: the remote's /v1/models gives native_endpoints, every API the model goes on as it is, in its provider's speaking order (Chat first), and nothing for a routing group. Here Provider.Native took the first one the remote magpie provider speaks: Chat, for every model but a ChatGPT sign-in's (listed on /v1/responses alone). The remote's own choice (Native: ResponsesFirst or the Base URL's API; a group's GroupAPI) was lost on the wire. Now the remote's list (X-Magpie-Drawers) says magpie_prefers, the path it asks the model on best (provider.PreferredEndpoint). The local magpie keeps it as catalog.Model.Prefers and Native takes it first for a remote magpie (RemotePrefers), so every agent wired one API per model (Pi, omp, droid, dsh, grok, hermes, liveagent through catalog.Model.APIs) asks it there, and the gateway's usable translates another API's request to it once instead of to Chat. A user's own API set on the model still wins; a remote from before says nothing and stays as it was. Not changed: a Chat request a client sends itself for such a model is still relayed as Chat to the remote, which decides as it does for its own clients. Run (mote, at this tree): - TestRemoteMagpiePrefersResponses (gateway: two magpies on one gateway, a fake vendor that turns away reasoning_effort max on Chat) and TestPiAsksARemoteMagpiesModelWhereItPrefers (agent): green; both red with the RemotePrefers check in Native and usable turned off (openai/* and group/auto on chat, Pi's api nil, a Messages request relayed as Chat). - Two real magpie serve processes in sandbox HOMEs, a fake vendor, an OpenAI key there with its Base URL given as Responses, a group auto and the first magpie as the second's Remote magpie: Pi's models.json has office/openai/gpt-6.2-astra and office/group/auto on openai-responses with max, and /v1/responses effort max reaches the vendor's /v1/responses for both. The same script at the base commit wrote both with no api (the provider's openai-completions). - At base |
||
|
|
504db2206e |
kiro: the docs say what the Routing page shows, and the min names the ACTIVE, outlasting trial
The ported change said the Routing page shows "on credits · after the others"; nothing in the GUI renders Weighed.CreditsLast, so the docs now say the mark is read by affinity only. The plugin (0.1.41, review follow-up on plugins#1352) says credits only while an ACTIVE bonus has credits left that outlast the month's reset; the docs and the mover's note say so. |
||
|
|
5a83f0ae6c |
gateway: a plugin's account on its trial credits is asked after the accounts with plan credits left
A plugin window may say credits: used up, the account goes on past it on credits its vendor spends after the window's. Kiro spends a month's plan credits before a trial's, and the plan's are lost at the month's reset while a trial's last a year, so such an account goes after the provider's accounts with room and before those used up, under every routing but Pick account by hand.
Ported from StringKe's branch (StringKe/magpie kiro-trial-last, 23e084262;
yetone/magpie#7179, with plugins#1352, kiro 0.1.41). Kiro's billing docs
say "Kiro uses your plan credits first, then your trial credits" and that
trial credits last 12 months. Opt-in per plugin window (credits), so a key
or a Codex account routes as before: creditsLast and CodexCreditsFirst
stay Codex-only, behindOthers moves only plugin: accounts, and no other
plugin package sends credits. The Kiro mover's min goes to 0.1.41, on npm
(gitHead 0ae116db1).
Run at this stack's head on mote: go test -timeout 45m ./... with go vet
./...: every package ok but internal/gateway, red on
TestOpenCodeGoOwnFreeModelGetsNothingOfOpenCodes (red 3 of 3 alone on
origin/main
|
||
|
|
239da9991d |
provider: Factory's mover takes opencode-factory-auth 0.1.50
dsh (DeepSeek Harness) on Factory got "This request was blocked by
Factory's usage policy check" (content_policy_rejected) on its first turn
(a1pha1nthefog on X). It wasn't its prompt or skills. Since 2026-11-18
Factory refuses a request that declares a tool under certain exact names,
and dsh declares bash, read, write, edit, glob and grep. 0.1.50 declares
such tools under droid's own names (Execute, Read, Create, Edit, Glob, Grep,
Task), or suffixed, and gives the agent its own names back in every reply
(magpie-community/plugins bb849910, porting heggria's #1314).
keepMovedCurrent updates every moved user to it.
npm view --registry=https://registry.npmjs.org --prefer-online
@magpie-community/opencode-factory-auth version gives 0.1.50
(published 2026-11-19T09:02:51Z); its tarball has tool-names.mjs.
Run (mote, at origin/main
|
||
|
|
9bf5848c1f |
gateway: a Kubernetes rolling update runs two pods on one volume safely
@justforlxz on X asked for a RollingUpdate (maxSurge 1, maxUnavailable 0) with no request dropped. The docs said strategy: Recreate, because the work only the serving magpie may do (renewing sign-ins, check-ins, moves, plugin updates, WhileServing) was kept to one magpie only by the gateway's port: a second couldn't bind it. Two pods each bind their own network namespace, so in an overlap both did it, and two renewals of one refresh token can spend it (a single-use token rotates). Design: both pods answer requests at once (each refresh and file write is already locked across processes: filelock, host.js lockRenew); the serving work is held to whichever gateway holds gateway.serving.lock (flock on the config folder, serving.go). The new pod retries every second and takes the work over as the old pod's gateway ends (its drain lets go first). A file system without locks is read as no other magpie, as before. Pods share the volume but not a pid namespace (both run magpie as pid 1), so the locks that judged a holder by its pid now judge it by host: - host.js lockRenew records host (hostname + pid namespace); a lock of another host is stale by age only, never by "pid 1 is alive here". - lockMoves (migrate.go) the same. - gateway.json records Host; forgetListening removes only its own, so the old pod's end no longer removes the new pod's file (same pid, same Started second was enough before). - temp and run-mark names get a random part (writeDurable, Claude run marks, gateway.json's temp file). While draining (SIGTERM), every reply says Connection: close, on the gateway and on magpie web's page port, so an agent that kept its connection to the old pod alive dials the Service again for its next request. Without it, the real rollout below had one broken pipe per kept-alive connection, ~5.8s after each SIGTERM, when the drain's end closed them. Docs (en/zh/ja docker, reference.md): RollingUpdate maxSurge 1 / maxUnavailable 0, the readiness probe, a required podAffinity on kubernetes.io/hostname (a ReadWriteOnce volume mounts on one node), and one Recreate update from a version before this one, whose old pod doesn't take the lock. Run: - Real overlap, podman 4.9.3 in WSL magpie-desktop: three pods (pa -> pb -> pc) on one volume, each its own container (pid 1, own hostname and network), a Service proxy over a readiness-probed endpoint list (1s probe, endpoint removed 1s after SIGTERM as kube-proxy does), 12 agents streaming 3s SSE turns through it, half keeping connections alive, no retries. Before Connection: close: 226 ok, 10 failed (broken pipe, kept-alive). After: 209 ok, 0 failed; second run 207 ok, 0 failed. Each new pod logged "another magpie serves", then "let go" as the old pod's gateway ended; gateway.json named the last pod. - Broken by hand, each red then green: TestServingWorkWaitsForTheOther- Magpie, TestServingWaitEndsWithItsGateway, TestForgetListeningKeeps- AnotherPods, TestMoveLockOfAnotherPod, TestRenewLockOfAnotherPodIs- WaitedFor, TestDrainingRepliesCloseTheirConnection, TestPagePortClosesWhileDraining. - Full suite, go test -count=1 -timeout 45m ./..., at 85305a82d (this change on |
||
|
|
6e58821092 |
provider: WorkBuddy's mover min is 0.2.37, kimi-k3.1-pro's call-only turn
opencode-workbuddy-auth 0.2.37 sends kimi-k3.1-pro (and -highspeed) an assistant turn with tool_calls and no text with one space as its content. The model answered such a turn 400 "Invalid request parameters", so dsh, which records a call-only turn as "content": null, failed on it from the first tool call on (Gloria335056 on X; the same model on QwenWork, plugins #1213). keepMovedCurrent brings every moved user's plugin up. npm view --prefer-online: 0.2.37 is latest. |
||
|
|
681f2ee7f0 |
templates: a cheaper small model beside a near flagship is the cheap one (@qinzhidaoa on X)
The reporter's DeepSeek provider has deepseek-v4.1-flash and deepseek-v4-pro, and the Routing groups page greyed out "Hard to strong, easy to cheap" and "Cheap first" with "Needs a model cheap beside DeepSeek-V4-Pro". Both prices are known (models.dev's DeepSeek, as the bundled catalog has it: V4 Pro $1.98 out, V4.1 Flash $0.60 through its canonical id), so it was not a missing price. cheapest() took a model as cheap only at a quarter of the strongest's price or less, and Flash is 3.3 times less. Sonnet beside Haiku (3x) and Gemini Pro beside Flash (~3.4x) failed the same way. Now a model is cheap at a quarter of the price, or when it costs less and its id says small (flash, mini, haiku...) where the strongest's doesn't. A model that costs as much, or one cheaper with no small id at under a quarter, is still not taken. With no price on either side, the size words already decided, unchanged. Prices for the new ids do reach the templates: deepseek-v4.1-flash is priced 0.60 at its maker (maker=true) through models.dev's deepseek-flash canonical, logged by the new test. Run (mote): - TestTemplatesCheapBesideACloseFlagship reproduces with the reporter's ids (deepseek-v4.1-flash, deepseek-v4-pro on the DeepSeek preset) and models.dev's DeepSeek entries from the bundled catalog, written as the test's catalog (testdata/models-dev-deepseek-2026-11-10.json). On the old cheapest() it is red: smart and thrifty need "cheap" of "DeepSeek V4 Pro", members [], and Haiku beside Sonnet, Gemini Flash beside Pro, red the same. Green with the change; the other template tests pass. - gofmt -l: nothing. go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./..., go build, GOOS=linux go build -tags nogui, GOOS=windows go build: ok. - go test -tags nogui -timeout 45m ./... at 56b3f0780 (this change on |
||
|
|
344253c4e2 |
provider: Codex's Ultra on every GPT Sol, Astra and Terra by family, GPT-6.2 Sol and Astra too
forkhouhou on X: on a relay, gpt-6.2-sol and gpt-6.2-astra stopped at max in Codex while gpt-6-astra and gpt-6.1-terra had ultra. OffersUltra read a hand list (ultraModels), so each new model lacked Ultra until someone added it (#4909 did 6.1 Terra); 6.2 was never added. openai/codex's models-manager/models.json (6c0cee502, "Add GPT-6.2 Sol and Astra to model catalogs (#62106)") lists ultra on every Sol, Astra and Terra from GPT-5.6 to 6.2, and on no Luna, GPT-5.5 or older. So the rule is now the family: catalog.FamilyOf names gpt-sol, gpt-astra or gpt-terra with a version. It is asked of every spelling the catalog matches through a new catalog.IsOneLike (found/lookupIn moved onto a getter, their map forms unchanged), so a provider prefix, :official, [A], a dated suffix and gpt-6-1-sol keep working, and -fast, -pro and Luna stay out. Ultra still goes upstream as the entry's multi_agent_reasoning_effort or max (fitEffort), and turns Codex's V2 subagents proactive. It changes no sandbox or approval. Run: - Red on the old code (mote): OffersUltra false for gpt-6.2-sol, gpt-6.2-astra, relay/gpt-6.2-astra, gpt-6.2-sol-2026-11-17 and gpt-6.3-terra; copilot/gpt-6.2-astra's entry stopped at max with v2=false. Green after. - Sandbox HOME e2e (mote, -tags nogui, fake relay, never live configs): old code: relay/gpt-6.2-sol and -astra low..max, no v2, in /v1/models, /v1/codex/models, `magpie models` and ~/.codex/magpie-models.json. New: low..max,ultra with multi_agent_version v2 in all four; gpt-6.1-sol unchanged (ultra), gpt-6-luna unchanged (none). config.toml's enabled-reasoning-efforts has ultra. A POST with effort ultra reached the relay as reasoning_effort max. - GUI: `magpie web` on that sandbox HOME, read with Playwright Chromium: /api/state's Codex effort and subagent effort fields on relay/gpt-6.2-sol offer low..max,ultra. No GUI code changed. - Full suite, `go test -tags nogui -timeout 45m ./...` on mote at ad3a8b1d3 (this change on |
||
|
|
2926b7beff |
usage, routing: the model id a request went out under is kept and shown
daoche_wuzui on X asked how magpie serves Antigravity and whether a
request goes out under a suffixed model: nothing showed the id actually
sent. Antigravity's plugin turns gemini-3.7-flash at high effort into
gemini-3.7-flash-high, and a relay's upstream name (ModelWires) renames
a model too; the ledger and Routing showed only the routed model.
- A plugin's reply may carry X-Magpie-Sent-Model
(provider.SentModelHeader). forward() reads it from plugin providers
only (a non-plugin's header is ignored) and deletes it, so it never
reaches the agent. Without it, provider.SentNameOnIn (the upstream
name, or Antigravity's variant) is used.
- wireName keeps the id only when it differs from the model. It goes in
usage.Record.Wire (`wire`, omitempty), the trace's Try.Wire, the
ledger cache and a last CSV column, sent_model (docs/reference.md).
- Usage › Requests: the Sent cell and the detail show the sent id when
there is one, with "model → sent id" on hover. Routing: a try sent
under another id gets one aside line, "Sent to the vendor as {model}"
(zh, zh-TW, ja, de).
- Antigravity's mover min is 0.2.4: plugins 67fb1258 sets the header on
every reply (stream, whole and errors); its tgz is on the plugins
repo's dist branch.
Run at this head (
|
||
|
|
ddc78405cf |
gateway: a magpie's /v1/models offers Ultrafast where its accounts do
OoopsHh on X: a magpie in Docker could pick Ultrafast on a model, but another magpie that has it as its Remote magpie provider was offered Fast alone on that model. The remote's list takes its service tiers from provider.CodexTiers through codexcat.Entries, and CodexTiers only ever added "priority". Ultrafast came only from Codex's own catalog, which a magpie with no Codex beside it (Docker) does not have, and the codexcat branches for Fast and OwnTier models dropped any tier m.Tiers added. - CodexTiersWith adds "ultrafast" after Fast where provider.UltraOn says the key or account offers it (an OpenAI key's Ultrafast models, a provider added by its address on OpenAI's Ultrafast models, a Codex account whose live list has it), and on a group where a member does. UltraModels is read at most once a list, and only after a model already shows Fast. - codexcat keeps those tiers (withTiers) and names "ultrafast" "Ultrafast" when Codex's own catalog doesn't. - The asking side already sends ultrafast to a Remote magpie (RemoteTiers), and the remote already asks a member without it for priority (tierMate). Both ends need this version: the remote to list it, the local one to read it. A provider added by its address serving gpt-6.1-sol now lists Ultrafast in /v1/models, /v1/codex/models and magpie-models.json, as its editor's CanUltra already said; TestModelsListTiersForEveryClient, TestRemoteMagpieOffersItsTiers and TestCodexCatalogTiersReachDisk expect it. Tests: - TestRemoteMagpieOffersUltrafast: a relay's gpt-6.2-sol and a group of it list "priority ultrafast"; a Remote magpie provider reading that list has CanUltra on both, and an ultrafast ask through it reaches the vendor as ultrafast. Red on |
||
|
|
ee079814ba |
provider: Factory's mover takes opencode-factory-auth 0.1.49
0.1.48's per-conversation session didn't stop Factory's 400 "Invalid model ID in request body" on gemini-4-hydrogen (marovole on X): it still came on requests of 0.6 to 1.6 MB, every retry alike, while smaller ones went through. magpie's gateway sends a Gemini body with its keys sorted, so the plugin sent the model after the contents, a long session's megabytes. droid 1.14.0 always sends it first. 0.1.49 sends the fields in droid's order, model first (magpie-community/plugins ec1c675f). keepMovedCurrent updates every moved user to it. npm view --registry=https://registry.npmjs.org --prefer-online @magpie-community/opencode-factory-auth version gives 0.1.49 (published 2026-11-19T04:18:41Z). Run (the Linux box, magpie-desktop, through wsl-run, since mote and mica each had a full suite running): gofmt -l internal/provider is clean; go vet ./internal/provider; go test -timeout 45m ./internal/provider is ok (179s at origin/main |
||
|
|
567ba3a277 |
codex: a function tool goes with a strict the backend can compile (Anotiaww on X)
Anotiaww on X: LobeHub's OpenAI provider, pointed at magpie, asked a
Codex model on Responses and got "Codex: Invalid schema for
'tools[3].parameters': oneOf constraints are not supported. Enable
'coerce_one_of' option to approximate oneOf with anyOf".
Cause: LobeHub sends its tools on Responses with no strict
(convertChatCompletionToolToResponseTool spreads the function, no
strict), and magpie passed them to the ChatGPT backend so. Left out,
the backend compiles a tool's parameters as a strict grammar; its
calculator's defintegrate bounds and limit's point are a oneOf of
string and number. Codex CLI itself says "strict": false on every
function tool (codex-rs/tools ResponsesApiTool). A Chat or Messages
client asking strict true with a schema strict mode refuses (calculate's
optional precision, an allOf, a lookaround) was turned away the same way.
Fix, in codexBody, so every route to a Codex account (Responses relayed,
Chat and Messages built as Responses) passes it: a function tool's
strict left out goes false, as Codex says it; strict true is kept when
the schema fits strict mode, with a oneOf asked as anyOf (the backend's
own suggestion); a schema strict mode still can't take goes as written
with strict false. Namespace tools, additional_tools and
tool_search_output are covered. coerce_one_of is not used: it is nowhere
in Codex's source or any docs found. Other vendors are unchanged.
What strict mode takes was tried on the backend (2026-11-19, the
owner's ChatGPT account, gpt-5.6-luna and gpt-6-sol among others):
refused with strict true: oneOf, allOf, not, if, uniqueItems,
minProperties, contains, propertyNames, dependentRequired, an optional
property, additionalProperties not false, a root anyOf, a lookaround, a
node with only a const ("schema must specify a type"); taken: anyOf
(nested, in items, in $defs), $ref, enum alone, a type list, const with
a type, min/max keywords, format, pattern, $schema, title, examples.
Left out, a lookaround is refused and false takes it.
Run:
- go test ./internal/provider -run TestCodexToolStrict,
./internal/gateway -run 'TestCodexToolSchemasTheBackendCompiles|
TestToolStrictOnlyForCodex': ok on mica.
- go vet ./internal/provider ./internal/gateway for darwin, linux and
windows: ok on mica. gofmt -l: clean.
- Real backend: LobeHub's 10 calculator tools as this change sends them
(strict false on Responses; strict true from a Chat client, defintegrate
kept strict as anyOf; calculate, evaluate, sort, limit and solve,
which have optional properties, false)
and a mixed set (oneOf nested in items and $defs, a const-only oneOf,
an allOf, a lookaround): 200 on gpt-5.6-luna and gpt-6-sol. The old
strict-true request was refused ("required must include declared
property precision"). That run found the const-only case, fixed here.
Broken by hand: with the codexToolStrict call removed, the gateway
test is red with the reporter's message word for word (tools[5],
defintegrate). TestToolStrictOnlyForCodex passes on the old code too;
it guards scope (OpenAI's API, a relay and a Chat provider keep strict
left out and the oneOf).
Not tried: the reporter's exact 400 could not be reproduced on this
account, where a oneOf with strict left out was taken on every model
tried; the lookaround case shows the same rule. LobeHub itself was not
run. The full suite runs after the tag (mote load 28 on 18 cores, mica
in another session's suite); its result goes in a follow-up.
|
||
|
|
598bc45346 |
update: a container's hint names the found version's own image, not :latest (fishmagic80 on X)
In Docker, Settings › About on the Daily channel said "0.1.4479 is out … docker pull ghcr.io/yetone/magpie:latest". :latest is the newest release (docker.yml), daily and stable the Daily and Stable channels' (docker-daily.yml, docker-stable.yml), so :latest held 0.1.4504, not the 0.1.4479 announced; on Stable it is weeks apart. docker.yml writes every release's own tag (ghcr.io/yetone/magpie:0.1.4479; checked on ghcr: 4479, 4395, latest, daily, stable, 0.1 all resolve, daily = 4479's digest). update.Image(version) is that tag, and every place that printed the command names it now, with "recreate the container from it" (a compose file on :latest would otherwise run the old tag again): - the GUI's Version row and Update pill (/api/update's new `image`, stuck "container"; app.js updateStuck); - `magpie update` in a container (internal/cli); - a Remote magpie row's tip for a container: UpdateRemotes now keeps the version it asked for on an "unsupported" answer too, so the tip names that version's image; - i18n zh, zh-TW, ja, de for both strings; - docs/docker (en, zh, ja): Updates says Settings › About names the version's own image and that latest may be ahead of the channel; llms-full and search indexes rebuilt (site/docs-index.mjs). Run at this tree (mica, through mica-run): - red on origin/main |
||
|
|
2ab2f69132 |
agent: Codex's status line shows the account's quota or the relay's balance (opt-in)
lyj1115 on X asked for the current account's quota, or the relay key's
balance, under Codex's chat box, off by default. Codex's TUI draws its
footer from a status line provider from 0.171.0-alpha.12 on: a stdio
MCP server whose tool advertises a statusline entrypoint, picked in
[tui] status_line_provider behind [features] tui_extensions_statusline.
Codex reads it about once a second with the thread's id. Nothing is put
into the prompt or the model's reply.
- `magpie statusline --codex` is that server. Each read asks the local
gateway for the thread's latest route and the kept quotas (no vendor
read). It answers `→ provider/model` and that provider's account that
answered last, with its windows or a key's balance. A gateway that is
down gives a null tree, never an error, because an error stops Codex's
reads. The tool's name and words name neither magpie nor a vendor,
since the tool is listed to the model.
- A status line square on Codex's row (`magpie codex statusline on`)
writes the flag, [mcp_servers.quota_line] (this magpie by full path,
args statusline --codex, env_vars = ["MAGPIE_ADDR"]) and the
provider. Every write is read back, and the file is restored on a
mismatch. Off and Disconnect take out only magpie's keys, and the flag
only when the stash says magpie wrote it.
- Nothing of the user's is written over. A provider of their own, a
quota_line of theirs, the flag turned off or an unreadable file keeps
the square away and refuses on.
- The switch is offered only when a Codex CLI here is 0.171.0-alpha.12
or newer (0.170.0 reads the keys and draws nothing), and only on this
computer, not in a WSL distro.
- In the GUI, the status line square's title takes the note of its
field's on option, which Claude Code's field already sent with the
same words TOGGLES kept, so Codex's says its own words in en, zh,
zh-TW, ja and de. TOGGLES' copy of Claude's note went, and app.js
stays under its budget (30 bytes of room) without a raise.
The Codex desktop app has no such footer. cockpit-tools reaches it
through a debug port, and magpie doesn't.
Run (WSL magpie-desktop, since mote's load was over 18):
- go vet -tags nogui ./...; GOOS=windows go vet of agent, cli, provider
and gui; gofmt -l clean.
- go test -tags nogui of ./internal/cli and ./internal/provider: ok.
- ./internal/agent -run "CodexStatus|Statusline|StatusLine|TestCodex|
TestWSLCodex": ok.
- ./internal/gui -run "CoreScript|Budget|I18n|Keys" and node --test of
codex-statusline, claude-statusline and i18n-keys (both engines, every
language, window and panel), with vet (and GOOS=linux and windows
vet) of agent, cli, provider and gui, on mote at the rebased head
(on
|
||
|
|
1e2287758c |
copilot: a Responses turn goes as its delta over Copilot's WebSocket
yuushabu_buyinn on X asked whether Copilot's Responses route can send
the delta too: their Usage page has Copilot at 70.4K requests, up 129 GB
for 31 GB down, since each turn went whole over HTTP. Copilot's HTTP
/responses answers previous_response_id with 400, but its Responses
WebSocket at <api>/responses takes previous_response_id (store false)
on the same connection, as Copilot Chat sends it for a model whose
supported_endpoints list "ws:/responses".
- provider: the model list remembers which models list ws:/responses
(copilotSee); SocketTurn gives a Copilot turn its socket at the API's
/responses with Copilot's own headers (CopilotSocketTurn).
- gateway: overSocket takes such a Copilot turn; the message is
{type:"response.create", initiator, ...body} without stream; the
handshake has no OpenAI-Beta or X-Initiator; the keep key adds the
Copilot session token. A status-less error frame and a refused
handshake have the turn over HTTP, as before.
- keep: Copilot's reasoning ids are Base64 (+ and /), and plainItemIDs
leaves such reasoning out of the next turn, so the real account's
second turn never matched what it kept and went whole. A Copilot turn
without its kept reasoning still carries on: Copilot keeps that
reasoning with the response.
Tests (fake Copilot, no network): TestCopilotSocketSendsTheDelta,
OnlyForItsModels, RefusedGoesOverHTTP, ErrorFrameGoesOverHTTP,
DeltaWithoutItsReasoning. Each of the first four is red on origin/main;
DeltaWithoutItsReasoning is red with the sealed skip turned off (whole
input, no previous_response_id).
Real account (owner's Copilot, sandbox HOME, wsl-run magpie-desktop):
gpt-5.3-codex over the socket, turn 2 on the kept socket with
previous_response_id and only its new input, answer right ("apple
banana"). gpt-5.5 and gpt-5.4 answer 400 "not available for integrator
vscode-chat" on that account, so weren't tried.
Run at this tree (wsl-run, magpie-desktop): gofmt -l internal/ clean; go vet
of gateway and provider for GOOS linux, windows and darwin; go test
-run "Socket|Copilot" ./internal/gateway ./internal/provider ok. The full
`go test -count=1 -timeout 45m ./...` is queued on mote behind another
session's suite and was not finished at push.
|
||
|
|
cb96fcc3a0 |
claude: a gated model goes to the account whose Claude Code offers it (ZacharyZhang on X)
With several Claude accounts and only one with Claude Mythos 5.2, the model was asked of the first account, which answered Anthropic's 404 "There's an issue with the selected model (claude-mythos-5-2). It may not exist or you may not have access to it." That 404 wasn't read as the model's, so the account rested for every model, with a backoff that grew, and was asked Mythos again each time the rest ended. - claudeLists: Claude Code names only the gated models an account has (additionalModelOptionsCache), never the ones it lacks. A model models.dev doesn't list that another account's Claude Code offers is now out of an account whose own file doesn't offer it. AccountsFor then tries it only after the accounts that have it. A model no account offers, nor models.dev lists, is still taken to be in, so an account is never left out when nothing is known. - ModelUnserved: Claude Code's "may not exist or you may not have access" and the API's not_found_error "model: …" rest only that model on that account (restID). Its other models stay on it. Run on mote at |
||
|
|
3438b7bd9c |
codex: a kept ChatGPT account that runs out is taken over on magpie's models, so the Codex app sends them (Yuzhou__Zhang on X)
Yuzhou__Zhang on X, after updating from Stable (v0.1.3960) to v0.1.4477: once the ChatGPT account ran out, the Codex app (ChatGPT app) sent nothing, on "Claude Opus 5.5 · routing group" too, whose Claude accounts had room. The screenshot shows the app's own banner, "Codex 和工作使用额度 已用完 … 11月20日 16:25 重置", and Send greyed: no request reached magpie. Cause. The Codex app greys Send for every model while its authMethod is chatgpt and the account's rate limit says not allowed. magpie gets past that by becoming Codex's provider while the account is held (codex.out, #540). |
||
|
|
35e5989f17 |
provider: OpenCode Go's own free models are asked as the client asked them, without OpenCode's environment block (withtee on X)
withtee (X, 2123032184043024704) saw models on OpenCode Go answer with
"Prefer /tmp/opencode over generic system temporary directories such as
/tmp". That line is magpie's: OpenCodeFree counted Go's own -free models
(beam-free, cat-jam-free, which models.dev's opencode-go lists) as Zen's
free tier, so the Zen mimicry went with them: OpenCode's <env> block and
the core-tool stubs were added to every request from Claude Code and other
clients, and the model said the block back. Paid Go models never got it.
OpenCodeFree now leaves out a model opencode-go lists when the provider is
at Go's gateway (openCodeGoLists). It is asked as the client asked it and
is not asked again at Zen when Go refuses it. A Zen free model Go doesn't
list (glm-5-free) keeps the block when RetryOpenCodeFreeOnZen asks it at
Zen, which answers 429 without it. The opencode-zen preset is unchanged.
Tests: TestOpenCodeGoOwnFreeModelsAreNotZens (provider) and
TestOpenCodeGoOwnFreeModelGetsNothingOfOpenCodes (gateway, checks the
request body has no /tmp, <env> or stub; Zen's retry of glm-5-free still
carries both). TestOpenCodeGoUnavailableSaysWhere moved to glm-5-free,
since Go now lists cat-jam-free itself.
Run (all on magpie-desktop, WSL2 on xiaomi-gpu, via wsl-run; mote over
its load limit, mica's disk full):
- gofmt -l: clean.
- go vet -tags nogui ./... (Linux): ok. GOOS=windows go vet ./...: ok.
- go test -tags nogui -count=1 -run 'OpenCode|Zen' ./internal/provider
./internal/gateway: ok, before the rebase and again at 32c5d297a on
origin/main
|
||
|
|
70ad7cf30f |
provider: an OpenAI key's GPT-6 Astra and Sol can go Ultrafast, on its Responses (OoopsHh on X)
OoopsHh on X: in Docker, an OpenAI API provider's GPT-6 Astra offered Standard and Fast only, in the model's speed, in routing groups and in the Agents settings. Every Ultrafast offer came from a Codex account's or Codex CLI's list, which a Docker magpie with an API key has none of, and buildResponses sent "ultrafast" to chatgpt.com alone. OpenAI's Ultrafast mode guide (developers.openai.com/api/docs/guides/ultrafast-mode) names GPT-6.2 Astra, GPT-6.2 Sol, GPT-6 Astra and GPT-6.1 Sol, with service_tier "ultrafast" on the Responses API. provider.OpenAIUltra holds those four (a dated snapshot too). UltraOn offers Ultrafast for them on an OpenAI key's Responses, and on a provider added by its address (OwnFast) with no Codex cache; the GUI's three speed controls read UltraOn (providers.go canUltra, groups.go ultraOK, agent route UltraOK), so no GUI asset changed. buildResponses sends the tier to api.openai.com for those models only (any other goes priority, as before). OpenAI's Chat Completions turns the tier away on every model, so a Chat request to api.openai.com that would carry it, a client's own ask too, goes priority (chatNoUltra, in the tierMate check). Another vendor's model is untouched. The Codex subscription half (Docker asked the ChatGPT list as 0.159.0, below the 0.166.0 that lists GPT-6.2 and Ultrafast) was fixed meanwhile on main by |
||
|
|
e08dc0fe58 |
provider: OpenAI's own API sends Responses turns over the WebSocket by default, only the new input each turn (KawaiiZapic on X)
KawaiiZapic's screenshot showed 6.4 GB up for 799 MB down: every turn went out whole. What each leg sends, checked in the code: - Codex on a ChatGPT subscription: the kept upstream socket already sends previous_response_id and only the new input (codex_socket*.go). - A Responses provider with socket=auto/on: the same, but socket was off unless someone ticked it, so an OpenAI API key provider sent the whole conversation each turn over HTTP. - A client's own previous_response_id is kept for api.openai.com, Azure and Ark (prevKeeps); other relays get the expanded whole turn, since they can't be trusted to hold the chain. - Claude Messages, Chat Completions and Gemini have no incremental protocol; those always send whole (prompt caching is what saves there). - The ↑ counter (upbytes.go) counts each upstream write once; no double count found. Change: a Responses provider at https://api.openai.com with no socket set now goes over the WebSocket (provider.SocketByDefault, mirroring codex-rs's create_openai_provider supports_websockets: true). socket=off is now stored, so unticking it there sticks; elsewhere unticked is still "". The CLI shows "auto (default)" and takes socket=off|default. The editor's WebSocket row moved into socketrow.js (imported as the editor draws), so app.js and the core shrink by 165 bytes and their budgets drop with them. Caveat: an OpenAI provider saved unticked before this (socket "") now goes over the socket until it is unticked again; the docs say so. Measured (fake api.openai.com over TLS, sandbox HOME, 20 turns of a 4KB user message each): socket off 20 HTTP posts, 876,345 bytes up; default 0 posts, 20 socket turns on one handshake, 84,928 bytes up (Traffic().Up equal to the socket bytes, so no double count). Run (mica). At this head, rebased on origin/main |
||
|
|
389169f761 |
gateway: a Qwen Token Plan's TTS, ASR and video models are served on OpenAI's routes
gaubeebangeel on X (tweet 2122991088017477954) asked for every kind of model Alibaba's Token Plan sells, each on its own DashScope endpoint. Before this, magpie served the plan's text (Anthropic and chat completions), its realtime voice (/v1/realtime, realtime.go) and its Qwen-Image drawing (draw_dashscope.go). The plan's text list lacked deepseek-v4.1-flash-1017, and nothing served its TTS, ASR or video models. - presets: alibabaPlanModels as the four plans' overviews list them on 11-18 (qwen4-max, qwen4-max-preview, deepseek-v4.1-flash-1017 added). PresetDef gains Drawers, Videos, Speakers and Transcribers, Region gains Speakers and Transcribers, and the four Token Plans (qwen-token-plan, bailian-token-plan, alibaba-token-plan, qwencloud-token-plan) name qwen-image-3.0-pro and wan2.7-image(-pro), wan3.0-video and happyhorse-1.1-t2v/-i2v/-r2v, qwen-audio-3.0-tts-plus and qwen-audio-3.0-asr-flash. PlanSpeakers and PlanTranscribers feed PlanRetrieval, so the router knows which provider speaks and transcribes. - /v1/audio/speech (speech_dashscope.go): a plan key's qwen-audio TTS model is asked on <root>/api/v1/services/audio/tts/SpeechSynthesizer, every field under input as the docs have them. An OpenAI voice name becomes the model's own first voice (longanlingxin for -plus, longanhuan_v3.6 for -flash), speed goes as rate (0.5 to 2), and instructions as instruction. mp3, wav, pcm and opus are served; aac, flac and stream_format sse are 400s before DashScope is asked. The answer's output.audio.url is fetched (or data decoded) and served with the format's type. - /v1/audio/transcriptions: a plan key's qwen-audio ASR model goes to multimodal-generation with the file as an input_audio data URI, its format from the file's name or type, and language as language_hints. The answer is given back as OpenAI's json, text or verbose_json; srt, vtt and translations are 400s. The form's file is read only on this path (audioForm.file), so a form passed on as sent is never copied. - /v1/videos (video_dashscope.go): Wan 3.0 and HappyHorse start at video-synthesis with X-DashScope-Async: enable and are polled at /api/v1/tasks/<id>. The id carries the model and the key's mark, as MiniMax's does. vendorAsk.answer now takes the request's context, so the TTS answer's audio URL is fetched under it. Hosts, paths, fields and voices were checked against Alibaba's docs (help.aliyun.com model-studio qwen-audio-tts/asr HTTP API and Wan 3.0 video reference, docs.qwencloud.com Token Plan multimodal pages, platform.qianwenai.com token-plan), not against the tweet. Not tried against the real API: the owner's magpie has no Token Plan provider. The tests use a fake DashScope serving the docs' shapes. Run (on mote via mote-run, tree at |
||
|
|
e199eb9c79 |
codex: the Codex app's picker puts a ChatGPT model its list lacks where the order put it (Wangalan167673 on X)
Wangalan167673's Order tab (Codex's list on the Agents page) had GPT-6.2 Sol and Astra third and fourth, and the Codex app's picker had them last, "GPT-6.2 Astra · Codex", after every other provider's models. The app's list (model_catalog_json, gateway.CodexDesktopCatalog) is the ChatGPT backend's list asked for the app, then magpie's models. A model of the account's own that the app's list lacks yet (GPT-6.2 beside a list asked before it came, CodexListedBeside) is handed by magpie's id, codex/<slug>, which is where the "· Codex" comes from. provider.CodexOrder mapped an own model of the order only to its bare slug, as the backend lists it, so the codex/ entry matched nothing in the order and went after every model the order names. It now maps both the bare slug and the entry id. Groups and other providers' models were already matched by id. The Codex app reads the file at its start, so an order changed while it runs reaches its picker after it is restarted. TestCodexDesktopCatalogInUsersOrder (gateway) builds the reporter's list: GPT-6.1 Terra and Sol in the backend's list for the app, GPT-6.2 Sol and Astra only in the account's own list, three routing groups and four models of an agy-cli provider, in the reporter's order. Red on the old code: "got [gpt-6.1-terra gpt-6.1-sol group/code-daily ... agy-cli/ claude-sonnet-5.5 gpt-6.2-sol gpt-6.2-astra]"; green with the fix. Run on mica at 230feb5b2 (base |
||
|
|
1bfa8d5a18 |
gateway: the Codex app's list is asked again when the account lists a model it lacks (ANAGABRIELRLki on X)
OpenAI released GPT-6.2 Astra on 11-17. Beside a ChatGPT sign-in, the Codex app's picker reads magpie-desktop-models.json (model_catalog_json). That file is the ChatGPT backend's list, which magpie keeps in memory (codexDesk) and asked for again only on a sync, once it was an hour old. ANAGABRIELRLki's app had no GPT-6.2 until they took the line out. The owner's machine shows the same class: the account's own list (KeepAccountsListed, fetched 14:36) has gpt-6.1-terra and gpt-6.1-sol, while the desk file and the gateway's /backend-api/codex/models, asked as 0.165.0, have neither. The list is now due (codexDeskDue) when any of these holds: - it is an hour old (as before); - it was asked for an older Codex version than magpie asks as now (provider.CodexVersionBehind; the backend lists a model only to a client new enough for it); - the sign-in's own list magpie keeps (provider.CodexSignInListed) is newer and has a model the kept list doesn't. A loop on the serving magpie (KeepCodexDeskFresh, every minute, only once Codex has asked for the list) asks when it is due, and the rewrite reaches the file through CodexDesktopChanged, as before. A failed ask is still tried again after codexDeskRetry. Users with the old file get it rewritten on the first answer after start (no list kept, as before) and from then on while magpie runs. The Codex app reads the file at its start, so the app-server restart magpie already offers is still needed to see it. Inputs are read before codexDesk is held. Run (mica, at 16e6bee32 on origin/main |
||
|
|
03314b25a4 |
import: magpie no longer registers CC Switch's ccswitch:// scheme (asombrado_a on X)
|
||
|
|
1318864d1b |
provider: Factory's mover takes opencode-factory-auth 0.1.48
The factory plugin used one x-session-id for every request of its process. 0.1.48 gives each conversation its own, and each subagent in it, as droid opens them. With one shared session, Factory now and then answered Gemini 4 Argon, Hydrogen and Carbon with 400 "Invalid model ID in request body" (marovole on X; magpie-community/plugins 63c2ff93). keepMovedCurrent updates every moved user to it. npm view @magpie-community/opencode-factory-auth version --prefer-online gives 0.1.48. Run (mica): gofmt -l internal/provider is clean; go vet ./internal/provider; go test -timeout 45m ./internal/provider is ok (148s, at this head after the rebase). The plugin's own run is in its commit: the plugins suite has 9055 pass and 0 fail, and the new session test is red on 0.1.47. Not tried: a real Factory account. None is here, so the refusal was not reproduced against Factory itself. |
||
|
|
3ec89c5224 |
codex: the takeover's end waits for the chats on magpie the Codex app has open (milianxinqi on X)
milianxinqi on X, the Codex app: "Model provider mismatch. This chat uses
magpie, but your current provider is OpenAI. Switch to magpie to
continue." ("用的好好的,codex 突然就弹这个了"), with nothing disconnected.
Cause. With the ChatGPT account Codex is signed in to held (out of its
allowance and credits), magpie is Codex's provider (the codex.out
takeover, #540) and new chats start on magpie. When the account has room
again (its window's reset, a switch to another account, or the account
the user keeps Codex on,
|
||
|
|
f7e0f68ca2 |
codex: GPT-6.2's instructions go first in the input, where its cache keeps them
From GPT-6.2 on, OpenAI reads a Responses request's top-level
instructions after its input, not before it (prompt caching guide:
"instructions ... appended to the end of the input" for gpt-6.2 and
later), so they sit past the cached prefix and are billed uncached on
every turn. Codex itself sends no top-level instructions: client.rs puts
its base instructions first in the input as a developer message
(BaseInstructionsFragment, codex-rs/core/src/client.rs).
magpie sent Codex's instructions on top for every ChatGPT-account
request that is not Responses Lite: Claude Code, OpenCode, Pi and other
translated agents through a codex account, and Codex CLIs older than
Lite. Measured on a real ChatGPT account, third turn of a growing
conversation: gpt-6.2-sol cached 1,920 of 8,271 input tokens with the
instructions on top, 6,016 with them first in the input; gpt-6-sol
cached 5,632 of 6,843 with them on top (the old order still works
there). Reported on X by Anotiaww (Codex hit rate looked low).
- codexBody: for a GPT-6.2+ model Codex's instructions, and a client's
own, go first in the input as developer messages, and the request
carries no instructions field. Older models are unchanged, and Lite
turns (no instructions at all) are unchanged.
- siwcBody (Sign in with ChatGPT API path): the client's instructions
go first in the input for GPT-6.2+.
- buildResponses (Chat/Anthropic translated to Responses, any host):
the system prompt goes first in the input for GPT-6.2+.
- InstructionsAfterInput names the models: gpt-N.M with N.M >= 6.2,
gpt-7 and later, after a provider prefix; gpt-6, gpt-6.1, gpt-5.x,
o-series and other vendors' models keep top-level instructions.
The instruction text itself is unchanged; only where it sits moves.
Run (mote, at this tree on origin/main
|
||
|
|
d90780c5d4 |
gateway, gui: a built-in is turned on in Plugins › Built-in, not a Settings › Plugins that isn't there
Errors and notices sent people to "Settings › Plugins" or called a built-in "the … plugin", where no such page is and the thing is a built-in (item 18, "Plugin" qualified where it's ambiguous). They now name Plugins › Built-in and say built-in. Own tests: builtins, websearch-places; Go: the gateway tests whose strings changed (TestKeyLimitsOnAndOff, TestSearchOnAndOff, TestToolsMCP*, TestHubMCPHeldToKeyLimit, TestVisionMCPHeldToKeyLimit), internal/gui's plugins_own_* tests, davsync, gwbudget, gwmw, provider. Run (mote, Chromium and WebKit, en zh zh-TW ja de): - before the rebase, 23 GUI files: every one green except plugin-provider-options (my bug, fixed in this branch before the push) and settings-groups' "warm-ups and check-in in each service's provider editor", red the same way at fresh origin/main |
||
|
|
28430c9b90 |
gui: magpie's own paths are written with ›
A path through magpie's own screens was written with › in some places and → in others (11-17 scan, item 18). Every one the user reads is now ›: Settings › Network and sharing, Settings › Privacy, Library › MCP servers, Providers › … › Use it anyway, Settings › Usage, in the GUI and in the Go errors and notices that reach it, in every language. The GUI matches errNotAsked by its prefix, so it still finds it. Left as they are: gateway errors written for agents, AiHubMix's and Claude Desktop's own menu paths (their apps' words), the image MCP tool description (it goes to agents), and comments. Own tests: chatgpt-usage-why, websearch-places, library-mcp-hub, i18n-keys; Go: internal/library (TestPrivateRepoInstallsWithToken, red on the first try because skills.go still had →), internal/plugin (notplugin_test), internal/pii, internal/provider. Run (mote, Chromium and WebKit, en zh zh-TW ja de): - before the rebase, 23 GUI files: every one green except plugin-provider-options (my bug, fixed in this branch before the push) and settings-groups' "warm-ups and check-in in each service's provider editor", red the same way at fresh origin/main |
||
|
|
265217bf4c |
gui: a model disabled in Settings → Models says so in its provider's editor
A model disabled for every request (#1867) still drew in its provider's editor as an ordinary chip, ticked or served, so it read as one agents get while the gateway refused it. /api/providers now gives each model the pattern that turns it off (provider.DisabledPattern, the list read once per provider), and its chip is dimmed with a "disabled" badge and a title naming the pattern and where it is set. Every language. Paid for in the core budget by moving six trailing comments onto lines of their own (whole-line comments aren't counted), no raise. Run (mote, at this tree): - go test ./internal/gui -run 'TestProviderInfoSaysADisabledModel|TestCoreScriptBudget|TestI18n|TestCSS': ok - go test ./internal/provider -run TestDisabled: ok - disabled-model-chips.test.cjs, Chromium and WebKit, en zh zh-TW ja de: 12 pass Broken by hand, each red, then put back: - providers.go not setting Disabled: TestProviderInfoSaysADisabledModel red. - the chip not reading m.disabled: disabled-model-chips 12 of 12 red. Not tried: the real app window; the rest of the GUI suite. |
||
|
|
32a1818681 |
provider: an AI Studio key decides with Google's gemini-decision-1 (WangYeruo on X)
WangYeruo (v0.1.4401) has a Google AI Studio key's provider, the google
preset. magpie's System One asked for google/gemini-decision-1 fell to
OpenRouter's decision list, because the google provider had no decision
API, and the user's own attempt got Google's 400 "type parameter is
required at input[0]" for an object input.
Google's Decisions API (launched 11-11, aistudio.google.com/docs/
decisions-api, api-reference/decisions/create-decision) serves
gemini-decision-1 at POST generativelanguage.googleapis.com/v1beta/
decisions on any AI Studio key, free tier included, with the key as
x-goog-api-key. It takes System One's questions (noul, choice, score),
an input of text or content blocks, and answers by name with usage
total_input_tokens / total_output_tokens.
- normalize gives a provider asked at the Gemini Developer API (the
google preset's OpenAI-compatible base or a native Gemini base) its
System One at AIStudioGemini (googleDecisions). Not Vertex, not a
signed-in account, not another magpie, and a URL the user gave is kept.
- ViaGoogle: /decisions, signed as Gemini (x-goog-api-key, never Bearer;
DecideProtocol), in AskSystemOne, the list and key checks, and the
gateway's postDecideSent.
- googleAsk: the state goes as input (a string as it is, an object as
its JSON text, never an object, which Google reads as a block), images
as image blocks after it, a choice's null description as "".
- DecideResult: the usage comes back as System One's input_tokens /
output_tokens; prompt_feedback.block_reason with no answers is a 400
that says why. Every other way of asking is unchanged (tested).
- gemini-decision-1: 262,144 context, takes images, so the gateway lets
images through to it as it does for the Clef.
- docs/subsystems/providers-accounts.md says so.
Tests, from Google's documented request and answer bytes, no network:
TestGoogleDecideWire, TestGoogleKeyDecides (with OpenRouter's live list
holding google/gemini-decision-1 seeded: it now routes to google),
TestGoogleSystemOne, TestGoogleDecisionsTakesImages.
Broken by hand, each red: the normalize fill dropped (KeyDecides,
SystemOne, TakesImages red); googleAsk skipped (Wire, KeyDecides,
SystemOne, TakesImages red); signed as Chat/Bearer (KeyDecides,
SystemOne, TakesImages red).
Run at this head:
- gofmt -l internal/: clean. go vet (provider, gateway), GOOS=linux go vet
-tags nogui ./..., GOOS=windows go vet ./... on mote: ok.
- Full suite on mote at 6317fd789 (this change on 7707ba9ad+f4b202030):
go test -count=1 -timeout 45m ./...: 103 packages ok, exit 0, no FAIL.
- Rebased onto
|
||
|
|
e1c186cfee |
provider: Codex's models are asked for as npm's latest Codex, never older than 0.169.1, so GPT-6.2 shows
zzstar101 and m0eaki on X: after a refresh the GPT-6.2 models never
appeared ("magpie内置的codex cli版本过低"). The ChatGPT backend lists a
model only to a client at or past its minimal_client_version, and
GPT-6.2 Sol and Astra have 0.166.0. magpie asks /models, and signs
requests, as the newest of a fixed floor (0.159.0), models_cache.json's
client_version, the installed codex CLI and a Codex seen through the
gateway. With no Codex CLI here, or one older than 0.166 (this Mac has
0.165.0), every source was older than 0.166, so the list left 6.2 out
and a request for it was refused.
- codexClientVersion goes to 0.169.1, npm's latest @openai/codex today.
- codexPublished reads npm's latest @openai/codex (source.Do, so the
mirrors answer when npm doesn't) in the background at most every 6h,
and codexVersion counts it, so the floor no longer goes stale as
Codex releases. Only an x.y.z release counts, never an alpha; a
failed read keeps the last one or the floor. A test binary never asks
npm unless a test points codexNpmLatest at a fake.
- codexListBehind already re-fetches a list asked at an older version,
so a saved list from 0.159.0 is fetched again.
The reporter's follow-up, "请求头版本太低了": the request headers
carry it too. codexSign, which every ChatGPT account's request goes
through after the client's own headers are copied (gateway.go's
codexHeader copy, then Provider.Sign; codex_backend.go's passthrough),
sets the version header and User-Agent (originator codex_cli_rs or
Codex Desktop) to the newer of codexVersion and the client's own, so an
old Codex's request goes on as 0.169.1. Every caller of codexVersion
takes it: the /models fetch
(codex_models.go, CodexLiveList), codex_entries.go's client_version,
codexSign's version header and User-Agent, account.go,
codex_device_signin.go, signin.go and test_as.go. magpie bundles no
Codex CLI of its own (Docker image included); the "built-in" version
is this floor.
Real account (the owner's ChatGPT sign-in, auth.json copied to a
sandbox HOME, token not near expiry, so no refresh; compared byte for
byte after):
- GET /models at 0.159.0 and 0.165.0: no gpt-6.2-*; at 0.166.0 to
0.171.0: gpt-6.2-sol and gpt-6.2-astra, each with
minimal_client_version 0.166.0.
- POST /responses gpt-6.2-sol: 0.159.0 answers 400 "The 'gpt-6.2-sol'
model is not supported when using Codex with a ChatGPT account."
(the reported refusal); 0.169.1 answers 200, response.completed.
- A throwaway binary of this tree calling CodexLiveList under that
HOME with no codex on PATH: old code lists no 6.2; this change lists
both. Built with the floor at 0.150.0, it started at 0.150.0 (no
GPT-6.x) and after the background npm read asked as 0.169.1 and
listed 6.2: the real registry read works.
Tests (mica-run, at this tree before rebase onto
|
||
|
|
659e8850a2 |
gateway: a routing group named for a model is listed by that id when the model's own row isn't (小八 on Discord)
v0.1.4377, Settings › Network and sharing › Model ids without the provider = Only: group/glm-5.2, group/glm-5.3, group/glm-5.3-flash, group/deepseek-v4.1-flash-1017 and group/sensenova-6.8-flash kept their prefix while other groups lost it ( |
||
|
|
4a1ac84421 |
usage: Qianfan's card counts its gift and bought credit packs beside the month (yuushabu_buyinn on X)
Baidu Qianfan's Token Plan Personal also holds credit packs, Baidu's
gifts (赠送积分包) among them, and the card read only the month's plan
quota. The card now reads the console's pack list too and shows:
- "Gift credits": the gift packs still live, credits used of their
total, and how many run out when (the soonest end with credits left);
- "Credit packs": the bought packs, the same way.
Each row shows only when the account has such packs. A pack list that
can't be read (refused, not JSON, a pack with no amount) is a "Credit
packs · Unknown" row, never 0 left. The month window goes on to credits
(Credits) while a usable pack holds some, since Baidu spends the month,
then the gift packs, then the bought ones. The pack rows are set aside
from routing. An account with no plan but live gift packs shows them as
its allowance, since Baidu spends gift packs without a plan; with no
plan and no packs (or none read) the card says there is no plan, as
before.
Endpoint: GET /api/qianfan/charge/tokenPlanPersonal/pack/list on
console.bce.baidu.com, with the cookie and headers the card already
sends for the resource list. Found in the console's public JS: the
qiankun "resource" micro-app (aip-static.cdn.bcebos.com/mb-static/
resource/), chunk index-5e21b2bb.js, which calls
send("charge/tokenPlanPersonal/pack/list", {}, {httpMethod: "GET"}) and
reads result.items: packType ("gift", "guoqing_lite", "guoqing_pro",
others bought), status ("active"), totalCredits, usedCredits,
remainingCredits, expiresAt, isUsable. The rules follow that page: a
gift pack counts while its expiresAt is ahead; bought packs while
active; guoqing packs are left out, as the page leaves them out.
No real account was used: no one here has a Baidu Cloud account with
a Token Plan or packs. The fixtures are built from the field names the
bundle reads, not a captured reply. String or number amounts are both
read.
Run at origin/main
|
||
|
|
3fbade47ab |
gateway: a found group gone with a provider still goes to its model (canlee886)
canlee886 on X (2122660479411855365): a Codex App thread saved on group/auto-gpt-6-1-sol failed every turn with 404 "magpie knows no model", followed by every id magpie has, after azure-fte2-sea's gpt-6.1-sol went away; other threads were fine, and switching the thread's model did not help. The user patched the thread over Codex's app-server RPC. Cause: a group magpie finds needs two providers serving the model (autoGroups). When one is removed, or its list no longer has the model, the group is gone. Reseat moves an agent's config off it, but a Codex thread keeps the model it was saved with and names it on every turn. provider.AutoStandIn sent a gone found group's id to its model only while found groups were off, or when a provider kept out of them took it away; any other way of losing the group was a hard 404, even with a provider still serving the very same model. Fix: - AutoStandInFor: with found groups on, a found group's id (group/auto-… or auto/<model>) that is no group now, and that the user neither changed nor removed (no providers.json record), goes to its model from a provider that serves it (the agent's own subscription first, then one not kept out, then the first). It is the same model, never another; a group the user removed stays a 404. - With no provider serving the model, the request is still 404, but unknownModel says the model is gone and to pick another for the conversation (Codex: the model menu under the message box), with the three nearest ids, not every id (provider.GoneAutoGroup). - Codex's compaction on the model a thread is leaving (model_downshift) already compacts locally when that model 404s ( |
||
|
|
a922e3864e |
provider: moving Antigravity onto agy goes through Antigravity's proxy (huiqiang6 on X)
huiqiang6 on X: in the Docker image, moving Antigravity's accounts onto "Antigravity (local agy CLI)" always fails at installing agy. Reproduced with ghcr.io/yetone/magpie:latest (v0.1.4377) on xiaomi-gpu's Docker, with the owner's real Antigravity account in plugin-auth.json: - plain network, amd64 and emulated arm64: the move works (26s, 39s); agy 1.5.10 installs into /config/data/magpie-agy-cli. - Google unreachable directly, reachable only through a squid proxy set on Antigravity alone (providers.json proxy, as a user in China sets it): the move fails in 7s, every time, with "installing Antigravity CLI failed (couldn't reach Antigravity's release server: Unable to connect…); install it yourself with `curl … | bash`". Cause: MoveToAgy ran agy's install and the accounts' import under agy-cli's proxy, which a new agy-cli doesn't have, so both went direct and never through the proxy Antigravity's requests used. Now MoveToAgy first carries Antigravity's proxy onto agy-cli (its provider proxy while agy-cli has no account and no proxy of its own; each moving account's own, or Antigravity's, as an account proxy where agy-cli would take another), then installs agy and imports through agy-cli's. A proxy the user set on agy-cli is kept. Run: - go test ./internal/provider -run Agy on mote: ok. The two new proxy tests are red with the carry and Via lines taken out (installed through "", imported through ""). - A linux/amd64 nogui build of this tree in the same blocked container (fresh volume, same account, same proxy): the move gives kumw95ya25@gmail.com "added" in 26s, agy 1.5.10 installed, providers.json has agy-cli's proxy, and a chat request to agy-cli/gemini-3.8-flash answers "OK", squid logging the CONNECTs. - gofmt -l; go vet GOOS=linux -tags nogui ./..., GOOS=windows ./... - Full suite: not run before the push. mote and mica were each running another session's suite; it runs after, one per machine, and a red gets its own issue. Not tried: native arm64 hardware with the proxy; the reporter's own config (the tweet has no screenshot, so their proxy setup is inferred); an agy-cli that already has accounts and no proxy (the move's import then goes through agy-cli's, direct; the moving accounts still keep their proxy afterwards). Moves that already failed simply work on retry; none half-moved anything. |
||
|
|
3126b0bacd |
gateway: with model ids without the provider on, a routing group the user made is listed by its own id too (小八 on Discord)
"路由组的外显模型名可以选择去掉 group/ 这个前缀吗": with Settings › Network and sharing › Model ids without the provider on, /v1/models listed a user's routing group only as group/<id>, though the gateway already takes a request for its bare id (GroupFor). BareEntries skipped every group row. Now a group the user made adds a row by its own id (fast beside group/fast; under Only in group/fast's place, through OnlyBare as before), and GET /v1/models/fast and Ollama's lookup answer it (BareEntry). Only where the id is the group's alone: not when a provider serves a model by it (the model's bare id is listed, reaching the group as the gateway routes it), when it is listed already, when GroupFor of it reaches another group, for a group magpie found (its auto/<model> row is already listed under the model's bare id), or for a group a gateway key can't use. Agents: unchanged. magpie still writes group/<id> into an agent's config, as it writes provider/model under Only; the gateway takes either id, so turning the setting on or off rewrites nothing. The Settings help text says nothing that is now false, so i18n is unchanged. Run (mica, mica-run, mote over 18 cores): - go test -timeout 45m -count=1 ./internal/provider ./internal/gateway: ok (152s, 1059s) - GOOS=linux go vet -tags nogui ./...: ok; GOOS=windows go vet ./...: ok - gofmt -l on the changed Go files: nothing - After the rebase onto origin/main: TestBare in internal/gateway again. Broken by hand: with bare.go at its old version, TestBareIDsListUserGroups fails "on: [... glm-5.3 only-a only-b], want [...] and then fast once". With the found-group and already-reached checks taken out of groupBare / BareEntries, it fails listing "auto-glm-5-3". Not tried: a real client against a running magpie; the full ./... suite and the GUI suite (no GUI file changed); Windows and Linux runs beyond vet. |
||
|
|
f8cd4723cc |
groups: a model its vendor lists without the maker's name joins its found group (tmr11235 on X)
tmr11235 on X (v0.1.4334): the found group auto/kimi-k3.1-pro had OpenCode Go's and Devin's kimi-k3.1-pro but not Kimi Code's, which they had to add by hand. Kimi Code lists the model as k3.1-pro (and K3 as k3), so SameModel merged it by k3-1-pro, a group of its own. - catalog.Unprefixed: the model a provider's id is when its vendor left the maker's name off, by what the provider's own models.dev catalogs say of that very id. models.dev gives Kimi Code's k3.1-pro the canonical_model_id moonshotai/kimi-k3.1-pro. The canonical alone never merges: it gives k3.1-pro-highspeed kimi-k3.1-pro and k3-256k kimi-k3, other models. The id must be the canonical's with a maker's name (letters) taken off the front, or go on past it to a model models.dev knows by that name before the whole id (k3.1-pro-highspeed is kimi-k3.1-pro-highspeed; k3-256k stays its own). No K3.1 or K3 takes K3.1 Pro. - provider.mergeKeyIn reads it after the user's same-as and the edition twins, so autoGroups, AutoGroupOf (group_share, reseat, dsh compact), offSpreadIn and the Providers editor's Same-as placeholder (MergeName) all merge alike; spelledIn takes the unprefixed spelling, so Kimi Code with Kimi Code China alone is auto/kimi-k3.1-pro. - Old data: such a model's old group id (auto-k3-1-pro, from Kimi Code plus Kimi Code China) is the found group's Former, so an agent set to auto/k3.1-pro is still served by it. Who else names models this way, from the real models.dev cache: Kimi Code's two plans (k3, k3.1-pro, k3.1-pro-highspeed), MiniMax models at relays (ofox minimax/m2-her, cloudflare-ai-gateway minimax/m3.1-flash), vercel's sakana/namazu. A canonical that is a rename rather than a dropped prefix (kimi-for-coding-highspeed, canonical kimi-k2.7-code-highspeed) is not merged; that would need the canonical to be trusted alone, which it can't be (highspeed above). Tests, red on the old code (Unprefixed's line taken out of mergeKeyIn: the Kimi Code members missing from all three groups and the relay's k3.1-pro grouped with Kimi Code's; the spelledIn line out: the pair listed as group/auto-kimi-k3-1-pro; the Former line out: auto/k3.1-pro and group/auto-k3-1-pro unserved): TestUnprefixedAs, TestFoundGroupTakesAModelListedWithoutItsMaker, TestFoundGroupOfUnprefixedIDsAloneIsTheModels, TestFoundGroupTakesKimiCodesPreset (both presets). Not changed: ownEntry still matches on sameModel. No agent's own subscription (Claude, Codex, Copilot, ChatGPT API, Gemini, Antigravity) lists a model without its maker, so there is nothing for it to join. Run at f8787be1f, these two commits on origin/main |
||
|
|
b1d5912def |
gateway: a Gemini image model listed as models/{id} is drawn at models/{id}, and a Lite one is sent no 2K
Dani Ariyanto on Discord: Nano Banana 2.1 on Google AI Studio always
answered 404 "models/nano-banana-2.1 is not found". AI Studio's
OpenAI-compatible /models (the Google Gemini preset's list) names every
model models/{id}, so the provider's id is models/gemini-nano-banana-2.1
(google/models/gemini-nano-banana-2.1 at the gateway, the model
Automatic image generation picked for them). Chat already dropped the
prefix (GeminiPath), but drawGemini put the id after its own /models/,
and asked /v1beta/models/models/gemini-nano-banana-2.1:generateContent.
GeminiModelPath now drops a leading models/ itself, so every path built
from it agrees: chat (GeminiPath), image generation (drawGemini), a
plugin's Code Assist path and Vertex's. The listed ids are left as they
are: renaming them would orphan every pick saved as google/models/... .
The reporter also saw gemini-3.1-flash-lite-image (Nano Banana 2 Lite)
refuse size 1024x1536 with 400 "Image size 2K is not supported for this
model". takesImageSize now says which models may be asked an imageSize
past 1K: not Gemini 2.x (as before) and not a Gemini / Nano Banana Lite,
read without models/ or a relay's google/. imageConfigOf (Gemini API
and Code Assist draws) and openRouterSize (OpenRouter's Image API
resolution) both ask it; such a model gets the aspect ratio alone and
draws at its 1K, as it did with no size asked.
Run at this change on
|
||
|
|
f9492fd8ed |
routing: a model offered at a window (claude-haiku-5-5@1m) joins its model's found group (Will on Discord)
Will (0.1.4356, macOS, Cursor plugin) ticked claude-haiku-5-5@1m and
claude-fable-5-2@1m in Cursor: served, but never in auto/claude-haiku-5-5.
Cause: found groups merge by catalog.SameModel, which keeps everything
after an "@" except a snapshot date, so every sized id the Cursor plugin
lists (it lists Claude only as <model>@<size>) and grok's grok-4.7@500k
formed a key of its own and never met the unsized model at another
provider.
mergeKey now goes through mergeName = sameModel(windowless(id)):
windowless drops a window after "@" by the same patterns pricing already
reads as "the same model at that window" (modelWindow @<n>k|m, and Grok's
@<n>). It is the same model at the same price per token, and a group's
members already differ in window by provider, so it joins rather than
needing Same as. One member per provider still: its unsized model when it
lists one (grok-4.7 over grok-4.7@500k), else the first size it lists.
spelledIn lists the group by the windowless id; MergeName (the editor's
Same as placeholder) shows it. A Vertex @20260801 stays a snapshot date,
any other "@" (model@cf) stays as it is. catalog.SameModel is unchanged,
so models.dev lookups by spelling don't lend a 1M id the base's specs.
Run (mote, mote-run): go test -timeout 45m -count=1 ./internal/provider/...
./internal/catalog/... ./internal/gui/ ./internal/agent/...
./internal/gateway/... at 9d8d9c544 (same tree): all ok (gateway 1179s).
After rebase on
|
||
|
|
a75a1fffcb |
provider: agy's Orchestrator (Argon), gemini-pro-orchestrator-g1-pro, is priced as Gemini 4 Argon (mu33410 on X)
mu33410 on X: agy's Orchestrator model showed no cost. |
||
|
|
167101d57a |
gateway: service_tier "fast" reaches a Codex account as Codex sends Fast, "priority" (Archivemylife on X)
Archivemylife on X sent a Responses request for gpt-6.1-sol on a Codex account with "service_tier": "fast" and got "default" back. magpie dropped the key: codexBody kept only "priority" and "ultrafast", and the IR's Fast (Chat and Responses parse) is set by "priority" alone, so "fast" never reached the ChatGPT backend on either API. "fast" is Codex's own name for its Fast mode. Codex never sends it: ServiceTier::from_request_value reads "fast" and "priority" alike as Fast and request_value sends "priority" (openai/codex codex-rs/protocol/src/config_types.rs; step_settings.rs normalizes the legacy "fast" the same way; read at 7fb4014d5). - handle() turns a top-level string service_tier "fast" into "priority" on Chat and Responses (fastTier), before the Codex and key tier settings, routing and tier_asked. Those settings still win: they are the user's own value. Other tiers, "Fast", nested or non-string values go as they came. - codexBody sends "fast" as "priority" too, for any path that reaches it without the handler. - Anthropic Messages: Claude's equivalent is speed "fast", already read as Fast and sent to the ChatGPT backend as priority (covered by the new test). Anthropic's own service_tier (auto/standard_only) is about capacity, not speed, and is not mapped. - Not changed: "flex" (Codex's Flex) is still dropped for ChatGPT accounts, as before; responses.go untouched. The backend's reply still says "auto" then "default" with priority honoured (servedTierAt already knows this), so the client's response service_tier is not proof either way; speed is. Run: - Red on the old code (production files from HEAD, tests new): TestFastTierWordReachesCodex red on Responses fast, whole fast, Chat fast, whole fast; TestCodexBodyServiceTier red on "fast". Green with the change. - Real Pro ChatGPT account in a sandbox HOME (codex logins only, refresh tokens blanked, no agent config touched), binary built at this change, gpt-6.1-sol: Responses "fast" (whole and streamed), Chat "fast" and Messages speed "fast" each went out with tier priority (trace tries); "default" went with none. Streamed Responses reply said service_tier auto/default. Two pairs, 600-word essay, effort low: priority 28.3 and 30.1 tok/s, none 22.3 and 21.2 tok/s. - mica: go test -count=1 -timeout 45m ./... at this tree: 103 ok, no FAIL. go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./..., go build: ok. gofmt -l: empty. That tree was on be6f8b730; after rebasing onto |
||
|
|
be6f8b730e |
provider: Zen's free models go out through Bun, which Zen serves them to (biubiubiuzone on X)
magpie 0.1.4349 on macOS: with an OpenCode Zen key set, deepseek and the
other free models failed, while the same key worked in the OpenCode app.
Cause: Zen's free tier tells OpenCode from other clients by the
connection, not the request. I captured the bytes real OpenCode 2.3.0
sent (through a recording Bun relay) and replayed them from one computer
(mica) within a minute:
- Bun 1.4.2 (magpie's BunVersion) and Bun 1.4.4 (OpenCode's own) got 200.
- Go's net/http and curl got 429 FreeUsageLimitError, "Free usage limit
reached. Free models work in OpenCode", over HTTP/1.1 and HTTP/2, with
the public key or a user's own.
Zen's server source (console/app/src/routes/zen/util/handler.ts) runs
the free model's rate limiter before authenticate(), so a key never
lifts it.
Fix:
- netproxy.Elsewhere is a hook every Dispatch transport asks first.
- internal/provider sets it (zen_bun.go). A request to an OpenCode host's
/inference/ paths (Zen's free tier, OpenCodeFreeURL) goes through the
plugin host's fetch, which is Bun's, with its own headers and body and
the proxy chosen in its context.
- The host is told a provider id no plugin claims, so no plugin's
sign-in or fetch takes the request over.
- This covers the gateway's turns, the Test button and
RetryOpenCodeFreeOnZen.
- Where Bun can't be had (HasBun false after the fetch failed), the
request goes through Go as before.
- Zen's paid paths (/zen/v1, /zen/go/v1) stay in Go.
Run:
- New tests: TestZenFreeTierGoesThroughBun, TestZenPaidAndOthersStayInGo
and TestZenFreeTierWithoutBun. With the hook not set (init's assignment
taken out by hand), the first and third are red ("dialed").
- Real end to end on mica, in a sandbox HOME, through
provider.FromPreset("opencode-zen").TestModels with the public key:
- this change: deepseek-v4.1-flash-free, big-pickle and
mimo-v2.6-flash-free gave 200, every time;
- with Elsewhere set to nil (the old path): all three gave 429
FreeUsageLimitError, alternating runs, in the same minutes;
- with magpie downloading Bun 1.4.2 itself: 200 on 4 of 4 calls. The
first call after the download timed out connecting (10s), on mica's
flaky network.
- mote:
- gofmt;
- go vet of netproxy and provider for darwin, linux and windows;
- go test -tags nogui -timeout 45m of netproxy, provider, plugin and
gateway: ok at base 31dcfcc33;
- netproxy and provider again at this head on origin/main
|
||
|
|
3f6a101fe1 |
providers: Images per request in the editor's Advanced, per model, learned from 100milionseek's and Coarena's words (#6849)
Yuu_jiang_ on X (#6849): 100milionseek and Coarena take at most 8 images a request, counted over the whole conversation, tool results included, and every turn after the ninth screenshot failed with no way on but /clear. ID-VerNe's max-images (the commit before) set one number from the CLI. This builds on it: - The cap is per provider, and optionally per model: max-images=8, or max-images=8,gemini-3-flash=10. The exact model is looked up first, then its upstream name, then "*" for all. The provider's cap moves with a model's local id like the other per-model limits. - 100milionseek's "At most 8 images per request (MAX_IMAGES)." and Coarena's "A request may carry at most 8 images." are learned as Copilot's words are, by provider and model, so the first refusal is the last. A user's own number is fitted before any refusal; a learned one that is smaller still lowers it. - Images are counted everywhere, a tool_result's too; the oldest are left out first and the latest user turn keeps its own. Only the request sent changes; session files are not touched. A request with no cap, or within it, goes out byte for byte as it came. - The provider editor's Advanced (folded unless set) has Images per request under Max output, in maximages.js, imported as that field is drawn, in every language. A GUI save keeps the value when the field isn't drawn. An editor opened and closed is not dirty (the draft takes the value only when typed), and the import, like keyrates.js's, draws nothing once the editor has closed: before that, a quick close threw "Cannot read properties of null (reading 'maxImages')" and ('keyPriceRates'), which add-sheet and key-box-once caught. - Budgets: app.js and the core +354, said in core_budget_test.go. What was run: - go test -count=1 -timeout 45m ./... on mote at |
||
|
|
e049b5cd35 |
providers: a user-set cap on the images of one request (max-images)
100milionseek's and Coarena's APIs take at most 8 images a request, counted over the whole conversation, and answer the ninth with a 400 of their own words (#6849): "At most 8 images per request (MAX_IMAGES)." and "A request may carry at most 8 images.". imageCapWords matches Copilot's wording alone, so the cap is never learned there and every turn of a session that has shown nine screens fails, with no way on but /clear. `magpie provider set <id> max-images=<n>` sets the user's own cap. The gateway fits a request over it before it is sent, the oldest images left out for the line imageOverCap stands, exactly as the learned Copilot cap does; no refusal is needed to know it. The user's number stands over a cap Copilot's refusal taught the same provider. 0, the default, keeps the learned path as it was. The provider editor has no field for it: a GUI save keeps what the CLI set, as it keeps usefirst and standin. What was run: - gofmt -l internal/ (clean); go vet ./internal/gateway ./internal/cli ./internal/provider ./internal/gui (clean); GOOS=linux go vet ./... (only wails beta.24's own cross-compile errors, the same 12 as at the base commit |
||
|
|
ff88ec264a |
sync: subscriptions whose sign-ins stay on this computer (Ethereal499 on X)
Sync's sign-ins can now leave chosen subscriptions out on one computer
(`signInsExcept`, provider ids; Ethereal499 on X keeps Claude's accounts
off other computers). On that computer:
- its accounts of those subscriptions never go up;
- the server's accounts of them are never merged in, so a removal or a
new account on another computer changes nothing here;
- the server keeps them as they are for the computers that do sync them
(syncOnce splits the remote set with SignIns.Except and puts the held
part back with With after the merge, so the hash doesn't change);
- the preview and Restore count and restore none of them.
An id names both the built-in and its -plugin id. An old config has no
field and syncs everything as before. The setup text doesn't carry the
choice, since it belongs to one computer.
GUI: Settings > Sync > edit > Advanced, under "Sign-ins", a "Not synced"
row with a multi-select openProtoMenu of the subscriptions with an
account. The row shows only while the sign-ins tick is on. The strings
already existed in en, zh, zh-TW, ja and de. CLI: `sign-ins-except=`
on the WebDAV, S3 and GitHub setups ("none" clears it), and status
shows the excluded ids. docs/subsystems/sync-backup.md says it.
Tests:
- TestSignInsExcept (provider) and TestSyncSignInsExcept (davsync, two
computers on a fake DAV).
- sync-signins-except.test.cjs: both engines, 1100 and 420px, all 5
languages.
Broken by hand, each red and then restored:
- the Except in collect;
- the Except on the remote set before the merge;
- the Except in the preview;
- the With after the merge;
- the GUI form's post of signInsExcept.
Run:
- At
|
||
|
|
ad585ccd6c |
claude: settings.json holding a setup-token is readable by its owner alone
|
||
|
|
2f25728ddf |
claude: Use switches Claude Code itself to a setup-token account (liukaybee on X)
liukaybee adds Claude accounts with `claude setup-token` and wants magpie
to switch only which one Claude Code itself uses, without connecting it
to magpie. Such an account has no sign-in to put in Claude Code's
keychain or .credentials.json, so Use was refused ("magpie only").
Claude Code takes CLAUDE_CODE_OAUTH_TOKEN from the env of its user
settings.json ahead of its stored sign-in. Use on a setup-token account
now writes the token there (claude_token_env.go). Claude Code's stored
sign-in stays as it is and stays Active; the token account is listed
with Uses. A switch to a signed-in account, Use on the signed-in row,
or removing the token's account takes the token out again.
- A value the user set is theirs: magpie keeps only the sha256 of what
it wrote (claude-token-env.json), never writes over another value and
never removes one whose hash differs, even if it once wrote it.
- An unreadable settings.json is "unknown": nothing is written, the
record is kept, and the switch fails without moving the sign-in.
- NextLogin (Switch accounts only) leaves Claude Code on a token in use,
as its allowance can't be read.
- magpie's own runs pass --setting-sources "" and are unaffected.
- GUI: the token row's Use and In use; the signed-in row says Signed in
with a Use back. Every new string in zh, zh-TW, ja and de.
- app.js +864 bytes over its budget, raised with the reason in
core_budget_test.go: one swUse helper shared by both buttons, packed;
renderAccounts draws every account row, so no page to move it to.
Real use: real Claude Code 2.1.316 in a sandbox HOME/CLAUDE_CONFIG_DIR
(never the live ~/.claude) with a deliberately broken .credentials.json
access token. The settings.json magpie's switch writes (dumped from a
test) gave a PONG with a real account's token; the file after switching
back gave "401 OAuth access token is invalid", i.e. Claude Code was on
its stored sign-in again. Sandbox homes holding real tokens deleted.
Run (mote/mica, at f00e2059d rebased on
|