Commit Graph
2242 Commits
Author SHA1 Message Date
yetone f7cf98ee3a update: a magpie off the Mac that can't write to the folder it runs from (a magpie.exe kept at C:\) says so, naming the folder, beside "a new version is out" and on the Update pill, instead of opening the release page with no reason (#1277, baymax0306)
Before, a binary in a folder magpie may not write to, on a system that
can't ask for the administrator's password (Windows; Linux without
pkexec), was left with no exe to replace and shown only "{v} is out";
Download opened GitHub. The reporter found the cause themselves: the exe
was at C:\. updater.placeExe now marks it stuck "not-writable" with the
folder, and updateStuck says to move it to a folder the user can write
to; zh, zh-TW, ja and de strings added.

Verified:
- TestUpdateNotWritableSaysWhy (internal/gui) fails without the fix:
  "a binary in a folder magpie can't write to: {State:available ...
  Stuck: StuckDir: ...}"; passes with it.
- update-stuck.test.cjs, Chromium and WebKit, en/zh/ja/de at 1000px and
  440px: 18/18 pass; without the app.js change it fails (the reason text
  never appears, waitForFunction timeout).
- gui-ja, gui-de, gui-zh-tw, i18n-keys, update-*.test.cjs, cli-path:
  136/136 pass in both engines.
- go vet ./internal/gui, go build, GOOS=linux/windows go vet -tags nogui
  ./internal/gui, GOOS=windows go build; sandbox HOME go test -tags nogui
  ./... all ok.
- On the Windows box, update.Writable (a windows/amd64 build, over ssh)
  is false for a folder whose ACL denies the user write. Over ssh the
  token is High integrity, so C:\ itself reads writable there; a
  standard user's C:\ and the GUI on Windows weren't tried.
2026-10-08 17:35:30 +08:00
yetone 0b7a740ee6 gui: Usage's Context tab names its agents when the state answers after the routing history, not by their ids until the history changes
context.js draws each agent card and session row with the agent's name and
icon from the state (agentLabel, agentIcon). When /api/context answered
before /api/state, the cards were drawn by the agents' ids ("claude", a
generic icon). The state's arrival calls loadContext again, but a read that
brought the same history returned early ("the same answer keeps the pane"),
so the ids stayed until the history itself changed.

The "same answer" key now holds what the pane is drawn with besides the
history: each agent's id, name and icon from the state. Once the state is in
the pane is drawn again (still, without its entrance animations); a refresh
with the same history and the same agents still keeps the pane.

