ac4af582301a4e8a29245dbba767eba31334ddf9
6816
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
d1c485f7e9 |
agent: a model at max without xhigh tells Claude Code it has xhigh, so Ultracode shows on GLM, DeepSeek and Kimi in Claude Desktop
leesunrise2364 on Discord: Claude Desktop on magpie has no Ultracode effort,
which cc-switch had, and Ultracode is what turns on dynamic workflows.
Desktop 2.7032.0 shows Ultracode only when the model's effort options
include xhigh and Claude Code takes it. magpie lists a model with known
levels to Desktop as mythos-magpie-<n>, whose options include xhigh, and
tells Claude Code what each model can do in CLAUDE_CODE_MODEL_CAPABILITIES.
That value said only the levels magpie knows the model has. GLM-5.3
(low/high/max), DeepSeek V4 (high/max), Kimi K3 and the like reach max
without xhigh, so they were written as "effort,max_effort", and Claude Code
refuses Ultracode there: "Ultracode isn't available on <model>". cc-switch
names its models as real Claude ids, which Claude Code already knows have
xhigh.
A model Claude Code doesn't know whose levels reach max now also gets
xhigh_effort. The gateway already runs xhigh at max for such a model
(fitEffort: a tie goes up), so no level the model doesn't take is sent.
Claude models Claude Code knows are unchanged: Opus and Sonnet 4.6 still
get no xhigh, as Claude Code's own table has it. Models that top out at
high, or have no known levels, are unchanged too.
Tests: TestClaudeModelCapabilities gets v/glm (low/high/max) and v/top
(high/max), both now "effort,xhigh_effort,max_effort", while
v/claude-opus-4-6 stays "effort,max_effort". TestClaudeCapabilitiesSync's
w/b (low/max) now has xhigh_effort. TestFitEffort covers xhigh to
[high,max] going out as max. With the change turned off by hand, both
agent tests go red on exactly those values.
Run:
- Real Claude Code 2.1.299 in a sandbox HOME, gateway mode
(CLAUDE_CODE_USE_GATEWAY=1), `-p '/effort ultracode'`, with the value
magpie's own code wrote for v/glm-5.3 at low/high/max
("v/glm-5.3=effort,xhigh_effort,max_effort") printed "Ultracode on (this
session only): dynamic workflows on every task". The old value
"effort,max_effort" printed "Ultracode isn't available on v/glm-5.3".
The same pair was run for Desktop's id mythos-magpie-7, with the same
two results.
- gofmt -l is clean. go vet passes for darwin, GOOS=linux -tags nogui and
GOOS=windows.
- go test ./internal/agent passes when run alone (1110s at load ~250),
and so do the caps and fitEffort tests.
- The full go test ./... ran twice at load average ~300.
- The first run hit internal/provider's 10m timeout (#2051).
- The second run (-timeout 30m) had these reds:
- internal/agent and internal/gateway passed 30m as whole packages;
- TestAgentGoneInTheRetryPause/last_one_left (#2175's sibling);
- TestMainWindowCorners was killed at its deadline (#1936).
- None of these is in code this commit touches.
Not tried: a live Claude Desktop. The packaged app won't start on a
sandbox user-data dir, and the live Desktop config is not to be touched.
So Desktop's effort menu showing Ultracode was not seen. It rests on
Desktop's renderer code (the Ultracode gate needs xhigh among the options
and the claude_code_workflows capability) and on the Claude Code probe
above.
|
||
|
|
22512cde53 |
provider, gateway: rest-cap off never rests a provider's keys after an unknown failure (Kismet Alan on Discord)
A relay or account pool fails now and then with errors that say nothing
of why (a 5xx, a dropped connection), and the next request often goes
through. Every such failure rested the key or account a minute, doubling
up to 10, and `rest-cap` could only move that cap (1 minute at least;
`off` read as `default`).
`magpie provider rest-cap <id> off` (provider.RestCapOff, restCap: -1 in
providers.json) now has a failure that says nothing of why (failOther)
rest nobody and not count toward the backoff: restAfterMarked returns a
Rest by "off" with no time left. What says why still rests as before: a
401 or 403, a model not served (restID), an account's window full, a
rate limit (magpie's own 30-minute cap; RestCapOr treats off as unset),
quota, credit, a restriction. `rest-cap <id> 30s` is turned away and names
1m and off (the first rest is a minute already). The Routing page tells a
try rested by "off" as not resting (one new string, zh/zh-TW/ja/de).
No "fail N times before switching" counter: a failed try already moves
the same request on to the next key or member, so a count would only
keep requests on a failing upstream longer.
Run:
- TestRestCapOff (gateway), TestRestCapCmd (cli), TestOwnRestCap: pass;
each goes red with the change taken out by hand (the early return
disabled: "#1 500: rests 59.99s by backoff"; restMinutes in place of
restCapMinutes: "off: <nil> 0").
- routing-rest-off.test.cjs: 20/20 (chromium, webkit; 1100, 420; en zh
zh-TW ja de); red 10/10 with the "off" case renamed.
routing-wb-restricted 20/20. rest-try-now and routing-model-rest fail
a varying few under load average 200-420 here, and fail more on
origin/main
|
||
|
|
d692b25481 |
tests: routing-burst-speed scrolls to a row with a wheel over a point in sight, not hover()
The row pick was red on a loaded machine ("picking the request moved the
page", zh in Chromium, 2 of 4 on origin/main
|
||
|
|
6855218884 |
gateway tests: TestCanceledRequestRestsNobody cancels once a is asked, not 50ms after the request began (#2175)
The sibling of #2175 (fixed for TestAgentGoneInTheRetryPause in |
||
|
|
5ccc05afe7 |
gateway: a plugin's non-streaming Responses request is relayed streamed and given back whole, so Grok's x_search runs (plugins#112, Watchyourback)
Plugin accounts only stream (Account.Stream), so a stream:false request was translated: parsed to the IR and rebuilt. The Responses parser keeps only function and web_search tools, so x_search never reached the Grok plugin, and Grok answered "let me look that up" without searching. The rendered reply also hardcoded "tools": [], dropped usage.server_side_tool_usage_details, and dropped web_search's open_page item. Watchyourback's capture of the plugin's fetch showed this (no tools field, input wrapped into message[], store:false); CodeAlex52's code read agreed. Now a plugin's request on Responses that asked for one body is relayed like a streamed one (gathers, used by serve's relay decision and by passthrough): - It is asked with stream:true, and the stream goes through the relay's usual tidies. - The client gets the `response` of the stream's response.completed (or response.incomplete) as one application/json body. Its output is filled from response.output_item.done items, or else the streamed text, when that event's output is empty (gathered.go). - A non-200 goes back as before. - A whole reply goes back as it came. - A stream that fails, or ends without its last event, is a 502, as a translated one is, never an empty 200. - Usage is counted from the stream, as for a streamed relay. Left as it was: - Messages: its stream has no event holding the whole reply, so gathering it means assembling the message from deltas. That is not a simple sibling. - Subscriptions magpie signs in to itself (ChatGPT backend, Qoder, MiMo...): their own code fits their requests, and their fakes end in a response.completed with no output. A first version that covered every stream-only account broke 7 Codex/ChatGPT-API tests, so it was narrowed to plugins. TestGrokPluginGetsNamespacedTools now expects the namespace's freeform custom tool to be left out (grokBody), as the built-in and the streamed plugin already did. The translation had offered it as a function. Tests (fake grok plugin through the plugin host): - TestGrokPluginNonStreamKeepsHostedTools: upstream SSE with a custom_tool_call, tools [x_search] and server_side_tool_usage_details. Asserts the plugin was asked stream:true with tools [x_search]; the client gets application/json with the custom_tool_call, message, tools and details; usage is recorded at 50/7. - TestGrokPluginNonStreamEndedShort: no response.completed gives 502. - TestGatheredTextOnlyStream: deltas only. Each was broken by hand and went red: - the relay condition reverted: "the plugin was offered null"; - the missing-completed check removed: 200; - the text fallback removed. Run: gofmt -l; go vet ./internal/gateway on darwin, GOOS=linux -tags nogui and GOOS=windows; go test ./internal/gateway -count=1 (ok, 1400s, load ~200). Not tried: a real Grok account or the real grok plugin; the reporter's allowed_x_handles case. |
||
|
|
f3ea4bd69e |
gui: an agent's model picker lists magpie's models before the ones it asks for itself (abledo on Discord)
abledo: "为什么claudecode的magpie模型选不了?其他的agent可以选". Claude Code
pointed at a relay through its own ANTHROPIC_BASE_URL showed that relay's
Claude models first ("Claude Code · <host>", a dozen-plus rows), and with
the current model lifted to the top every magpie model sat below the fold.
The server always sent them; only the order hid them.
openPicker now orders: the picker's own choices (Automatic, Off), routing
groups, each provider's models, then the agent's own direct rows. This
covers every agent with direct rows (Claude Code, Codex, dsh), not only
Claude Code. The current model is still lifted to the top.
Run:
- new claude-picker-magpie-first.test.cjs: chromium + webkit, widths 1100
and 420, en/zh/zh-TW/ja/de, wired false and true: 22/22. Fails on the
old app.js (own group before Zhipu).
- claude-picker-fold.test.cjs updated for the new order (own group and
its fold row last): 22/22.
- the 67 GUI tests that touch direct rows or #pop, with the change: green
except claude-picker-fold before its update. searcher-pick chromium zh
failed twice under load at its scrollIntoViewIfNeeded after reload
(#1745); it passes alone 2/2 and in the later batch.
- go test -tags nogui ./internal/gui: ok.
Not tried: the real desktop app with a real relay-configured Claude Code.
|
||
|
|
07e95265af |
gui: a picker on a phone keeps to the room it was placed in, never off the window's top
On magpie web at phone width the pop may grow to the window's height
(body.web .pop { max-height: calc(100% - 16px) }), more than the 420 the
model picker is placed by. Opened upward from a row low in the page, its
top went above the window (y = -241 at 420x760 in zh): the filter and the
first rows were out of reach. placePop now holds the pop to the room it
chose, above the button or below it (holdPop), and the list scrolls.
Found while testing abledo's Claude Code picker at 420.
Run:
- pop-phone-room.test.cjs (new): chromium + webkit, 1100 and 420,
en/zh/zh-TW/ja/de, 22/22. On main's app.js all five languages at 420
fail with the pop at y -223/-241. Run 4 at once in webkit, 4/4 green.
- The 45 GUI tests that open #pop, both engines: green but
claude-picker-magpie-first (the next commit's, red until it) and
searcher-pick, which failed chromium zh twice at line 304
(scrollIntoViewIfNeeded after page.reload: element not attached),
passed 2 of 2 alone with this change and 1 of 1 on main's app.js; no
pop is open at that step.
Not tried: a real phone; the desktop app (its picker's max-height already
equals the h it is placed by, so nothing changes there).
|
||
|
|
2c2155c452 |
gateway: Claude Code through magpie on any model lets a relay be tested as Claude Code
neiko on Discord: Claude Code connected to magpie, and "Test as Claude
Code" stayed grey. The test asks with the headers Claude Code last sent
(client-shapes.json), and those were noted only where they were passed
on: a request forwarded on Anthropic Messages to a keyed provider. A
Claude Code on a subscription, a Chat provider's model or any translated
one never got there, so the test kept saying no Claude Code request had
come. They are now noted as the request arrives on /v1/messages, after
the caller guard, whatever serves it; the forward still passes them on
only to a keyed provider on Messages, as before.
Run:
- TestClaudeCodeSeenOnAnyRoute (new): Claude Code on a Chat-only
provider, then a relay's model tested as Claude Code with its headers.
Fails on main ("no Claude Code request has come through magpie yet").
- TestModelTestAsClient still green.
- gofmt; go vet darwin, GOOS=linux -tags nogui, GOOS=windows for
internal/gateway and internal/provider.
- go test -tags nogui ./internal/gateway ./internal/provider (-timeout
60m; the machine was at load ~300): gateway ok; provider red only on
TestCopilotSecretToolUsername's 10s bound under load (#1627), green
3 of 3 alone. The full ./... ran twice and timed out package by
package at load ~270-300 (10m default, then build failures in the
second), so it is not a pass.
Not tried: a real Claude Code against a real Claude Code-only relay.
|
||
|
|
2c5db1c6ea |
gui: a template picked from Routing's Templates menu opens filled in, in the editor and in view
Owner, 10-14: picking a template from the menu added a group somewhere below the fold, with nothing to show what happened. Now a pick opens the new-group editor with the template in it (as the cards' Edit first does), scrolls the editor's top into view and focuses its name. Nothing is saved until the user saves. The cards' Add still adds in a click, since the group then shows in place of the cards. - openRowMenu passes its click to run(e), so an item can scroll through scrollOnPurpose; every run is an arrow function, the others ignore it. - block "start" with scroll-margin-top 12px, not "center": the editor is taller than the window, and centred it opened halfway down the form (ja/de/zh-TW failed the new test that way). Run: group-template.test.cjs + click-scroll.test.cjs, chromium and webkit, en/zh/zh-TW/ja/de at 420px: 52/52. The new test (12 groups of the user's, so the editor opens below the window) goes red with the scroll removed by hand. Load average was ~300 during the runs. |
||
|
|
e1dcd1e1d7 |
tune: a compaction window advised never makes you wait longer on compactions, and says the wait (HirotaNagai on X)
Tuned for you advised the compaction window by tokens alone, so a smaller
window that compacts far more often could be advised however long each
compaction keeps the user waiting.
What changed
- sessions: a call now carries how long a compaction took (Call.Compact).
Claude Code's compact_boundary line gives compactMetadata.durationMs,
which goes on the first call after it that isn't an error. Codex compacts
by a call of its own (the token_usage_record a compacted line names), and
that call's own time is the compaction's. Older rollouts with no such
record stay untimed. callCacheVersion is now calls-v13.
- tune: with 3 or more compactions timed for a model (minTimed), Facts.took
is their median in seconds, and each window's Point.wait is its
compactions x took. When compactions are timed, the advice never takes a
window that compacts more often than the current one. Of the windows that
don't, it takes the cheapest, and of those within 3% of that (sameCost)
the one that compacts least. Tokens and seconds share no unit the files
measure, so magpie doesn't trade one for the other at a guessed rate. The
token-cheapest window is reported (cheapest, wait_cheapest) so the user
can pick it. A model with fewer than 3 timed compactions is advised as
before, with no wait shown.
- GUI (Usage > Context): when timed, the advice is labelled
"Tokens + wait". The explanation says what a compaction took, the wait at
the advice against the window now, and the cheaper window that would wait
longer (if it saves 3% or more). The caveat says tokens and waiting only.
The picker shows each window's wait, with "Fewest tokens" on the
cheapest. Untimed rows are unchanged. The new strings are in zh, zh-TW,
ja and de.
- docs/subsystems/agent-wiring.md describes the timing sources and the
rule.
What was run
- go test -tags nogui ./internal/sessions ./internal/tune ./internal/gui
./internal/agent pass.
- internal/agent ran before the rebase. It took 1416s under a load
average of 120-300 and passed with -timeout 40m (the default 10m timed
out mid-suite). Its Tune/Compact/CacheTTL tests pass on their own.
- sessions, tune and gui ran again after rebasing on origin/main
|
||
|
|
b7a2e73761 |
agent: connecting an app that gets magpie's models as its provider, with none listed for it, says why instead of reporting success (Lumens on Discord)
Lumens (v0.1.1233) connected WorkBuddy from the Agents page. The toast said it was connected, but the toggle flipped straight back and WorkBuddy had no magpie models. For agents that take magpie itself as the provider (WorkBuddy, WorkBuddy AI, ZCode, Pencil, T3 Code, Copilot JetBrains), Agent.connect() went down the "magpie" branch and called Apply without checking whether any model was listed for the agent. With none listed (no provider or subscription yet, or "only picked" with every pick gone), Apply wrote nothing, connect still answered 200, and the next read found nothing wired. The fix applies, then, if the agent still doesn't read as wired, returns the same NoModelsError or AllHiddenError the field-less path already used. The GUI already maps both to no_models and all_hidden, in all five languages. The check comes after Apply because Cursor Private Inference is wired through its environment with no models at all, and TestCursorLocalConnects keeps that connecting. The noModelLeft helper is shared with the existing field-less path. Tests: - TestConnectMagpieAsProviderWithNoModelLeft (agent): WorkBuddy with no provider gives NoModelsError. With its only picked provider switched off it gives AllHiddenError and stays unwired. Switched back on, it connects and is wired. - TestAgentConnectNoModelsMagpieAsProvider (gui): POST /api/agents/connect/workbuddy with nothing in magpie gives 400 no_models. The old code gave 200. Both fail on the old code. Run: - gofmt -l is clean. - go vet passes on darwin, on GOOS=linux -tags nogui and on GOOS=windows, for internal/agent and internal/gui. - go test -tags nogui passes for ./internal/agent and ./internal/gui under a sandbox HOME (load ~250 from sibling sessions). - An earlier full ./... run: gateway, library and provider passed on a rerun with a longer -timeout. Their first run hit the 10m timeout under load, with no assertion failures. Not tried: the real WorkBuddy app, and Lumens' own settings, which haven't been seen. Left for its own change: workbuddyWired counts only vendor "magpie" entries, while buddyWrite also treats an entry under magpie's key that WorkBuddy re-saved as vendor "Custom" as magpie's. |
||
|
|
62e012b3e2 |
gui tests: Settings tabs are opened with Enter, not a click that waits on frames a loaded WebKit doesn't draw (#2150)
Cause: quota-reads (webkit de 360) timed out on
`:is(#setTab-usage, .nav-s[data-of=setTab-usage]):visible").click()`. Its
call log ends at "waiting for element to be visible, enabled and stable",
with no "element is not stable" retries, so the tab wasn't moving.
Playwright's stability check compares the box over two
requestAnimationFrame callbacks. WebKit's frames are driven by its UI
process, and on a loaded machine they stall for seconds while the page's
ordinary tasks run on, so the click sat out the whole 5s page timeout over
a still tab.
Reproduced by injecting a delay: SIGSTOP/SIGCONT duty-cycling of WebKit's
UI process (10ms on / 990ms off) around the tab step in a copy of
quota-reads. click() took 3-4s and timed out in 4 of 6 runs.
press("Enter") on the same locator took 2-3s and passed 6 of 6.
Fix: reader.cjs gets openPart(page, id), which presses Enter on the tab or
its sidebar strip entry. Both are <button>s, so Enter clicks them with no
frame to wait for. All 49 call sites of that locator shape across 35 test
files use it now. The other shapes (getAttribute, focus, boundingBox, the
.nav-s strip's own pointer tests) are left as they are, since they test
the tab itself.
Run (playwright 1.62.0, chromium + webkit, each file's own languages and
widths): all 35 changed files, four at a time, at load average ~400 from
other sessions. 450 tests passed. sync-not-backup (#prefs not there yet)
and tray-inuse (a 180s browser launch timeout) failed one test each
before the tab step; alone they pass 20/20 and 4/4.
Not tried: the other rAF-polled waits across the suite (waitForFunction
defaults to rAF polling, and settingsDrawn is one of them). They starve
the same way under this load, but none is named in #2150 or #2151.
|
||
|
|
fcd6f35198 |
gateway: a decision model's intent counts by its option probabilities, not its own confidence field (@VersunPan on X)
Cause: readJev took an intent (and kept a level over the turn before's) only when the answer's `confidence` was at least jevSure (0.4). That scale is System One's: 0 for an even spread, 1 for one option certain (provider.Confidence, (top - 1/n) / (1 - 1/n)). Other decision models fill the field their own way. Cloudflare's @cf/cloudflare/clef-flash compresses it: "提醒我明天下午三点给 Dora 打电话" came back light at 0.2866 while its top probability was about 0.68, so everyday requests matched no rule and fell through to the group's default (Opus). MLX-Serve's clef-flash-4bit says its top probability (0.68-0.95) and passed. Both picked the same choice 15 of 15. Fix: sureOf reads sureness from the answer's `probabilities` when it gives two or more numbers, on System One's scale. Cloudflare's clef-flash output schema makes probabilities (summing to 1) and confidence required for a choice answer, and calls confidence only "derived from the probabilities". Jev's own confidence is that same formula, so Jev's decisions don't change. An answer without probabilities is read by its confidence as before. A near-even spread still comes out near 0 and matches nothing. The threshold stays 0.4. The level path, which falls back to the turn before's level when unsure, uses sureOf too. Verdict.Sure, which the Routing page shows, is now the value the decision used. The effort pick reads only `score`, so it is unchanged. The GUI line "An intent it isn't sure of matches no rule" stays accurate. Tests (decide_sure_test.go): - TestClefFlashSureByProbabilities runs end to end through Workers AI's envelope at /ai/run/@cf/cloudflare/clef-flash, with answers shaped as that schema has them. Light at 0.68/0.14/0.10/0.08 with confidence 0.2866 now routes to its rule (Sure 0.573). A 0.28/0.25/0.24/0.23 spread matches none. - TestJevLevelSureByProbabilities: a clear level is taken over the turn before's, a torn one keeps it, and an answer with no probabilities falls back to its confidence. Run: gofmt -l (clean). go vet ./internal/gateway on darwin, GOOS=linux and GOOS=windows. go test ./internal/gateway -count=1 -timeout 40m: ok (2086s at load ~250. A first run hit go test's default 10m package timeout under that load). Broken by hand: - readJev back on a.Confidence: both tests red. The CF case went to "from ka" with Sure 0.2866, the reporter's miss. - sureOf floored at 0.5: the near-even spread and the torn level went red. Not tried: a real Workers AI call. The fixture's spread is built from the reporter's numbers (sure 0.2866, MLX top 0.68, MAE 1.6%), not from saved bytes of that request. |
||
|
|
430871d632 |
provider: SiliconFlow offers its international site as a region beside China
SiliconFlow asked (by mail) for its international site, api.siliconflow.com, in magpie. It is a separate account with its own keys page and a $ balance, so the siliconflow preset now has two regions: China (the default, so every saved provider and link reads as before) and Global, with cloud.siliconflow.com's key page and console. The balance read already knew the .com host. Import links take region=intl; the import docs (en, zh, ja) list it. "Global" reuses the GUI's existing translations. Run: go test ./internal/provider/ (ok, 541s), incl. the new TestSiliconFlowInternational: an intl link gets the .com endpoint, key page, console and $ balance source; FromPreset stays on .cn; a saved .cn provider sits at region cn and an intl one at intl. gofmt, go vet clean. Not tried with a real international-site key (no account). |
||
|
|
4048ead7fa |
provider: a balance query's header takes the key as {token} too, and the key pasted as its token goes as a Bearer (lx_78654 on Discord)
A key usage query that takes only "Authorization: Bearer <key>"
answered magpie's Check balance with {"code":"INVALID_AUTH_HEADER",
"message":"Authorization header format must be 'Bearer {token}'"}. Two
ways got there:
- a header written as the vendor's own error names it, "Authorization:
Bearer {token}", went with "{token}" in it as written: only {key},
{apiKey} and {api_key} were put in;
- the key pasted into the Account balance (token) field went bare in
Authorization, the way a new-api access token goes.
The key is now put in for {token} as well, for any case of key, apikey,
api_key, api-key and token, and in {{…}} or ${…}. A balance token that
is the provider's own key (with or without "Bearer ") is taken as no
token, so the query is asked as a chat request is, with the key as a
Bearer. A token of the account's own still goes as it is. Without a
header or a token the key already went as a Bearer.
Run:
- TestBalanceKeyAsBearer: an httptest server that answers only
"Bearer <key>"; no header, Bearer {token}/{key}/{API_KEY}/{{apikey}}/
${API_KEY}, the key and "Bearer <key>" as the token all read $8.50;
{TOKEN} in the URL is escaped; an access token still goes bare. On the
old code it fails with the reporter's INVALID_AUTH_HEADER for {token},
{API_KEY}, {{apikey}}, ${API_KEY} and the key as token.
- go test -tags nogui ./internal/provider/ ./internal/cli/.
- gofmt -l; go vet darwin, GOOS=linux -tags nogui, GOOS=windows.
Not tried: the vendor's real endpoint (a relay, not contacted). Chat
requests still send Headers exactly as typed (provider.go's Headers
doc); only the balance query puts the key in.
|
||
|
|
8ea4fec90a |
tui: w changes a custom provider's base URLs (luluxiu_1_4392 on Discord)
On Linux, with no window, the TUI had no way to change an API-key
provider's base URL: w only moved a local server's address or a preset
with an endpoint, and for a provider of the user's own it only pointed
to `magpie provider set <id> url=…`.
w on a provider with no preset now asks each base URL it has (Chat,
Responses, Anthropic, Gemini) in turn, prefilled with the one there now;
Enter alone keeps one. Only http(s) addresses with a host are taken, a
trailing / is dropped, and only the URLs that changed are saved, the
balance cache forgotten. A vendor preset is still asked at its own
address, and the footer already said "w address".
TestTUIAddsARemoteMagpieWithItsAddress asserted w asks nothing on the
custom provider "a"; its vendor case now uses a DeepSeek preset.
Run:
- TestTUIEditsACustomProvidersBaseURL: one URL changed and saved
without the trailing slash, a bad URL refused, a two-URL provider with
one kept and one changed, Enter Enter = unchanged. With the new branch
disabled it fails ("w opened "" (mode 0)").
- go test -tags nogui ./internal/tui/ (the full run caught the old
assertion above, now updated).
- gofmt -l; go vet darwin, GOOS=linux -tags nogui, GOOS=windows.
Not tried: the TUI by hand in a real terminal on Linux.
|
||
|
|
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
|