* gui: a group's members say what each can do, images included
A routing group's editor said of a member its name, its provider and the
reasoning it is sent at, and nothing of whether it sees images — a group
mixing members that see with ones that don't gave no way to tell one from
another, and which member a picture would reach was found out by sending one.
Each member now carries the same chips the Gateway page's model list sums a
model up in (modelInfo): its reasoning levels, whether it sees images and the
window it holds. The group's own models API carries Images and ImageSet for
them (internal/gui/groups.go), and the chips' look is shared with the Gateway
list's.
A member whose list says nothing of images is said to be unknown, not "text
only": magpie counts it text-only for a describer (gateway.blindTo), which is
not its list saying it takes none. For the same reason the group's own line —
"Accepts images (every model in it does)" — said something a group no longer
is: since #756 one member that sees is enough, so it reads "one of its models
does" now, in English, Chinese, Japanese and German.
group-member-info.test.cjs (new) checks three members — one that sees, one its
list says takes none, one nothing was read of — for their chips, their
tooltip's words in both languages, and that the row still switches off and
removes. Routing view regressions pass as on the baseline.
Validation:
- node --test --test-concurrency=1 internal/gui/tests/group-member-info.test.cjs
- group-arrange, routing-manual, group-member-off, group-context, group-fold,
group-patterns, group-bulk-remove, group-member-fast, group-found-off,
agent-model-groups, member-model-setting, group-from-model-add, click-scroll:
32 pass, 2 fail — both the 600x420 group-from-model-add cases, which fail
identically on the unmodified 9e77092.
# Conflicts:
# internal/gui/assets/routing.js
* gui: test that a group's models carry what they take
The chips the Routing editor draws a member with read the served catalog
entry: whether agents are told it takes images, whether anything said so
either way, its reasoning levels and the window it holds. The first is the
same expression the gateway decides by when it describes an image for a
model that can't see one (blindTo reads Entry.Images), so the editor cannot
say a member sees images that the gateway would describe them for. A model
whose list says nothing is carried as unknown, not as text only.
Covers: one that sees, one its list says takes none, one nothing was read
of, and one the user answered for themselves (settings.ModelImages).
* gui: carry a member's unknown images as a flag, not an absent key
Review of the chips: `imageSet` was omitempty on both structs, so a model
magpie knows nothing about went out without the key, not with `false` —
`m.imageSet === false` never held, and such a model still read "Text only",
which is what the chips set out to avoid. The browser test passed only
because its fixture wrote `imageSet: false`, which groupsState() never
produces.
`imagesUnknown` is the flag now, sent only when true: a model magpie has an
answer for carries no such key at all, and the page reads `=== true`. The
name is apart from the Gateway page's `imageSet` on purpose — there it means
the user answered for the model themselves (provider.ImageOverride), and
modelInfo is shared by both pages.
The fixture now writes what groupsState() emits: `images` and
`imagesUnknown` left out where they are false. A Go test holds the wire
shape (`TestGroupModelImagesOnTheWire`), and with the fixture as it now is
the browser test fails 2/2 on the old check ("a member nothing was read of
says unknown, not text only: Reasoning levels: none known").
Validation: go vet ./... and go build ./... pass; go test ./internal/gui/
fails only TestSetPortMovesTheGateway and TestPurposeAssetMatchesUsage,
which fail identically on the unmodified 9e77092; the routing and group
browser regressions are 34 pass, 2 fail — both the 600x420
group-from-model-add cases, which fail identically on the baseline.
---------
Co-authored-by: wizzy-yang <wizzy-yang@users.noreply.github.com>
group-from-model-add.test.cjs failed 2/2 at 600x420 on both engines, and had
for a while: it asked that every label sit beside its field, but under 760px
the editor is one column on purpose (routing.css), so the label is above its
field there. It now asks for that where the editor is one column, and keeps
asking for beside where it is two.
The other half was the click: the error Add answers with comes in at the foot
of the page, and in the one column editor it covers Add until the view is
scrolled to its end. The test wheels down until the button is under the
pointer, which is not yet the end of the page, and then clicked the place it
had found before the error arrived. It now scrolls to the end of the page
first, and finds the button again before each press.
Both engines, both languages, both viewports: 8/8 pass (was 6/8), and the
routing and group regressions are 34/34 on each engine (were 41 pass / 2 fail
on Chromium and 40 pass / 3 fail on WebKit).
Co-authored-by: wizzy-yang <wizzy-yang@users.noreply.github.com>
With Dock on "Hide", magpie runs as an Accessory app. A full-screen
window's title bar comes down only with the menu bar, and an Accessory app
has none, so the full-screen main window had no close, minimize or
full-screen button, and only Esc left full screen.
magpie now joins the Dock as a window starts entering full screen, from a
native NSWindowWillEnterFullScreenNotification observer: Wails hands that
event to Go later, and switching once the window is full screen doesn't
bring the title bar back. dock counts a full-screen main window (inDock),
so reopening the app or changing the Dock setting during full screen keeps
magpie in the Dock, and WindowDidExitFullScreen applies the setting again.
TestFullscreenKeepsDock checks inDock; it doesn't compile on main. On
macOS 27.0.1 with Dock on "Hide", main stays out of the Dock in full screen
with no title bar; this branch joins the Dock with the title bar and its
buttons, and leaves it after the green button, View > Toggle Full Screen
or Esc.
Fixes#763
* gateway: a Chat upstream gets a mended tool exchange — Kimi turns a broken one away 400 ("tool_call_id is not found"): a turn's tool results all go ahead of its own text, in the calls' order; a result whose call is gone gets a synthetic call (unknown_tool) so it survives; an unanswered call gets a synthetic error result; a thinking-only assistant turn, which an aborted stream leaves behind, is dropped
* gateway: a translated reply whose stream the upstream cuts off mid-way goes on instead of failing — the same conversation is asked again with what the client already has of the reply sent back as its last message, for the model to go on from (vk-relay dropping Kimi K3 and DeepSeek streams mid-reply: "API Error: Server error mid-response"). The reply so far goes back with its reasoning for models that read reasoning_content back (Kimi, DeepSeek), a full echo of it is dropped, and the continuation's fresh thinking isn't shown again; the client waits with keepalives between tries, up to two. A reply a tool call of has begun can't be prefilled, and a refusal isn't asked again: both end with the error in the stream, as they used to. A stream's own error event mid-reply ends its read at once rather than waiting on a vendor that keeps the connection open. TestStreamCutMidReplyContinues (reply goes on, one message), TestStreamCutContinuationEchoDropped, TestStreamCutAfterToolCallEndsAsBefore, TestStreamCutContinuesOnlySoLong, TestStreamCutMidThinkingContinues(WithoutReasoning), TestStreamErrorMidReplyContinuesAtOnce and TestContinuationUnecho cover it; TestStreamErrorKeptOpenFailsOverAtOnce and the severed-stream tests pass unchanged. go vet ./internal/gateway, go build (darwin, GOOS=linux, GOOS=windows), go test of gateway, provider, catalog and imagemcp pass.
* gateway: a Chat upstream's mended tool exchange — an orphaned or late result reaches the model as a user message, the Responses path's policy, so no call is made up and no id is used twice; an empty assistant is dropped only inside a pending exchange, where it would break adjacency, and passes through outside one; a second answer to a call is dropped, the first stands; the session replay harness gives way to fixed fixtures
* gateway: a cut reply is asked to go on only where the upstream goes on from a prefill — a trailing assistant message isn't one on most Chat APIs: the model answers it again from the start, reworded, and the client, an exact echo alone dropped, kept its part and the re-answer spliced as one reply with no error to tell (api.deepseek.com did so 5 times in 6). It goes on only where the prefill is real: an Anthropic Messages upstream natively (a model that turns one away answers 400 and the reply ends as it used to; the newest Claude among them), a Chat one in its vendor's own mode — DeepSeek's prefix, asked of its /beta endpoint with "prefix": true on the message, Kimi's "partial": true — a relay on this machine or the LAN serving one of their models taken to front the vendor, as geminiCompat takes one to front Gemini; everywhere else the reply ends with the error, as it used to, for the agent to try the turn again. reasoning_content goes back with the prefill by the same decision (reasoningBack named any kimi model on any host); the prefill's trailing whitespace, which Anthropic turns the request away for, is trimmed, the client having it already; and the tries' usages are summed into the reply's, the client's and the ledger's, where only the last try's was kept while the vendor billed each (a cut try's is only what it said before the cut). New tests: a re-answering upstream is never asked to go on (the client reads the error, not the garble), DeepSeek's /beta prefix mode and Kimi's partial on the wire, an Anthropic upstream's native prefill (text, thinking-only, whitespace trimmed, a refused prefill ending as it used to), the tries' usages summed, chatPrefill and prefillHow themselves. go vet, builds (darwin, nogui) and go test -count=1 -race ./internal/gateway pass (2146; gui's TestSetPortMovesTheGateway fails on main too).
* tests: three environment- and drift-broken suites pass again — port: a moved gateway finishes the connections it has (Relisten's handover), so answers() pooled a keep-alive one from its start-up polls and the old port answered from it forever; it now dials with keep-alive off, asking what the test means to: does the old port take NEW connections. plugin: TestBunIsGivenTheSystemsRoots read the shell's ambient NODE_EXTRA_CA_CERTS as the user's own (it wins by design); the test sets its own. accounts: forgetting the account in use puts the one left first since 30d952cf, which updated the provider and GUI tests but not accounts_plugin_cli_test.go; it now expects that. All three failed on upstream/main on a machine with a proxy CA configured; the full nogui suite passes.
* fix(agent): give magpie's provider table the actor-authorization header
Codex offers its built-in image tool (image_gen.imagegen) — and the other
OpenAI-provider tools — only to a provider it reads as the OpenAI actor:
ModelProviderInfo::uses_openai_actor_authorization(), i.e. a provider that
does not require OpenAI auth but carries x-openai-actor-authorization.
magpie writes [model_providers.magpie] but carried neither signal, so a
Codex on magpie was never given the tool and could not draw through a
Codex backend such as sub2api's.
Write http_headers = { "x-openai-actor-authorization" = "magpie" } into
that table. magpie does not forward the header upstream: codexHeader
rejects anything naming "authorization".
Test: TestCodexMagpieProviderCarriesActorAuthorization.
* gateway/provider: let a Responses-only relay (Codex backend, sub2api) draw
A provider added as 'OpenAI Responses' only (what a Codex backend such as
sub2api speaks) has no chat base, so Drawers() returned nil before ever
looking at the vendor's list, draw() refused with 'can't draw', and
drawImages() posted to an empty base. The vendor's own /v1/models does list
its image models (sub2api serves gpt-image-2.5), and they are meant to be
picked in Settings → Images.
- Drawers: a Responses-only provider draws when it has any OpenAI-shaped
base, not only a chat one.
- draw: refuse only when neither Chat nor Responses is set.
- drawImages: fall back to the Responses base when there is no chat base.
- List: the add form's 'Fetch models' keeps the vendor's image models so
one can be picked while the provider is added.
Tests: TestResponsesOnlyProviderDraws, TestListOffersImageModels.
* fix: route Codex native images through its turn provider
---------
Co-authored-by: yetone <yetoneful@gmail.com>
* fix(gateway): an account Antigravity turned away doesn't rest
A 429 that is Antigravity refusing Claude Code's or its Agent SDK's
system instruction — "Resource has been exhausted (e.g. check quota)"
whatever quota the account has left (#666) — carries the word "quota",
so it was classified failQuota: the account rested 15 minutes and had
its usage asked of Google again, while it answers titles, background
requests and Codex normally.
Carry the fact the error path already works out from —
antigravityTurnsAway(request.System) and the CodeAssist agent, what the
8c652a83 hint is computed from — into the routing decision, the way
sharedPool and refused already carry an upstream routing fact through
error translation. The held attempt is marked on either failure path,
not only on a 429: the refusal also arrives as an in-stream error event,
which skips the 4xx branch and returns 200 while still failing the
attempt, and usedUpWords doesn't look at the status either. Where the
attempt then fails on that mark, the next member is asked first and
restAfterMarked is never called, as for a refusal — nobody rests and
nobody's usage is re-queried.
A 429 that really is the plan used up, with no such system prompt
asking, still rests the account and re-queries its usage, as it did
(#147, #530).
* fix(gateway): only the refusal leaves an Antigravity account alone
The mark was wider than the refusal it describes (yetone's review of
#873): it was set for any status >= 400, and for any failed stream,
whenever the system prompt was Claude Code's. A 500, 503 or 403 on such
a turn was therefore told as a refusal and never set the account aside,
and the account's 4xx handling below it was skipped for those requests.
The mark now goes on the refusal itself: a 429, or an in-stream error
event saying "Resource has been exhausted". The latter needs its own
predicate, since the Code Assist decoder keeps only the error's message
and leaves its status and code out of the event.
Two more of the review:
- the refused attempt now writes a usage.Record, as the hw.refused
branch it is modelled on does, so these 429s stay in the ledger;
- the member's other Antigravity accounts are asked last rather than
first, by matesLast, the inverse of matesFirst: they carry the same
system prompt, so each is turned away just the same, and asking them
first spent a round-trip apiece before the group reached a member
that answers.
TestAntigravityTurnedAwayIsOnlyTheRefusal, ...StillLandsInTheLedger
and ...LeavesItsMatesForLast fail on the previous revision of this
branch for each of these reasons.
* fix(gateway): the refusal said inside a reply that isn't streamed
The mark was inside translate's `if stream` block, so a client that
doesn't ask for a stream — and a stream that isn't held — never set it:
the same "Resource has been exhausted" said as an in-stream error event
still rested the account 15 minutes on those requests.
A test for that path first: TestAntigravityTurnedAwaySaidInsideTheReply
drives a 200 that opens with the error event, and pairs it with an error
event of another kind, which still rests the account. The first half
failed on the previous commit for exactly this reason.
Both error paths now go through markAntigravityRefused, which decides
from what the failure said rather than repeating the four conditions at
each return: the Code Assist decoder keeps only the error's message, so
an in-stream refusal is recognised by its text, while a 429 is
recognised by its status as before.
* fix(rules): reject nan/inf and overflowing token lengths
ParseTokens used ParseFloat and cast straight to int. Values like
"nan", "inf" and "1e20" therefore became a huge negative (or other
nonsensical) token threshold instead of an error.
* fix(rules): reject tokens at the float64 MaxInt boundary
float64(MaxInt) rounds to 2^63, so n > float64(MaxInt) let the
boundary through and int(2^63) becomes MinInt on amd64.
On a non-Claude model magpie wrote CLAUDE_CODE_AUTO_COMPACT_WINDOW=272000 into ~/.claude/settings.json's env even when the user had set autoCompactWindow there, or modelSettings.<model>.autoCompactWindow (where /autocompact saves it). Claude Code takes the env first, so the user's own window was overridden: in a sandbox, autoCompactWindow 900000 showed 900k in /context, and 272k once the env was added. magpie now leaves the env out when the user set either one for the main model. A size the user typed in magpie, for every model or for a model or its provider, is still written, because the user chose it there.
Codex is unaffected. Codex's model_info.rs applies model_context_window and model_auto_compact_token_limit from config.toml over the catalog, and magpie never writes or removes either key.
TestClaudeCompactYieldsToOwnSetting fails without the change ("autoCompactWindow: "272000"; want """).
The click-hold that keeps what the reader clicked under the pointer holds its
place by scrolling, and makes room at the view's foot when the wanted scroll is
past the content. A group's editor is tall, and the reader scrolls down to its
Save: saving closes the editor, the page shrinks by its height, and the browser
clamps the scroll. What the hold then keeps is a parent that never moved in the
page — the screen moved only by that clamp — so it scrolled back to the old
place and padded the view with a blank view-room as tall as the editor. In a
window shorter than that room not one row of the page was in sight: the Routing
page looked blank while its DOM was intact.
Room is now only kept while some of the view stays in sight; when the whole of
what the reader was looking at is gone, the browser's own clamp stands.
routing-save-blank.test.cjs fails 2/2 on the old assets ("a blank room of
1355px in a 565px window") and passes 2/2 with this. click-scroll and the
group/routing regressions pass as on the baseline.
Co-authored-by: magpie-fix <fix@localhost>
Until now the only choice was 272K for every model or Full window for every model. The 272K default stays as it is (e950eb08: OpenAI runs its own 1M models at 272K in Codex, and Chen saw 70–90s to a first token at 550K).
What changes:
- A provider's editor has Compact at beside Context window and Max output, in the same form: "500k" for all of its models, "deepseek-v4-flash=272k" for one, and empty to follow Settings. A size at or above a model's window means the whole window. The values are kept in settings.ModelCompacts.
- Settings → Long conversations takes a size of its own beside Compact at / Full window (settings.CompactAt).
- `magpie model compact` takes a size such as 500k.
Order: the model's own value, then its provider's "*", then Settings. Full window turns off only the Settings value. A group uses the smallest value among its members.
Where it applies:
- Codex's model_catalog is told the threshold as context_window, with the whole window as max_context_window.
- Claude Code's CLAUDE_CODE_AUTO_COMPACT_WINDOW follows the main model. A Claude model now takes its provider's value when one is set.
- The Codex list tag changes when the Settings size or Full window changes.
Tests:
- New: TestModelCompactsSetFromTheEditor, TestSetCompactAt, TestCodexCatalogCompactAt and TestClaudeCompactAt.
- TestSettingsSaveKeepsWhatItDoesNotSend now covers the two new fields.
- compact-at.test.cjs (WebKit, en/zh) checks the editor field (shown, refused, chips, saved) and the Settings size (posted, hidden under Full window, no scroll).
- go vet ./..., go test -tags nogui of the root package, provider, codexcat, agent, gui, gateway, settings and catalog under a temp HOME, and GOOS=linux/windows builds all pass.
The old README was the whole manual in one file. Someone who opened the
repo saw a wall of config paths before seeing the app. The new one leads
with the app: a hero screenshot, six highlights, then a section for each
part (picking models, providers, routing groups and intent routing,
subscriptions and plugins, usage, sharing, the library), with the site's
light and dark screenshots in <picture> tags. A supported-agents list, a
three-step quick start and a CLI sample follow. README.zh-CN.md is the
same page in Chinese, with the Chinese screenshots where the site has
them.
The full manual moves, word for word, to docs/reference.md, with its two
relative links fixed. Both READMEs link to it, so no detail is lost.
Explain manual-only relay selection and current searcher eligibility without a hard-coded provider list. Make quota and cost guidance apply to all search providers.
Update English, Chinese, Japanese, and German help while preserving existing ellipsis, hover titles, and search routing. Extend picker and help regression coverage.
Validation: 28 Chromium regression tests pass; picker/help tests pass three consecutive runs. WebKit is unverified due to missing host libraries. The separate search-api copy assertion has a pre-existing timing race reproduced on original and changed assets.
#874: Sign out… on a removed built-in with a single account of magpie's always failed with "magpie uses a@x.com first; put another account first". It was the first account and there was no other to put first. Also, the ask closed whatever the answer was, so the error only flashed. forgetSideLogin now lets the first account go when no other account is left, so the subscription ends with none; with two or more it still asks for another to be put first. The ask now closes only when the sign-out succeeded. When it fails, it stays open with the error and its button enabled again. TestForgetOnlyFirstLogin fails on the old code (an antigravity row with one account; ForgetAccount drops it, logins.json keeps none; with two, ForgetLogin of the first still refuses and ForgetAccount takes both). removed-forget.test.cjs adds "a failed sign-out stays with its error", which fails on the old app.js.
#875: Max output now has 8K, 16K, 32K, 64K and 128K picks under it, the same as Context window. A click fills the field, a size typed in lights its pick, a per-model value lights none, and Save sends it. Under More endpoints, the label column is as wide as its longest label, so Anthropic 地址 / Responses 地址 no longer wraps a last 址 under the label. provider-output-picks.test.cjs (en and zh) fails on the old code. Item 3 (section headings) is left for the owner.
Tests: WebKit, en and zh: provider-output-picks, provider-max-output, removed-forget, provider-search, balance-fix, own-signin-remove, deprecated-subscriptions, click-scroll and fallback-more pass. Also passing: go vet; builds for darwin, GOOS=linux nogui and GOOS=windows; and go test -tags nogui -count=1 ./... under a temp HOME, where TestUserPath failed once waiting on the login shell and passed on a re-run.