This is one of context-window.test.cjs's failures under load and alone: its
Claude Code card is found by hasText "Claude Code", which the card titled
"claude" never matches (":129 locator.innerText: Timeout 5000ms ...
.ctx-agent hasText 'Claude Code' .ctx-grade-word"). "codex" matched "Codex"
since hasText ignores case, which hid it on the other card.

New test in context-window.test.cjs: /api/state is held until the two cards
are drawn, then they must read "Codex, Claude Code".
Run:
- New test on origin/main f00ed290: red in Chromium and WebKit (the names
  never come). With the fix: green in both.
- context-window.test.cjs and context-scroll-end.test.cjs whole: 38/38.
- No t() strings changed; no Go changed.
2026-10-08 17:32:10 +08:00
yetone ceccd0e17f gui tests: panel-arrange records the menu bar cell's flash as it is lit, not by a poll that can miss its one frame under reduced motion
panel-arrange's last part calls panelQuotaFocus("deepseek") and waited for
the card to have the `flash` class. The test emulates reduced motion, and
app.css's reduced-motion rule makes every animation .01ms long, so the
flash's animationend comes within the same frame: logged, the class was on
for one frame (animationend at elapsedTime 0.00001) in every run, passing
or failing. A rAF poll sees it only if it lands in that frame; under load
it often didn't (4 of 12 parallel runs red on origin/main, all at :156).

The app is right: the card is drawn, scrolled to and flashed. The test now
records each card given the class through a MutationObserver installed
before the call, and waits for "deepseek" to be among them.

Run (Chromium and WebKit, en/zh/ja/de):
- 12 parallel copies on origin/main f00ed290: 4/12 red at :156 ("waitForFunction:
  Timeout 5000ms"). With the fix: 12/12 green at load ~110.
- With flashCard's classList.add("flash") commented out the new check
  fails (chromium en), so it still catches a card not flashed.
2026-10-08 17:32:10 +08:00
yetone d1fca72f69 library: the Library's MCP servers go to WorkBuddy and CodeBuddy Code (#1266)
WorkBuddy had skills only, and CodeBuddy Code had no library target at all,
so their MCP chips could not be switched on.

WorkBuddy 5.5.6 (app.asar) reads ConnectorService.customMcpConfigPath:
$WORKBUDDY_CONFIG_DIR, then $CODEBUDDY_CONFIG_DIR, then ~/.workbuddy, plus
mcp.json, as {"mcpServers": {...}} in Claude's shape. It connects a server
only once the user has switched it on in its MCP settings
(mcp-approvals.json, module.app-server.js). magpie doesn't write that
approval. Instead, the servers page tells the user to switch it on once,
in en/zh/zh-TW/ja/de.

CodeBuddy Code 2.162.0 (PathUtils.resolveMcpFilePath) reads the first of
<dir>/.mcp.json, <dir>/mcp.json and <base>/.codebuddy.json that exists.
<dir> is $CODEBUDDY_CONFIG_DIR or ~/.codebuddy. The file holds mcpServers
in Claude's shape, and ${NAME} is expanded (McpConfigEnvExpandService).
User scope needs no approval. Skills go in <dir>/skills.

Verified: the real CodeBuddy Code 2.162.0 CLI, in a sandbox HOME, read
SaveServer's file back with `mcp get` and `mcp list`. That covered stdio
with ${MY_TOKEN} expanded, http and sse, and the user's own entry and
disabledMcpServers were kept. WorkBuddy.app was not run; its side is
from its code.

Tests: TestAgentMCPFiles (4 new cases) and TestCodeBuddyMCPFile fail
without targets.go. library-workbuddy-trust fails without library.js.
Run: go test ./internal/library ./internal/gui; go vet for darwin, linux
and windows; in Chromium and WebKit: gui-ja, gui-de, gui-zh-tw, i18n-keys,
click-scroll and all library-* GUI tests.
2026-10-08 17:12:07 +08:00
yetone d7bdb0765f agent: with magpie Codex's provider, Codex's own models on the Agents page say what picking them does: one magpie serves on a ChatGPT account is picked as magpie serves it and Codex stays on magpie; any other reads "direct, not via magpie" and asks before taking Codex off magpie (#1269, shenghsi)
Picking Codex's own gpt-5.5 tagged "via magpie" while magpie was Codex's
provider took Codex off magpie at once, with no question: the tag came
from routed(), but set() unroutes for a model of Codex's own unless it is
joined beside a ChatGPT sign-in or on magpie API.

Verified: TestCodexProviderOwnModelSaysItsPath fails without the change
(gpt-a reads Via:true with no ChatGPT account; Value gpt-a, not
codex/gpt-a, with one), passes with it. Reproduced and checked in a
sandbox HOME with Playwright against `magpie web`, on macOS and on Linux
(WSL2 Ubuntu 24.04, codex-cli 0.161.0): before, picking gpt-5.5 left
Codex "Not connected"; after, it reads direct and opens "Take Codex off
magpie?". go test -tags nogui ./... green; go vet for darwin, linux,
windows on internal/agent.
2026-10-08 17:06:48 +08:00
yetone 8bbc03ac78 provider: moved Cursor and Devin users get plugin 0.1.11, whose split parallel tool calls keep their results (#1275)
cursor 0.1.11 and devin 0.1.11 (magpie-community/plugins 78780b8, 994d580)
join an assistant message onto an assistant message before it that made
tool calls, as joinSplitCalls does in the built-ins since 7067fce5: a
turn's calls split over two assistant messages were answered as
interrupted and their real results dropped. Both are on npm (npm view,
2026-10-08). Kiro's plugin already joined them; a test in f35c189 keeps
it so.

HOME=$(mktemp -d) go test -tags nogui ./internal/provider ok; go vet
-tags nogui ./internal/provider on darwin, GOOS=linux and GOOS=windows
clean.
2026-10-08 17:05:00 +08:00
yetone 716c8c9544 provider: moved Grok and Devin users get plugin 0.1.10, whose tool schemas with a root union go folded with nested branches kept (#1271)
grok 0.1.10 (magpie-community/plugins a6910fd) folds a function's root-union parameters, which it sent as they came; devin 0.1.10 (fbee8a0) keeps the fields of branches that are unions themselves. Both are on npm (npm view, 2026-10-08).
2026-10-08 17:01:22 +08:00
yetone c8ac18a2ca gateway: Grok on a relay's key or xAI's own API gets a tool's root-union parameters folded to an object, so Codex's turns aren't refused (#1271)
Only the Grok subscription's requests were folded (grokBody). Grok
anywhere else refused Codex desktop's automation_update the same way:
AiHubMix's grok-4.7 on its Chat API answered the real schema 400
"Failed to start sampling: [invalid_client_tool_schema] ... tool parameter
root must be an object type" (2026-10-08) and 200 once folded; xAI's API
(api.x.ai) had no fold at all. OpenRouter's x-ai/grok-4.7 takes the union.

xAI's API now gets such tools folded from the first request. Any other
upstream that refuses one for its root ("tool parameter root must be an
object type", or Anthropic's "does not support oneOf, allOf, or anyOf at
the top level" behind a relay's Chat API) is asked once more with them
folded, passed through or translated, and that model is folded from then
on. An upstream that takes the union gets it as sent.

TestRootUnionFoldedWhereRefused (Responses passed through, and Codex's
Responses translated to a Chat-only relay, with AiHubMix's bytes) fails
without the gateway.go change: the client gets the 400. TestRootUnionFoldedForXAI
checks xAI's host is folded and another isn't. go test -tags nogui ./...
in a temp HOME: all pass but the root package and internal/gui under load,
which pass rerun alone; vet for darwin, linux and windows; builds for all three.
2026-10-08 17:01:22 +08:00
yetone faab600e50 provider: a tool's root union whose branches are unions themselves folds with their fields kept, so Grok can create a Codex automation (#1271)
xiaocui12: Codex on Grok, "[invalid_client_tool_schema]
mcp__codex_app__automation_update: tool parameter root must be an object
type (root schema is an anyOf/oneOf union with a non-object branch)".
Codex desktop's automation_update (ChatGPT.app 26.930, zod 4's
toJSONSchema with $defs) is a root anyOf of view, delete, create and
update, and create and update are unions on kind themselves. ObjectRoot
dropped those nested branches: the fold kept only mode (const "view") and
id, both required. Grok took the tool but could only view.

A branch that is itself a union is now folded first (on a copy, up to 8
deep); a field the root doesn't define takes each distinct schema the
branches give it, as anyOf when they differ; a field every branch
requires stays required (here only mode).

Verified with the real Grok subscription and the real schema
(testdata, rebuilt with zod 4.1.8 from ChatGPT.app's app.asar): raw, 400
with the reporter's exact message; the old fold, 200 but no tool call when
asked to create an automation; the new fold, 200 and
{"mode":"create","kind":"heartbeat","name":"CI watch","prompt":"check CI",
"status":"ACTIVE","destination":"thread","rrule":"FREQ=MINUTELY;INTERVAL=30"}.
TestObjectRootNestedUnion fails without the change ("no name among
[id mode]", "required = [mode id]", mode leaves out "delete", kind null).
2026-10-08 17:01:22 +08:00
wizzy-yangandwizzy-yang e5e87d980a 支持 Ante:把 magpie 作为 provider 写进 ~/.ante/catalog.json (#1210)
* agent: Ante takes magpie as a provider in ~/.ante/catalog.json

Ante (antigma.ai, AntigmaLabs/ante) is asked for in #1179. Its catalog is
~/.ante/catalog.json ($ANTE_HOME moves the folder), merged on top of the
providers it ships: a providers map keyed by the id --provider takes, each
with base_url, wire_style (AnthropicMessage, OpenAiCompatible, OpenAiResponse
or Gemini), an optional auth, and preferred_models, the ids its model picker
shows (docs.antigma.ai, reference/catalog-reference). magpie adds the entry
"magpie" at the gateway's /v1 on OpenAiCompatible, which is the wire style
Ante speaks Chat Completions with and what the gateway takes every model on,
and lists magpie's models in its preferred_models. The user's own providers
and the models section are left as they are, and magpie's entry goes again
when magpie steps out; a file magpie made goes with it.

No auth block is written. The gateway listens on loopback and lets any token
in from this machine (gateway.Token's own comment, lan.go's identifyCaller:
"Loopback takes any token"), and Ante counts a provider with no auth as
authenticated. A bearer env_key would mean putting the gateway's key into
Ante's environment, which the user would have to do themselves -- the same
decision Empryo's entry makes, which sends no key of the user's either. A
gateway shared on the local network is another matter, and the same one every
agent magpie wires has.

Two things are deliberately left off a model's entry. A routing group is not
told what it reasons at: which member answers, and what that member takes, is
the group's own to decide per turn, and magpieModels sets no APIs for a group
for the same reason. And support_vision is never written: Ante takes a model
as seeing images unless told otherwise, and what magpie knows is only as good
as a provider's own list -- a relay's models are often not described at all,
so writing false would have Ante drop the reader's images before the gateway,
which describes them to a model that can't see them itself
(provider.Described). No other agent magpie wires declares it either.

Ante ships macOS and Linux builds alone and suggests WSL on Windows, so the
Windows machine's Ante is usually the one in a distro: wslKinds gains it
beside Empryo, which also means the gateway address Ante is pointed at is the
one that distro reaches magpie on (place.base), and a distro not known to be
in mirrored networking gets the notice it already gets for the others.

TestAnte covers a user's own providers and models section kept as they are,
magpie's entry added and taken away, Sync repointing it, and a file magpie
made going again. TestAnteKeepsTheUsersFile covers a catalog magpie can't
parse costing magpie's provider and not the user's. TestAnteGroupSaysNoCapab
ilities covers a group declaring neither effort nor support_vision.
TestAnteEfforts covers the ladder: Ante's has no "none" or "minimal", its two
lowest, so both are its "min", and the rungs come out in Ante's order
whatever order magpie lists them in.

Tried with a real Ante 0.2.9 in WSL Ubuntu: magpie wrote the catalog, and
`ante catalog` then read 16 providers with magpie's among them, 39 models,
and Ante filled in support_vision: true for each itself. Ante then ran a real
turn through the gateway — `ante --provider magpie --model
group/auto-deepseek-v4-1-flash -p …` answered, and magpie's own usage log has
the request (ep /v1/chat/completions, req the group's id, served by one of its
members, out 10) — and so did a second model on another provider. The gateway
was reached over the Windows host's address from the distro (172.17.128.1),
this machine's own being on 127.0.0.1 alone, which is what notMirrored tells
the user about.

go vet, gofmt -l and go build (linux nogui, windows) pass. go test -tags
nogui ./internal/agent: 12 failures here, the same 12 on unmodified main (the
Windows ones AGENTS.md lists). ./internal/gui and ./internal/provider:
TestGatewayFixQuitsOnlyAMagpie, TestPurposeAssetMatchesUsage,
TestUpdateThatWontStart and TestLoginUsageClaudeAskedMeanwhile, all four on
unmodified main here too. docs/reference.md's adapter table gains Ante.

* agent: Ante keeps the user's own keys, reads ANTE_HOME, sends no effort it wasn't told to, and starts Ante on magpie (#1210)

Seven points from the review, each with a test that fails without it.

1. ANTE_HOME was in the file's own comment and in docs/reference.md but never read:
the path was fixed to $HOME/.ante, so a user who set it had magpie write a catalog
Ante does not look at. anteDir reads it through place.getenv, the way MiniMax Code
reads MINIMAX_DATA_DIR, so a distro's own ANTE_HOME - which magpie can't read -
still means ~/.ante there. "ANTE_HOME" joins agentenv.Vars so a sandbox clears it.

2. providers.magpie was written whole, so every key of the user's that magpie
doesn't write - the auth block a gateway shared on the LAN or reached from WSL
needs to send a key, http_headers, extra_body, stream_idle_timeout_secs,
thinking_display - went at the next sync, and an unchanged catalog was rewritten
every round. It goes through theirsKept and syncJSON now, as #1103 did for the
others: the user's keys in magpie's entry stay, preferred_models is magpie's list
alone, and a file that says the same as it does is left as it is.

3. The two files were written in separate steps, so a change that failed halfway
left Ante's catalog without magpie's entry and its settings still naming magpie.
Each field's Set and its Sync are wrapped in atomic(), as empryo, minimax and kimi
do.

4. The comment said Ante's "min" was the rung it sends no effort at, and folded
both magpie's "none" and its "minimal" into it. Ante's reference says what min is:
"OpenAI-compatible providers send the selected level as the same-named
reasoning_effort (min is sent as minimal)" - so min is a sent level, and magpie's
"none" has no rung of Ante's to fold into. Ante's "min" is magpie's "minimal"; a
model magpie knows only "none" of comes out as the empty list, which is Ante's own
way of saying it takes no effort setting at all.

5. The default was the highest rung the model takes, so every model magpie listed
ran at Ante's slowest and dearest level. No effort is written: "Omit for models
with no reasoning knob (Ante then sends no effort parameter and hides the effort
slider)".

6. Having magpie in the catalog never meant Ante used it. What a session starts on
is the provider and the model of ~/.ante/settings.json; with neither set Ante
"uses the first authenticated provider in catalog order", and Ante's own presets
come before magpie's entry - so while the user has any of those signed in, that is
the one picked and magpie is not. (Measured: nothing named in settings, two keyless
providers ordered aaa_other then magpie, and the request went to aaa_other's port;
settings provider=magpie and it went to magpie's.) magpie sets that pair now and
saves what it found there, so Disconnect hands it back; a provider the user picks in
Ante's own /providers while magpie is wired is theirs and stands, and Check says so
instead of keeping quiet. Ante's settings name the model apart from the provider, so
magpie writes the catalog id it put in preferred_models, un-prefixed, and reads a
bare id as magpie's only beside magpie's provider.

Tests lean on the package's own testenv, not a real ~/.ante.
TestAnteSyncKeepsTheUsersKeys is modelled on ad3b7fe5's
TestAirProviderWritesKeepCustomFields and goes both ways - sync and pick - and
wants an unchanged file to keep its mtime.

Tried with a real Ante 0.2.9 in WSL Ubuntu on this machine (Ante ships macOS and
Linux builds alone; there is no Windows Ante here). The strongest of these is the
whole of it: magpie's own Go code - ante(home).Connect(), then the model field -
wrote a catalog.json and settings.json into a temp folder, that folder was handed
to the real Ante as ANTE_HOME, and Ante ran a turn through it with no --provider,
no --model and nothing typed by hand.

- `ante doctor` read `home ok /tmp/ante-e2e` and `16 providers (1 authed), 108
  models` from ANTE_HOME, and magpie's entry came back with the base_url it was
  given: ANTE_HOME really moves the folder, and a base_url already ending in /v1
  is not doubled (the request went to /v1/chat/completions).
- What a session starts on is settings.json's provider, measured against two
  keyless providers each answering on its own port, so the logged port names the
  one Ante asked. Catalog ordered aaa_other then magpie, nothing named in
  settings: Ante asked 44331, aaa_other - the first authenticated in catalog
  order, exactly the review's "很可能选不到 magpie". settings provider=magpie: it
  asked 44220, magpie. settings provider=aaa_other: 44331 again, so a pick the
  user makes in Ante's own /providers overrules what magpie wrote, which is why
  stepping out leaves it rather than handing back the one magpie found. And with
  magpie the only authenticated provider, auto-detection does reach it - so the
  catalog entry is not useless, it is simply not enough while the user has any
  other provider signed in, which is every real install.
- What Ante sends for effort, from the same files: no reasoning_effort at all for
  a model with no effort written (item 5, as its reference says omitting it sends
  none); `--effort min` on a model sent `reasoning_effort: "minimal"` - Ante's min
  is magpie's minimal, exactly item 4; and a model Ante was told
  `"supported_efforts": []` for sent no reasoning_effort even when asked `--effort
  low`, which is what a none-only model now gets instead of a level that refuses
  it.
- The user's own keys inside magpie's entry are ones Ante reads, not decoration:
  `ante catalog` hands back the entry's auth, http_headers, extra_body,
  stream_idle_timeout_secs and thinking_display unchanged, and a bearer env_key
  there makes `ante doctor` count the provider as the one authed. That is item 2.
- The no-auth decision holds on Ante's side, isolated by doctor's counts: Ante's
  own presets alone read `15 providers (0 authed)`; a magpie with no auth block
  reads `(1 authed)`; the same magpie given a bearer env_key that isn't set drops
  back to `(0 authed)`; with the key set, `(1 authed)`. So an entry with no auth is
  authenticated and one that asks for a key the user doesn't have is not - writing
  an env_key, which the first version's comment considered, would have made magpie
  the one provider Ante refuses to auto-detect.
- Ante fills `support_vision: true` in for itself, as the PR's own note said, and
  a routing group declared with no capabilities at all still worked.

Not covered by that run: the stand-in server answered inside the distro, so this
proves Ante's config handling end to end, not a live magpie gateway relay (the
first commit's message records a real turn through one). Every probe used
ANTE_HOME into a temp folder; this machine's real ~/.ante gained no catalog.json
or settings.json.

What each fix failed without it, one test each: taking ANTE_HOME out ->
TestAnteHome "$ANTE_HOME ignored"; theirsKept out -> "the user's auth lost or
changed"; syncJSON out -> "an unchanged catalog was rewritten"; atomic out ->
"settings.json kept half of a change that failed"; the old min mapping ->
"anteEfforts([minimal high]) = [high], want [min high]"; a written default ->
"deepseek/pro: effort written"; settings never pointed at magpie -> TestAnte; a
model never written -> TestAnteModelField; Check left quiet -> "moved off magpie:
\"\""; handing magpie back over a pick the user made while wired ->
TestAnteKeepsWhatTheUserPickedWhileWired; never restoring the model ->
TestAnteConnectDisconnect "not put back"; Connect picking the model field instead
of magpie as provider -> "Connect left the user's model beside magpie's provider";
ANTE_HOME kept out of agentenv.Vars -> TestFolderVarsAreListed. Taking
preferred_models out of the whole list is the one mutation no test turns red on:
mergeTheirs cannot merge a JSON array (sync.go returns want for it), so the file
behaves the same either way and the argument is there for intent and for the other
keys, not for behaviour.

go vet ./... and go build ./... pass, as do GOOS=linux go build -tags nogui ./...
and GOOS=windows go build ./..., and gofmt is clean on LF content (this clone has
core.autocrlf and no .gitattributes, so gofmt -l reports every file).
go test -tags nogui ./internal/agent fails twelve tests, and an untouched worktree
of origin/main run the same command on this machine fails the same twelve, test for
test; ./internal/agentenv, ./internal/appdir and ./internal/edit pass, and every
Ante test passes at -count=5. The whole ./... was run on both: the failing sets are
alike, origin/main having one more, TestLoginUsageClaudeAskedMeanwhile, already
filed as #1228. None of those twelve is this change's, and none is fixed here.

* docs: agent-wiring records that Ante keeps the user's keys in magpie's entry and starts on settings.json's provider (#1210)

The two rules the review asked for, written where the repo keeps them - the same lines ad3b7fe5 (#1239) added for Air and 2d9db1b6 (#1242) for malformed configs. The Verification block gains the package's own Ante run, as #1239 added Air's.

---------

Co-authored-by: wizzy-yang <wizzy-yang@users.noreply.github.com>
2026-10-08 16:58:41 +08:00
yetone 1b29cb81a2 agent, wslrun, sessions, gui: Settings → General has Detect agents in WSL; off, magpie asks wsl.exe nothing and shows no WSL agents or sessions (#1264)
On Windows magpie lists the running distros and probes each one for agents,
their sessions and Claude Code. Etsuya233 asked for a way to turn that off.
settings.NoWSLAgents (per machine, kept by KeepOwn) now gates every
auto-discovery path: agent.wslAgents/wslHomes/WSLRunning, sessions'
wslFiles/wslDirs (via the new sessions.WSLOff hook), and wslrun.Find, which
the Claude subscription uses to run Claude Code in WSL. The toggle is shown on
Windows only and is on by default.

Verified:
- red without the change: TestWSLDetectionOff (1 WSL agent with detection
  off; with only sessions reverted, a distro's session is listed),
  TestFindWithDetectionOff (Find returned Ubuntu after asking wsl.exe).
- go test -tags nogui ./... in a sandbox HOME: every package ok except
  TestPluginLoginTakesTheLapseOff, which timed out at 63.7s under the full run
  and passes alone (-count=3) and with its package (-count=1); it doesn't
  reach WSL.
- go vet -tags nogui on agent, wslrun, sessions, settings and gui for darwin,
  linux and windows.
- GUI: wsl-agents-setting (en/zh/zh-TW/ja/de, 900 and 440px) 30/30;
  gui-ja, gui-de, gui-zh-tw, i18n-keys, keep-awake, lightweight,
  settings-sections, settings-groups 44/44 in Chromium and 44/44 in WebKit.
- Windows box (10.0.0.132), nogui magpie.exe in a sandbox profile with a
  logging wsl.exe first on PATH: on, `magpie agents` listed Claude Code · WSL
  magpie-desktop after 3 wsl.exe calls; off, `agents`, `ls` and `sessions`
  made no wsl.exe call and wrote no wsl.json.

Not tried: the toggle in the real Windows GUI window, and Claude Code in WSL
through the Claude subscription with the setting off (unit-tested only).
2026-10-08 16:57:39 +08:00
yetone 746cfbdecc provider: moved Qoder takes qoder-auth 0.2.9, whose international check-in lists the daily 100 credits (#1268)
Without Qoder's native device identity (Cosy-MachineToken and
Cosy-MachineType from its own runtime-info helper), openapi.qoder.sh
answers the campaigns list with VIEW_DETAILS only, so check-in found
nothing to claim. qoder-auth 0.2.9 (magpie-community/plugins#49) sends
it the way Qoder.app 0.4.3 does. The mover's min names 0.2.9, so
keepMovedCurrent updates every moved user. That also brings them 0.2.8's
CN enterprise VPC sign-in.

Verified: the owner's real international account through 0.2.9's fetch
(GET only) lists CLAIM_BENEFIT/CLAIMABLE/100, and VIEW_DETAILS only
without the identity. npm view shows 0.2.9 as latest. go test -tags
nogui ./internal/provider under a temp HOME passes, and go vet passes
for darwin, linux and windows.
2026-10-08 16:56:16 +08:00
yetone 4a8338cced codex: Codex's Ultrafast (service_tier "ultrafast") reaches the ChatGPT backend when magpie's pool of Codex accounts serves the turn, as it does on Codex's own sign-in; it was dropped for anything but Fast's "priority", and OpenAI's API still gets it as Fast (yxinyu715 on X: two Pro accounts, Ultrafast does nothing through magpie)
Run: TestCodexPoolKeepsUltrafast fails on the old code (backend asked for <nil>) and passes now; go test ./internal/gateway ./internal/provider ./internal/codexcat pass; go vet clean. Not tried with a real account offering Ultrafast: the owner's accounts don't list it.
2026-10-08 16:53:56 +08:00
yetone b5c83420d0 provider: moved WorkBuddy users get plugin 0.1.11, where one user send is one request in WorkBuddy's usage list and both builds name the client (使用端) (magpie-community/plugins#48)
Every step of one send (a tool result sent back, a retry) carries one
X-Conversation-Request-ID, the user's next message another, under one
X-Conversation-ID, as WorkBuddy 5.5.6's own client does (read in its
codebuddy.js). The China build now sends the client's attribution headers.

Verified: 0.1.11 resolves with npm view (latest). go test -tags nogui
./internal/provider under a temp HOME passes; go vet passes for darwin,
linux and windows. The plugin was tried at review against the real China
build and WorkBuddy AI, using credential copies in a sandbox HOME: 200
on every request, the same turn id across one send's steps and a new one
for the next message.
2026-10-08 16:51:58 +08:00
yetone 2ab69d0f87 gateway: MiniMax's thinking reaches Codex as reasoning, folded, not as the answer's text (#1267, pluo)
MiniMax's own Chat API (api.minimax.io, api.minimaxi.com), which Codex's
Responses requests to a MiniMax key are translated onto, gives a model's
thinking at the head of the text between <think>…</think>. The Chat decoder
only knew Gemini's leading <thought>…</thought>, so the thinking went to
Codex as message text. A leading <think> block is now thinking too, however
its tags fall across chunks; a tag later in the text stays text.

MiniMax asks for that thinking back in the assistant's text on later turns
(interleaved thinking), which it got before only because it was taken for
text. On MiniMax's own hosts it now goes back between <think> tags; a relay
serving MiniMax's models, and every other Chat upstream, is sent what it was
before.

Verified: TestMiniMaxThinkTagsReachCodexAsReasoning (Codex /v1/responses
through the gateway to a fake Chat upstream with MiniMax-shaped chunks),
TestMiniMaxThinkingGoesBackInTags and TestChatThinkTags fail on the old
chat.go (message text "<think>\nThe user greets me…</think>\n\nHello!",
items [message]; assistant content "Hello!" without the thinking) and pass
with it. The chunk shape is from MiniMax's OpenAI-compatible docs; no real
MiniMax key was tried.
2026-10-08 16:51:47 +08:00
yetone 7067fce5ec gateway: a turn's parallel tool calls split over two assistant messages keep their results on Chat, Cursor and Devin (#1275)
An Anthropic request may send one turn's tool_use blocks in consecutive
assistant messages, answered by one user message. buildChat's
pairToolMessages, cursorMessages and buildDevin each closed the first
message's calls at the second one: the calls were answered "interrupted"
and the real results went out as a stray user message (Chat) or were
dropped (Cursor, Devin). joinSplitCalls now joins an assistant message
onto an assistant message before it that made tool calls, as Anthropic
reads them, so the calls are pending together. Responses, Messages,
Kiro and Gemini/Code Assist already kept the results.

Tests (split_calls_test.go): Chat, Cursor and Devin split cases fail on
main and pass now; a truly unanswered call of a split turn still gets
the synthetic result; text after a call in its own message; two text-only
assistant messages unchanged; Responses guard.
2026-10-08 16:47:52 +08:00
yetone 7d8cda18aa gateway: a magpie-model compaction the ChatGPT backend breaks off after the reply began, HTTP 200 and an error event "response protection is unavailable", is asked again as text and else compacted locally, as the 502 is; the error nested in an error event is read, not "the model failed" (#1270)
Ran: go test -tags nogui ./internal/gateway (green; an earlier full run had TestOTelExportsWholeBodiesWhenOn panic once under load, passes alone -count=3 and in the rerun); GOOS=linux/windows go vet ./internal/gateway. The new tests failed before the fix with the reporter's "502 compaction: the model failed". Not tried with the real backend or Lody.
2026-10-08 16:47:24 +08:00
Timon Wong dc08da834c test(gui): hover a context cell only once it stops moving (#1263)
context-window.test.cjs failed about half its Chromium cases on macOS
(6-7 of 11 per run, on main too) at the cell hover: the tip stayed
hidden. A window's cells scale in one after another (ctx-cell), and
wheelTo only waited for the view's scroll to settle. Hovered while the
cell was still scaling, Chromium scrolled the view by 77px to reach it,
the app put that scroll back 9ms later, and the pointer left the cell,
closing its tip. A longer timeout didn't help; hovering again did.

wheelTo now waits until the target's own rect stops moving, which
covers both the eased wheel scroll and the cells' animation.

On an M3 Mac: main 7, 6, 6 of 11 in Chromium; with this change 11/11
in 5 Chromium and 5 WebKit runs, and in 3 Chromium runs beside gui-ja.
2026-10-08 16:43:03 +08:00
yetone 31b903fed2 gui: a Dock click goes to the main window on its own Space, not pulls it to the current one (#1252)
The window has MoveToActiveSpace so that a first show, or an Open from
the menu bar, puts it on the Space the user is on (a window first shown
while another app was full screen belonged to that Space from then on).
The Dock's reopen also went through openMain's Show and Focus, so with
the window open on another Space a Dock click pulled it over instead of
switching to it, as other Mac apps do.

The window now carries MoveToActiveSpace only while it is shown
(showHere: set, Show, Focus, cleared 500ms later, since clearing it at
once loses the move). The Dock's reopen (reopenMain) activates the app
and leaves an open window where it is, so macOS switches to its Space; a
closed, hidden or minimised window, or one still loading, is shown on the
current Space as before. The menu bar panel and its Open are unchanged.

TestDockReopenKeepsTheWindowsSpace (darwin, cgo) runs a real Wails app:
open, reopen while open (the flag is never set, the window stays open),
hidden then reopened, and minimised then reopened. With the old reopen
it fails ("the shown window stays on its Space").

Tried for real on this Mac (macOS 26.2), on sandbox .app builds of the
old and new code under a sandbox HOME, with a second Space added and
removed afterwards. Old build: window open on Space 1, Dock reopen from
Space 2 left the user on Space 2 and moved the window there. New build:
the same reopen switched to Space 1 and the window stayed there. A
minimised or closed window was shown on Space 2, the current one. The
menu bar panel opened and closed on both Spaces. go test -tags nogui
./internal/gui/... and go test ./internal/gui (cgo) pass under a temp
HOME; go vet, and GOOS=linux / GOOS=windows go vet -tags nogui pass.
Not tried on a full-screen Space or with several displays.
2026-10-08 16:38:14 +08:00
yetone e52d1cb820 docs: README rewritten for what magpie does now — stat line, flow diagram, warm-up, context, image MCP, keep awake, agent updates, all 47 agents; "coding agent" is now just "agent"; per-agent notes moved to the reference 2026-10-08 16:36:33 +08:00
yetone 1bc18b2f4d gateway: a history that opens with the model's turn reaches Gemini and Code Assist after a user turn, so Gemini no longer answers 400 (magpie-community/plugins#45)
An agent's compaction or a cut-down context can leave a history whose
first turn is the assistant's (text, or a tool call). Gemini turns that
away: "Please ensure that function call turn comes immediately after a
user turn or after a function response turn." buildCodeAssistSent, which
Gemini CLI and Antigravity accounts, Factory's generateContent route
(buildGemini) and Zed's Google models all build their contents with, now
puts the user turn "[Continuing from previous AI thoughts...]" before such
a history, as Gemini CLI's own hardenHistory (packages/core/src/utils/
historyHardening.ts, enforceRoleConstraints) does. Histories that open
with the user, and parallel calls split over two assistant messages, go
as before. Chat, Responses and Anthropic upstreams are unchanged.

Verified: TestGeminiHistoryOpeningWithModel fails without the change
(roles model,user, want user,model,user, for codeassist/gemini,
codeassist/antigravity and gemini, with model text and with a model
functionCall first). TestGeminiHistoryOpeningWithUserUnchanged and
TestNonGeminiHistoryOpeningWithModelUntouched pass before and after.
go test -tags nogui ./internal/gateway/... ./internal/zed/... under a temp
HOME with pinned caches; go vet -tags nogui for darwin, linux, windows.
Not tried against a real Gemini or Antigravity account.
2026-10-08 16:24:07 +08:00
yetone 927da8c41a provider: moved ZCode users get plugin 0.1.14, which lists a gift-only account's GLM-5.3 as GLM-5.3 (#1261)
sun1090's ZCode account has no GLM Coding Plan, only the Start Plan, whose
buckets serve GLM-5.3 and GLM-5.3-Flash. The card counted GLM-5.3, but the
plugin listed the Start Plan's config models (GLM-5.3-Flash, GLM-5.2,
GLM-5-Turbo) and GLM-5.3 only as GLM-5.3-Trial. ZCode itself lists a Start
Plan account's models as its balance's buckets name them, so 0.1.14
(magpie-community/plugins aca7c59) lists them by their own names too, and
keeps the -Trial entries. keepMovedCurrent updates every moved ZCode user.
The builtin check's note says the plugin now lists GLM-5.3 while a gift
bucket serves it; the check itself is unchanged.

0.1.14 resolves with npm view and its publish run passed. The plugin's
bun test (75) passes and its new test fails on 0.1.13. go test -tags nogui
./internal/provider under a temp HOME passes; GOOS=linux and GOOS=windows
go vet pass. Not tried with a real Start Plan account here.
2026-10-08 16:23:52 +08:00
yetone b6d88ce66e provider, gui: each of a provider's keys can go through a proxy of its own, as a subscription's accounts can (Beyfish_Wang on X: 不同 key 走不同的代理)
A provider of keys kept one proxy for all of them: Save dropped
AccountProxies for it. Now AccountProxies holds a key's proxy by its
KeyID, ProxyChoice reads it for the key a try uses (WithKey), and Save
keeps only the keys the provider still holds. The key editor's Proxy
row has a line per key (Provider's proxy | Direct | Custom), named as
the Accounts list names it, when the provider has two or more.

Run:
- go test ./internal/provider ./internal/gui ./internal/gateway: ok;
  TestKeyProxy fails without the provider change ("kept map[]").
- account-proxy.test.cjs, Chromium + WebKit, en + zh: 16/16; the new
  key cases fail without the app.js change. Also at 440px: 16/16.
- gui-ja, gui-de, i18n-keys, account-models, provider-many-keys,
  provider-typed, provider-proxy: all pass.
- Built binary, `magpie serve` in a sandbox HOME, three keys, four
  local proxies: k-1 (429) through its own proxy, k-2 (429) through its
  own, k-3 through the provider's; the global proxy got nothing.
2026-10-08 16:17:23 +08:00
yetone 15afd98891 provider: marshalling Claude credentials no longer writes into the cached sign-in, so two requests reading it at once don't race (main's Race red since 01e66e0f)
claudeCredential hands out its cached credentials by value, but their
raw blob is one map, and marshal wrote the token fields into it. 01e66e0f
calls ClaudeCodeMovedOff from limitHeaders beside a run's own read, so two
goroutines marshalled the same map: CI run 37744825866 (52ad2d98) failed
Race on ubuntu and macOS in six TestClaude* gateway tests with "DATA RACE"
in claudeCredentials.marshal (account.go) and "http: panic ... invalid
concurrent Body.Read call". marshal now writes into clones of the blob and
of claudeAiOauth.

TestClaudeCredentialsMarshalLeavesTheBlob marshals one credential from 8
goroutines and checks the blob is unchanged: on the old marshal it reports
WARNING: DATA RACE under -race; passes with the fix (-race -count=5).

Run at f00ed290 under a temp HOME with pinned caches: the six gateway
tests with -race -count=3 FAIL on the old marshal and pass with the fix;
go test -race ./internal/provider ok; go vet (darwin, GOOS=linux) and
GOOS=windows go build ./... pass; gofmt clean.
2026-10-08 16:07:55 +08:00
yetone 0506ea396f provider, settings, gui: Daily warm-up takes several times a day, each starting the 5-hour windows once (#1260)
Sinnhu asked for more than one daily warm-up time (e.g. 09:00, 15:05,
19:10). Settings has codexWarmAts / claudeWarmAts beside the old single
keys: the list wins when set (an empty one is off), a file from before
it reads its one time as a list of one, and the first time is written
back to codexWarmAt / claudeWarmAt so an older magpie still reads one.
Times are kept as HH:MM, sorted, once each; a bad one is refused.

The scheduler (dayStart, nextDayStart, dailyDue, heldForDay,
dayStartPassed, warmLook) takes the list: the start due is the latest
of any time that has passed, and the day kept per window is now that
start ("2026-09-28 15:05"), so each time sends once a day. A day kept by
an older magpie ("2026-09-28") counts as every start of that day had,
so nothing is sent twice on the day of the update. An account's own
time (codexWarmAtOf) stays one time.

Settings › Allowances › Daily warm-up: each time is a time field with ×
beside it while another is left, + adds one a window after the last,
Off/On as before. The times wrap in a group of their own beside + and
Off/On, so adding or removing one never moves the button pressed. New
strings in zh, en, zh-TW, ja, de.

Verified:
- go test -tags nogui ./internal/provider ./internal/settings
  ./internal/gui (temp HOME, pinned caches, pipefail): ok. go build and
  go vet -tags nogui ./...; GOOS=linux and GOOS=windows go vet -tags
  nogui on the three packages: clean.
- Fails without the change: TestWarmAtSeveralTimes (dayStart looking at
  the first time only, or a day-only key: "sent at 06:00"),
  TestWarmLookAndHoldAtSeveralTimes ("15:05 not looked at"),
  TestWarmAtKeptDayFromBefore and TestDailyDue (an old day-only record
  not honoured: "sent again"), TestWarmAtsMigrate (old key not read:
  "old file: [] ..."; first time not written back: "old file:
  ["06:00"] "" ...").
- GUI: warm-at-times.test.cjs, Chromium and WebKit, en/zh/ja/de, 900
  and 440px: 16/16; with warm-at-own, settings-groups, gui-ja, gui-de,
  gui-zh-tw, i18n-keys: 36/36 in each engine.
  Whole GUI suite (node --test, concurrency 4): 3716/3724; the 8 red
  (agent-models-redraw, azure-endpoint, context-window,
  gateway-key-limit, login-import, member-model-setting, search-api)
  each pass run alone with this change, and none reaches the warm-up
  row.

Not tried with real accounts or a live day of the scheduler.
2026-10-08 16:05:15 +08:00
Zhu Wang f00ed2901c routing: filter by several purposes with checkboxes (#1247)
* routing: filter by several purposes with checkboxes

Ticking a purpose immediately shows the union of the selected purposes while keeping the menu open. All purposes, Clear filter and removing the last selection restore every purpose. Counts, the story and history follow the same list.

Live menus ignore renderer-induced scrolling while deliberate outside scrolling still dismisses them. Update the GUI shell reference and browser coverage for multi-purpose counts, keyboard toggling, history, aliases and narrow windows in five languages.

Verified 115 isolated Playwright checks in Chromium and WebKit, JavaScript syntax and git diff --check. The new checkbox case fails against the old assets with 0 checkbox choices instead of 5; restoring the old menu scroll handler separately detaches the menu during selection in WebKit.

* routing: All purposes returns keyboard focus to its button

Address the keyboard-focus regression reported in PR #1247. Choosing All
purposes closes its menu and focuses the purpose button without scrolling.
Unticking the last purpose keeps the live menu and its checkbox focused.

The expanded checkbox test fails without the focus restoration in Chromium
and WebKit: All purposes returns keyboard focus to the purpose button
(false !== true). With the fix, 162 isolated Playwright checks pass across
both engines, including five locales, narrow widths, purpose state,
history, request/session grouping, Usage and scroll/menu regressions.
JavaScript syntax and git diff --check pass. The full GUI/Go suites and the
packaged desktop app were not run.
2026-10-08 16:02:17 +08:00
yetone 6485f5ecb5 gui: the Routing page, and Usage's Context tab with a session open, scroll to their end in WebKit: their narrow and wide layouts go by classes set from each box's width, not container queries (#1249)
In WebKit (the macOS app's WKWebView, and Playwright's WebKit) the Routing
page stopped well short of its bottom (wizzy-yang on #1213). Each time the
page was drawn again while it was scrolled near its end, WebKit cut its
scrollTop back to a shorter range. The page has query containers in it
(.rt, .rt-accts, .rt-more, .rt-col), and the cut happens during a redraw.
Seen at 440x620: 575 of 585, and up to a whole screen short when a part
was redrawn. Chromium is unaffected. With container-type set to normal on
those boxes the page reaches its end, and the cut goes away. Replacing a
container with its clone at the end reproduces it in WKWebView too.

Each box's width now sets a class, the same way container queries would
have chosen a layout:
- routing.js sets the classes from a ResizeObserver: max560 on .rt and
  .rt-accts, max460 on .rt-accts, max520/min1150 on .rt-more, and
  max440/max760 on each .rt-col.
- context.js does the same for each .ctx-card: max520 and max420.
- A rule that names the box goes through :where(), so it keeps the
  specificity it had inside its query.
- The class is set on the next frame, as quotaFit does: set in the
  observer's own call, it changes the box's height, and WebKit reports
  that as a ResizeObserver loop.
- A redrawn ctx-card starts with the width the last card in its place had
  (routing or session). It doesn't lay out wide for a frame and then
  narrow, which would itself pull the page up.
- The Safari 15 @supports fallbacks are dropped. They chose a layout by the
  window's width, and ResizeObserver covers that Safari.

Sibling: Usage → Context, with a session open, has the same bug. Each
timed read redraws the card, and WebKit pulled the page up by up to 946px
at 420 wide (682px at 1100). It is fixed the same way. The other query
containers were checked at their end with a synthetic redraw and were not
affected: Library's .lib-row.with-agents and Agents' .row.agent .who.
Sessions (.sess-pane) also jumps in WebKit as it refreshes, but it still
does with its container removed, so the cause is something else. It is
left alone here.

Run:
- routing-scroll-end.test.cjs (new): 440x620, 600x700, 900x500, 1200x600
  and 1400x700, en and zh, Chromium and WebKit, with the trace redrawing
  the page. It also checks the stage, request and column layouts. On the
  old CSS all 10 WebKit cases fail (twice); with the fix it passes 22/22
  (four runs).
- context-scroll-end.test.cjs (new): 420, 700 and 1100 wide, en and zh,
  across a timed read. On the old CSS the WebKit cases fail ("958 of
  1891"…); with the fix it passes 14/14.
- Layout compared with the old CSS: every element's rect on the Routing
  page (group editor closed and open) and in the Context card. Widths
  360–1700, en/zh/zh-TW/ja/de, Chromium and WebKit: 220 + 100
  configurations, none differ, and there are no page errors.
- The macOS WKWebView: a part redrawn at the end left the page 200–238px
  short before the fix and 0 after, at 440 and 1100.
- gui-ja, gui-de, gui-zh-tw and i18n-keys pass.
- Full GUI suite (concurrency 4): 3719/3733.
  - Pass alone: azure-endpoint, remote-magpie, signin-again and
    routing-sessions.
  - mobile-web compares with origin/main, which had moved on; against
    this commit's parent it passes.
  - panel-arrange fails the same way on the parent.
  - context-window's chromium 1100px hover flakes under load on the parent
    too: 5 of 16 parallel runs, against 1 of 16 here.
- go test ./internal/gui; GOOS=linux and GOOS=windows go vet
  ./internal/gui.

Not run: the reporter's own machine, or an old Safari 15 WebKit.
2026-10-08 15:57:08 +08:00
yetone 7e2fc88260 gui: Codex's panel says when the Codex app's model menu can't reach every model: the app asks for 100 and never the next page, so with more the last ones can't be picked there; it points to Pick and Order (#1262)
magpie writes every model to Codex. ChatGPT.app 26.930 asks Codex's
app-server for model/list with limit 100 and doesn't follow nextCursor;
the Codex CLI's /model asks with no limit. Checked with the real codex
0.160.1 app-server in a sandbox CODEX_HOME holding 150 models: limit 100
gave 100 and nextCursor "100", no limit gave all 150.

Run: codex-app-menu-cap.test.cjs (Chromium and WebKit, en and zh, 1000 and
560px; 8/8 fail on the old app.js), gui-ja, gui-de, gui-zh-tw, i18n-keys;
full GUI suite 3708/3715, the failures (azure-endpoint, mobile-web,
routing-kind) pass alone and touch nothing changed here.
Not run: the real ChatGPT.app.
2026-10-08 15:53:30 +08:00
如是 52ad2d9845 gui: a ZCode account with nothing left to spend says so, and says what to do (#1245)
A ZCode account whose free Start Plan (体验套餐) has run out and which has
no GLM Coding Plan of its own reads as "Allowance unavailable" on the
Usage page's card, which is the words for a reading that failed — the
account's real state is that it has nothing to spend. The built-in already
names it (zcodeStartQuota, internal/provider/zcode_start.go: "this account
has no GLM Coding Plan, and ZCode's Start Plan has ended or was never
started") and the plugin's usage error is that same string byte for byte
(NO_START, magpie-community/plugins packages/zcode); quotaError matched
neither, so both fell through to the fallback.

The card now says it, and says the action on the card itself: the
"subscribe at …" wording is in the sign-in errors (zcodeSignedIn /
signedIn), which never reach this card, so there was nothing to hover for
(yetone on #1001). "has ended" would also be wrong for an account that
never started one, hence "no free Start Plan".

The match is anchored on the whole card sentence, so the sign-in errors —
which name the address themselves — and the sibling "…Start Plan could not
be read: <err>" (a reading that failed) are both left alone.

zh, zh-TW, ja and de get the new string. balance-fix.test.cjs gains both
card errors, the sign-in error and the could-not-be-read one, asserting
the first two get the card's words and the last two do not; the new string
joins its list of those needing a Chinese. Red/green: the two card
assertions fail with the mapping taken out of app.js, and the
could-not-be-read and sign-in ones fail if the match is loosened to
"Start Plan has ended" anywhere in the string. 108 tests pass across
balance-fix, gui-de, gui-ja, gui-zh-tw and i18n-keys.
2026-10-08 15:39:50 +08:00
yetone 01e66e0f4a gateway: a reply a Claude subscription account answered carries its anthropic-ratelimit-unified-5h/7d headers, so a Claude Code signed in to claude.ai shows the 5-hour and weekly limits in its status line (claude-hud, #1257)
Claude Code tells the allowance in its rate_limit_event, not as headers, so
magpie says what it keeps of the account again as Anthropic does: a share
0-1 and a Unix-seconds reset per window, set as the request comes in and
again as the reply begins, after the turn's own event.

Claude Code 2.1.293 reads them only when it is signed in to claude.ai (the
sign-in field's claudeai); with magpie's key it ignores them.

Run: go test -tags nogui ./... (temp HOME); the two new tests fail without
limitHeaders; GOOS=linux/windows go vet of gateway and provider; real
Claude Code 2.1.293 in a sandbox HOME against a fake server sending these
headers: its statusline stdin had rate_limits.five_hour/seven_day with
used_percentage 42/17 when OAuth-signed in, none with ANTHROPIC_AUTH_TOKEN.
Not run: a real Claude account through a running magpie.
2026-10-08 15:28:52 +08:00
yetone b2432754e5 usage, gateway: Antigravity's gemini-3.8-flash answered as gemini-3.8-flash-n is no longer marked as another model (dumplings on Discord)
Google's Code Assist backend names the deployment serving Gemini 3.8 Flash
"gemini-3.8-flash-n" in modelVersion, for every level it is asked at. On the
owner's real Antigravity account (daily-cloudcode-pa, 2026-10-08)
gemini-3.8-flash-low, -medium and -high all answered gemini-3.8-flash-n, with
or without a thinking level. gemini-3.8-flash-n itself is a 404 and
fetchAvailableModels doesn't list it. 3.7/3.6 Flash's levels answer the bare
family name, which #462 already allowed. So the requests log's amber "actual
model" and its "probably swapped" note were a false flag.

usage.GeminiServing accepts the sent Gemini model's own name plus "-n".
Swapped and the readers for kept rows and routes (request_page row(),
history routedAgain) all use it, so rows already logged read correctly
too. It covers Gemini only. gpt-5 -> gpt-5-mini, gpt-5 -> gpt-5-n,
claude-sonnet-4-5 -> -n, gemini-3.8-flash -> -lite, -> gemini-3.7-flash-n,
-> -nano and -high -> -low are still swaps.

Verified: TestSwappedGeminiServingName, TestLedgerGeminiServingNameIsNoSwap,
TestKeptRowGeminiServingNameNotSwapped and
TestRouteKeptGeminiServingNameNotSwapped fail on the old code ("gemini-3.8-flash
answered as gemini-3.8-flash-n is the model asked for", "still swapped") and
pass with it. Sandbox magpie on a copy of the real Antigravity login: before,
the routing log had swapped:true on every gemini-3.8-flash-n try. After, chat
completions at none/low/medium/high and /v1/responses are not swapped, and
the ledger reads the earlier rows as not swapped. go test -tags nogui ./...
passed under a temp HOME. go vet ran for darwin/linux/windows, and the
linux/windows builds passed.
2026-10-08 15:15:37 +08:00
yetone 9fcd332b6c proc: a .cmd or .bat is run through cmd.exe with each argument quoted for it, so npm.cmd under C:\Program Files\nodejs (nvm-windows) no longer runs "C:\Program" when magpie updates Claude Code (wztlink1013 on Discord)
Windows starts a batch file as `cmd.exe /c <line>`, and Go builds that
line for a program's parser: with more than two quotes cmd.exe drops the
first and last, so `"C:\Program Files\nodejs\npm.cmd" install -g --prefix
"C:\Program Files\nodejs" …` ran C:\Program. An argument with & or | was
also left unquoted and split into a second command. Every command magpie
runs is made by proc.Command/CommandContext, so the fix is there:
cmd.exe /d /e:ON /v:OFF /s /c "<script> <args>", each argument quoted as
Rust's std does for batch files (doubled ", % broken up).

TestBatchFileInFolderWithSpace (windows) runs npm.cmd, a .bat and npm via
PATH under "Program Files" with the reporter's arguments plus & | % ^ and
trailing-\ cases, through a script that hands %* to a real program. On the
old code it fails on the Windows box with "'…\Program' 不是内部或外部命令".
On the Windows box (Windows 11, zh-CN) magpie's own updater
(howInstalled + runUpdate) on a real npm install of Claude Code 2.0.50
under "…\Program Files\nodejs": old code failed with the reporter's error,
new code updated it to 2.1.293.
2026-10-08 15:04:24 +08:00
yetone 811681bc72 agent: on a Claude model that is no Fable, Claude Code's fable tier is left unset instead of following the main model, so Opus is no longer taken for Fable (Zhenzhen on Discord)
`magpie claude claude/claude-opus-5-5` wrote ANTHROPIC_DEFAULT_FABLE_MODEL=
claude/claude-opus-5-5[1m]. Claude Code 2.1.293 takes a model id equal to
that variable for a Fable model (Sye/Vle in its bundle), so on a Claude Pro
sign-in without Fable it asked for usage credits and fell back to Haiku.

follow() now gives the fable tier no model on a Claude model that isn't a
Fable; writeTiers leaves such a tier out of the env. On a Fable main model,
and on another vendor's model (Claude Code knows nothing of it), the fable
tier follows as before. Claude Code's own /model fable still runs on the
main model at the gateway (claudeStandInAt, asserted in the test).

Kept for the user: a fable pick of their own (even the main model) stays;
a fable effort they set keeps the tier on the main model at that effort;
a non-magpie value they wrote while routed stays as written; their own
pre-magpie value is still stashed and given back on `model default`.
Follow takes out a fable tier an older magpie wrote on a Claude model.

Verified: TestClaudeFableTierOnClaude fails on the old claude.go with
"on Opus: fable tier written as \"anth/claude-opus-5-5\", want it left
out"; breaking the Follow migration, the user-value keep and the effort
fallback each fails it too. go test -tags nogui ./... green under a temp
HOME with pinned caches; go vet + GOOS=linux/windows go vet of
internal/agent; go build, GOOS=linux -tags nogui and GOOS=windows builds.
Not tried with a real Claude Pro account.
2026-10-08 14:55:56 +08:00
yetone 10f7b4aa3f davsync, gui: a WebDAV server whose HEAD says Content-Length: 0 no longer fails every shared usage day as "kept 0 of 6869 bytes", and a usage share that failed is its own red line under the sync status (#1259, mzcinf on 坚果云)
After each PUT, check read the file's size from a HEAD and called anything
shorter a cut write. On 坚果云 every usage write failed that way with 0
bytes kept, three tries each; the 0 can only have come from the HEAD's
Content-Length, since a 6869-byte body that the PUT sends with its
Content-Length (not chunked) isn't cut by a dropping network three times
running. A HEAD that says short is now asked again of PROPFIND (Depth 0)
getcontentlength, the size WebDAV clients of 坚果云 read. The write counts
as kept when that size is whole. When PROPFIND gives no size, the HEAD's
stands. A real cut write is still told as cut, with the bytes PROPFIND
says were kept. The extra request is made only after a short HEAD, so
坚果云's request limit isn't spent on servers whose HEAD is right. The
backup's own PUT goes through the same check, so a 坚果云 user whose
setup changes would have hit the same error on the main sync.

Settings > Sync put "Couldn't share usage: …" in the same grey line as
"Synced · host", so it read as part of a sync that went fine. It is now a
line of its own under the status, in red, wrapped whole at 440px. The CLI
already printed it on its own line.

Verified: TestNutstoreHeadSaysNoLength and TestNutstoreBackupWrite use a
fake 坚果云: HEAD Content-Length: 0, real getcontentlength on PROPFIND,
409 for a read in a missing folder, a chunked PUT refused. Whole writes
sync with no usage error, and each write goes once with one HEAD and one
PROPFIND. A tunnel that keeps half is still told as cut, with the half it kept.
On the old dav.go all three fail ("the WebDAV server kept 0 of 536 bytes
of magpie.magpie-backup", "kept 0 of 6869"). TestDAVShortWrite and
TestUsageSharedShortWrite/TestUsageSyncShortWrite pass unchanged.
sync-usage-error.test.cjs runs in Chromium and WebKit, en/zh/ja/de, at
900 and 440px, and fails on the old app.js ("the status line carries no
usage error: 14:46 已同步 · dav.jianguoyun.com · 用量未能共享:…"). The
sync-*, s3-sync, usage-computers, gui-ja, gui-de, gui-zh-tw, i18n-keys
and click-scroll tests pass, 78/78. go test -tags nogui -count=1
./internal/davsync ./internal/gui pass under a temp HOME. go vet passes
on darwin, GOOS=linux and GOOS=windows. Not tried against a real 坚果云
account: that its HEAD answers 0 is inferred from the error, and that its
PROPFIND gives the real size is how its other WebDAV clients read sizes,
neither seen here.
2026-10-08 14:52:11 +08:00
yetone e90f30d99c provider: a built-in account signed in again is read afresh, not answered by the reading kept from the refused sign-in (8c0ffcc6's siblings)
8c0ffcc6 dropped a plugin account's kept usage reading when it signs in
again. The built-ins had the same bug: every sign-in and import keeps its
account through addLogin (Claude, Codex), addSideLogin (Copilot,
Gemini/Antigravity, Kiro, Devin, Grok, ZCode, Zed, Factory, MiMo, Command
Code, ChatGPT API), wbKeepSignIn (WorkBuddy, WorkBuddy AI) or qoderSave
(Qoder, Qoder CN), and none of them touched loginUsageCache.
forgetAccountCaches drops only the Usage page's cards, which are read
again through the same per-account cache, so for up to a minute both
LoginUsage and the Usage page showed the old sign-in's refusal for the
renewed account.

Those four store points now call StaleAllowance for the account under the
name it is kept by (codexName's, WorkBuddy's uid-suffixed name), after
loginsMu is let go, so every sign-in path and import is covered.

Tests, each red on origin/main and each red again with only its own store
point reverted:
- TestCodexSignInAgainReadsUsageAfresh: the browser sign-in twice,
  /wham/usage 401 then 200 ("signed in again, but the usage is the old
  sign-in's: ... Error:Unauthorized")
- TestFactoryKeyAgainReadsUsageAfresh: a key import, then a new key for
  the same account ("... Error:Factory: Invalid API key")
- TestOwnStoreSignInAgainDropsTheReading/{workbuddy,qoder}

Run: the new tests at -count=3 and -race -count=3; go test -tags nogui
./... under a temp HOME with pinned caches, all ok; go vet and
GOOS=linux/windows go vet -tags nogui ./internal/provider.
2026-10-08 14:11:24 +08:00
yetone db0feb3615 library, gui: a remote MCP server's headers and a command's env can name ${NAME}: the library keeps the placeholder and each agent gets its own syntax, so the token is never written into an agent's settings (#1250)
The library keeps `${NAME}` as typed. refsOf (internal/library/envref.go)
gives each MCP format the agent's own syntax, with the source beside each:
${NAME} for Claude Code, Droid, Grok, Gemini, Crush, Copilot, Pi, OmO, omp,
Qoder, AtomCode, Hermes and Command Code; {env:NAME} for OpenCode and MiMo;
${env:NAME} for Cursor; Codex's bearer_token_env_var, env_http_headers and
env_vars; Goose's ${NAME} plus env_keys. An agent with no syntax (Claude
Desktop, Antigravity, Kimi, Cline, ZCode, dsh, Devin, Pi with
pi-mcp-extension) is never given such a server: supports() refuses it with
the reason, an entry magpie wrote before is taken out, and its chip is
greyed with the reason on the row and in the editor. Codex's and Goose's
extra keys are magpie's only while the server names a variable, so the
user's own env_vars / env_keys stay. The editor says how to write one under
Headers and Environment; a check whose variable isn't set where magpie runs
says which one ("GH_TOKEN not set").

Verified:
- go test -tags nogui ./... (sandbox HOME): all ok.
- New TestEnvRefs* (per-agent encode/read-back, left-out agents, library
  keeps the placeholder, user values kept, health check novar) fail with
  the behaviour turned off (refsOf -> ${NAME} for all, no refsProblem /
  refKeys, no expansion).
- library-env-refs.test.cjs (Chromium + WebKit, en/zh/ja/de at 440px)
  fails on the old library.js (4/4 subtests); gui-ja, gui-de, i18n-keys,
  library-servers-bulk, library-all, by-agent, project-servers,
  library-mcp-health, library-null-agents, library-items: 109/109 pass.
- Real: magpie built from this tree synced a library server with
  Authorization: Bearer ${FAKE_MCP_TOKEN} and X-Api-Key: ${FAKE_KEY} into a
  sandbox HOME, then against a fake MCP on 127.0.0.1:3561 that answers only
  the right bearer: Claude Code 2.1.293 `mcp list` Connected, Gemini CLI
  0.62.0 Connected, Codex 0.160.1 app-server listed the tool (authStatus
  bearerToken), cursor-agent sent both headers expanded; no agent file held
  the token. Antigravity got the Problem and no entry. Not run for real:
  OpenCode (its mcp list goes through the user's background service),
  Goose, Crush, Copilot and the rest; their syntax is from their source.
- go vet (darwin, GOOS=linux, GOOS=windows) for internal/library and
  internal/gui.
2026-10-08 14:04:21 +08:00
yetone 173ab71e8b gateway: a Gemini client's thinkingConfig no longer reaches a quiet group member as reasoning_effort (#1253)
withoutReasoningAsk (#950) took the reasoning ask off Chat, Responses and
Anthropic bodies sent to a group member known not to think, and passed a
Gemini-protocol body through as it was. parseGemini then read
generationConfig.thinkingConfig into the request's effort, and the quiet
member was sent reasoning_effort.

It now drops generationConfig.thinkingConfig when it asks to think, by
the same reading parseGemini uses (gThinking.effort: a level, a budget,
-1 as medium), keeping the rest of generationConfig. A budget of 0 is no
ask and stays. A member the user fixed at an effort isn't quiet and is
sent the ask as before.

TestGroupQuietMemberGeminiThinking sends generateContent through
lanGuard(s.Handler()) to a group whose thinking member fails over to a
quiet one, for thinkingLevel, a budget and -1. Without the change it
fails: "the quiet member was sent map[... reasoning_effort:high ...]";
TestWithoutReasoningAsk's new Gemini cases fail too. With it both pass,
and the thinking member and a fixed quiet member still get
reasoning_effort. go test -tags nogui ./internal/gateway passes under a
temp HOME with pinned caches; the three group tests pass with -race
-count=5; go vet and GOOS=linux/windows go vet -tags nogui pass.
2026-10-08 13:58:58 +08:00
yetone 8c0ffcc640 provider: a plugin account signed in again is read afresh, not answered by the reading kept from the refused sign-in (TestPluginLoginTakesTheLapseOff red after its first run in a process)
clearPluginLapse took the lapsed mark off a plugin account signed in
again, but its usage reading from before stayed in loginUsageCache for a
minute. The next LoginUsage was answered from it: the old sign-in's
"expired" shown for the renewed account, and no plugin asked, so nothing
marked or cleared. TestPluginLoginTakesTheLapseOff hit it from its second
run in one process (-count=3: pass, fail, fail): the run before's last
reading, still under a minute old, answered the "gone" account's read
under the new HOME, and the vendor's refusal never marked it.

A sign-in now drops the account's kept reading (StaleAllowance), on both
paths that finish one (pluginDone and PluginSignedIn).

TestPluginLoginReadsUsageAfresh fails without the change at -count=1
("signed in again, but the usage is the old sign-in's: ... Error:the
FakeCo sign-in has expired"). With it, -run TestPluginLogin passes at
-count=5 and with -race -count=5; go test -tags nogui . ./internal/provider
./internal/plugin pass under a temp HOME with pinned caches; go vet and
GOOS=linux/windows go vet -tags nogui pass on the two packages.
2026-10-08 13:52:50 +08:00
如是 1b8c33b5e2 provider: a routing group reasons when any member does, not only when all of them do (#950)
* provider: a routing group reasons when any member does, not only when all of them do

groupEntries started a group at Reasoning: true and intersected it with
each member's (e.Reasoning = e.Reasoning && thinks), so one member that
doesn't think made the whole group 不支持推理. Pi reads that off /v1/models
and turns /thinking off for the model: a routing group of
deepseek-v4-flash-0731-max (a Trae plugin model magpie read as one that
doesn't reason) with a DeepSeek that does lost reasoning for both.

The group now reasons when any member does. Images already worked this way
(#756: a text-only member doesn't turn every image away), and the gateway
fits a request's effort to the member that gets it (fitFor), failing over
when a member refuses the level (failEffort). What the group offers as
levels is not changed: a member known to take none still leaves the group
none (#597), so such a group is Levelless — a shape magpie serves — rather
than one that doesn't reason.

group_reasoning_test.go (6 tests) fails without the change:
TestGroupReasoningFromAMemberThatThinks, TestGroupReasoningLevels and
TestGroupReasoningQuietMemberKeepsTheRest report reasoning off.
TestModelsListReasoning, the /v1/models contract test, fails the same way
and is updated to the new semantics. go vet, go build, GOOS=linux
GOARCH=amd64 go build -tags nogui and GOOS=windows go build pass; go test
-tags nogui ./internal/provider ./internal/plugin pass under a temp HOME.
internal/gateway passes except TestPluginStreamStalledClientKeepsOther
RequestsMoving, which fails on this machine with and without the change.

* gateway, provider: a group's member that can't think is sent no reasoning, rather than a 400

A routing group reasons when any member does (#950, 533887c2), so an agent
asks a group for reasoning that a member of it may not think at all. The
effort reached every member, and some vendors turn a reasoning ask away
with a 400 on a model that can't think — the review's second point: the
comment said the gateway routes a reasoning request to the members that
take it, and nothing did.

The gateway now sends such a member no reasoning ask, in the agent's own
protocol: Chat's reasoning_effort and reasoning, Responses' reasoning (with
reasoning_effort, which some relays take), Anthropic's thinking when it
asks to think — thinking disabled is no ask and stays — and output_config's
effort alone, the rest kept. Everything else goes as the agent sent it, the
Responses effort-update history is skipped for it, and the trace's Effort is
"" (nothing was sent) with Fixed kept, so the user's own pin is still read.
Which member goes first is unchanged: the group routes as it did, and only
the body changes.

provider.Entry.Quiet is the judgment: magpie has a word on the model — its
vendor's or its maker's list, or its provider's own account list — and that
word says no reasoning. A model nothing speaks for isn't quiet: it is sent
the effort the agent asked for, as #597 leaves it. Nor is one that takes
levels, which includes a model the user gave levels of their own: those
take the effort the gateway fits to them. Direct requests outside a group
are untouched, as TestPluginThinkingOff pins.

TestModelsReasoningWithoutLevels (thinks_test.go) still expected
group/mixed false; the review's first point. It is updated with a comment
saying why the #402 expectation changes, and a group of two quiet members
keeps the "none of them thinks" case.

TestGroupNonThinkingMemberNoEffort (group_reasoning_test.go) fails without
the change: with the withoutReasoningAsk call disabled it reports "B: the
quiet member was sent map[... reasoning_effort:high]". TestEntryQuiet
(provider) pins the judgment, and TestWithoutReasoningAsk the field set per
protocol.

go vet ./..., go build ./..., GOOS=linux go build -tags nogui ./... and
GOOS=windows go build ./... pass. go test ./internal/provider,
./internal/catalog and ./internal/plugin pass whole; internal/gateway
passes in three chunks covering every test (TestGroup|TestFixed|TestFast|
TestModels|TestPluginThink|TestWithout|TestMember, TestEffort|TestResponse|
TestReasoning|TestQuiet|TestTrace|TestRoute|TestRules|TestRule, and the
rest), 43s + 36s + 790s. The whole suite in one process times out on this
machine in an unrelated test (TestRuleDecidesAtTurnStartAndHolds here,
TestRequestBodyProgressRenewsIdleDeadline on another run) — the base commit
533887c2 times out the same way, at 800s — so the chunks are what was run.
The GUI is untouched, so no Playwright run.

* gateway, provider: a member the user fixed at an effort keeps it, quiet or not

The review's remaining point: Quiet() rests on magpie's catalog or an
account's own model list, and what this PR is about is that word being
wrong — the Trae plugin gave no capabilities, and magpie read a thinking
model as one that doesn't. A member the user fixed at an effort
("provider/model:high", #189) is the user saying this model does think, so
magpie's word doesn't override theirs: the gateway sends the fixed member
its effort and strips the reasoning ask from the others as before.

quiet := isGroup && c.effort == "" && quietTo(c.p.ID, c.model). c.effort is
only ever the member's own fixed effort (Member.Effort, planLevel), never
the agent's, a group's Group.Levels, the turn's pick or the Settings' — so
those are stripped as they were.

TestGroupNonThinkingMemberNoEffort's E is now the other way: the fixed quiet
member is sent reasoning_effort "high", and the trace's Effort is "high"
with Fixed "high". Dropping the c.effort == "" guard makes it fail with
"E: the fixed member was sent map[... model:plain]". quiet.go and
Entry.Quiet say why.

gofmt, go vet ./..., go build ./..., GOOS=linux go build -tags nogui ./...
and GOOS=windows go build ./... pass. The review's own set passes —
go test -count=1 -run 'TestGroup|TestWithoutReasoningAsk|TestEntryQuiet|
TestModelsReasoning|TestModelsListReasoning|Thinks|TestPluginThinking'
./internal/provider ./internal/gateway — and so does internal/provider whole
(208s). internal/gateway passes in chunks (Test[A-D] 340s, Test[S-Z] 216s,
Test[^A-DS-Z] split over TestEffort|TestResponse|TestReasoning|TestQuiet|
TestTrace|TestRoute|TestRules|TestRule|TestFixed|TestFast 38s and the rest
earlier): the whole suite in one process still hangs here on an unrelated
test (TestCodexBodyReadsPastOldLimit this time, TestRuleDecidesAtTurnStart
AndHolds and TestRequestBodyProgressRenewsIdleDeadline before), which the
base commit does too and which passes alone in 0.9s.
2026-10-08 13:47:13 +08:00
wizzy-yangandwizzy-yang 6a8095421e sessions tests: TestCursor expects the resume command Windows gives it (red on Windows in main since 585f7f7d) (#1248)
585f7f7d made resumeCommand put a `Set-Location -LiteralPath '<cwd>'; ` in front of a session's command on Windows, and updated the tests that assert one: TestCarryPiToOmp (transcript_test.go:168) expects the Set-Location form there. TestCursor's own assertion was left behind. It builds `want` for a Cursor chat run under /work/cur, and its Windows branch only skips the `cd` prefix rather than taking the one Windows uses, so on Windows the test asserts the bare `cursor-agent --resume <id>` while the code returns the prefixed one:

    cursor_test.go:254: resume "Set-Location -LiteralPath '/work/cur'; cursor-agent --resume 6f0c…", want "cursor-agent --resume 6f0c…"

Nothing about Cursor is wrong: the Sessions page copies that command for the user to paste into their shell (sessions.js's copy of `s.resume`), and on Windows `Set-Location` is the right form for it, as wslResume's comment already says of the distro variant ("the PowerShell line that resumes a session"). The test was simply not carried over with the rest, and CI never sees it — test.yml runs `go test` only where `runner.os != 'Windows'` (test.yml:67), Windows gets `go test -run '^$'` to compile.

The assertion now takes the Set-Location prefix on Windows, as TestCarryPiToOmp does. No production change.

TestCursor passes on Windows here and the whole internal/sessions package is ok (20.5s). It is a real check, not a mirror of the code: with resumeCommand's Windows branch made to return the bare command, the test goes red naming the missing prefix, and green again when restored. go vet and gofmt (on LF content; this clone has core.autocrlf=true and no .gitattributes, so gofmt -l flags every file) are clean. Not run on Linux or macOS, where the branch is the `cd … && …` form already covered.

Co-authored-by: wizzy-yang <wizzy-yang@users.noreply.github.com>
2026-10-08 13:34:23 +08:00
yetone 1ab6228b22 provider: moved Factory users get plugin 0.1.20, whose Claude Code compaction context quotes summaries like tool output and no longer lets a hook notification stop it early (plugins #42) 2026-10-08 12:54:55 +08:00
yetone 52e27881ac gui tests: panel-arrange's Usage window reads the saved order from its fixture, not set into state by hand, where the page's own load could answer after and put the first order back (red on Chromium en, zh, de) 2026-10-08 12:53:27 +08:00
yetone 5318231938 gui tests: usage-ledger expects the Usage page's Context tab (red since 586f2bce added it) 2026-10-08 12:53:27 +08:00
yetone fd29653d4e context: a window opened on the Context tab loads it at once, not at the refresh's first tick five seconds on
context.js comes after app.js, and app.js shows ?view=usage and reads the
state before context.js is there: when /api/state answered first, both
paths called window.loadContext while it was undefined, the TypeError went
to the status line, and the tab stayed empty until the 5s refresh (found
as context-window's webkit de 1100px flake, 2 of 6 runs). The calls are
optional now, and context.js loads the tab itself when the page opened on
it, as plugins.js and library.js do. The new test holds context.js until
the state has answered: it fails on both engines without the fix and
passes with it; context-window passes 22/22, the case that flaked 10/10.
2026-10-08 12:53:27 +08:00
yetone b5a7d3999b gui: the requests table's width, details and scrollbar are fitted on the next frame, not in its ResizeObserver's own call, so WebKit no longer reports a ResizeObserver loop as a page error (number-units, red on main under load)
The #ledWrap observer set --ledw (an open row's details box width) and
called ledHScroll() in its own call; each can change the table's or the
wrap's height, which the observer is owed in the same frame. A probe
wrapping ResizeObserver caught it resizing an observed element in WebKit en
under load; with the fix, number-units and the probe pass under the same
load (52/52 twice), and ledger-hscroll, usage-ledger(-fit, -detail, -chart,
-content), panel-usage and click-scroll's Requests steps pass on Chromium
and WebKit.
2026-10-08 12:53:27 +08:00
yetone 5d0c1dcad7 agent, library, sessions: a Claude Desktop installed as an MSIX package on Windows is found, wired, given MCP servers and skills, and its Cowork calls read, in the package's folders (Kilig on Discord, Windows 10 LTSC 21H2)
Desktop from its setup.exe there runs packaged, so Windows keeps what it
writes under %APPDATA% and %LOCALAPPDATA% in
%LOCALAPPDATA%\Packages\Claude_<publisher>\LocalCache\{Roaming,Local}.
Nothing was in %APPDATA%\Claude or %LOCALAPPDATA%\Claude*, so magpie didn't
recognise Desktop at all. The packaged app reads its own copy before the
real folder's, so writing the usual folders wouldn't reach it either.

New internal/desktopdir is the one resolver for Desktop's folders: Data
(its own userData: %APPDATA%\Claude, the package's LocalCache\Roaming\Claude),
Mode (the Claude folder deploymentMode goes into, %LOCALAPPDATA%\Claude as
before) and ThreeP (Claude-3p). The package is found by globbing
Packages\Claude_* (the publisher id isn't assumed) and used unless Desktop
runs in the usual folders: it has run there (Chromium's "Local State"; an
%APPDATA%\Claude holding only another tool's claude_desktop_config.json
doesn't count) and not later in the package's. Every place that built
these paths goes through it:

- agent: desktopDirs (its 3p switch's writes, DesktopConfig3p, Claude
  Code's desktop check in claude.go) and detection, which also looks at
  Data (replacing the separate %APPDATA%\Claude check). windowsDesktopDir
  moved into desktopdir unchanged.
- library: apps() (Desktop's MCP file, was os.UserConfigDir) and
  desktopSkillRoots (Cowork's skills-plugin).
- sessions: desktopDataDirs, a copy of agent's resolver, now desktopdir's
  All(); it also adds %APPDATA%\Claude on a usual Windows install, where
  Desktop keeps 1p Cowork sessions (only %LOCALAPPDATA%'s were read). usage's
  request_page and session_provider read it through sessions.DesktopDataDirs.

Tests: TestFindMSIX/TestFindWindowsClassic/TestFindOthers (desktopdir),
TestClaudeDesktopMSIX (agent: detected, switch writes LocalCache\Local\Claude
and Claude-3p, nothing in the usual folders), TestClaudeDesktopMSIXLibrary
(MCP file and skills-plugin in LocalCache\Roaming\Claude),
TestCallsCoworkMSIX (sessions). With the call sites put back to origin/main
the last three fail: "an MSIX Claude Desktop isn't detected", "no Claude
Desktop target: <nil>", "dirs: [.../Claude .../Claude-3p]".

Run: go test -tags nogui ./... under a temp HOME with pinned caches (all
ok); GOOS=darwin|linux|windows go vet -tags nogui on desktopdir, agent,
library, sessions, usage; GOOS=windows go build, GOOS=linux go build -tags
nogui. On the Windows 11 box (Squirrel install, no MSIX package): the
windows test binaries pass every Desktop/MSIX/Cowork test; the full agent
and sessions binaries fail the same 16 and 76 tests (run outside their
testdata) as origin/main's; a read-only probe of desktopdir.Here() gives
the usual %APPDATA%\Claude, %LOCALAPPDATA%\Claude and Claude-3p, Package "".
Not tried against a real MSIX Desktop: none on the box, and Claude-3p's
place in the package (LocalCache\Local, as Local\Claude is in Kilig's
listing) is inferred, not seen.
2026-10-08 12:47:48 +08:00
Strelizia 69b6772794 provider: Qoder check-ins follow the campaign window, so a campaign open past Beijing midnight is claimed and the next one isn't missed (#1173)
Qoder and Qoder CN campaigns run on [startAt, endAt) windows that cross Beijing midnight, so a campaign claimed yesterday could stand in for the whole new day and the next campaign was never claimed.

- A campaign is active by its upstream window, so one still open after Beijing midnight can be claimed.
- A saved result records the campaign's end in `until`, and is reused only on the same Beijing day, within 30 minutes and before that end; after that the list is read again (about 48 list reads per account per day, `inactive` included).
- Manual check-in always verifies upstream; failures and older records without `until` keep the old retry behaviour.
- Only Qoder sets `recheck`; WorkBuddy, Trae CN and MiniMax keep their once-a-day settlement.
2026-10-08 12:46:41 +08:00
yetone 3aeb7d1bf8 gateway: a model a key's plan doesn't serve rests that model alone, not the key (#1235)
SenseNova answers a Token Plan key asked for deepseek-v4.1-flash with
403 "model is not available in the current token plan" while the same
key serves deepseek-v4-flash. That refusal was a plain failure: it
rested the whole key, its backoff counted per key and doubling up to
10 minutes, so an agent that kept asking for the model left every key
of the provider resting for every model (Sun1090: both keys "失败 · 9
分钟后恢复").

A 400/403/404/422 whose body says the model isn't served
(unservedWords), with no quota, credit, rate-limit or channel words,
now rests only that key's or account's model (modelRefused, keyed by
restID, which is now restKey/model for every candidate), its backoff
counted by the model and cleared when the model answers. The key's
other models stay first in order, and its row shows no rest.

TestModelNotInPlanRestsTheModelNotTheKey (two keys, four requests for
the refused model, SenseNova's error shape) fails without the change:
"key One rests for a model its plan lacks: {Why:other Status:403 ...
By:backoff Failures:3}" and "deepseek-v4.1-flash doesn't rest". With
it: go test -tags nogui ./... under a temp HOME passes; -race -count=5
over TestModelNotInPlan|TestSeveralKeys|TestFallback|TestRouting|
TestPool|TestGroup passes; go vet (darwin, GOOS=linux, GOOS=windows,
nogui) passes. Not tried against a real SenseNova key: the body's
"code" field in the fixture is a guess; the message is the reporter's.
2026-10-08 12:26:53 +08:00
yetone e4c292f655 provider: moved ZCode users get plugin 0.1.13, whose claim line has one fixed name the GUI can translate (plugins #43) 2026-10-08 11:57:15 +08:00
Alex be1ce5d4d2 davsync: incomplete S3 listings keep cached usage days (#1243)
Reject truncated listings with missing or repeated tokens and listings that exceed the page limit. On the old code the regression reports successful partial listings and shareWith removes a cached day. Focused tests pass in a temporary HOME.
2026-10-08 11:52:26 +08:00