ef0c515eb006c29e2bfef2c0055ee84fee2ebce0
3445
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
ef0c515eb0 |
provider: a sub2api or new-api account query left without its token asks the key's query instead (lx_78654 on Discord)
The editor's "Use …/api/v1/user/profile" sets the Balance URL to the sub2api panel's account query, which only the login JWT can ask. Its Remove button clears the token but not the URL, so the profile query was then asked with the key, refused with 401, and the Usage card said "Allowance unavailable" for good. keyQueryOf now asks the same panel's key query when the Balance URL is an account query (sub2api /api/v1/user/profile, new-api /api/user/self) and no token is set: /v1/usage and /api/usage/token, with the key, their own default field unless the user wrote another. The saved URL is left as set, so pasting a token again asks the account query again. A provider whose Headers carry its own Authorization or Cookie is asked as set. It covers every reader: the Usage page and `magpie quota` (KeyBalances), the editor's Check balance, routing's key windows (sub2APIKeyLimits), and `magpie provider <id>`, whose "from" line now says the query actually asked (BalanceQuery). Run: - TestAccountQueryWithoutTokenAsksTheKey (httptest sub2api + new-api): JWT, removed, JWT again; new-api without token; custom field kept; account query never asked with the key; own Authorization kept. With keyQueryOf a no-op it fails with the reporter's 401 card. - Sandbox CLI (scratch HOME, fake sub2api on 127.0.0.1): old binary, after `provider set sub2 balance.token=`, `magpie quota` shows "401 Unauthorized…"; new binary shows "$7.25 left", from /v1/usage. - go test -tags nogui ./internal/provider/ ./internal/cli/ ./internal/tui/, and internal/gateway's balance, allowance, quota and key-limit tests. The full `go test -tags nogui ./...` passed every other package; internal/gateway and internal/agent ran out of time (10m, then 40m) with the machine at a load average of ~300-370, the tests running at the deadline seconds old, so not a hang; neither run finished. - gofmt -l; go vet darwin, GOOS=linux -tags nogui, GOOS=windows. Not tried: a real sub2api or new-api account; the GUI not clicked through (no asset changed, it reads the same KeyBalances). |
||
|
|
b8070cc6c8 |
tests: TestAgentGoneInTheRetryPause cancels once the last try is in its pause, not 100ms after the upstream counted it
CI on |
||
|
|
331c27703a |
gateway, provider: send no prompt_cache_options to Codex, and ask again without it when an upstream refuses it (#2154)
pi-ai sends {"prompt_cache_options":{"mode":"explicit"}} on the Responses
API. The ChatGPT backend behind a Codex subscription answers 400:
{"error":{"message":"prompt_cache_options is not supported on this
model","type":"invalid_request_error","param":"prompt_cache_options",
"code":"invalid_parameter"}}
Probed on 2026-10-14 with a read-only use of the owner's Codex token
(never refreshed or written): gpt-5.5, gpt-6-sol, gpt-6-astra,
gpt-6-luna and gpt-5.6-sol all refuse it, and the same requests without
the field return 200.
- codexBody drops prompt_cache_options with the other fields the backend
turns away. prompt_cache_key stays; the backend follows it (#1473).
- prompt_cache_options joins the gateway's optional fields. Its refusal
names the field bare, at the start of the message, which none of the
existing patterns read, so unsupportedOptionalField also takes
"<field> is not supported/unsupported" when the message starts with
it. Only at the start, so a field named inside an echo of the input is
not taken for it. As for the other optional fields, the refusal is
remembered per provider, though OpenAI's wording says "on this model";
the cost of that is a cache hint left off, never a failed request.
Run: go test -tags nogui for internal/gateway (40m timeout; load ~380
from other sessions), provider, catalog, codexcat and agent; gofmt -l;
go vet darwin, GOOS=linux -tags nogui, GOOS=windows. With each fix taken
out by hand, TestRefusedOptionalNamesOnlyUnsupportedFields,
TestPromptCacheOptionsRefusedRetried and
TestCodexBodyDropsPromptCacheOptions go red.
Not tried: pi-ai itself against a Codex subscription.
|
||
|
|
f51863b3da |
catalog: a relay channel's word before a known model is that model, so Codex lets it see images (#2157)
The reporter's relay lists nyro-gpt-5.5, nyro-gemini-3.8-flash and nyro-deepseek-v4.1-flash. None of those ids is in models.dev, so magpie knew nothing about them: magpie-models.json gave each one input_modalities ["text"], no context window and no reasoning levels, and Codex refused every image. The bare ids are known (gpt-5.5: images, a context window and reasoning levels). renamed now also takes a leading channel word off an unknown id: 2 to 24 lowercase letters and a dash, when what is left has a digit and is a known model. models.dev's own data backs it: 147 of its listed ids have the form word-<another listed id> (openai-, databricks-, anthropic-, doubao-, zai-, ...), and each is the same model. A listed id is never renamed, so a vendor's own chan-gpt-5.5 keeps its entry; nyro-auto, ny2-gpt-5.5 and nyro-gpt-5.5x stay unknown. NameOf keeps the word, so the shown name is still the relay's own. TestRenameNeverTakesAModelForAnother (#1383) had anthropic-deepseek-v4.1-flash as a near miss. By the evidence above, that id is DeepSeek's model under a vendor word, so the guard row is now anthropic2-deepseek-v4.1-flash, which the rule still leaves alone. A model magpie still can't place stays text-only: telling Codex a text-only model sees images makes it offer view_image and fails the turn upstream. For those the per-model "sees images" switch already writes image into the catalog, which TestChannelModelsReachCodexWithImages covers along with the renamed ids. Run: go test -tags nogui for internal/catalog, codexcat, provider, gateway (40m timeout; load ~380 from other sessions) and agent; gofmt -l; go vet darwin, GOOS=linux -tags nogui, GOOS=windows. With the channel rule turned off by hand both new tests go red (nyro-gpt-5.5 images false, window 0; input_modalities [text]). Not tried: a real Codex image turn through the reporter's relay. |
||
|
|
bab1b30009 |
routing: the hub's mode chip is written only when it changes, so a press held over the once-a-second redraw still clicks in WebKit (#2151)
Cause: the routing view redraws every second (setInterval → render → header). header() set chip.textContent and goTo() re-set data-go, tabindex, role and title each time, even when nothing changed. Setting textContent swaps the chip's text node. In WebKit, a press whose mousedown and mouseup straddle that swap gets no click, so goRouting never ran and routing-mode-goes timed out waiting for .rt-found (webkit zh 420 on CI). A reader pressing the chip for a moment could miss it the same way. Reproduced by injecting a delay: SIGSTOP/SIGCONT duty-cycling of WebKit's UI process. At 10ms on / 490ms off, a MutationObserver on .rt-hub plus pointer logging showed pointerdown at 2407ms, the hub's childList swap at 2869ms, pointerup at 2904ms, and no click. At 50/450, 1 of 30 runs timed out at the rt-found wait on the old code; 0 of 30 do with this change. Fix: header() and hubText() go through setText (write only if different), and goTo() sets each attribute only when it differs. The activity list's heading chips already keep equal nodes through patch(). Test: routing-mode-goes now holds a press over one redraw. It counts the routing interval's ticks through a wrapped setInterval, then does mouse.down, waits for a tick, does mouse.up and expects .rt-found. On the old routing.js this fails in all 10 WebKit cases at that wait (chromium passes, since it clicks the common ancestor); with the fix it passes. Run (playwright 1.62.0, chromium + webkit): - routing-mode-goes: 40/40, en zh zh-TW ja de at 1100 and 420. - group-switch-add-many, group-share, routing-key-windows, routing-weight-chip, view-scrollbar-drag, routing-steady, routing-idle-frame and routing-shape all pass. - routing-live-patch failed one folded subtest only with 9 files run at once. It passes 2/2 alone with and without this change: a fixed 400ms sample, filed as #2174. Not tried: the desktop app's WKWebView by hand. At 2% CPU (10/490) the chip now clicks, but the view's scroll guard can still refuse or put back the scroll when the click is handled more than 1s late. I left that alone; it doesn't appear at 10%. |
||
|
|
0506f011d7 |
agent: a Codex reaching the gateway from another machine is never joined beside its ChatGPT sign-in (#2145, lazydao)
A Codex in a WSL distro under NAT (or with MAGPIE_ADDR pinned beyond loopback) signed in to ChatGPT was joined beside its sign-in: it sent its ChatGPT token to <gw>/backend-api/codex, and from another machine the gateway takes a named key alone, so every request was a 401. chatGPT() is now false when onAnotherMachine(at.gw()): such a Codex is wired as one with no ChatGPT sign-in, magpie as its provider with gwKey() (the LAN sharing key). One of its own models picked still goes straight to OpenAI on its sign-in, as it does for a Codex with no sign-in. Run: TestCodexBeyondLoopbackNotJoined (new; fails on the old code with the joined config), go test -tags nogui -count=1 ./internal/agent (975s, ok), gofmt -l, go vet darwin / GOOS=linux -tags nogui / GOOS=windows. A first version forced magpie API under NAT and broke TestWSLCodexProvider (own model refused); this one keeps that path. Not tried: a real WSL distro under NAT with a ChatGPT-signed-in Codex. A NAT Codex already joined is rewired on the next connect or model pick. |
||
|
|
a4d580fa24 |
gateway: a group skips Antigravity for the system prompt it just turned away (#2156)
Antigravity answers Claude Code's and the Agent SDK's system prompt (the x-anthropic-billing-header line, "built on Anthropic's Claude Agent SDK") with 429 "Resource has been exhausted" whatever quota is left (#666). magpie already tells it as prompt_turned_away, rests nobody and hands it on, but each Claude Desktop turn in a group waited on the same refusal first (#2156: 429 in 1073ms, then cursor/composer-2.5 200). Now, once Antigravity has turned such a request away (any of the three paths that set holdWriter.turnedAway), for agForeseeing (6h) after, the candidate loop skips an Antigravity candidate for a request that carries the line, when someone is left after it (antigravityForeseen). The skip goes in Fallback with the hint, sets `other` as the asked path does, and changes no account state. The last one left is still asked and told the 400 with the hint. A request without the line (titles, Codex) still goes. An old refusal foresees nothing, so a block Google lifts is noticed. The lines are still neither rewritten nor hidden (#666). The stamp is per Server, in memory. TestAntigravityTurnedAwayRestsNobody's "asked first again" half now checks it with a turn without the line, since one with it is foreseen. Run: - TestAntigravityTurnedAwayIsForeseen: fails with the skip turned off ("Antigravity was asked again for the prompt it just turned away"), passes with it; TestAntigravity* -count=3 green. - gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows ok. - go test -tags nogui ./... in a sandbox HOME at load average 140-220: everything green except 10m timeouts in agent, cli, gateway, library, provider and TestSetAnswersWhileDevinAndProvidersHang (#1375, noted there); those six packages rerun with -timeout 45m: all ok. Not tried: the skip against the real Antigravity account (the refusal itself was reproduced with a real account before: 400 with the line, 200 without), nor Windows/Claude Desktop as the reporter uses. No GUI change. |
||
|
|
9bc9a6e5e1 |
tests: TestRefreshInvalidationCancelsStaleCall gives the second ask 10s, not 1s, so a loaded runner doesn't read it as a stale listing left running
Seen red during a full run at load average 200-360 ("stale listing was not
cancelled and followed by the new state", 1.73s). The test's fake first ask
waits on its context alone, so a listing that invalidation fails to cancel
never ends; a 1s bound only measured how fast the second ask and the commit
ran. 10s keeps that apart with room on both sides.
Run: a 1.5s sleep injected into the second ask fails the old 1s bound with
the same message and passes the 10s one; with provCancel() taken out of
forgetProviders the test still fails (Fatal at 10s, then the package times
out on Settle, as before). go test -race -count=20 -run the test, go test
-tags nogui ./internal/plugin (179s), gofmt -l, go vet darwin, GOOS=linux
-tags nogui and GOOS=windows on ./internal/plugin pass. Test-only change;
./... not run. TestRefreshDeadlineBoundsRealProviderCall in the same file
still bounds a 100ms deadline against a 1.5s plugin call with a 1s wait
(900ms/500ms of room); not changed here.
|
||
|
|
bc2d351337 |
gui: a routing group's member held at its cap, or used up and set not to spend credits, stays on the Routing stage (#2129, wyq0x55)
A member whose accounts were all held — Codex used up with "spend credits" off, or an account past the usage cap set on it — went to the route's left list, and the stage draws r.order only, so the member vanished from the group on the stage (d-task's gpt-sol-6.1), while a used-up Claude, resting, stayed there faded. The stage now seats left entries held at a cap or for credits (not those a gateway key may not use, nor those whose plan doesn't list the model, which |
||
|
|
845b5c4ddd |
gui: Settings › General's Codex model rows and Open at login say what they do in their tooltip, and Lightweight mode that the gateway keeps running (#2120)
Anoninz asked on #2120 what the Codex model rows do, why Open at login
shows under App Background Activity on macOS, and what Lightweight mode
gives up. These rows were made to say their name alone in
|
||
|
|
52b5d9f83f |
gui: an allowance curve says when it runs out, so its 52px shape need not be read (#2079, #2146, Edward4226)
A window's curve is asked one question — will this run out before its reset, and when — and answers it with the angle between two lines in a 52px box. In the issue's card (a monthly window 13 days into 30, 28% used, under even burn) the curve's own slope is 4.9° on the Usage page and 1.5° in the tray's spark, against even burns at 7.8° and 2.4°: the two differ by 2.9° and 0.9°, and in the panel their right-hand ends sit about 2px apart. |
||
|
|
cf455ebd5f |
gui: a view at its top when a control is clicked stays at its top, what came in above moving the control down (#2134)
The click guard's own rule says "A view at its top stays at its top: what comes in above the control there moves it down instead of scrolling itself out of sight", but hold() only kept that rule for the room at the foot. Anything that grew above the held control scrolled the view to follow it. At 420 wide, Settings › About turning Automatic updates Off gave the Version row its "are off" line ~2.3px tall once the save answered, and the view slid from 0 to 2. hold() now keeps a view that was at its top (h.top) at 0, so the switch moves down by those pixels instead. Tests: - update-auto: a new case at 420x640 clicks Off with Settings at its top and checks scrollTop after the save's redraw (600ms), not only right after the click. On origin/main's app.js it is red in both engines (2 !== 0); with the change green. - update-restart (#2096) held the switch to within 1px, which is the old behaviour at the top. It now checks the at-top rule when the view is at its top (scrollTop 0, switch down by at most 4px), and the old 1px hold otherwise. Run (load avg 200-340 from other sessions): - update-auto + update-restart, chromium and webkit, widths 1100 and 420, en/zh/zh-TW/ja/de: 32/32. - 71 scroll-guard files (click-scroll, *scroll*, *steady*, *pin*, *profile*, settings*, stays-strict, held-animations, and every file checking "must not scroll the page"), both engines, 4 wide: 921 pass, 11 fail. The fails are nav-sub-unroll, removed-groups-menu-scroll, settings-proxy-auth and text-size. Alone, settings-proxy-auth passes 10/10 and nav-sub-unroll chromium 2 of 2; nav-sub-unroll webkit, removed-groups-menu-scroll and text-size are red alone on origin/main bda271999's app.js too (#1950, #1866, filed #2172). Not tried: the real app window; only the Playwright engines. |
||
|
|
b75e21be31 |
agent: the Qoder app counts as Qoder again, found by the status file it writes to ~/.qoder (#2138, xiaozicoder)
xiaozicoder's Windows 11 has the Qoder app and the Qoder CN app (Qoder-win-x64-user.exe, Qoder-CN-win-x64-user.exe from qoder.com and qoder.cn) and no qodercli, and since v0.1.1220 magpie's Agents page lists no Qoder at all. Qoder-win-x64-user.exe is the Qoder app (com.qoder.app, qoder-app/releases/latest.yml at 0.4.7), not the Qoder IDE. Its app.asar runs Qoder's CLI as its agent (qodercli 1.1.64's worker runtime, config dir .qoder / .qoder-cn, QODER_CONFIG_DIR, with BYOK config management), so ~/.qoder/settings.json's providers.magpie reaches it. It writes the enabledPlugins of its bundled qoder-context plugin to settings.json, which alone stopped counting in the same change, so the app's Qoder was lost. The app also writes .qoder-app-status.json (-canary-, -dev- for its other channels) into ~/.qoder, or ~/.qoder-cn for the China product (the map is in its app.asar; this Mac's Qoder.app 0.4.3 wrote one). Agent gets sign, one more sign the agent is here for a dirShared folder, and Qoder's (both builds) is that file. The JetBrains plugin's folder of #1495 has none, so it still isn't Qoder. Run: TestQoderAppIsQoder (both builds: plugin-only settings.json not detected; each of the three status files detected; the status file with no settings.json detected; a folder of that name not) red on the old code (Qoder CN subtests fail), green now; TestQoderSettingsFromAnIDEPluginIsNotTheCLI still green; go test ./internal/agent -count=1 -timeout 45m ok (1576s, the machine at load ~350; a first run hit the default 10m package timeout mid TestCodexAgentsV1WarnsWhenCodexOwnV2IsOn at 1s, not a hang). gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows clean. A nogui build's `magpie ls` in a sandbox HOME (PATH=/usr/bin:/bin) with ~/.qoder holding the plugin-only settings.json and a copy of this Mac's real .qoder-app-status.json, and ~/.qoder-cn the same with a qoder-cn status, lists Qoder and Qoder CN. Not tried: the Qoder app on Windows itself, and whether its agent takes magpie's provider from settings.json in practice (would need a live ~/.qoder changed). |
||
|
|
6d19988416 |
usage: a provider the log names but that isn't set up now goes by its name, "Claude Code", not "claude" (@ByronVon1 on X)
The Requests page's Provider filter listed "claude" between named providers. The usage log keeps the id of every provider a call went to, and usageapi named those only from provider.All(). The Claude Code subscription is in that list only while its account is discovered, so after a sign-out, with account discovery off, or for a preset provider removed since, the bare id showed. This happened in the filter, each row's Provider column, the split-by-provider and model-at-provider legends, the Account filter's provider notes, and the summary's model and account subtitles (stateOf had its own copy of the same lookup). - provider.KnownFace(id): the name and icon magpie knows an id by while it isn't set up. It covers the built-in subscriptions' card faces (accountCard: Claude Code, Codex, Copilot, Gemini, Antigravity, moved ones) and then the presets. A custom provider removed since stays its id, since nothing else knows its name. - usageapi.providerFaces: one lookup for LedgerPage and stateOf, in order: the provider set up, "Local session" for session-unknown, then KnownFace, then the id. Run: - TestProvidersNotSetUpAreNamed (new, internal/usageapi). Fails on the old code with 13 errors across the filter, rows, both splits, the Account filter and the summary; passes with the fix. - gofmt -l: clean. go vet for usageapi, provider, gateway, gui on darwin, and usageapi, provider on GOOS=linux and windows: clean. - go test ./internal/usageapi ./internal/usage: ok. - go test ./internal/provider ./internal/gateway ran at load average ~300 with other sessions' suites. Three timing tests went red, and each passes 3/3 alone (-count=3 -run): TestCopilotSecretToolUsername (#1627, commented), TestOTelFastRequestTranscriptDiscovery (#1811), and TestTranslatedStreamKeepsClientAlive (filed as #2169). TestUsageOverGateway and the gateway's TestUsage* pass. - GUI: usage-ledger.test.cjs and usage-ledger-chart.test.cjs in chromium and webkit, 52/52 (playwright 1.62.0). app.js is unchanged, since the page already shows the name the API sends. Not tried: the real GUI with a signed-out Claude account. |
||
|
|
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. |
||
|
|
1a33d22cca |
agent: an omp outside magpie's PATH (bun's ~/.bun/bin) is still found and asked its version on Linux and macOS, so its models offer max (whqtian on Discord)
whqtian: "ubuntu 24 版本的 omp 最大推理级别,还是xhigh,win版和 wsl版好了". omp
gets max in models.yml only when its version is known to be 16.4.0 or
later (ompTakesMax). The version comes from cliBin → binAt, which looks in
the user's tool folders (proc.FindTool: ~/.bun/bin, npm prefixes, every nvm
Node, mise, fnm ...) only on Windows. Elsewhere it uses the PATH magpie
was started with, and only the GUI and `daemon install` widen that. Under
`magpie serve`, web, tui, the CLI or a service, an omp installed by bun in
~/.bun/bin read as no version, so max was turned into xhigh.
|
||
|
|
8c5190a203 |
provider: a routing group keeps its thinking members' levels beside a member known not to think, so Codex shows its effort control (#2127, cnlove7777777-art)
#2127: with a routing group as its model, Codex showed an effort but no control to change it, and new sessions and subagents ran at medium. A group offers agents the levels its members have in common (groupEntries), and a member magpie knows doesn't think (Entry.Quiet: its vendor's list says no reasoning) counted as having none, so the intersection came out empty. The group still reasons when one member does, so Codex got its entry with reasoning but no supported_reasoning_levels and no default_reasoning_level: no slider, and Codex's own medium. Since #950 the gateway sends such a member no reasoning ask at all (withoutReasoningAsk, quiet.go), as it does a reasonless one ( |
||
|
|
778000326a |
gui: the sidebar sets off from rest and settles in a third of a second, as a Mac's does (wangye1644294 on X)
wangye1644294 (Windows, zh-CN, sidebar layout) found collapsing and
expanding the sidebar stiff. The morph ran .5s on cubic-bezier(.32,.72,0,1),
the spring the sidebar's lists open on. That curve leaves at speed: 8% of
the travel in the first frame, 92% by 184ms, then a 300ms creep. The frames
a webview drops as the view transition's pictures start to move (WebView2's
most) landed where the page moves most, and read as a jerk, followed by a
long tail.
The view-transition group, side-out and side-in animations now share
--morph-t (.32s) and --morph-ease (cubic-bezier(.42,0,.58,1), the Mac's
ease-in-ease-out). Largest per-frame step drops from 13.7% to 9% of the
travel, and the start, where frames drop, barely moves. End states,
reduced motion (no transition), Linux (no transition) and the 1500ms stuck
cut-off are unchanged. The other .32,.72,0,1 uses in app.js (lists, iOS
sheet, nav) are other animations and are left alone.
side-toggle.test.cjs now reads the running animations' computed timing:
the page, nav-usage group and side-out each last 250-350ms and their curve
starts from rest (x1>0, y1=0).
Measured (page card edge, 188px travel):
- Real WebView2 on the Windows box (Edge 155.0.4283.45, 125Hz, 1349x1128,
DPR 1.1), 12 toggles each over CDP, a temporary build with
AdditionalBrowserArgs (not committed):
old: 63-67 frames over ~503ms, first step 7-8px, max step 14px, one 39px
jump from frames dropped at the start
new: 42-44 frames over 320-328ms, first step 0px, max step 9px, no long
frames
- Mac, headed Chromium, ffmpeg avfoundation 60fps + mpdecimate, 3 rounds
alternating:
old: 25-27 changed frames over ~500ms, 4-7 gaps per toggle, first
visible step 19-54px
new: 14-20 changed frames over ~333ms, 0-5 gaps, first visible step
4-18px (a busy shared desktop makes the gap counts noisy)
Run: side-toggle, side-width, header-centre in Chromium and WebKit, 44/44
pass (five languages; widths 1023 and 640 included). Broken by hand, each
red in the new test: the old .5s timing ("group(nav-usage) lasts 500ms"),
the old curve at .32s ("sets off from rest: cubic-bezier(0.32, 0.72, 0,
1)"), and side-out alone at .5s ("old(side) lasts 500ms").
No Go changed, so no gofmt/vet/go test. Not tried: the top-tab-bar layout
on Windows (it has no sidebar morph; covered by the existing tests), and
the reporter's own machine.
|
||
|
|
bfef5d51b5 |
gui: Routing is back to v0.1.1231's layout; reverts dae2618ad (#1354)
v0.1.1233 shipped community PR #1354 ( |
||
|
|
60fa582c80 |
gateway: a try is queued only for the time it stood in its lane's queue or waited for its minute, so a provider with no limit never reads as queued (#2153)
TestSentTellsMagpieFromEarlierTries failed on a loaded Mac with
"queued 1" for a provider with no MaxConcurrency and no MaxRPM. queued
was time.Since(waited) around the whole block: keepQueued's goroutine
starting, lanes.take, rpms.wait, and queuedAlive() waiting for that
goroutine to end. With no limit take returns at once, but starting and
stopping the keepalive goroutine on a busy machine took a millisecond,
and that read as a wait for a slot. Users saw the same: a 1ms "queued"
in a request's detail on a provider with no limit, taken out of
"In magpie".
lanes.take now answers how long it stood in the queue (0 on the fast
path, with no limit or a slot free), rpms.wait already answers how long
it waited for its minute, and queued is their sum. A lane wait that ends
in errQueueWait or the agent leaving still counts its time, which
laneMessage's "waited %.1fs" uses.
Reproduced by injecting a 3ms sleep at the end of keepQueued's stop
func: on the old code the test failed ("queued 7"); with the change it
passes with the sleep still in. The sleep is not committed.
Run: go test -tags nogui -count=1 ./internal/gateway/ (full package,
ok, 1833s on a machine at load ~220); gofmt; go vet darwin,
GOOS=linux -tags nogui, GOOS=windows. Not tried: -race on the full
package.
|
||
|
|
4faa931325 |
provider: Vertex AI's preset offers Gemini 4 Argon at global, and its test asks it at low (#2155, TomXPRIME)
Gemini 4 Argon went live on Vertex AI's global location on 2026-10-13
(gemini-4-argon), and the preset's fixed list (Vertex has no list to ask)
didn't have it, so a fetch never showed it. It is added to the preset's
models, which are global's; us, eu and the regions are left as they
answered on 2026-10-06, since nothing says Argon is served there (typed
in by hand it still goes).
Its metadata (1,048,576 context, 65,536 output, low/medium/high, $2/$10)
comes from models.dev's google-vertex entry, which lists it as of today,
so nothing is hard-coded here. The gateway already tells Gemini 4 a
thinking level at the level asked (
|
||
|
|
50929661fe |
provider: a moved Devin gets plugin 0.1.16, where SWE-2 isn't held by a used-up quota
太陽と向日葵 on magpie's Discord: SWE-2 is free, but with the Devin account's quota used up magpie said so and didn't route SWE-2 to it, while a model test worked. The plugin's "1 day" and "7 days" windows named no models, so a full window held the account for every model. @magpie-community/opencode-devin-auth 0.1.16 (plugins cff78b3) reads Devin's model_cost_tier from GetCliModelConfigs: SWE-2's variants are its Free tier, the only ones of 262. It gives the day and week windows notModels with their ids (quotaOfPlugin's idSet then leaves them out) and lists them free: true (catalog Free, so PaidBesideFree rests only a paid model on a quota refusal). Raising the mover's min updates moved users. Run: gofmt -l; go vet for darwin, GOOS=linux -tags nogui and GOOS=windows on internal/provider; go test -timeout 30m ./internal/provider in a sandbox HOME, ok in 691s (the default 10m timed out at load average ~300, other sessions' test binaries running). npm view @magpie-community/opencode-devin-auth@0.1.16 --registry https://registry.npmjs.org --prefer-online returns 0.1.16. Not tried: an account with its quota really used up, nor the moved plugin end to end through a gateway. |
||
|
|
7d4ad7c628 |
gui: the menu bar's total is every token, cache too, marked Σ, as the Requests tab sums it (NextCommit)
NextCommit on Discord: the menu bar's usage showed only input tokens, and
more input than the Usage page. It showed input + output, unlabelled, so
it read as the input and came out above the page's input. And it was summed
as the Overview sums (usage.SummarizeTop: the gateway's calls only, cache
aside), while a click opens the panel's Usage tab, which sums the ledger
(the agents' own session-file calls too) and counts the cache's tokens
in its Tokens. Two numbers under one name.
- trayTotalSum is the ledger's cached sum, usage.QueryPage(p, {}, 0, 1).Sum,
the one the panel's Usage tab and the window's Requests tab show.
- The cell's top row is every token (in + out + cache read + write, as
allTokens) prefixed Σ; the cost stays under it. The tooltip spells out
"N tokens (a in · b out · c cached)".
- With the window as the tray's, a click opens the Requests tab at the
period (quotaView), not the Overview, which sums differently.
- docs/reference.md and gui-shell.md say so.
Run:
- TestTrayTotalIsTheLedgers (new): a Codex session-file call of 1000 in,
200 out, 8000 cache read; the menu bar's sum equals ledgerPage's and the
cell reads Σ9.2K. With trayTotalSum put back to SummarizeTop it fails
(menu bar all zeros, ledger 1 call).
- TestTrayTotals/BesideCards updated for Σ, the cache and tab=requests.
- go test -tags nogui ./internal/gui (sandbox HOME via the package): ok.
- tray-totals, tray-usages, tray-cell-click .test.cjs, chromium and
webkit, five languages, 1100 and 420: 70 pass.
- The Mac cell rendered with trayImagePNG and looked at: "Σ6.3M" over
"$3.40", "Σ47M" alone, both inside the row width.
- gofmt -l, go vet darwin, GOOS=linux -tags nogui, GOOS=windows; builds.
Not tried: the real menu bar on the reporter's data.
|
||
|
|
bda271999f |
gui: the desktop window saving an allow list is this computer, not 192.0.2.1 (Mathresearcher)
Settings › Allowed addresses in the desktop app refused a list with "that allow list would shut out 192.0.2.1, the address this page is open from" (Mathresearcher on Discord). The window's requests reach the API through Wails' asset server, which has no peer address and fills in 192.0.2.1:1234 (TEST-NET-1; assetserver_webview.go in wails v3 beta.24). KeepsOut took that for the page's address. The asset handler handed to Wails is now wrapped in ownWindow, which marks its requests as loopback: only the webview reaches it, never the network. magpie web (web.go, AllowGuard) is unchanged and still judges the real peer. Run: - TestAllowIPsFromTheAppWindow (new): posts ["10.0.0.0/8"] with RemoteAddr 192.0.2.1:1234 through ownWindow(Handler). With ownWindow's rewrite taken out it fails (refused, saved []); with it, passes. - go test -tags nogui -run TestAllowIPs ./internal/gui: ok. - gofmt -l, go vet (darwin), GOOS=linux -tags nogui and GOOS=windows vet of internal/gui and internal/gateway; go build for all three. Not tried: saving the list in a real desktop window (not launched). |
||
|
|
3ec45e7155 |
gateway: a json_schema an upstream turns away is asked for as a JSON object, the schema in the system prompt, before the format is told in words alone (#2126)
klarkxy's Codex on Xiaomi MiMo's Token Plan got back "text.format type
'json_schema' is not supported, only 'text' and 'json_object' are
supported" and the turn ended there. Codex's /responses reaches the
upstream by passthrough when the protocols match, and passthrough never
looked at a format refusal; the translated path did, but only by moving
the whole format into the system prompt, which drops the object
requirement the vendor would have kept.
Now, on either path, a json_schema the upstream turns away is asked
again as {"type":"json_object"} with the schema appended to the system
prompt (Responses instructions, Chat's first system/developer message,
Anthropic system). If json_object is turned away too, the format field
goes and only the words stay. Each step is remembered per provider,
model and protocol once a request with it is taken, so later turns go
out already rewritten. Anthropic's output_config.format has no object
mode, so it goes straight to words. DeepSeek, which takes json_object
only, gains the same middle step on the translated path.
Run:
- format_refused_test.go, new:
- TestPassthroughSchemaRefusedAskedAsObject replays the reporter's
exact error and probe body through /backend-api/codex/responses.
It covers object taken (2 asks, then json_object) and object refused
too (3 asks, then no format). Turn 2 is checked to take 1 ask, the
instructions to keep "You are Codex." first, and the input to be
unchanged.
- TestPassthroughFormatRefusedChatAndAnthropic.
- TestRefusedFormatToldInWords was rewritten for both outcomes on the
translated path.
- Break check: with the old gateway.go, the passthrough test gets back
the reporter's exact error.
- gofmt -l is clean. go vet passes for darwin, GOOS=linux -tags nogui
and GOOS=windows. go test ./internal/gateway/ -count=1 is ok (1017s).
Not tried: a real Xiaomi MiMo key (none here; the error envelope is
assumed to be OpenAI's), and Gemini passthrough, which has no rewrite.
|
||
|
|
3e812ebde4 |
gateway: a provider that refuses a tool_result holding only tool_reference blocks gets them said as text too (#2124)
OpenDesign's Anthropic-compatible endpoint answers 422 "messages[4]:
missing field `content`" when a ToolSearch result carries only
tool_reference blocks, so every Claude Code turn after a deferred tool
loaded failed there.
The fix is a learned shape, scoped to the provider that refuses it, like
the deferred-tools one: refuseShapes marks shapeRefsOnly when a 400/422
says "missing field `content`" and the request held such a result, and
withoutRefusedShapes then puts a text block ("Tool X is loaded and can be
called now.") before the references in each refs-only tool_result,
keeping the references. Every Anthropic upstream route goes through
forward/forwardOnce, so /v1/messages, count_tokens and a group's member
all get it; a provider that takes the references unchanged never sees the
text. Requests translated to another API already rendered a reference as
text in stringOrText; it now uses the same sentence (toolLoadedText).
Run:
- TestRefsOnlyToolResultRefusedGetsText (fake vendor answering the
reporter's 422 bytes, body from the reporter's repro.json): first ask
refused, retried with the text; group member and count_tokens get it at
once afterwards; a provider that takes them sees bare references.
- TestRefsSaidLeavesOtherResults: other results unchanged, two refs.
- Break checks: with the mark off, and with the mend off, the test fails
with "status 422 ... missing field `content`".
- go test -tags nogui ./internal/gateway/ -count=1: ok (1069s, loaded
machine; a first run with the default 10m timeout timed out under load).
- gofmt -l; go vet darwin, GOOS=linux -tags nogui, GOOS=windows.
Not tried: the real OpenDesign endpoint (no key); the fake follows the
reporter's own curl evidence.
|
||
|
|
54a2b0d05f |
gui: a provider kept for its usage alone is one click, Usage only, and its card says so (#2068, keleus)
keleus wanted a subscription's quota in the status bar without anything routed to it. That has existed since #1818 (noModels), but getting there took Picked only, then Select none, then Save, and the card then just said "no models exposed". The models' serves control now has a third option, Usage only: no picks, noModels on, nothing routed, balance and usage still read, models the vendor lists later not added. The card's line says "usage only" for such a provider. Picked only with none picked used to be the same state under another name; it now starts from the models the vendor's list serves (the dashed ones), so each of the three options is a state of its own. Unpicking the last pick still leaves none (#1831), which now reads as Usage only. Strings in en, zh, zh-TW, ja, de; the old Picked only tooltip's second half moved to Usage only's. Decision (owner delegated product calls): name the state rather than document the path; the backend, CLI (`magpie provider models <id> none`) and saved files are unchanged. Run: provider-none-picked.test.cjs and i18n-keys.test.cjs, Chromium and WebKit, 5 languages, 1100 and 420 wide: 33/33. With app.js put back, provider-none-picked fails ("+ 'Picked only' - 'Usage only'"). The test's saved-as-none fixture now has its models off, as /api/providers sends them (Exposed is empty for it). No Go changed. Not run: the whole GUI suite (no shared selector or API added). |
||
|
|
1a5128747b |
cli: magpie provider refresh-every and auto-include set a list's schedule and rules (#2135)
`magpie provider refresh-every <id> 6h|1d|off` and `magpie provider auto-include <id> 'gpt-*' 're:claude-.*'|none` set the fields the previous commit added; `magpie provider <id>` shows them, and `magpie provider refresh` prints the models its rules took. TestRefreshEveryAndAutoIncludeCmds: a too-short or unreadable time and a plain id as a rule are refused, the rule takes the current matches, and none/off clear both while keeping the picks. Run with the go test in the previous commit's body. |
||
|
|
ee4a7ab471 |
provider: a provider of your own can fetch its model list on a schedule and take newly listed models by rule (#2135, tianxia3111)
tianxia3111 runs a headless `magpie serve` with relays of 10–70 models. A model the relay adds never reached the list until Fetch models was clicked, and was then picked by hand. - RefreshEvery (a Go duration or Nd, at least 10m): the gateway (KeepListsFresh, started beside KeepPluginsListed, so serve and the app) looks each minute and fetches a list once Fetched is that old, through the same Refetch as Fetch models, so dropped models leave the picks exactly as they do there. A failure waits min(every, 15m). - AutoInclude (globs with *, or re: patterns, the same ones routing groups read; a plain id is refused): RefetchTaking adds a model the fetch newly lists that a rule matches. It starts from what is served now (Exposed), so nothing served is removed, and a model the user unticks stays out because it isn't new to the next fetch. Setting the rules takes the current list's matches. Rules only ever add. - Only providers of the user's own take them: an account's list is fetched for it, and a plugin's by the plugin. - Every save keeps them, the window's editor (/api/provider/save) among them, which has no fields for them yet. Tests (each fails without the change, broken by hand and watched go red: GUI keep line removed, takeMatching skipped, retry guard removed): TestAutoIncludeTakesNewlyListedMatches, ...KeepsWhatIsServedWithNothingPicked, ...RefusesWhatIsNoRule, TestParseRefreshEvery, TestKeepListsFreshFetchesWhatIsDue, TestSaveKeepsTheListsScheduleAndRules, gui TestProviderSaveKeepsListScheduleAndRules. Run: gofmt -l; go vet ./... (darwin), GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./...; go test internal/provider internal/gui internal/gateway internal/cli with pipefail in a sandbox HOME. Not tried against a real relay; the GUI editor fields are not added. |
||
|
|
00afcf97a1 |
provider, gui, cli: a Codex account's auto-use of its resets is two switches, its week used up and one about to expire (#2078, alanwalk)
alanwalk asked for "自动使用重置卡" to be split: they want a reset that is
about to expire used rather than lost, but a used-up week waited out rather
than spending a reset on it (and the other way round for others).
What changed:
- settings: codexAutoResetOnly narrows an account in codexAutoReset to
"week" or "expiring". An account with no entry keeps both, so every
existing config means what it meant: nothing to migrate, and no user
value is rewritten. Load drops entries for accounts not in the list or
with an unknown value.
- provider: CodexAutoResetWhen(user) reads both times. AutoUseCodexReset
(the week used up, called from the gateway's autoReset and
autoResetSignedIn through AutoResetsWeek) only acts when the week is on;
SpendExpiringCodexResets and routing's resetRunsOut only count on the
expiring reset when that is on. SetCodexAutoResetCase(user, when, on)
sets one time and keeps the other; SetCodexAutoReset still sets both.
Both off removes the account.
- gateway: POST /api/settings/codex-auto-reset takes an optional "when";
POST /api/settings keeps codexAutoResetOnly, which the page doesn't send.
- GUI: the account's card (Usage page and the menu bar panel) says
"Auto-use resets:" with each time on its own line and its own switch;
the brief account's one switch still sets both, its title naming each
time; Settings › Usage gives each account an Off/On per time. The status
line says which times are on now. "· auto-used before it expires" on
the resets held follows the expiring switch alone. Strings in zh, zh-TW,
ja and de.
- CLI/TUI: `magpie quota auto-reset <account> week|expiring on|off`; the
quota and accounts tables and the TUI say "auto", "auto when the week
runs out" or "auto before one expires".
What was run (worktree on origin/main
|
||
|
|
4f08533e86 |
agent: an update that exits 0 but leaves the CLI unable to run is mended once, else said as failed (#2128, leozejia)
The reporter clicked Update all. npm 11.19.0 ran
`npm install -g --prefix /opt/homebrew @anthropic-ai/claude-code@latest`,
logged "reify failed optional dependency …claude-code-darwin-arm64" and
exited 0. Claude Code 2.1.299's postinstall soft-fails without its native
package, so bin/claude.exe was left as the stub that says "Error: claude
native binary not installed." and exits 1. UpdateCLI saw npm succeed and
read the new version from package.json (proc.Version never runs an npm
CLI), so the update was reported as done.
Now, after an update that succeeds, UpdateCLI runs `<cli> --version` once
(runsBroken). It uses a 30s timeout, the update's env (npm's folder first
on PATH) and no stdin. Only a run that exits non-zero and prints no version
counts as broken. A run that didn't start, timed out, or exited 127
(interpreter not found) is unknown, not broken.
- npm installs that magpie runs as the user: the version just installed is
installed once more with --include=optional, which is how the reporter
mended theirs, and the check runs again.
- npm installs needing administrator rights get no second prompt.
- If the CLI still fails, or it was installed some other way (bun, pnpm,
brew, self), the update fails. The message carries what the CLI said and
how to reinstall it, e.g. `npm install -g --prefix /opt/homebrew
@anthropic-ai/claude-code@2.1.299 --include=optional`.
Both Update all and a row's Update pill go through UpdateCLI, so both are
covered. The GUI already shows an update's error, so it is unchanged.
What was run:
- TestUpdateCLIChecksItRuns: a fake Homebrew prefix with Claude Code's
package and the stub as the reporter found them. It covers the update
mended by the second install, a working update that runs nothing more,
and an update left broken that fails with the reinstall command. With
the check disabled it fails ("not mended: <nil>").
- TestRunsBrokenOnlyWhenSure: a version said with a non-zero exit, exit 127
and a silent exit 0 are not broken.
- gofmt -l; go vet for darwin, linux (nogui) and windows.
- go test ./internal/agent/ -timeout 45m passes (856s). The first run hit
the default 10m timeout at load ~290 while in TestOmo, with no failure.
- go test ./internal/proc/ passes, TestNoCommandBypassesProc included.
Not tried: a real npm install that drops the native package, and Windows,
where the new tests skip because their CLIs are shell scripts.
|
||
|
|
26d11fb78f |
gui: a quota curve's tooltip follows colorblind mode as soon as it changes, not at the next redraw (#2073)
The colorblind patch set the curve's tooltip only when box.draw ran, so with the mode turned off elsewhere (another window, read on focus) a curve on screen kept the "dash shown beside its name" text until the next state redraw. quota-curve's colorblind test caught it 1 time in 10 (webkit zh), and also read the curve while a state poll begun before the change could still answer with the mode on (chromium zh-TW: the even pace still dotted). applyPrefs now sets the tooltip again on every drawn quota curve when the mode changes (quotaCurveTitle, shared with box.draw). The test checks the tooltip matches the mode right after it changes, then waits for the plain curve rather than reading once. Run (playwright 1.62.0, chromium and webkit, the test's 5 languages and widths): api-key-theme, balance-*, context-*, gui-de/ja/zh-tw, i18n-keys, omarchy, quota-*, seg*, settings-*, usage-ledger*: 651/651. Taking the applyPrefs line out turns the colorblind test red (chromium en, ja). Not tried: the real Wails window. |
||
|
|
5fc2f87d13 |
gui: in colorblind mode a quota legend key is its window's dash, the even paces are dotted, and the balance curve and the good grade keep their look (#2073)
A review of db25c4ee found that colorblind mode reached past the quota
curve and that its legend shapes matched nothing on the plot:
- The fallback rules `.qc-line:not([data-series="0"])...` and the
matching `.qc-key` rule also matched elements with no data-series, so
the balance curve's solid line became dashed like its fitted line, and
its legend dot became a ring in var(--c4) while the line was var(--c1).
- A filled circle, hollow square or diamond in the legend appeared
nowhere on the plot, so it didn't tell a reader which line was which.
Series 3 and up shared one dash and one shape.
- The 7-day line's 6 2.5 dash sat beside its own 3 3 dashed even pace in
the same colour, while the tooltip still said "Solid: what was left.
Dashed: an even pace".
- The Context tab's "good" grade took var(--c2), which the palette turns
amber, next to "fair" in --amber (dark #fbbf24 vs #f2b544).
- omarchy.css made the first legend dot round with colorblind mode off.
- The legend set its colour twice (--sw and background) and undid it
with !important.
Now, with colorblind mode on:
- drawQuotaPlot tags each window's path.qc-line and line.qc-even with
data-series (its index mod 7, the same slot as its colour), and the
quota legend tags its key. Seven dash patterns, one per slot, apply to
`:is(.qc-line, .qc-dash)[data-series=N]`, so a line and its key can't
drift apart. Nothing else sets data-series, so the balance curve is as
on main.
- Each quota legend key shows a 22px sample of its window's line
(svg.qc-sample > line.qc-dash) in place of the dot; with the mode off
the sample is hidden and the dot is as on main.
- The even paces are dotted (0 4, round caps), unlike every window's
dash; the curve's tooltip, set in box.draw, says "Each window's line
has the dash shown beside its name. Dotted: an even pace, ..." in en,
zh, zh-TW, ja and de.
- `.ctx-ring.good` / `.ctx-grade-word.good` take --c1, the palette's
blue.
- omarchy.css is back to main's; the legend's `--sw` and !important are
gone.
- The Settings note now says what the mode does ("Colorblind-safe chart
colors, and each allowance window's line in a dash of its own"), and
gui-shell.md says the note is the Off/On control's tooltip, as the
code has it.
Run on db25c4ee + this change (upstream/main
|
||
|
|
a7a38193f5 |
gui, settings: colorblind mode for quota curves and chart series (#2073)
In Usage -> Allowances, the 5-hour and weekly quota curves and their
legend dots took --c1 and --c2, which are both shades of blue in light
(#4f46e5, #0ea5e9) and dark (#a5b4fc, #7dd3fc) themes, with identical
solid lines and 7px round dots and the 5-hour line dimmed to .45 over a
week (#2073, chenlz22550).
- settings.Colorblind ("colorblind" in settings.json), passed in GET
/boot.js when on and applied before first paint by theme.js and on
every state/settings read by applyPrefs as data-colorblind="1" on
:root.
- Settings -> General adds a Colorblind mode row (#colorblindRow,
#colorblindSegs) under Appearance, in en, zh, zh-TW, ja and de.
- Under :root[data-colorblind="1"], --c1...--c7 switch to an Okabe-Ito
qualitative palette in both light and dark themes so adjacent series
differ in hue and lightness across quota curves, tray sparklines, the
usage ledger and context charts.
- drawQuotaPlot and quotaCurve's drawLegend tag each series with
data-series on path.qc-line and .qc-key; in colorblind mode series 0
and series 1+ use distinct stroke-dasharray patterns and legend swatch
shapes (filled circle vs hollow square/diamond), and .qc-line.qc-short
keeps .85 opacity so short windows stay legible over a weekly span.
- docs/subsystems/gui-shell.md documents the boot and Settings contract.
Run (on origin/main
|
||
|
|
9a0d723d4d |
gateway: a request whose kept-alive connection was dropped is sent again at once on a new one, not failed as a 502 and asked after a pause (#2136, jiangkoumo)
The reporter's Pi -> Codex routes showed "POST …: EOF" and "write:
broken pipe" before any reply, each answered as a 502 and asked again
after retryPause. Both are a kept-alive connection to the vendor that a
proxy (Clash here) or the vendor's front closed while it sat idle: the
request is written into it and the read finds EOF. Go's Transport sends
such a request again on a new connection by itself, but only when it
counts as replayable, and a POST doesn't unless it carries an
Idempotency-Key or X-Idempotency-Key header.
upstreamTransport is now wrapped in replayable, which marks every
upstream request with a body Go can send again (GetBody set) with
X-Idempotency-Key = nil: Go's mark, never written on the wire, so no
vendor sees a new header. Go only replays a request on a reused
connection when nothing came back on it, so a cut mid-reply is not
replayed (that stays the retry loop's, as before).
Run:
- TestDroppedKeepAliveIsAskedAgainAtOnce (new): a raw TCP fake answers a
connection's first request and drops it on the second. Without the fix
it fails: "the dropped connection took 2 tries (502 Post …: EOF; 200 ),
want 1". With it, passes, also -race -count=3 and -count=10.
- Broken by hand: giving the header a value fails on "the vendor was
sent an X-Idempotency-Key".
- go test -tags nogui -count=1 ./internal/gateway/ ./internal/netproxy/:
netproxy ok; gateway all pass but TestSentTellsMagpieFromEarlierTries
("queued 1" under load; passes 10/10 alone with and without this
change). Filed as #2153 with its cause.
- gofmt -l, go vet darwin, GOOS=linux -tags nogui, GOOS=windows; go build
for darwin, linux (nogui), windows.
Not tried: real Codex through Clash; the mid-reply "unexpected EOF"
after reasoning had flowed is not changed by this (see #2136 reply).
|
||
|
|
8e2c1bd2a4 |
tui: u on the Usage page follows the app's "how much is left", and writes it back (#1070)
The TUI read Settings' quotaLeft nowhere: a user who had picked "left" in the app saw the used share on every start, and u only turned it in memory. newModel now seeds qleft from settings.QuotaLeft, and u saves the pick through the same Load/Save pair POST /api/settings/quota-left uses. TryWorld2026's yetone/magpie#1070 (head 91430684e), squashed onto main by hand: GitHub couldn't merge it, as usage_test.go conflicts with #1856's TestUsagePageSaysCallsUnpriced appended at the same spot. Both tests kept. Run: gofmt -l; go vet ./internal/tui for darwin, and -tags nogui for darwin, linux, windows; go test -count=1 ./internal/tui ok. Main's pages.go fails TestQleftWritesBack, main's tui.go fails TestQleftSeededFromSettings. Real use: magpie tui (nogui build) in tmux under a sandbox HOME, starting from settings.json quotaLeft true; on Usage, u wrote false, u again wrote true. Not tried: the headline line (no subscription accounts in the sandbox), and a running tray following a TUI change before its next refresh. Co-authored-by: TryWorld <tryworld@foxmail.com> |
||
|
|
1c98e0d7e8 |
sessions: the Routing page names a PI-Desktop chat by its PI-Desktop title (#1967)
PI-Desktop sends its chats through magpie with X-Magpie-Session, and keeps their names only in its own pi.sqlite. |
||
|
|
536b15a8e9 |
gui: Settings › Proxy has a Test that says whether requests leave through it (#2076)
c4ex: the proxy setting gave no way to see whether it takes effect, and
suggested asking a Cloudflare address.
What changed:
- POST /api/proxy/check (proxycheck.go) asks Cloudflare's trace page
(www.cloudflare.com/cdn-cgi/trace) twice at once, 10s each: once as a
vendor request without a proxy of its own goes (http.DefaultClient,
netproxy's Settings / *_PROXY / system proxy), once direct
(netproxy.With "direct"). Each answer is the ip= and loc= Cloudflare saw,
and the ms. With no proxy in force (source off/none) only the direct one
is made. The proxy is reported redacted (Describe); a failure's text has
user:password taken out.
- The Proxy row gets a Test button; the result goes on a line under the
row's text: works (two addresses), the same address both ways (shown as
a failure: the proxy isn't taking the requests), the proxy failing (with
the direct address), no proxy in force, the check failing. Testing… while
it runs; the result outlives a redraw and goes when the proxy changes.
Strings in zh, zh-TW, ja, de.
Decision (delegated): compare against a direct request rather than only
show the proxied address, since an address alone can't say whether the
proxy was used; Cloudflare's trace page as the reporter suggested (plain
text, no account, served worldwide).
Run:
- go test ./internal/gui -run TestProxyCheck: 5 tests (proxy vs direct;
no proxy asks only direct; a refusing proxy, password not in the error;
a page with no ip= fails; ALL_PROXY global proxy is gone around for the
direct leg). All loopback/.invalid, nothing leaves the machine. Broke
the direct leg's With("direct"): the global-proxy test goes red ("the
proxy asked 2 times").
- go test ./internal/gui -count=1: all pass except TestMainWindowCorners,
the load red filed as #1936 (same on origin/main).
- New proxy-test.test.cjs (5 languages x 1100/420, 6 cases each): chromium
11/11, webkit 11/11; with the same-address branch broken 0/11.
- proxy-test, settings-proxy-auth, proxy-own-wording, i18n-keys and six
settings-* tests: chromium 63/63; webkit 62/63, the red being
settings-proxy-auth zh once under the 2-wide run; it passed alone 5/5
and three more 2-wide runs with proxy-test 3x0 fails (noted on #2142).
- gofmt -l clean; go vet darwin, linux -tags nogui, windows clean.
Tried: checkProxy against the real www.cloudflare.com trace page, direct
leg only, from a temporary test (not committed): ip and loc read, 1.2s.
Not tried: a real proxy (Settings, *_PROXY or system) through to it.
|
||
|
|
b2d558db97 |
gui: on the Mac the quick panel opens over a full-screen app, on the Space the user is on, not on the desktop it was first shown on (#2141)
With Chrome full screen and Settings > Click the tray icon set to the quick panel, a click on the menu bar icon flashed the icon and showed the panel on the non-full-screen desktop instead, out of sight until the user swiped back (witt-bit, macOS 27.0.1, v0.1.1230). The panel's window had no collection behaviour of its own, so Wails gave it FullScreenPrimary alone: an ordinary window, kept on the Space it was first ordered in on, and not allowed on a full-screen app's Space. It now has CanJoinAllSpaces | FullScreenAuxiliary, as a menu bar extra's panel (and Wails' own notch window) does, so it is on every Space, full-screen ones too. It never moves to the active Space as well (AppKit refuses that pair), and nothing calls setMovesToActiveSpace on it (showHere is the main window's only). The panel lightweight mode makes again takes the same options. Tests: - TestPanelOnEverySpaceOnMac (panel_options_test.go) checks the options. - TestPanelJoinsFullScreenSpaces (AppKit, runAppKit) makes the real panel through panelWin, at start and again after lightweight mode let it go, shows and hides it, and reads NSWindow.collectionBehavior (joinsFullScreenSpaces). - Without the change both fail: "panel collection behaviour 0 is not on every Space and over full-screen ones" and "made at start: the panel isn't on every Space and over full-screen ones". Run: gofmt -l (clean); go vet ./internal/gui/ (darwin), GOOS=linux go vet -tags nogui, GOOS=windows go vet; go build, GOOS=linux go build -tags nogui, GOOS=windows go build; go test ./internal/gui/ under a sandbox HOME with pinned caches. In the package run, at load average ~300-420 from other sessions, two tests unrelated to the panel failed: TestMainWindowCorners (40s deadline killed; fails the same on clean origin/main |
||
|
|
644ad1ed7a |
provider, gui: a model listed only on APIs the provider has no URL for isn't offered to agents, and Select all and Free only leave it (#2094, wangjianjq)
A key provider's live list says which APIs each model is served on (supported_endpoints). Command Code lists its Claude models on /messages only. A provider with just a chat URL still offered them: Select all ticked all 89, the top-24 default took Claude models first, and every request to one failed upstream, because usable() falls back to Speaks() when nothing matches. - provider.NoAPIFor(model): a key provider (not a sign-in, whose APIs come from magpie's own code) has no URL for any API the model is listed on. It uses APIs(), so the user's per-model API in Names & levels wins. A model with no listed APIs is unchanged. - Exposed() drops those models from the picks and from the default before taking the first 24, so Catalog() and agents' lists drop them too. - /api/providers sends each model's noAPI and the key provider's speaks. In the editor, Select all, Free only and the dashed default chips skip them. Their chips are dimmed with a tooltip that names the provider and says how to fix it. A model the user picked before stays picked (dimmed), so saving doesn't drop it. Tests that fail without the change: - TestExposedOnlyOnTheAPIsTheProviderHas serves testdata/commandcode_models.json (the real list) to providers with chat+responses, anthropic only and all three URLs. On the old code it fails "with none picked, exposed claude-sonnet-5-5", "with every model picked, exposed 87, want 77". - TestExposedKeepsTheUsersAPIAndUnlistedAPIs: the user's API override and unlisted models. - models-select-all-api.test.cjs: chromium and webkit, en/zh/zh-TW/ja/de, 1100 and 420, 20/20. It fails with app.js stashed, and with only the Select all filter removed. Run: gofmt; go vet darwin, GOOS=linux -tags nogui and windows for provider, gui, gateway and cli; go test provider, gui, cli, gateway and tui in a sandbox HOME, all ok except gui's TestMainWindowCorners (#1936, killed at its 40s deadline at load ~380, fails alone too) and TestSetAnswersWhileDevinAndProvidersHang (#1375, passes alone 3/3). 44 related GUI test files: 463/465. The red was quota-reads webkit de 360 under load, filed as #2150, passes alone 3/3. Not tried: a real Command Code key end to end. The owner's Command Code is a sign-in, which this filter skips on purpose. The live unauthenticated list (89 models: 11 /messages, 70 chat+responses, 8 chat) has the testdata's shape. |
||
|
|
3b6ca05571 |
gateway: /v1/magpie/concurrency tells the whole gateway's requests in flight, waiting and tool turns, 0 when idle, with or without a limit (#2132, bigbitbox)
A status bar (SketchyBar) polling /v1/magpie/concurrency got
{"data":{},"object":"concurrency"} with no limit set: the lanes hold only
keys and accounts with a limit, so an idle gateway and a busy one with no
limits read the same. The answer now carries, beside data:
- requests: Busy().Requests, every agent request in flight, those waiting
for a slot among them; a GET (this poll included) is never counted;
- waiting: how many of those wait for a slot, summed over the lanes;
- tools: Claude subscription turns waiting on their caller's tool results.
Each is 0 when idle. Access is unchanged: this machine, another only with a
gateway key, a held key refused (refuseHeld). docs/reference.md says so
beside the usage API.
Run: TestConcurrencyTellsTheWholeGateway (new) fails without the change
("idle: tools = <nil>, want 0 (map[data:map[] object:concurrency])") and
passes with it, -count=5; it covers no limit anywhere (the reporter's
case), and three in flight on a one-slot provider with one waiting.
gofmt -l (nothing); go vet, GOOS=linux go vet -tags nogui, GOOS=windows go
vet on internal/gateway (ok). go test -tags nogui -count=1 ./internal/gateway
in a sandbox HOME: ok in 835s with -timeout 40m (on 0ad9661b6; the default
10m ran out while three other gateway suites ran on this machine), then
the concurrency, busy, held-key and LAN tests -count=3 after rebasing on
|
||
|
|
1015fbab7f |
gui: a part kept in place is put back to the nearest whole pixel, so WebKit's dropped fraction no longer adds up (#1804)
backToReader set scrollTop to a fractional target. WebKit truncates
scrollTop, and the early return let anything under 1px stand, so the
part kept in place (the Routing groups under the live stage) could sit
up to just under a pixel off either way. Two of those apart moved it by
nearly two. routing-steady caught it as "the editor at 334.33, not
332.64": rt-cols grew by 40.72px and the view followed by 40.
A probe of every layout showed it isn't load. Each request's growth
above the groups has its own fraction, and how far they drift depends
only on which fractions happen to come in. Rounding to the nearest
pixel, with a 0.5px early return, keeps the part within half a pixel
of where the reader left it.
Run:
- routing-steady (WebKit, alone, load ~150-170): 8 of 8 green. Without
the change, on
|
||
|
|
63ad2b7c76 |
provider: a moved ZCode updates to plugin 0.1.18, which reads ZCode 3.15's plan key from config.json (#2130)
Plugin zcode 0.1.18 (magpie-community/plugins 5c0aebc, on npm) gives moved
users the built-in's
|
||
|
|
20350dafaf |
gateway, agent, gui: Claude Desktop's subagents can be held to one model, set in its row on the Agents page
Claude Code in a terminal holds every subagent to one model through
CLAUDE_CODE_SUBAGENT_MODEL (its "subagents" field), and Codex through
magpie's own setting (settings.CodexSubagentModel). Claude Desktop runs
its Code tab's Claude Code with CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST=1,
and Claude Code 2.1.295 then ignores CLAUDE_CODE_SUBAGENT_MODEL,
CLAUDE_CODE_SUBAGENT_MODEL_FORCE and the tier variables in its settings
files ("Ignoring … this session's provider routing is managed by the
host"). The env Desktop 2.31226 builds for the Code tab has no key for it
either. So Desktop's subagents ran on the lead's model or on a tier's, and
only the tiers could be picked.
Claude Desktop's row now has a "subagent model" square, the same square
and strings as Codex's. It is magpie's setting
(settings.DesktopSubagentModel), which the gateway applies
(desktopSubagentPick):
- Only a claude-desktop request with x-claude-code-agent-id and tools is
moved: a subagent's turn. The lead's turns, the tool-less helper calls
Claude Code makes inside a subagent (on the haiku tier's model),
terminal Claude Code and every other agent stay as asked.
- It is applied after desktopTurn, the tiers and the groups. A turn
already on the model set isn't marked as moved. Route.Subagent,
Route.Model and the ledger's Requested keep the model asked for; Kind
stays empty.
- The model set must be served by its exact id (Resolve takes any model
name under a provider that is on), enabled, and allowed to a gateway key
held to some models (groupAllowed for a group). Otherwise the subagent
stays on the model asked for and the trace says why, in the reasons
Codex's subagent model already has.
- count_tokens counts on the same model.
- It is read on each request, so Desktop needn't restart. The field is
Live (a new Field flag): /api/set and `magpie <agent> <field> <value>`
leave Desktop's restart notice out after it, unless the pick connected
Desktop. Codex's subagent model is unchanged.
- The getter follows a provider renamed since it was set (RenamedRef).
The setter takes any provider/model or group/<id>, also one not served
now (a restored profile), refuses a bare name, and keeps a Desktop
alias by its catalog id. Options are shown while Desktop is on magpie.
- POST /api/settings keeps it; a stopped WSL distro's field copy keeps
Live.
- The Routing page says why a Desktop subagent was moved or kept
(subagentWhy, for a route with a subagent pick and no kind). "it is
disabled in magpie" gets its zh, zh-TW, ja and de, which Codex's kept
reason lacked as well.
- Unset, the pick costs one held settings read (no body decode, no
catalog build).
Not changed: a Desktop on another computer that reaches magpie with a
named gateway key is read as Claude Code (agentOf), so none of Desktop's
routing applies to it, this included. There is no fallback when the model
set has a smaller window than the lead's.
Verified at this head, on
|
||
|
|
5c458996db |
gateway: a Claude Desktop subagent's turn no longer becomes the session's model, so Desktop's titles stay on the lead's
Desktop's Code tab runs Claude Code, whose subagents send tool turns too,
marked with x-claude-code-agent-id. desktopTurn kept the model of every
request with tools as the session's (claude-desktop.model), so a subagent
on another tier's model (opus picked as a routing group of its own) took
the session's place until the lead's next turn. Titles and unserved
Claude ids asked for in that window went to the subagent's model. In the
reporter's usage log the saved model flipped between the lead's and a
subagent's while both ran.
desktopTurn now takes bySubagent (serve passes subagentOf != "") and
keeps only a lead's turn as the session's model. A subagent's aside or
unserved model still goes to the session's model, as before.
Verified, under a temporary HOME with Go's caches pinned:
- TestDesktopSubagentTurnKeepsSessionPick (desktopTurn) and
TestDesktopSubagentTurnLeavesTitleOnLead (through New().Handler(): a
lead turn on fake/m1, a subagent turn on fake/m2, then Desktop's title
request) pass.
- desktopTurn recording every tool turn again: both FAIL,
`subagent true: picked "fake/m2\n", want "fake/m1"` and
`title after a subagent's turn: sent "m2", want the lead's m1`.
- serve passing false for bySubagent:
TestDesktopSubagentTurnLeavesTitleOnLead FAILs the same way.
- go test -tags nogui ./internal/gateway: ok. gofmt -l: nothing.
- The whole suite, vet and the three builds were run on the next commit,
which contains this one.
Reviewed and re-run by the maintainer on origin/main
|
||
|
|
1d8e83a797 |
provider: ZCode 3.15's GLM Coding Plan key is read from its config.json, so a valid plan no longer reads as "no plan" (#2130, Hanhan758)
ZCode 3.15 keeps no coding plan key in credentials.json any more. The key
it uses is in config.json, at provider["builtin:bigmodel-coding-plan" /
"builtin:zai-coding-plan"].options.apiKey (ZCode 3.15.3's host reads that
value as it is). zcodeOwn found no key, so a signed-in BigModel GLM Coding
Pro account went on to the Start Plan and read as "this account has no GLM
Coding Plan, and ZCode's Start Plan has ended or was never started".
zcodeOwn now falls back to config.json when credentials.json has no key:
Z.ai's first, as before, then BigModel. It also accepts the provider ids
ZCode 3.15 normalizes to (account:*-individual-coding-plan) and a value
written encrypted. A value that isn't a key, such as "{env:...}", is
skipped. A key in credentials.json still comes first, and so does a team
switch.
What was run:
- TestZCodePlanKeyFromConfig uses the reporter's layout: credentials.json
with BigModel sign-in data and no key, and config.json with the key under
builtin:bigmodel-coding-plan. The account reads as GLM Coding Pro with
two windows and never asks the Start Plan. Without the zcode.go change
it fails, with the key empty.
- gofmt -l; go vet for darwin, linux (nogui) and windows.
- go test ./internal/provider/ passes.
Not tried: a real ZCode 3.15 account. The fix rests on the reporter's
account of their config.json, which they verified against the plan
endpoints with the key, and on ZCode 3.15.3's extracted host code.
Moved users get the same fix through the plugin, in a separate commit.
|
||
|
|
c4c3cafa27 |
gateway tests: TestClaudeRunEndsAfterStructuredOutput waits for the bridge to let its runs go, not only their processes
CI's macOS race shard failed it on main at |
||
|
|
d4a9cb5cb0 |
provider: moved WorkBuddy users get plugin 0.1.20, so Claude Code's tool results reach WorkBuddy AI's gemini-3.8-flash (magpie-community/plugins#113)
0.1.20 (plugins a4f8178) resends a chat that gemini-3.8-flash refused with 11153 "the conversation must end with a user message". The resend puts an empty assistant message between the tool results and the user's message. a4f8178's body records the test on the owner's real WorkBuddy AI account. npm view shows 0.1.20 published. Ran: gofmt -l; go vet on darwin, GOOS=linux (nogui) and GOOS=windows for internal/provider; go test -tags nogui -run 'Mov|Migrat|Plugin|Keep|WorkBuddy|WB' ./internal/provider, ok. Not tried: a moved user's live update to 0.1.20 through keepMovedCurrent. |
||
|
|
65a83656d3 |
gui: the tray's quota line is taller and shades its gap to the even burn (#2079)
maidangdang1: the tray card's line of a window's cycle was 16px tall across
the card, so a month read as one straight line lying on its dashes, and
whether it was above them (lasts the cycle) or below (runs out first)
couldn't be told.
What changed:
- quotaSpark draws 30px tall (CSS box 30px, line 1.4px).
- sparkGap shades the area between this cycle's readings and the even burn
(the diagonal from full at start to empty at reset): green where it is
above, amber where it is below, nothing on the far side. Two clipPaths
split one polygon at the diagonal, so a line that crosses it shows both.
Only when the reset is known and the cycle has 2+ readings.
- The spark's tooltip adds the window's Pace (the existing "Pace {n}"
string and quotaPace), so the number is a hover away.
Decision (product call delegated): Edward4226 offered an ETA/balance-axis
branch on the issue. Pace (
|
||
|
|
f70c0525aa |
access, gui, cli: a gateway key's limit can run every N hours, a 5-hour cycle among them (#2102)
A key's limit window was a calendar day, week or month, or every N days (#1509). #2102 asks for a shorter cycle, every 5 hours, like a vendor's own 5-hour window. Limit gains period "hours" with Hours (1..8760), counted in absolute time from Since, as the N-day cycle is; a change to N or from days restarts the cycle, a cap change keeps it, Reset starts a new one. Budget status, the 429's wording ("this 5-hour cycle"), X-Magpie-Limit-Reset, /v1/magpie/limit and a remote magpie's key card carry Hours. The GUI's window menu has "Every N hours" with an Hours field beside it (no native select); the CLI takes `<N>h` (magpie gateway-key limit <id> 5h --tokens 200k). Docs: reference.md and docker.html (en, zh, ja). Strings in zh, zh-TW, ja, de. Run: - go test ./internal/access (TestLimitHoursCycle across NY DST, UTC, UTC+8; TestLimitHoursSetAndReset), -tags nogui ./internal/cli (5h, rejects 0h/8761h/xh/1.5h/hours), ./internal/gateway (TestKeyLimitHoursCycle: 429 and reset header, /v1/magpie/limit, Reserve at the boundary, Reset; remote key card 5h), plus the full access, budget, cli, gateway, provider and gui packages. The gateway package hit go test's 10-minute default once with the load average near 270; rerun with -timeout 40m it passed in 1536s. - Broke cycle() for hours by hand: TestLimitHoursSetAndReset and TestKeyLimitHoursCycle went red; restored. - GUI: gateway-key-cycle (extended with the hours case: menu, field, validation, Save body, badge, Reset confirm, one-column at 500px) in chromium and webkit x en/zh/zh-TW/ja/de, 10/10; i18n-keys, gateway-key-limit, gateway-caller-keys, phone-rows, gateway-keys-off, gateway-own-key, api-key-theme 63/63; an ad-hoc check of the hours editor at 1100 and 420 in both engines and 5 languages (no overflow, screenshots looked at). - gofmt -l; go vet darwin, GOOS=linux -tags nogui, GOOS=windows. Not tried: a real gateway under load across a 5-hour boundary; the Windows box. |