Commit Graph
3654 Commits
Author SHA1 Message Date
yetone 618bfc1a95 kimi: pick Kimi Code's subagent pool and its effort (XiaoLing_Arisa on X)
XiaoLing_Arisa asked on X for Kimi Code's subagent pool (子代理池) on the
Agents page: which models its subagents may run on, and how hard they
think. Kimi Code 2.x keeps them in config.toml's [secondary_model]:
default_model (the legacy `model` stands for it), the pool
[secondary_model.models] ("alias" = "when to use it") and default_effort.

- internal/agent/kimi_secondary.go: three fields, subagent_model,
  subagent_pool and subagent_effort, written the way Kimi Code takes
  them. Its validator refuses a pool that lacks the default, a name with
  no [models."…"] table, and an effort a pool model can't take, so a
  default goes into the pool, a pool without the default gets its first,
  and only the levels every pool model takes are offered
  (kimiPoolLevels). A magpie model goes in only while [providers.magpie]
  is there. Keys are set in place; hints, other keys and comments stay.
  Before Sync or Unwire drops a magpie model table, its name leaves the
  section (kimiPruneSecondary). The default goes back to the user's own
  (stashed at kimi:<path>:secondary) or to the pool's first, and an empty
  section goes. The user's own pool of their own models is never touched.
  kimi-cli (legacy) has no such section. A stopped WSL distro shows none
  of the three, since each reads the config (#3896).
- GUI: the three fields form one Subagents line in the opened row: the
  model, then the effort (disabled until a model is set), then a
  multi-pick pool menu that stays open between ticks. The model's tick
  can't be removed. The picker's note says an unset model runs each
  subagent on the lead's model. The line is drawn by kimisub.js, which
  Details imports before its first slide so the sheet measures it.
- Size budgets +457 (reason in core_budget_test.go). Translations in
  zh, zh-TW, ja and de. kimisub.js is added to old-webkit's list of
  scripts loaded on demand. The Kimi bullet in agent-wiring.md is
  updated.

Run at this tree on mica (mica-run):
- go test -tags nogui -count=1 ./internal/agent ./internal/gui: ok,
  including TestKimiSubagentPool*, TestWSLColdPlaceOpensNothing and
  TestCoreScriptBudget. An earlier run of these packages found the cold
  read and the budget overrun; both are fixed here.
- go vet ./... on darwin, GOOS=linux go vet -tags nogui ./... and
  GOOS=windows go vet ./...: ok. go build: ok. gofmt -l .: empty.
- GUI: kimi-subagent-pool passes 20 of 20 (Chromium and WebKit, 5
  languages, 1100 and 560px). kimi-thinking passes. agent-details-ready,
  old-webkit and i18n-keys have 35 reds, and origin/main ff88ec264 has
  the same 35, all filed: #6373, #6369 (agent-details-ready), #6030,
  #5919 (old-webkit), #6877 (i18n-keys).
- Broken by hand: with Details not waiting for kimisub.js,
  kimi-subagent-pool goes 10 of 10 red in Chromium ("the Subagents line
  is there when Details first draws").
- Real Kimi Code 2.6.2 (npm) in a sandbox HOME with a fake SSE server:
  the pool and effort written here are read and used. A pool naming a
  model with no table is refused when a subagent starts. A bad effort is
  not refused at runtime, but magpie refuses it anyway, as the validator
  does.

Not run or tried:
- The full go test ./... and the full GUI suite: mica and mote were both
  past their load limits with other sessions' suites. Only the packages
  and GUI files above were run.
- A real Moonshot account. The subagent's "timed out" in the sandbox run
  came from the fake server.
2026-11-17 14:30:55 +08:00
yetone ff88ec264a sync: subscriptions whose sign-ins stay on this computer (Ethereal499 on X)
Sync's sign-ins can now leave chosen subscriptions out on one computer
(`signInsExcept`, provider ids; Ethereal499 on X keeps Claude's accounts
off other computers). On that computer:

- its accounts of those subscriptions never go up;
- the server's accounts of them are never merged in, so a removal or a
  new account on another computer changes nothing here;
- the server keeps them as they are for the computers that do sync them
  (syncOnce splits the remote set with SignIns.Except and puts the held
  part back with With after the merge, so the hash doesn't change);
- the preview and Restore count and restore none of them.

An id names both the built-in and its -plugin id. An old config has no
field and syncs everything as before. The setup text doesn't carry the
choice, since it belongs to one computer.

GUI: Settings > Sync > edit > Advanced, under "Sign-ins", a "Not synced"
row with a multi-select openProtoMenu of the subscriptions with an
account. The row shows only while the sign-ins tick is on. The strings
already existed in en, zh, zh-TW, ja and de. CLI: `sign-ins-except=`
on the WebDAV, S3 and GitHub setups ("none" clears it), and status
shows the excluded ids. docs/subsystems/sync-backup.md says it.

Tests:
- TestSignInsExcept (provider) and TestSyncSignInsExcept (davsync, two
  computers on a fake DAV).
- sync-signins-except.test.cjs: both engines, 1100 and 420px, all 5
  languages.

Broken by hand, each red and then restored:
- the Except in collect;
- the Except on the remote set before the merge;
- the Except in the preview;
- the With after the merge;
- the GUI form's post of signInsExcept.

Run:
- At ac4a4cf84 on mote: `go test -timeout 45m ./...`, 102 packages ok,
  exit 0.
- At ac4a4cf84, the whole GUI suite on mote. The first part ran at
  concurrency 6 under load 25 to 37, and mote rebooted mid-run (not
  this session's doing). The 410 files it never reached ran at
  concurrency 4. Reds fell in 125 files, none of them a sync-* file
  except s3-sync (see below).
- At the rebased head b781d0bcb on mote:
  - go test ./internal/davsync ./internal/provider ./internal/cli
    ./internal/gui: ok.
  - Every sync-*.test.cjs, webdav-settings-refresh and
    sync-signins-except: ok.
- gofmt -l: clean.
- On mica: go vet ./..., GOOS=linux go vet -tags nogui ./... and
  GOOS=windows go vet ./... ok, plus go build, GOOS=linux go build
  -tags nogui and GOOS=windows go build.

Red the same on origin/main 873b1f7d5, run there alone:
- s3-sync webkit en ("picking S3 must not scroll the page"), #3413 and
  #2448.
- i18n-keys (", with an image" in plugins/routing), #6877.

Not run: the full Go suite at the rebased head. Another session's full
suite held mote, and mica was full. The 125 GUI files red under load
were not each run alone on main.

Not tried: a real sync between two computers with real accounts.
2026-11-17 14:08:48 +08:00
yetone 873b1f7d5e classify: 15 seconds unset for a classifier that reasons, and its cut call is magpie's wait (ESern29751 on X)
ESern29751 on X (v0.1.4341): in a routing group with intent recognition,
magpie often 499-cancels the intent classifier's request, with MiniMax,
GPT-6 Luna and Grok 4.6 as the classifier.

Cause: those models reason before they answer. The classifier asks for
reasoning_effort none, but MiniMax thinks anyway and Grok 4.6 and Luna go
no lower than low. Through the live gateway with the classify prompt over
a real routing prompt (~5k tokens of context): grok-4.6 took 4.7-8.1s
(288-462 reasoning tokens), minimax-m2.5 3.7-10.3s (439-1012 output
tokens), gpt-6-luna 1.2-7.2s; cold calls reached 12-29s. The unset
classifier timeout was 8 seconds, so most turns were cut off, fell back to
the group's order and lost their intent routing. Each cut call was then
logged 499 "the agent canceled the request", which usage counts as no
failure, though no agent had canceled anything: askChat's own
context.WithTimeout had no cause, the mislabel #2318 fixed for an image's
description but never for the classifier.

Fix:
- settings.ClassifyTimeoutDefault 8 -> 15 (an existing Settings segment).
  A user who saved 8 keeps 8; only the unset value moves. The GUI's
  fallback segment follows (app.js), and the docs (en/zh/ja intent and
  start, gateway-routing.md) say 15.
- askChat's wait is context.WithTimeoutCause(..., sideTimedOut{"decision
  model", wait}): the usage row says "magpie stopped waiting: its
  decision model had no answer in Ns", a failure.
- Siblings checked: the advisor and Codex titles use the client's
  context, compaction and vision already carry sideTimedOut; askJev
  (decision providers) logs no 499 row of its own.
- Tests that assumed the 8-second unset wait now use 15 (classify,
  decide, decide_group, nested_classify_wait, settings).
- app.js grows by the one byte of the fallback's second digit: both
  core budgets +1 with the reason (TestCoreScriptBudget was red at
  exactly 1 over without it). A shorter `|| 15` would show a hand-edited
  negative value as its own segment, so it wasn't taken.
- site: llms-full.txt and the search indexes regenerated for the docs
  pages (node llms-full.mjs, node search-index.mjs).

Test: TestReasoningClassifierAnswersInTheWaitUnset - a classifier
answering in 10 units routes the turn with the timeout unset, and one
slower than 60 units gives no answer with one 499 usage row that says
magpie stopped waiting for its decision model and counts as a failure.

Broken by hand (mica-run): with askChat back on a plain WithTimeout the
test is red ("the classifier's cut call: 499 "the agent canceled the
request""); with the default back at 8 it is red ("gave no answer in
400ms").

Run at 0479372b8, this commit's tree (mica, through ~/suite.lock; mote was over its cores):
- gofmt -l: clean. go vet (darwin), GOOS=linux go vet -tags nogui,
  GOOS=windows go vet: rc 0 (darwin vet rc 0 at the first try on mote).
- go test -tags nogui -count=1 -timeout 45m ./...: rc 0, 103 ok.
  (The first run, on mote before the budget raise and the rebase onto
  adfa196db, was red on TestCoreScriptBudget alone.)
- node --test site/*.test.mjs: 132 of 132.
- GUI (node --test, Chromium and WebKit, five languages, 1100 and 420):
  classify-timeout-setting, settings-places, i18n-en-no-cjk green;
  i18n-keys red only on "a plugin's words are its own" over
  claude_image_budget_test.go's ", with an image", already #6877 from
  2896e82cc, untouched here.

Not tried: the real reporter's group in the GUI with these models after
the change (the timings above were measured through the live gateway
before it); the whole GUI suite (only a fallback value changed in app.js).
2026-11-17 13:31:08 +08:00
yetone 2f25728ddf claude: Use switches Claude Code itself to a setup-token account (liukaybee on X)
liukaybee adds Claude accounts with `claude setup-token` and wants magpie
to switch only which one Claude Code itself uses, without connecting it
to magpie. Such an account has no sign-in to put in Claude Code's
keychain or .credentials.json, so Use was refused ("magpie only").

Claude Code takes CLAUDE_CODE_OAUTH_TOKEN from the env of its user
settings.json ahead of its stored sign-in. Use on a setup-token account
now writes the token there (claude_token_env.go). Claude Code's stored
sign-in stays as it is and stays Active; the token account is listed
with Uses. A switch to a signed-in account, Use on the signed-in row,
or removing the token's account takes the token out again.

- A value the user set is theirs: magpie keeps only the sha256 of what
  it wrote (claude-token-env.json), never writes over another value and
  never removes one whose hash differs, even if it once wrote it.
- An unreadable settings.json is "unknown": nothing is written, the
  record is kept, and the switch fails without moving the sign-in.
- NextLogin (Switch accounts only) leaves Claude Code on a token in use,
  as its allowance can't be read.
- magpie's own runs pass --setting-sources "" and are unaffected.
- GUI: the token row's Use and In use; the signed-in row says Signed in
  with a Use back. Every new string in zh, zh-TW, ja and de.
- app.js +864 bytes over its budget, raised with the reason in
  core_budget_test.go: one swUse helper shared by both buttons, packed;
  renderAccounts draws every account row, so no page to move it to.

Real use: real Claude Code 2.1.316 in a sandbox HOME/CLAUDE_CONFIG_DIR
(never the live ~/.claude) with a deliberately broken .credentials.json
access token. The settings.json magpie's switch writes (dumped from a
test) gave a PONG with a real account's token; the file after switching
back gave "401 OAuth access token is invalid", i.e. Claude Code was on
its stored sign-in again. Sandbox homes holding real tokens deleted.

Run (mote/mica, at f00e2059d rebased on 593517bf0, then this head):
- Rebased on effdd1beb (internal/gui and internal/provider untouched
  since, but for this): TestCoreScriptBudget and the provider TestClaude*,
  NextLogin and Forget tests rerun at the pushed head, ok.
- go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go
  vet ./...: ok. gofmt -l: clean.
- go test ./... -timeout 45m on mote: 102 packages ok, internal/gui
  FAIL: TestCoreScriptBudget (fixed above, then green) and
  TestQuitKeepsTheMenuBarIconsPlace, killed at its 30s AppKit bar under
  load; passes alone in 1.1s here and on origin/main 00b2c11a6. Filed
  #6919.
- GUI, both engines, every language, on mica: the 45 account, Claude,
  switch, sign-in and i18n files (1275 tests, 68 red). The same 9 red
  files on origin/main effdd1beb give 67 of the same reds (#5925, #6660,
  #6179, #6424, #6010, #5998, #5814, #6877). The one red only at this
  head, accounts-own-signin webkit zh (access-control on /api/autobackup)
  is #6038 and passes 20/20 alone. claude-setup-token: green in all 10
  engine x language runs.

Broken by hand, each red, then restored: the own-value check
(TestClaudeOwnEnvTokenLeftAlone), clearing on an OAuth switch
(TestClaudeCodeSwitchedToSetupToken, ...UnreadableSettings), clearing
on Use back (Switched, InUseNotMovedOff), clearing on remove
(TestClaudeSetupTokenRemovedLeavesSettings), the NextLogin guard
(InUseNotMovedOff), unreadable settings read as empty
(TestClaudeEnvTokenUnreadableSettings).

Not tried: the whole GUI suite (both machines were running other
sessions' full suites for hours); a magpie GUI build clicking Use
against the real binary (the switch's file was checked instead);
Windows and Linux Claude Code.
2026-11-17 11:42:27 +08:00
yetone 00b2c11a6b agent: Open Code Review (ocr) is an agent magpie sets up (@AlanWang1027713 on X)
Open Code Review (github.com/alibaba/open-code-review, npm
@alibaba-group/open-code-review) is a Go CLI, `ocr`, that reviews a diff
with a model. Its Claude Code, Codex, Cursor, Kimi Code and OpenCode
plugins and its skills all run that command, which reads
~/.opencodereview/config.json on every run.

Picking one of magpie's models on its row writes a custom provider
"magpie" there (protocol openai, the gateway's /v1, a key naming Open
Code Review, the model) and points provider at it. The user's own
provider and model are stashed and come back on Disconnect, which also
drops a custom_providers left empty. A model of the user's own can be
picked too (written the way `ocr config model` writes it). Check reports
a hand-edited url or key, or a removed entry. The `ocr` command counts
only under a folder named for Open Code Review, since other programs
share the name. WSL distros get the row too (cold distros not opened).
Its User-Agent, open-code-review/<version>, already counts as this agent.
CLI update via npm. Docs, READMEs, site and icon (OCR's own logo,
Apache-2.0).

Run (mica, at 593517bf0; origin/main has one unrelated usage commit since):
- go test ./internal/agent -run 'TestOCR|WSL|Wsl|TestOwnProviderNamedAsMagpies|TestHandWiredMagpieProviderSiblings|TestAgentOf|TestEveryAgentNamedByItsKey|TestMarkedLinesEveryAgent': ok
- gofmt -l: clean; GOOS=linux go vet -tags nogui ./... and GOOS=windows go vet ./...: ok
- Broken by hand: url dropped from Check -> TestOCRWiring red; stash
  turned off -> red at the Disconnect restore. TestWSLColdPlaceOpensNothing
  went red before the row's options were given an asleep path.
- Real e2e in a sandbox HOME: npm-installed ocr v1.13.10 (7e5ce06c)
  darwin/arm64, magpie built from this tree, a fake OpenAI upstream that
  calls tools. `magpie agents` lists the row with the user's
  deepseek/deepseek-chat; `magpie open-code-review magpie/fake/m1` wrote
  the entry and kept the user's keys and settings; `ocr llm test`:
  connection ok, tool-call round trip verified; `ocr review` on a repo
  with a nil dereference: 2 findings "[bug · high]" through magpie
  (8 /v1/chat/completions calls, UA open-code-review/v1.13.10, model m1,
  its six review tools); `magpie usage` counts them under Open Code
  Review; `magpie open-code-review default` put deepseek/deepseek-chat
  back and removed custom_providers.
- Full suite: not run before this push (ship at once; mote was running
  another session's suite). It runs on mica right after, at this head.

Not tried: a real vendor model behind magpie; WSL and Windows/Linux
machines for real; the Claude Code / OpenCode plugin path itself (it runs
the same `ocr`); an ocr installed by the curl script outside a folder
named for it is found by ~/.opencodereview only.
2026-11-17 11:10:43 +08:00
yetone acc358f071 gui tests: codex-async-compact's zh and zh-TW notes say Codex CLI as translated (#6658)
35aaaa4b9 (11-13) translated "Codex CLI" as "Codex 命令行" / "Codex 命令列"
for the Codex client setting. codexHeld in context.js passes the same
word through t(), so the held-share note in zh and zh-TW changed too,
and codex-async-compact's expected strings still had "Codex CLI": 4 of
20 cases red (chromium and webkit, zh and zh-TW) since then. The app is
right; the test now expects the translated word.

Run at this head on mote (macOS 27, Playwright 1.62.0):
node --test internal/gui/tests/codex-async-compact.test.cjs: pass 20,
fail 0. Broken by hand: zh's expectation put back to "Codex CLI",
chromium zh and webkit zh red (18/2), restored.

Not run: the rest of the GUI suite (only this test file changes).
2026-11-17 07:55:10 +08:00
yetone ce16633367 tune: a Codex card locked by config.toml's own compact limit hands it to magpie on a click (sufeng1894 on X)
sufeng1894 asked why Codex's compaction threshold can no longer be set by
hand. The card said config.toml's model_auto_compact_token_limit wins, and
the background row said features.async_compaction's
model_async_compact_threshold_percent wins: both locked, and nothing on
the card did anything about it.

Cause. Only the old tune card (9e665491e to f20118304, 10-10 to 10-28)
wrote model_auto_compact_token_limit, stashing the user's own raw value;
the 10-28 migration puts that raw value back, which then locks the card.
So the values on the screen are the user's, or the user's restored by
that migration. A magpie-written value could have lost its stash through
stash.json races (before 270b52573), an unparsable stash (before
58651568b), tuneMigrateCodex forgetting the stash even when its file
write failed, and codexAsyncSync stashing only after every write. The
last two are fixed here: the migration forgets only after the write
succeeds, and codexAsyncSync records its stash in a defer right after
reading the old state, advancing it per successful write.

Change. A locked card shows one button, "Let magpie set it" (zh 交给
magpie 设置, zh-TW, ja, de), only when the user clicks. POST
/api/tune/takeover (TuneTakeOver):
- the file's limit moves into Long conversations by tuneMigrateCodex's
  rule (a lower Long the user has is kept), the key is deleted from
  config.toml with every other key kept, and the file value is stashed
  (tune.codex.compact_file); Undo puts Long back and writes the key back,
  unless the user changed Long since;
- a background threshold of the user's (enabled = true) is adopted as
  magpie's background share with its own Undo, which turns the share off
  and gives back the percent and enabled as they were. enabled = false
  is not taken.
Nothing removes the user's value without that click.

Run:
- internal/agent, internal/gui, internal/cli, internal/tune at the pushed
  head (rebased on ca87ae9c5) on mica: ok. TestCoreScriptBudget raised
  by 189 (the button, its post and Undo background), reason in the file.
- Full Go suite -timeout 45m on mica at the pre-rebase head (2ba62f7f7
  base): every package ok except TestCoreScriptBudget, since fixed.
- Broken by hand, red: migrate forgetting first (TestTuneCodexMigrateKeepsStash),
  asyncGiveBack disabled (TestTuneCodexTakeOverAsync), longUndo in place
  of codexLongUndo (TestTuneCodexTakeOver), and the GUI button disabled
  (context-tune, 11 red).
- context-tune, compact-one-value, codex-async-compact, i18n-keys at the
  pushed head on mica, Chromium and WebKit, every language, 360 and 1100:
  the new test passes; reds are codex-async-compact's zh/zh-TW "kept the
  share out" (4, the same at ca87ae9c5) and i18n-keys' routing plugin
  word (#6877).
- win-run TestTune|TestCodexAsync in agent and gui: ok. wsl-run vet and
  those tests with -tags nogui: ok. GOOS=windows go vet and GOOS=linux
  go vet -tags nogui: ok. gofmt -l: clean.
- make test-ui on mote, pre-rebase head, through header-centre (about a
  third; the rest still running when pushed): reds in 29 files, none a
  tune file. The first 16 (account-arrange to context-cap) were run
  alone at this head and at origin/main ca87ae9c5 on mica: the same
  reds at both (base has 4 more, in agent-own-direct), the #5475 class.
  The next 13 (ctx-session-line to header-centre) were run the same way at the pushed head: 59 red at head, 60 at ca87ae9c5, the same tests (header-centre's halfway case red in one engine at each).

Not tried: a real Codex session after the takeover; codexAsyncSync's
defer has no test with a failing write.
2026-11-17 06:39:40 +08:00
yetone ca87ae9c59 update: an x64 magpie emulated on Windows on Arm updates to the arm64 build (EV_John_Liu on X)
EV_John_Liu on X: "能不能出个windows on arm的版本啊…看到magpie是转译的".
magpie ships magpie-windows-arm64.exe and magpie-cli-windows-arm64.exe,
and the site's Windows button offers it on Arm, but an x64 install on an
Arm64 computer fetched the x64 build on every update and stayed emulated.
update's arch() swapped only an Intel Mac under Rosetta.

- internal/winarm: Emulated() asks IsWow64Process2 (x/sys/windows) once;
  an amd64 build whose nativeMachine is IMAGE_FILE_MACHINE_ARM64 runs
  emulated. A failed call (no IsWow64Process2 before Windows 10 1709)
  means not emulated. false off Windows.
- update: arch() gives arm64 for windows/amd64 when emulated, so
  BinaryAsset picks magpie-windows-arm64.exe (GUI) and
  magpie-cli-windows-arm64.exe (CLI). The swap is the x64 one: canStart
  starts the downloaded exe (it runs natively there), the running exe is
  moved aside, the arm64 one renamed in under the same name, and
  magpie.com is rewritten from the new app's own launcher.
- pii (sibling found on the way): pf-serve has no windows-arm64 build.
  After the switch an arm64 magpie looked for a windows-arm64 pf-serve,
  found none, and left Privacy Filter / AstrLink Guard "not downloaded"
  while on. target() now maps windows-arm64 to the x64 pf-serve Windows 11
  runs emulated; candidates() runs it on the CPU (the x64
  pf-serve-vulkan has no x64 Vulkan driver there), then pf-serve-base
  for an emulation without AVX2. The guard's status says emulated
  (Status.Emulated), and its row reads "On, slowly under x64 emulation:
  the next update installs magpie for Arm" in all five languages, like
  the Rosetta line. app.js's and the core's script budgets grow by its
  66 bytes.
- gui feedback: the diagnostics block's Arch line says
  "amd64 (emulated on arm64)" / "amd64 (under Rosetta on arm64)".

Checked, not changed:
- site/public/index.html: the Windows main button already turns to
  /download/windows-arm64 when userAgentData's architecture is "arm".
  Run in Playwright Chromium and WebKit with a Windows Edge UA and
  injected userAgentData: arm -> windows-arm64; x86 and no
  userAgentData -> windows-amd64.
- telemetry (stats "arch") sends the build's GOARCH; left so, since what
  is sent and the privacy text stay as they are. After the update it is
  arm64 by itself.
- rtk: an arm64 magpie no longer upgrades a standalone x64 rtk.exe
  (rtkArch == "amd64" only), filed as #6896.
- claudecode (win32-arm64) and Bun (windows-aarch64) downloads already
  have arm64 builds.

Run (worktree at origin/main 17da22414):
- mote: go test -count=1 ./internal/winarm ./internal/update
  ./internal/pii ok; ./internal/gui -run Feedback ok.
- mote: go vet ./... ok; GOOS=linux go vet -tags nogui ./... ok;
  GOOS=windows go vet ./... ok; GOOS=windows GOARCH=arm64 go vet of
  winarm, update, pii, gui ok; darwin, windows and linux builds ok;
  gofmt -l clean.
- mote: node --test privacy-model.test.cjs (Chromium and WebKit, five
  languages, two widths) ok; i18n-keys' "a plugin's words are its own"
  is red at this base on claude_image_budget_test.go's ", with an
  image", already #6877.
- xiaomi-gpu (x64 Windows 11, real IsWow64Process2 saying not
  emulated): win-run go test ./internal/winarm, ./internal/update -run
  'WindowsOnArm|Rosetta|Asset|InstallBinary', ./internal/pii -run
  'ArmWindows|GuardNow|Base', ./internal/gui -run Feedback ok.
- magpie-desktop (WSL2): winarm, update, pii ok; gui -tags nogui -run
  Feedback ok.
- mote: go test -count=1 -tags nogui -timeout 45m ./... : every
  package ok but internal/gui's TestCoreScriptBudget (app.js 66 bytes
  over: the new pmSub line). The budgets are raised by those 66 with
  why (pmSub draws every Privacy row, no lazy page to move it to);
  internal/gui then ok in full.
- mote: gui-de, gui-ja, gui-zh-tw, i18n-en-no-cjk and the three other
  privacy-*.test.cjs, in Chromium and WebKit: 28 of 28 each. Not the
  whole GUI suite: the change is one string in one row, no API,
  selector, CSS or layout.

Broken by hand (each red, then restored):
- arch() without the windows clause: TestWindowsOnArmUpdatesToArm64
  (BinaryAsset magpie-windows-amd64.exe) and
  TestWindowsOnArmInstallsArm64Exe (magpie.exe still "2.0 for x64").
- pii target() without the mapping: TestArmWindowsRunsX64Serve
  (target windows-arm64, Supported false); candidates() without the
  Arm branch: its subtests start pf-serve-vulkan.
- Status without Emulated: TestGuardNowSaysEmulated.
- archNote without the emulated case: TestFeedbackArchSaysTranslated.
- app.js without the emulated line: privacy-model's "AstrLink Guard
  says what runs it" red in every language.

Not tried: real Windows on ARM (no such machine); detection is injected
in the tests, and the real call was only seen saying "not emulated" on
x64 Windows.
2026-11-17 04:29:02 +08:00
yetone ead91a9a50 gui: a browser tab's title names this magpie: MAGPIE_NAME or Settings › Network and sharing › Advanced › Name (starballl on X)
starballl on X (tweet 2122376116220633444) runs several magpie web pages
and every tab is titled "magpie", so they can't be told apart. A magpie
now has a name, and a browser tab's title is "<name> · magpie" (plain
"magpie" with none).

- settings.Name, set in Settings › Network and sharing › Advanced › Name
  (instancename.js, imported when Settings is drawn, so nothing is added
  to app.js's core). Advanced is closed until a name is set.
- MAGPIE_NAME (Docker, magpie web) names it while the field is empty and
  is the field's placeholder. It is read, never written, so a name typed
  in Settings always wins and clearing the field goes back to it.
- One line, at most 60 characters (settings.CleanName).
- This computer's own (KeepOwn): sync and a restored backup never bring
  another magpie's name. A Settings save that leaves `name` out keeps it
  (settingsapi.Merge).
- boot.js titles a browser tab itself for the first paint, so app.js's
  core gains only the line in applyPrefs, which sets the title again from
  every settings read (TestCoreScriptBudget was 74 bytes over with a
  title function in app.js). Only a browser page (web) is retitled: the
  app's windows and tray keep "magpie".
- Docker docs (en, zh, ja) list MAGPIE_NAME; docs/reference.md and
  docs/subsystems/gui-shell.md say how it works.

Tests:
- TestInstanceName (internal/gui): the variable alone names it at boot;
  a saved name wins over it, trimmed; a save without `name` keeps it;
  KeepOwn keeps it; cleared goes back to the variable; no name, none at
  boot. Broken by hand, each red: KeepOwn without Name ("KeepOwn took
  \"other\""), Merge without the keep ("a save without the name changed
  it to \"\""), boot.js with s.Name in place of InstanceName ("named by
  the variable alone: boot <nil>"), boot.js not setting the title ("a
  browser tab's boot.js sets no title"). The app window's boot.js sets
  none.
- TestSettingsSaveKeepsWhatItDoesNotSend now sets Name: the page's other
  saves leave it out, and it is kept.
- instance-name.test.cjs: title from the first paint, the field under a
  closed Advanced, save and clear retitle the tab, Advanced open after a
  reload, 360px, the app's window keeps "magpie"; en, zh, zh-TW, ja, de,
  Chromium and WebKit, 16/16. 14 of 16 red with applyPrefs not setting
  the title.

Run, at this commit on dbbb2f26b plus 9d5d8baf2 (the site index):
- go test ./... -count=1 -timeout 45m on Linux (WSL magpie-desktop, Go
  1.26.8), at the tree before the boot.js move: 99 packages ok,
  internal/gateway included (959s); ., internal/cli and internal/gui
  don't build there without GTK headers. On mica (macOS): . and
  internal/cli ok; internal/gui/... ok at this commit, after the two
  reds that run found (the core budget, the keep test) were fixed.
- go vet and GOOS=linux -tags nogui / GOOS=windows go vet of
  internal/gui and internal/settings, earlier the whole tree on all
  three: ok. gofmt -l clean.
- site: node --test *.test.mjs, 132/132.
- GUI: the 135 files the change reaches (settings, network, LAN, i18n,
  old-webkit, core budget) on mica: 16 files had reds. Run again on this
  tree and on its base, the same tests are red on both (allow-ips
  #4357, settings-hints #6107/#6353, lan-join #6353, i18n-keys #6877,
  old-webkit #6030/#5919 and the rest of the 16) but two:
  search-mcp-library (WebKit, #4756) and gateway-pause (WebKit de 420px,
  #6684), red only beside other files: alone, 0 of 10 and 0 of 3 red on
  both trees.
2026-11-17 03:11:31 +08:00
yetone dbbb2f26b1 groups: free: takes the models a catalog marks free (#5903)
A routing group's pattern may now start with free: (provider.FreePrefix):
free:workbuddy/* is, of the models workbuddy/* matches, those whose
catalog entry says free (Entry.Free, the vendor's or plugin's own flag as
the catalog was last read). The rest after free: is a glob, a re: pattern
or an id, matched as on its own, so free:re:workbuddy/hy.* works too. It
is expanded where every pattern is (matchesIn, PatternHits) each time the
groups are read, from the catalog magpie already keeps: no request to a
vendor, and a model the next list marks free joins without a save.

Only the flag decides. A $0 price (PricedFree), a rate of 0, an account
named Free or "free" in an id never counts; the test holds a
deepseek-v4-free id with no flag, a rate-0 model and an or/y priced at $0
out. Existing patterns read as before: openrouter/*:free still means ids
ending in :free (that is why the rule is a prefix, not a :free suffix),
and a provider's AutoInclude takes no free: (isIDPattern).

GUI: the Routing editor's pattern box counts and lists a free: rule live
as it does any pattern (patternTest in plugins/routing/client.js, from
groups.models' free), refuses "free:" alone, and one hint line says the
flag is the last catalog's, not a promise of no charge, in en, zh, zh-TW,
ja and de. CLI help, docs/subsystems/providers-accounts.md and the site's
routing-groups page (en, zh, ja) say the same.

routing-levels.test.cjs: the Advanced hint line made the editor taller,
so the second group's Levels row opened under the editor's sticky foot
and the click landed on the foot (webkit en). The test already wheels to
that row for its first group; it now does for the second too.

Run:
- TestGroupFreeRule, TestFreeRuleSyntax and the existing pattern tests
  pass. Broken by hand: with groupmatch.go and autolist.go from
  origin/main both are red (no members for free:workbuddy/*, IsPattern);
  with takes() ignoring the flag, TestGroupFreeRule is red (all six
  WorkBuddy models matched).
- group-free-rule.test.cjs (new): chromium and webkit, en and zh,
  green; red with origin/main's client.js.
- go vet ./... (darwin, mica), GOOS=linux go vet -tags nogui ./...,
  GOOS=windows go vet ./...: clean. gofmt -l: nothing.
- Full suite go test -tags nogui -timeout 45m ./... on Linux (WSL
  magpie-desktop) at 1e180c630 (this change on ac4a4cf84): 102 ok, no
  FAIL. Not run whole on macOS: mote had another session's GUI suite
  and mica's disk was full (2 GB free; a run there failed on "no space
  left on device").
- At the pushed head 6801ae683 on Linux: internal/provider, cli,
  plugin, agent, gui packages; group-free-rule, group-patterns,
  routing-levels, gui-zh-tw, gui-ja, gui-de: all ok, 21 tests pass.
- GUI: the 182 files that reach the Routing page or i18n, on Linux at
  d55680755's tree: 2805 pass, 112 fail in 21 files. The same 21 run on
  origin/main cb4ad12bd: 102 fail in 18 of them. The three red only
  here (input-look, search-keys, routing-levels) were rerun at
  concurrency 2: input-look and search-keys green, routing-levels red
  from this change and fixed above (green 2 of 2). Reds on main, filed:
  group-editor-selected #5049, i18n-keys #6877, codex-memories-settings
  #6372, inner-scroll-contain #4689, grip-inset #6293, and the rest in
  #4120's class; form-align newly filed as #6894.

Not tried: a real WorkBuddy account's catalog (the flags come from the
plugin's list, as the test's fixture has them); the GUI files on macOS.
2026-11-17 02:19:48 +08:00
yetone ac4a4cf849 sessions: opening Sessions waits on no WSL listing it already has (shangyuan0818 on X)
shangyuan0818 (X, third round, after v0.1.4091 and v0.1.4255): on Windows,
Usage -> Sessions opened only after a fixed ~20s when sessions were long.
The long sessions were not the cause. Goroutine dumps of the reporter's
case on the Windows box showed four waits on WSL on the page's first asks:

- agent.Looks -> Clients -> All -> wslDistros: a blocking wslRefresh,
  `wsl -l -q` (10s timeout) once its list is a minute old, then
  `wsl -l --running -q` (10s) every time. A WSL that answers slowly but
  answers is never marked hung, so each open after a minute idle waited
  for both: about 18s, every time. ClientsIn drops WSL's agents anyway,
  so Clients now reads only this machine's (local()).
- gui agentsHere (the web-mode own-sessions gate) called agent.All the
  same way. It now calls agent.AllKnown: this machine's agents and WSL's
  as last listed (wslDistrosWithin(0)), never waiting on wsl.exe.
- sessions.wslFilesAs waited wslFirstWait (3s) afresh on each read while
  the first listing was pending, so list, stats and overview each waited
  3s in turn. The 3s is now counted once, from when the first listing
  started.
- provider.copilotCLILogin waited copilotWSLWait (2s) on every re-read
  of a distro's Copilot sign-in, every copilotWSLAge (20s), though it
  had an answer. A re-read now answers the last read at once; only the
  first read waits.

Timed on Windows 11 (xiaomi-gpu), sandbox HOME with a 90 MB Claude JSONL
and a 32 MB Codex rollout, a fake wsl.exe whose -l -q answers "Ubuntu"
after 8s and whose --running hangs; /api/sessions list+stats+overview
together, opened 20s after start, then 70s apart:

  b0674b9ec (old):  0.39s, 18.11s, 18.12s
  this commit:      0.38s,  0.07s,  0.07s

With wsl.exe hanging outright and Sessions opened right after start:
old 10.3-10.5s, new 3s (the designed first wait, now waited once). With
no WSL: 0.4s on both.

Tests, each red on the old code by hand:
- TestClientsAskNoWSL (agent): with Clients back on All(), red (waited
  past 5s on the hung wsl.exe); with AllKnown on wslDistros(), red.
- TestWSLFirstWaitIsWaitedOnce (sessions): four reads with the first
  listing hung; with the wait counted per read, red at 2.007s.
- TestCopilotWSLHangHoldsNoRequest (provider): a re-read on a hung WSL
  with copilotWSLWait 10s must answer within 2s; with the kept answer
  disabled, red at 2.002s.

Run at this tree:
- mote: go test -timeout 45m ./... at dac5095c3 (base b0674b9ec): exit 0, 102 packages ok, no FAIL. Rebased onto
  2ec8e6ad0 after it, which changes README files only.
- mica: go vet ./..., GOOS=linux go vet -tags nogui ./...,
  GOOS=windows go vet ./... ok; gofmt -l clean.
- WSL (magpie-desktop): internal/agent, sessions, provider ok.
- Windows: internal/agent, sessions, provider, gui: 66 reds, 64 of them
  red at origin/main 2ec8e6ad0 too (#6068, #1827, #4115, #2808, #4446,
  #5957, #5343, #5344). The other two, TestHermesProfilesAreNotListedAsAgents
  and TestHermesProfilesFollowMagpieModel, call onMachine, not the code
  changed here, pass alone 3 of 3 on this tree, and follow other Hermes
  tests red at main in the package run (#1841: Windows tests share
  APPDATA).

Not tried: a real WSL distro that is slow (the fake wsl.exe stands in
for it), and the reporter's own machine.
2026-11-17 00:21:23 +08:00
yetone b0674b9ec4 providers: a key's balance shows on its row, as Usage last read it
lyj1115 on X: magpie found the relay's balance (the probe), but the
Providers row showed only the API key; the figure was on Usage alone.

The row's quiet facts line (host · models) now ends in " · $10472.14",
in the line's own colour and size, with "Balance $…" as its tooltip.
Several keys' balances are added up as the Usage card's head adds them
(shared balances counted once), else the key in use's. A failed read, a
signed-in account (its windows are on Usage) and Usage turned off show
none. Opening Providers asks for Usage's own read (never ?asked=1, so
"read only when asked" holds) when it is over a minute old, as Routing
does (#1833); rows are marked after the list is drawn and after a read.

rowBalance, markBalances and keysSum/keysSumTip live in
plugins/usage/page.js (keysSum moved out of app.js) so app.js stays
under its code budget without a raise; app.js calls markBalances?.().
No new words, no CSS.

Run (mote, at this tree rebased on origin/main 6cc7402bd):
- provider-row-balance.test.cjs: 24/24 green, chromium and webkit,
  en zh zh-TW ja de at 900 and 420px, and Usage off.
- Broken by hand: against origin/main's assets (MAGPIE_ASSETS) it is
  22 of 24 red (no .pv-bal); only the Usage-off cases pass.
- go test ./internal/gui -run 'TestCoreScriptBudget|I18n|Words|Asset|Budget': ok.
- i18n-keys, i18n-en-no-cjk and 12 provider-*.test.cjs files: 329 pass,
  1 red: i18n-keys "a plugin's words are its own" (routing's ", with an
  image"), red the same on origin/main 6cc7402bd, filed as #6877.
- A 218-file GUI batch (provider, routing, balance, usage-keys,
  usage-shared-balance, i18n) was still running on mote at push time;
  new reds against origin/main get issues when it ends.
Not tried: the real app with a real relay's probed balance.
2026-11-16 23:11:36 +08:00
yetone a24a5f6af4 gui: a model test its vendor queued shows queued, not green (sufeng1894 on X)
sufeng1894 (v0.1.4248) added Qoder China and QwenWork providers (both
served by the Qoder plugin): their models were green in the provider's
Test, and every request through Routing failed with 503.

A Qoder/QwenWork plan queues a model (code 10605, e.g. "this plan's
queue: p4"). The test sends x-magpie-fallback, the plugin answers the
queue's 503 at once, and probe counts it OK with Result.Queued
(d3aecfe95). The GUI drew that as a green dot and "answered", while
routing gives way from a queued member at once (503 busy) and the last
member's wait ends in the queue's 503 (4 minutes unstreamed; a frozen
queue after 5 minutes with qoder 0.2.71, v0.1.4321). So Test said the
opposite of what Routing does.

Now a queued result is its own state: an amber dot, its title
"Queued at its vendor, not answered: <queue>", and Test models' and
Test this model's status say the same and are not "ok". Working only
still keeps a queued model, as the test's OK says (a queue clears).
renderEndpoints is not a sibling: it is drawn only when no address is
plugin://, and only plugins report queued.

core_budget_test.go: +135 for it, the reason in the comment; one
string (queuedSaid) shared by all three places.

Run (mica-run/mote-run, at origin/main 8608ce024):
- models-queued.test.cjs (chromium, webkit): 4/4 ok; with the old
  app.js 4/4 red ("a queued model's dot isn't green", and the single
  test's status timed out waiting for the queued dot).
- go test -run Budget ./internal/gui: ok.
- every models-*, model-*, provider*, i18n-* and test-* GUI file:
  2430 tests, 2323 ok, 107 red (mote). The same 107 in the same 11
  files are red at untouched origin/main 8608ce024 (146 run, 107 red),
  all filed: i18n-keys (#6877), models-works-only (#4391),
  model-chip-steady (#4388), model-copy-id (#4621), model-api-preset
  (#5838), provider-max-output and provider-many-keys (#6209),
  provider-fetch-again, provider-models-rest, provider-picks-stay and
  provider-typed (#6532). A first run on mica died of ENOSPC (its disk
  is full) and tested nothing.
- Rebased onto 07f7e0b45 (nothing under internal/gui changed since
  8608ce024): the budget test and models-queued + model-test-one
  (8/8) ran again there, ok.

Not tried: a real Qoder China or QwenWork account; the reporter's 503
body, so which queue (or another cause) their 503s carry is not
confirmed.
2026-11-16 22:03:48 +08:00
yetone 8608ce0243 gui: the sticky tab strips are drawn only under scrolled rows, rounded and evenly inset (CHENGJIAHEGOXIS on X)
Over a background picture the Library tab bar showed a square frosted box
around the rounded tabs, 16px out at the sides, 8 at the top and 4 at the
foot. The strip behind the tabs (Library, Plugins, Settings, the Add
sheet) is now drawn only once rows scroll under it (.stuck), fading in
with opacity, so at the top only the track shows: radius 7, an even 2px
around its 5px pills. When drawn, it sits 4px out from the tabs with
radius 11 at its foot (Library, Plugins), and 6px out with radius 13 in
Settings and the Add sheet.

Run: shots in Chromium and WebKit, light and dark, with and without a
wallpaper, at 1280 and 640, at rest and scrolled, before and after
(strip opacity 0 at rest, insets 4/4/4 when stuck). Full GUI suite at
18ec1674a on mote: 1041 fails across ~118 files; those files at
c4d64a70b (origin/main): 971 fails, same files. market-have, models-fold,
key-replace and plugin-card-update, red only in the head run, were rerun
alone: market-have 3 of 6 red at base, 0 of 6 at head; the others fail
the same at base. Not tried: a real Windows WebView2 window.
2026-11-16 21:16:36 +08:00
yetone 34606000da gui: the tray panel's Usage tab ends in a heatmap of recent weeks (eiyuuzaki2333 on X)
Asked for "a heatmap like GitHub's / Codex's, also in the tray". The
window already has one (Usage › Requests, 53 weeks, #1369), so no second
copy goes on the Overview, which counts gateway calls only while the
heatmap counts session-file calls too. The tray panel had none.

The panel's Usage tab now ends in a card of the recent weeks, one cell a
day, Monday on top, as many weeks as the card fits (8 to 53: about 25 at
the panel's 440, 17 at 320). It goes after the chart and ranking, so
nothing above it moves. Its shades are the existing monochrome accent
ramp (.l0 to .l4) and follow the tab's own Tokens / Cost / Requests
switch, with no new read; a provider or computer picked above narrows it.
A tooltip says the day and its tokens, requests and cost. Weeks with no
call show no card. No animation.

It reads the existing cached /api/usage/heatmap, at most once a minute
and again when a pick changes; the tab's own 10 s reads don't wait for
it, and no endpoint was added. The card, its reads and tooltip live in
plugins/usage/page.js, which shares its grid (heatGridOf, taken out of
drawLedHeat as it was) and tooltip (ledHeatTip, now told the metric and
provider) with the Requests tab. app.js keeps one guarded call in
renderPanelUse: the ledger read can come back before page.js has run, so
page.js draws the tab again when it loads. Both script budgets hold it
at this base with no raise. The card
is .pu-heat, not .pu-card, so the chart's card stays the tab's one
.pu-card. The panel's light pills are its card's white, so a quiet day
there is a 7% shade of the text over the card.

Run (rebased on origin/main 2896e82cc):
- panel-heatmap.test.cjs (new), Chromium and WebKit, en zh zh-TW ja de,
  440 light and 320 dark: 12 of 12, 3 runs on mote. Red 12 of 12 with
  MAGPIE_ASSETS at origin/main's assets.
- Affected files (usage-heatmap, panel-usage, panel-usage-models,
  panel-usage-first-account, panel-currency-provider, panel-units-follow,
  number-units, usage-chart-axis, usage-head-steady, usage-phone-head,
  i18n-keys, phone-no-sideways) and TestCoreScriptBudget: green but
  phone-no-sideways de 375, the same with origin/main's assets (#5869).
- At 2896e82cc again: panel-heatmap, panel-usage, panel-usage-models,
  usage-heatmap, panel-usage-first-account green; i18n-keys red on a
  routing-plugin phrase 2896e82cc's claude_image_budget_test.go added,
  red on origin/main alone (#6877).
- Whole GUI suite on mica at 91b3af847 (concurrency 4): not finished.
  The runner exited 7 with no message twice (after ~2231 and ~2371
  tests); the third part, grip-inset on, is still running, ~10,900
  tests in. None of the red files is touched by this change. Under the
  whole-suite load (#6709, #6782), with their issues:
  agent-details-ready #6369 #6373, agent-switch-accounts #5925,
  claude-quota-onboarding #6179, bark #6543, api-key-theme #6444,
  aside-native #6212, agent-menu-label #6371, allow-ips #4959,
  account-refresh-holds #6003, account-arrange #6010, desktop-tiers
  #6475, quota-refresh-order #6180, provider-max-output and
  provider-many-keys #6209, rest-try-now and key-switch #6232,
  provider-fetch-again, provider-typed, provider-picks-stay,
  provider-models-rest and menu-scroll #6532, omp-roles #6432,
  recovered-file #4320, quota-bars-alike #6700, login-export #6628,
  gateway-key-arrange #6268, first-untick #6660, editor-hints #6156,
  connect-address-kept #6755, recent-call-bodies #6665, quota-credits
  #6807, models-works-only #4391, codex-memories-settings #6372,
  panel-options-fold #6794, reset-providers #6196, quota-curve #6789,
  model-copy-id #4621, modal-backdrop #6663, loop-guard-setting #6662,
  lightweight #6340, keychain-retry #6661, key-replace #3476,
  key-balance-card #6414, gateway-pause #6684, duplicate-pause and
  key-box-once #6424, codex-async-compact #6658, name-suffix-remote
  #5147, menu-input-scroll #3402, rollup-short #6560, remote-magpie
  #6099, plugin-signin-no-url #5938, plugin-signed-out-account #5998,
  plugin-page-foreign-error #6117, plugin-option-placement #6559,
  phone-no-sideways #5869, partners #6664, panel-fold #5796, omarchy
  #4624, old-webkit #6030, model-api-preset #5838, mobile-web #6790,
  library-open-again #6751, key-import #6416, grip-inset #6293,
  fast-ultra and fast-pick #6201, ctx-session-line #5801, context-cap
  #6514, codex-auto-reset #6232, panel-usage-first-account #6181
  (green alone at this head), lan-join #6353, icon-tile #6759,
  model-chip-steady, header-centre, last-page, nav-timeout,
  plugin-card-update #6709. With no issue before, filed as #6876:
  data-folder, plugin-move-unserved, name-suffix-where-named,
  group-editor-selected, found-skill-pick-remove, quota-count-wrap,
  nav-sub-fold, model-suffix-own, account-models,
  account-models-available.
- Looked at screenshots of the panel at 440 and 320, light and dark, en
  zh de ja, with the tooltip shown.

Not tried: the real app's tray panel on macOS, Windows or Linux
webviews, real accounts' usage.
2026-11-16 20:58:35 +08:00
yetone 8707ea7757 gateway: Codex's prompt suggestions go on a model set for them (@0xcb198609 on X)
The Codex app's home-page prompt suggestions (thread_source
ambient_suggestions, and their safety check, ambient_suggestion_safety;
the Routing page's 提示词建议) are a background agentic turn that reads
the project and connected apps. The app asks for the model its server
config names (codex-app-model-routing's
codex_ambient_suggestions_model_slug, gpt-6-luna) with provider model
fallback on, so with magpie as Codex's provider they ran on the
provider's default model, often auto: @0xcb198609 saw 76.9k tokens in
113s on deepseek-v4-pro. Codex has no config.toml key for that model,
only an on/off switch in the app (store key ambient-suggestions-enabled,
Settings › Configuration › Homepage suggestions; read from the 26.1106
bundle).

magpie now has a setting for it, "Codex prompt suggestions" in Codex's
row on the Agents page (Settings, beside Codex composer predictions):
- Empty, the default, is Codex's own pick: nothing moves. A value the
  user set is never overridden.
- A model or group of magpie's puts both calls there: in serve as the
  codex-suggestions move (the Routing page says why), and on the ChatGPT
  backend's route before the split, carrying the asked model to serve so
  the trace and ledger keep it. codexOwnOffMagpie leaves a bare
  gpt-6-luna to magpie while the setting is on (codexSideSet).
- A target that is disabled, unserved or not allowed to the gateway key
  leaves the call as asked, with a log line (compactRefused).
- To fit app.js's script budget without raising it, the suggestions and
  auto-review pickers share codexPick with codexSidePick, and every
  Codex row's button comes from condButton. The new route is named for
  the CLI (settings_parity_test.go). agent-prefs and settings-general
  list the new row.
- The row's tooltip and the Routing page's Suggestions story say where
  Codex turns them off. magpie's old story said "Suggested prompts",
  which the current app no longer shows; corrected in all five languages
  from the app's own locale files.

Run (mote, at this head rebased on e25210b6e):
- go test -timeout 45m ./...: ok, every package (101). A first run
  at e97271f02 had cli and gui red on the CLI-parity guard and
  TestCoreScriptBudget; both fixed here, without raising the budget.
- go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet
  ./...: clean. gofmt -l: clean.
- TestCodexSuggestionsMoved/Left/MovedOffChatGPT/ModelRefusesBareName,
  TestCodexSuggestionsSetting: ok.
- GUI: codex-suggestions (new), codex-predictions, codex-auto-review,
  routing-kind, i18n-keys: 58/58 ok before the rebase; at this head
  codex-suggestions, i18n-keys, agent-prefs, routing-kind 84/84 ok.
  Every GUI file that opens Codex's row or the Routing kind stories
  (26) ran too: red only in codex-async-compact (zh, zh-TW) and
  codex-memories-settings (chromium scroll), both red the same on
  origin/main e25210b6e and filed as #6658 and #6372.
- Rebased last onto 90d54a267 (internal/sessions and internal/usage
  only): internal/sessions, internal/usage, TestCoreScriptBudget, the
  route guards and the CodexSuggestions tests ok again there.

Broken by hand: codexSuggestionsTo returning "" and codexSideSet's new
case off: TestCodexSuggestionsMoved red (m1 sent, and a 404 "magpie
knows no model gpt-6-luna"), TestCodexSuggestionsMovedOffChatGPT red.

Not tried: a real Codex app's prompt suggestions against magpie (no
Codex.app here or on mote); the whole GUI suite (only the files that
open Codex's row, its settings or the Routing kind stories).
2026-11-16 18:59:40 +08:00
yetone e25210b6e4 providers: an Alibaba Token Plan's AccessKey says the grants it needs, in the reader's language (MetalHqa on X)
MetalHqa on X: "阿里云百炼 Token Plan 的额度查询需要的权限不明确,希望能够在里面备注出来".
Since 456b5c6c7 (#6506) the grants were named only in aliRAMHint, in
English, on the Usage card after a NotAuthorised refusal, and the editor
still said "a RAM user that may use Model Studio is enough", which is
wrong: the AliyunBailian*/AliyunModelStudio* policies don't cover the
Token Plan.

Now:
- The editor's AccessKey ID for an Alibaba Token Plan has one line under
  it (ALI_RAM): a RAM user's AccessKey needs AliyunTokenPlanReadOnlyAccess
  and AliyunBSSReadOnlyAccess, and Administrator or Subscription plan in
  Model Studio → Account Management; the main account's needs none. The
  Secret's hint loses the wrong sentence. Volcengine and Tencent keys are
  unchanged.
- A card refused with aliRAMHint says the same line in the reader's
  language (quotaError), the raw refusal still in its tooltip.
- zh, zh-TW, ja and de for both strings.
- aliRAMHint says "Subscription plan", as Alibaba's English docs do.

Checked against Alibaba's docs: Token Plan 权限与使用规范 (RAM 子账号授权:
AliyunTokenPlanReadOnlyAccess or FullAccess, AliyunBSSReadOnlyAccess or
FullAccess, 账号管理页面 → 管理员或订阅套餐权限), the personal FAQ (个人版
BSS policy is AliyunBSSReadOnlyAccess) and the English page (Account
Management, administrator or subscription plan permission). magpie reads
the personal plan's usage only, so the read-only policies are named.

Core script budget +275 (app.js and total): one string shown in two
places, less the wrong clause it replaces; the editor and quotaError draw
on every window, so there is no page to move it to.

Run on mote at e97271f02 + this change: gofmt -l clean; go vet
./internal/provider ./internal/gui, GOOS=linux and windows go vet
./internal/provider; go test ./internal/provider -run 'TestAli|Alibaba'
ok; go test -tags nogui ./internal/gui -run
'TestCoreScriptBudget|Words|I18n|Alibaba|AccessKey' ok; node --test of
the new alibaba-ram-grants (20/20, Chromium and WebKit, all five
languages, 420px) with every GUI file that draws an access key or a
card error, i18n-keys, i18n-en-no-cjk, form-align, editor-advanced-align
and quota-name-translated: 253 pass, 7 red, all under load ~70:
editor-advanced-align (#6421, a Claude editor) and qianwen-plan's 8s
sign-in wait (#6852); both green alone on this tree and on the base.
Broken by hand: alibaba-ram-grants on the base's app.js and i18n.js is
red in all 20 cases. After the rebase onto 1bfc6378c: TestCoreScriptBudget, TestAliGateway, alibaba-ram-grants (20/20), i18n-keys and volc-access-key ok on mote.
Not tried: a real RAM user's AccessKey (none here); the whole GUI suite.
2026-11-16 18:14:38 +08:00
yetone 1bfc6378c9 providers: Antigravity CLI's own Gemini API key is found and imported (shenggxhz on X)
shenggxhz set agy up on an AI Studio key: "modelProvider": "gemini" in
~/.gemini/antigravity-cli/settings.json, GEMINI_API_KEY exported in the
shell. `agy models` then listed Gemini 4 Carbon and Hydrogen. magpie's
model refresh didn't, because the agy-cli subscription runs agy on its
Google sign-in, whose models are the account's in Antigravity, and the
key was used nowhere in magpie.

The Providers page now finds that key on its own. A new import source,
"Antigravity CLI" (readAgySettings), reads agy's settings.json and offers
the key as the Google Gemini preset, which lists the key's models from
the Gemini API. With GOOGLE_GEMINI_BASE_URL set, it uses that endpoint's
Gemini API instead. The variables are taken from magpie's environment,
else from the login shell's: a key exported only in .zshrc is found when
magpie is opened from the Dock. proc.GeminiKeyVars are only read
(LoginEnv), never set in magpie's environment. agy on its sign-in offers
nothing. With no key the entry shows as not importable, and a key that
points at magpie itself is refused.

Not changed: the agy-cli plugin's own `agy models` reads the same
setting and, with no key in magpie's environment, fails and keeps the
old list silently. Filed as magpie-community/plugins#1218.

Run:
- red on the old code: with the appReaders entry removed, all four
  TestAgyGeminiKey* tests fail (no "agy" source); green with it.
- a real login shell on mica, in a sandbox HOME (key exported only in
  .zshrc, MAGPIE env without it): DiscoverSources gives status new,
  preset google, the key read.
- real agy 1.5.9 in a sandbox HOME: API-key mode lists the Gemini 4
  models from a list built into agy; without the key it exits 1 with the
  modelProvider error.
- go vet (darwin, GOOS=linux, GOOS=windows) for proc and provider, plus
  darwin internal/gui; gofmt -l clean.
- full `go test -timeout 45m ./...` on Linux (magpie-desktop): every
  package ok except internal/usage's TestRequestStateKeptAcrossACatalogFetchedAgain
  (#6572, filed, untouched here) and the root, internal/cli and
  internal/gui, which don't build there (no gtk4/webkitgtk-6.0 dev
  packages). Those three, plus provider and proc, ran on mote (darwin): ok.
  A first full run on mica died of a full disk (117G of shared Go build
  cache), so it tested nothing.
- GUI on Linux, Chromium + WebKit: icon-tile, import-collision,
  import-opencode, provider-discovery, import-row and i18n-keys pass,
  92 of 93. The one red is icon-tile's dim-color (#6759, red on main).
- appIcon became a table so the agy icon fits app.js's code budget
  without raising it (TestCoreScriptBudget ok).

Not tried: a real AI Studio key or a real Gemini request; the GUI import
sheet in a browser (the source shows through the existing discovery and
import sheets, with Antigravity's icon); Windows (LoginEnv is "" there,
so only magpie's own environment is read).
2026-11-16 17:59:26 +08:00
yetone e97271f027 agents: a client of a Remote magpie can connect new agents the remote has connected (KoiLx0 on X)
KoiLx0 runs one magpie as a client of another, through a gateway key, and
had to switch every agent on by hand on the client before it took the
remote's models. A Remote magpie's editor now has "Connect new agents to
this remote" (自动接入新 agent) under Advanced, off by default. It is kept
per computer in the stash (remote.<id>.connectAgents), not in
providers.json, so a synced or shared providers list doesn't turn it on
anywhere else. No server-side key permission.

With it on, the follow loop (FollowRemotePicks, every 5 minutes, and at
once when the switch is turned on) connects an agent installed here that
the remote has connected, on the remote's pick (connectFromRemote), and
records it as <agent>.remote.auto = on. An agent the user disconnected
here is never connected again:
- one with the Agents page's Disconnect mark, connected or not before;
- one recorded on that is no longer connected (taken out by hand in its
  file, or by any other route) is recorded off.
An agent magpie put back on quit (quit.restored) is left to RewireOnStart
and not taken for a disconnect. Connecting it by hand records on again.
The follow throttle's time is now under a mutex, since the save handler
resets it from another goroutine.

The switch shows in /api/providers as connectAgents and is saved as
connectAgents (a save that leaves it out keeps it; a provider that isn't
a Remote magpie is refused it). Advanced opens on its own while it is on.
docs/subsystems/providers-accounts.md says all of this.

app.js stays within its budget (TestCoreScriptBudget): the Remote
magpie's three ticks (MCP servers, skills and prompts, agents) and their
save are one loop, which the new switch costs less than it saves.

Run:
- mote, go test -tags nogui -count=1 -timeout 45m ./... with the first
  draft of app.js: every package ok but internal/gui, where only
  TestCoreScriptBudget failed (1087333 > 1086971). After the loop,
  rebased on origin/main 187d06724 (budget passes there alone), at this
  head: TestCoreScriptBudget, internal/gui, internal/agent and
  internal/cli ok.
- mica: TestRemoteConnectsNewAgents, TestConnectFollowsTheRemoteMagpiesPicks,
  TestProviderSaveConnectAgents ok.
- mote: go vet (darwin), GOOS=linux go vet -tags nogui, GOOS=windows go
  vet on internal/agent and internal/gui ok; gofmt -l clean.
- GUI, mica, both engines, at f261f7ba6 (before the loop and the rebase): remote-connect-agents.test.cjs (new: under
  Advanced and closed while off, sent as ticked, Advanced opens on it
  ticked, unticked sent so; en, zh, zh-TW, ja, de at 420px, no sideways
  scroll) passes, with i18n-keys, i18n-en-no-cjk and every file that
  reaches the provider editor's Advanced or a Remote magpie (64 files):
  1738 pass, 26 fail. The same files at origin/main 19794cc10: 1728 pass,
  24 fail, the same reds by name (editor-hints webkit #6156,
  account-arrange #6010, lan-join #6353, vertex-editor #4720,
  remote-magpie #5013, commented with this sha) except name-suffix-remote
  (#5147, red at base too on another language) and one count-free
  browser launch timeout; both files alone: 80 of 80 pass. At this
  head (rebased, with the loop): remote-connect-agents, library-mcp-on, provider-advanced-fold,
  i18n-keys, i18n-en-no-cjk pass; remote-magpie red as at base (#5013);
  editor-advanced-align red once in webkit, 1 of 4 alone (#6421, a
  Claude Code account's editor this change doesn't reach; it was red at
  base in the 64-file run).
- Real use on mica, sandbox HOMEs, this branch's binary: remote R
  (`magpie serve`, Claude Code on gpt-5.4-mini) and a fresh client C
  with Claude Code installed, not connected. Switch off: C's
  settings.json stayed {}. Switch on, C restarted: "agent: Claude Code
  connected as the remote magpie's", ANTHROPIC_DEFAULT_SONNET_MODEL
  office/openai/gpt-5.4-mini, recorded on. `magpie claude default`
  (disconnect) and C restarted: settings back to the user's, recorded
  off, not connected again.

Broken by hand, each red in TestRemoteConnectsNewAgents:
- connectFromRemote returning at once (the old code): "not connected on
  the remote's group/fast";
- without the on-then-unconnected record: "an agent the user
  disconnected by hand in its file was connected again";
- without the Disconnect mark check: "an agent marked disconnected,
  never recorded, was connected";
- without the quit.restored exception: "a quit-restored agent: wired
  false, recorded off".

Not tried: the switch turned on from the real app's window (the GUI test
fakes the API; the save handler is covered by TestProviderSaveConnectAgents
and real use wrote the stash key); agents other than Claude Code for real
(the code is the same ConnectHow for every agent with fields); Windows and
Linux runs.
2026-11-16 17:23:50 +08:00
yetone 187d067241 gui: a page's row in Sidebar pages is dragged by a finger too (chet030714 on X)
v0.1.4296's page order "根本拖不动" on a phone. Reproduced in Chromium
with real touch input (CDP Input.dispatchTouchEvent, 390px, hasTouch,
isMobile): the press on the grip went pointerdown, pointermove,
lostpointercapture, and the drag ended before it began. A finger (and a
pen, where the browser does so) is captured by what it pressed, here the
grip span inside the row; dragRows then takes the capture on the row,
the grip loses it, and its lostpointercapture bubbled to the row's
listener in dragListen, which cancelled the drag. A mouse has no
implicit capture, which is why the mouse test and the desktop app were
fine (mouse drags passed in Chromium and WebKit, 1100px and 390px).

dragListen now cancels only on the handle's own lostpointercapture. The
fix is in the shared listener, so every dragRows/dragCards whose handle
holds a child (the accounts' rows, a model's rows, plugin pages) gets it.
On a coarse pointer the grip is 40px wide instead of 26, a finger's
target. Alt+Up/Down is unchanged. No new motion: the rows' existing
0.16s strong ease-out shift (none under reduced motion) is what a finger
drag shows. The listener's lines were written shorter so app.js stays
under its budget (4 bytes of room left), no raise.

Run:
- nav-pages-order.test.cjs: a finger drag (CDP touch) and a pen drag
  (CDP pointerType pen) on the phone's menu, Chromium; WebKit checks the
  grip shows. 10/10 (Chromium, WebKit x en/zh/zh-TW/ja/de) on mica.
  Red on origin/main 269e54de5's app.js: "a finger dragged Masking up",
  chromium en and zh (2/2). The pen step passes on the old code too
  (Chromium's CDP pen isn't implicitly captured), so it guards nothing
  old, only the path.
- The drag GUI files (account-arrange, agent-grip, codex-model-order,
  drag-rows-shift, gateway-key-arrange, group-arrange, group-member-drag,
  group-member-row-drag, panel-arrange, plugin-page-arrange,
  provider-order, routing-rule-drag, usage-arrange, usage-drag,
  tap-lost-click, tap-inverted, tap-click, search-order, nav-pages-order)
  on mica: 196 pass / 12 fail. The 12 are account-arrange (53 !== 52,
  #6010) and gateway-key-arrange 420px (#6268); both fail the same 12 at
  origin/main 269e54de5's assets.
- go test ./internal/gui/ on mote: ok (TestCoreScriptBudget included).

Not tried: a real phone (iOS Safari, Android Chrome); WebKit touch,
which Playwright can't send; a real pen; the Wails windows.
2026-11-16 17:03:53 +08:00
yetone 269e54de5f gui: an update restart nobody clicked comes back in the tray alone (eating_dream on X)
eating_dream on X (v0.1.4303, macOS, Restart automatically on, a check
every half hour, prerelease channel): after each automatic update the
main window came back over what they were doing. A restart by itself
brought the window back when it was up (#2096), and minimised when it
was (#3495).

Now every restart nobody clicked comes back with the tray icon alone, on
every system, the window closed even when it was up. That covers
Settings' AutoRestart, `magpie update` from a terminal, a Remote
magpie's ask, and another copy replacing this binary. The restart path
is restartBySelf, which updates.autoRestart calls. It still takes no
focus and the Mac's Dock icon joins without coming to the front
(quiet_restart.go). A restart the user clicked (the pill, Settings, the
tray) opens the window as it was. No new setting.

restartInto loses its minimised parameter, and markQuietRestart writes
the seconds alone. An older version restarting into this one still asks
for its window and may write "<seconds> minimised", so the reading side
(takeQuietRestart, quietMinimised, showMinimised) stays. host.mainUp
had no caller left, so it moved into the Windows test that reads it.

Tests:
- New TestRestartBySelfComesBackToTheTray: by itself asks for no
  window, clicked asks for it.
- TestRestartBySelfComesBackQuietly now checks restartBySelf's mark and
  reads an older version's minimised mark (markOldQuietRestart, which
  the Windows minimised and quiet tests use too).

Run, at fd407bc99 + this change:
- mote-run:
  - go test ./internal/gui -count=1 -timeout 45m: ok
  - go vet ./internal/gui, GOOS=windows go vet ./internal/gui,
    GOOS=linux go vet -tags nogui ./internal/gui: clean
  - gofmt -l: clean
- Broken by hand: restartBySelf asking for the window (the old
  behaviour with it up) fails "windows asked for [true true], want
  [false true]". The old code read the window through a live Wails
  window, so the test can't run against it as it was.
- win-run go test ./internal/gui -run 'Quiet|BySelf|Minimised|RestartBy':
  ok. TestRestartMinimisedComesBackMinimised and
  TestRestartBySelfAsksNoAttention skip over ssh (session 0).
- wsl-run go test -tags nogui ./internal/gui -run 'Quiet|BySelf|Beside': ok

Not tried: a real automatic restart of the app on any system, and the
Windows desktop tests in the signed-in session. The first update into
this version is still made by the old one, which brings the window
back once.

Docs: gui-shell.md, restart by itself.
2026-11-16 16:37:40 +08:00
yetone e0f9218f91 update: Restart to update goes into the newest version out, not an older download (char1es_lu on X)
char1es_lu on X: Restart to update put in a version downloaded a while
ago, and right after the restart magpie offered an update again. Since
b05a525a3 (0.1.4051) a restart never asked the feed while a copy was
downloaded and waiting (keepsStaged). The clock's check runs every half
hour or more and magpie releases many times a day, so that copy was
often a release or more behind.

Every restart now asks the feed first (recheck, a check marked
restarting). This covers the page's Restart to update, the tray's, and
the restart AutoRestart or a click waits for. If a newer version is out
it is downloaded in place of the waiting copy, and the restart goes
into it once it is in. A restart waiting for an idle gateway takes it
too: run's waiting rule doesn't apply to the restart's own check. The
clock's check during that wait still keeps the waiting copy.

The feed is still not asked in two cases:
- The copy was downloaded by a restart's own check, or that check found
  it to be the newest (restartGot). The header's Update restarts once a
  click's download is in, and asking again there was elis_pina's loop of
  downloads that never restarted. This also stops a feed slower than
  recheck's wait from asking on every poll.
- Downloads wait for a click (NoAutoDownload). The copy clicked for is
  what goes in (sakamotokurome, iiiiiimone on X).

The update dialog's freshen still names the waiting copy (keep).

Trade-off: a click may now wait for a download (canlee886's earlier
complaint). The header's Update and the tray restart by themselves once
it is in. Settings' Version card shows the download and needs a second
click, which restarts without asking again. Making the card follow by
itself needs app.js bytes, and its budget has no room (tried: 337 over).

Tests:
- TestRestartTakesTheNewestOut replaces TestRestartTakesTheDownloadWaiting.
  With a fake feed it steps 0.1.11 waiting, 0.1.12 out, through the
  page's click, the restart once it is in (0.1.13 out, feed not asked),
  the tray (0.1.14), AutoRestart's wait (0.1.16) and the dialog.
- TestUpdateStagedGivesWayToNewer now checks that a restart's recheck
  takes 0.1.13 with downloads automatic, and keeps 0.1.11 on a click.
- The recheck lines in TestUpdateClockFetchesNewerThanWaiting asserted
  the old rule and are gone.

Run (mote-run, at 9c4e87736 + this change):
- go test ./internal/gui ./internal/update -count=1 -timeout 45m: ok, ok
- gofmt -l internal/: clean
- On the old update.go, TestRestartTakesTheNewestOut and
  TestUpdateStagedGivesWayToNewer fail: "the page's click ... Latest:0.1.11,
  1 downloads, want 0.1.12 after 2".
- Broken by hand:
  - Without restartGot set: "the restart once it is in: Latest:0.1.13,
    the feed asked 1 times".
  - With run's old waiting rule: "AutoRestart restarted into 0.1.15,
    want 0.1.16".

Docs: gui-shell.md "When an update downloads" and reference.md.
Not tried: a real release feed and real app restart; the fake feed
covers the updater only.
2026-11-16 16:37:40 +08:00
yetone fb711ae0fd settings: Quick check's Web search tests every search API, one line each (heyiwei5 on X)
heyiwei5 on X: "快速检测 联网搜索 是不是只检测第一个api 多个api的话 是不是不能检测?"
The Web search check ran one search (webSearch), which stops at the first
searcher that answers, so a second search API was never asked and a broken
one read as ok.

CheckPipeline's search now goes through checkSearch: it asks each searcher
a search can go to once, at the same time, by the path a search takes to
it, with no other standing in: the provider that searches (searcher, via
searchBy) unless provider search is off, and each search API on
(provider.SearchAPIs, via askSearchAPIKeys), in the order a search asks
them. The answer gains `searches` (name, ok, ms, error); the check is ok
only when every one is. Nothing set up, or the plugin off, says so as
before. pipecheck.js draws one line per searcher under the Web search row,
"Exa · 1.5 s" or "Tavily · <its error>" in red. Test and Test all are the
only things that ask, one call per searcher. No new strings. Documented
in docs/subsystems/gateway-routing.md.

Run (mica):
- TestCheckSearchAsksEveryAPI red on the old pipeline_check.go ("a broken
  API reads as ok: {"kind":"search","ok":true}"), green now.
- pipeline-check.test.cjs red on the old pipecheck.js (0/16), green now
  with i18n-keys.test.cjs, chromium + webkit, en/zh/zh-TW/ja/de, 1100px
  and 400px.
- At 56c988cb5: go test -timeout 45m ./internal/gateway ./internal/gui
  ./internal/cli ok; search-*.test.cjs and i18n-en-no-cjk both engines:
  284 pass, search-mcp-library webkit 420px "Turn on the Library" red,
  also red on a clean origin/main 9c4e87736 copy (open as #4756).
- Rebased on 9c4e87736 (this head's parent): go test -run
  'Check|Search|Pipeline|Searcher' ./internal/gateway, go test
  ./internal/gui ./internal/cli, pipeline-check + i18n-keys in chromium
  and webkit: all ok.
- gofmt -l clean; go vet darwin, GOOS=linux and GOOS=windows for
  internal/gateway.

Not tried: a real provider searcher or real search API keys (fakes only).
2026-11-16 16:24:38 +08:00
yetone 3d550e04e2 gui: the Claude import sheet's lines are said in the reader's language, and name the setup-token
liukaybee on X: Providers > Claude > Import accounts read, in Chinese,
"选择或粘贴 CLIProxyAPI 的认证文件(JSON)或 Claude Code's .credentials.json
or claude-swap's export。": importSay passed its {own} value to t() in
English. The two lines are now whole sentences, each translated in zh,
zh-TW, ja and de (German needed the phrase in two cases, so one {own}
couldn't have served both), and the intro names a setup-token
(claude setup-token) beside the files, which the import now takes
(previous commit). The two {own} keys are gone; no other t() call passes
an untranslated phrase that way (grep of `{ own: "`). app.js is shorter
than before, so no budget moved.

Run (mica, mica-run):
- claude-import-words.test.cjs (new; every language, chromium and
  webkit): red on origin/main's app.js/i18n.js ("…(JSON) or Claude Code's
  .credentials.json or claude-swap's export."), green now.
- node --test i18n-keys, i18n-en-no-cjk, login-import,
  signin-paste-import, claude-import-words: 20 of 20 ok.
- go test ./internal/gui (TestCoreScriptBudget among it): ok.

At this head, rebased on 19794cc10 (both commits): go test -run
'Import|SetupToken|Budget' ./internal/provider ./internal/gui, go test
./internal/cli, GOOS=linux and GOOS=windows go vet ./internal/provider,
claude-import-words and i18n-keys: all ok; gofmt -l clean.

Not tried: the sheet in the real app window; the whole GUI suite (text
only, no layout or API change).
2026-11-16 16:01:37 +08:00
yetone 40f7de248b workbuddy: the mover's min is 0.2.36, a refused free window without a made-up count (wsyfree on X)
wsyfree's Routing page showed one WorkBuddy account as "deepseek-v4.1-flash
token(估算) 200,000,000 / 200,000,000 · 已用 100%". That is the card the
plugin makes when WorkBuddy has refused the model with a reset still ahead.
It used the estimated cap as its count, under the "(est.)" name. Plugin
0.2.36 (magpie-community/plugins 2af72df7) has the refused card say 100%
used and the vendor's reset, with no count, named "deepseek-v4.1-flash
tokens". The ledger estimate stays set aside, so routing still stops an
account only on WorkBuddy's own refusal.

Here: the WorkBuddy mover's min goes to 0.2.36, so every moved user gets
it. The new name is said in zh, zh-TW, ja and de, and it is listed in
TestPluginWindowWordsSaidInEveryLanguage.

Run (mote, at this tree on origin/main afd2df09b): go test ./internal/gui
-run 'TestPluginWindowWords|I18n|Translat' ok; go test ./internal/provider
-run 'Move|Mover|Migrat|WorkBuddy|Plugin' ok; node --test i18n-keys,
i18n-en-no-cjk, routing-account-windows-fit: 18 pass, 0 fail.
npm view --prefer-online: 0.2.36.
Not tried: the reporter's own ledger, or a real refused account.
2026-11-16 15:11:46 +08:00
yetone 50f7a8e01f routing: a Smart row behind one renewing sooner says so; Smart says new conversations go there too
YsiCing on X: in Smart, every conversation went to one Codex account (pro,
74% of its week) while Business and team, both at 0%, said "已用 0% · 会话留在另一个账号" ("0% used · the conversation stays on another account").
That is what Smart is meant to do. It sends every request, new
conversations included, to the one account whose quota renews soonest, and
only Stays: Session or Strict spreads new conversations. But the row blamed
a kept conversation, and the Smart description said "one account at a time"
without saying that covers new conversations, plus "at 90%", which is wrong
for a week since d5d48f4f9.

- routing plugin client.js behindWhy: when the account in use also renews
  sooner, a row says "{n} used · one renewing sooner goes first" (and
  "renews in"/expires as before), not "kept"; "kept" is left for a row that
  would have gone first without the kept conversation. Four languages.
- The Smart description (app.js, i18n.js) now says every request, new
  conversations too, goes to the one account renewing soonest until it
  runs low. app.js is 4 bytes shorter; the budget is not raised.
- docs/reference.md: Smart is not load balancing; to spread conversations,
  set Stays to Session or pick Least used first.

Run:
- routing-behind-why.test.cjs on mote with the old client.js: 62 fail,
  40 pass (the "kept on the one renewing sooner" and "fresh" cases, both
  engines, all 5 languages). Green on the new code.
- mica-run go test -tags nogui ./internal/gui -run
  'TestCoreScriptBudget|I18n|Lang': ok. gofmt -l internal/: clean.
- GUI subset on mica at base c867a12c5: routing-*, i18n-*, account-arrange,
  account-weight, builtins, gateway-model-info, key-weight, rotate-figure
  and update-blocked (203 files). 3482 passed, 20 failed. I reran the 7
  red files at base c867a12c5 and with this change, one after the other:
  the same 17 are red at base (#6520 routing-signin, #6010 account-arrange,
  #6512 pin-away, #3799 row-swap, #3954 story-shrinks, #5647 pulse under
  load). routing-stage-routes 420px is red once in en and once in zh, on
  rows with no Smart account, a single read of the on class: #6830.

Not tried: real Codex accounts (fixtures only), and the Linux app's
WebKitGTK.
2026-11-16 14:40:53 +08:00
yetone 58cf764533 usage: a Claude Ultra account reads Ultra on its Usage card, and ChatGPT's $100 Pro reads Pro 100 (shangyuan0818 on X)
shangyuan0818 on X: "Claude Ultra 订阅在最新 magpie 中仍显示为 Max,而
ChatGPT Pro 100 订阅显示为 Pro Lite 这种根本不存在的订阅".

Claude: Claude Code writes subscriptionType "max" for both Max plans and
tells them apart only by rateLimitTier (default_claude_max_20x is Ultra).
The account chip already went through claudePlan, but the Usage card of
the one signed-in Claude account (claudeSubscriptionUsage) took
`claude auth status`'s raw "max". It is now named as the account is,
through one helper (claudeLivePlan) shared with claudeAccount, a sign-in
(claudeLogin), a saved login and the live login. When the credentials
carry no tier, Claude's own plan name decides: /api/oauth/profile's
organization.plan_display_name, kept by Claude Code as
oauthAccount.planDisplayName, which Claude Code 2.1.316 shows as
"Claude <name>". A known tier always wins, so a profile left from
another account can't rename a 5x one. Checked read-only against the
owner's accounts with saved tokens: the 20x ones answer
plan_display_name "Ultra" with tier default_claude_max_20x, the 5x one
no plan_display_name.

ChatGPT: planName mapped prolite to "Pro Lite" and promax to "Pro Max".
ChatGPT.app 26.1029.61003's bundle names them "Pro 100" and "Pro 500"
(and pro "Pro 200"). prolite and promax now read Pro 100 and Pro 500.
Plain "pro" stays Pro: Claude's and Grok's plans share that id, and
scoping it to ChatGPT put app.js over its code budget.

Run (mote, at this head on c38753a7e):
- go test ./internal/provider (149s) ok, before the rebase;
  go test -run Claude ./internal/provider and go test ./internal/gui ok
  at this head.
- red on the old code: TestClaudeUsageCardPlanIsUltra (Usage card plan
  "max", want "ultra"; account plan "max" with no tier) and
  TestClaudeSavedPlanFromProfileName (sign-in "max"); plan-name-fits
  "Pro Lite", want "Pro 100".
- node --test plan-name-fits, routing-codex-seats,
  routing-model-chip-whole, routing-twin-logo, i18n-keys: 134 of 134,
  Chromium and WebKit, five languages (the GUI files naming a ChatGPT
  plan id); plan-name-fits and i18n-keys again at this head.
- gofmt -l clean; go vet ./internal/provider for linux, windows and
  darwin, ./internal/gui for windows and darwin.

Not tried: a real ChatGPT prolite or promax account (the owner's are pro
and plus); a real Claude account with no rateLimitTier; the whole GUI
suite (only the files that name a ChatGPT plan id).
2026-11-16 14:19:19 +08:00
yetone b1dd96ab14 agents: a client of a Remote magpie starts its agents on the remote's models and follows them (KoiLx0 on X)
KoiLx0 runs several computers on one remote magpie and had to set every
agent's models again on each of them, and again whenever the remote
changed. Routing groups already reach a client (a group is a model of the
remote's list, TestRemoteMagpieNewGroupServedBesidePicks); the agents'
picks did not.

- The remote tells, per connected agent, each model field's catalog ref
  at GET /v1/magpie/agent-models (gateway.SharedAgentModels,
  agent.SharedModels). Guarded as the Library is: this computer, or a
  full-access key of a magpie shared on the network; a held key is
  refused (readonly_test), and another machine without a key gets 401
  (TestNetworkGatewayGuardsEveryRoute).
- An agent connected here starts on those picks where this magpie lists
  them as <remote id>/<ref> (How "remote", after "again" and "joined";
  the Agents page says "as on the remote magpie", in all five languages).
- A field taken from the remote, or found on its pick, is recorded in the
  stash and follows the remote's change every 5 minutes
  (FollowRemotePicks from library.KeepLinked). A model picked here is the
  user's: the record goes, and the field is left alone until it is on the
  remote's pick again. A pick this magpie doesn't list is skipped.
- app.js budget: no raise. The new line's 76 bytes come from same and
  alike sharing one string (CONN_WAS) and the native joined case
  returning plain instead of the same t() again.

Run at this head (rebased on c38753a7e, i18n-keys ok there; before that on b010fba05, whose budget raise left 2 bytes;
CONN_WAS's short name gives them):
- mote: go test -count=1 ./internal/agent ./internal/gui ./internal/library
  ./internal/provider: all ok.
- mica: go test ./internal/gateway (whole package, at the pre-rebase tree,
  ok 920s); at this head go build ./... and the gateway's guard, read-only
  and Library tests: ok.
- mica: GOOS=linux and GOOS=windows go vet of agent, provider, gateway,
  library: ok. gofmt -l: clean.
- mica at this head: go test ./internal/gui (budget ok), i18n-keys,
  agent-leave-magpie, agent-connect in chromium + webkit: ok.
- mica, chromium + webkit, before the last rebase: i18n-keys, i18n-en-no-cjk, agent-leave-magpie,
  agent-connect, agent-connect-no-models, agent-connected-unfolded: 0 fail.

Broken by hand: with connectRemote cut out of connect(),
TestConnectFollowsTheRemoteMagpiesPicks fails (connected on
aaa/claude-opus-5-5 (alike)); with the follow's "still the recorded value"
check made always true, it fails on the user's pick written over.

Not tried: two real computers; only a fake remote in the tests. Left for
#6824: a headless `magpie serve` client doesn't follow later changes
(the loop runs in the GUI), an empty field the remote fills later isn't
filled, and WSL / claude#name agent ids don't match across machines.
2026-11-16 14:18:47 +08:00
yetone c38753a7ee search: Settings can ask every search API at once, results merged (heyiwei5 on X)
The search APIs are asked in order: the next only when one fails or
finds nothing. Asking several together, with their pages merged and
repeats dropped, has existed since #2845 but only through
`magpie search mix`. Settings › Models › Web search now has an Advanced
fold, shown with two or more search APIs on, holding "Ask the search
APIs: In order | All at once". All at once marks every API on as mix
(POST /api/settings/search-api {"mix":[...]}, provider.MixSearchAPIs);
In order clears the marks. In order stays the default. A mix of some of
the APIs, set from the CLI, opens the fold with neither choice on and
names the APIs it asks.

Run (mote, at this tree):
- go test ./internal/gui -count=1: ok.
- TestSearchAPIsMixedFromSettings at origin/main's api.go: build fails
  (searchAPIJSON has no Mix), so it is red on the old code.
- node --test search-mix, search-count, search-api, i18n-keys:
  72/72 pass, chromium and webkit, en/zh/zh-TW/ja/de, 1100 and 560px.
- search-mix.test.cjs at origin/main's assets: 0 of 30 pass (red).
- gofmt -l: clean.
- After rebasing on b010fba05 (GUI pages): the gui Budget/I18n/mix Go
  tests and search-mix + i18n-keys GUI (34/34) pass again.

Not tried: the whole GUI suite, and a real search through mixed APIs
with real keys (the merge itself is unchanged since #2845).
2026-11-16 14:12:48 +08:00
yetone b010fba05b gui: the pages go in the reader's own order, in the sidebar and a phone's tab bar (chet030714 on X)
Settings › General › Sidebar pages, where pages are hidden, now also puts
them in order: a row is dragged by its grip (shown on hover, always on a
touch screen), or moved with Alt+↑/↓. The order is kept for this browser in
localStorage magpie.navOrder, beside magpie.navHidden. The sidebar and the
header's tabs follow it at once, and a phone's tab bar (phonetabs.js)
shows the first four with the rest under More. Providers is listed (it can
be moved, never hidden). While the order isn't the home one the sidebar's
group names (Work, Models, ...) are left out, since a reordered list breaks
the groups; Default order (shown only then) removes the key and puts the
pages and their names back. A page the kept order doesn't name (new in an
update) goes after the page it follows at home. Plugin pages keep their
place in their group. A reader who never reorders sees nothing change.

navOrder and navArrange live in the new navorder.js, imported by navHides
only once an order is kept (and by navpages.js with the menu), so what is
left in app.js is that one line: +107 on both core budgets, explained there.
old-webkit's list of on-demand scripts names navorder.js.

Built on the unpushed WIP 10b9ee22c (page-order worktree), cherry-picked
onto origin/main; the WIP test clicked the aria-disabled Providers row
without force, and its reload checks now wait for the async import.

Run:
- nav-pages-order.test.cjs (new): Chromium and WebKit, en/zh/zh-TW/ja/de,
  10/10 pass. Red on origin/main (no menu opens), 5/5 chromium.
- The whole GUI suite (make test-ui) on mote at the first, inline version
  (navArrange ran on every start; the final version runs nothing new for
  a reader with no order), stopped after 4,171 ok / 171 not ok, none in a
  nav, sidebar or phone file. Five of the red files (agent-switch-accounts,
  gateway-key-arrange, first-untick, data-folder, api-key-theme) rerun on
  mica at this tree and at origin/main c1ab9a494: 34 pass / 56 fail on both.
- At the final tree on mica: every nav*, phone*, side*, sidebar*, i18n*,
  last-page, menu-scroll*, settings-search and old-webkit file:
  377 pass / 42 fail; the reds (menu-scroll, nav-timeout,
  phone-no-sideways, side-effort, old-webkit) fail the same at origin/main
  c1ab9a494, and last-page webkit's (two requests cut off counted as page
  errors, #5972's kind) passed 3 of 3 alone; go test ./internal/gui/...: ok.
  old-webkit's two reds are #6570/#6030 (navpages.js, headerpresets.js
  missing from its list) and #5919, the same on origin/main.

Not tried: a finger drag on a real phone (the test taps the menu and
checks the grip shows; the drag is the mouse path dragRows shares), and
the real app's window (Wails); the GUI tests load the real assets.
2026-11-16 14:06:03 +08:00
yetone 04147086cd settings: a card with no rows is not drawn (fishmagic80 on X)
With Share on local network off, Allowed addresses, Client certificates
and HTTPS empty their cards (#allowList, #mtlsList, #httpsList), but an
empty .list still drew its 1px border, so Settings -> Network showed three
thin lines between the Local network card and Web pages. A Settings card
with no children is now display:none (.set-page .list:empty), for every
Settings page, not only these three.

settings-no-empty-cards.test.cjs opens Network with sharing off (en, zh;
980px and 390px; Chromium and WebKit), asserts no visible empty card on
it and on every Settings tab, and that Web pages sits right under the
Local network card. Red on the old CSS: ['allowList 2px', 'mtlsList 2px',
'httpsList 2px'] in both engines; green with the fix.

Run:
- the new test plus allow-ips, https-settings, lan-address-height,
  lan-lazycat, lan-public, lan-join at this head on mote: 92 pass, 8 fail;
  the 8 are allow-ips (#4357, #4959) and lan-join WebKit (#6353), red the
  same at base 9dcec6751.
- go test ./internal/gui on mote: ok.
- whole GUI suite (concurrency 4) on mica at the pre-rebase commit; every
  file with a red there was rerun at base 9dcec6751 and with the fix on
  mote: 46 files, the same reds both sides (254 and 611 tests: 134/134 and
  138/135 fails) except flakes that went both ways (bark zh 900, connect
  en 420, group-new-head en/zh, which is red at base alone too). These
  reds are filed under #6709, #6782, #6373, #6372, #6543, #6755, #6444,
  #6353 and others.
Not tried: the real app window (CSS only, rendered through the real
assets in both engines).
2026-11-16 13:53:37 +08:00
yetone 5bd13b8025 gui: TestProviderSaveClientCert expects the system's separator (#5928)
On Windows the editor shows a saved certificate path as
"~\Downloads\magpie-laptop\client.pem", and the test wanted the "/"
form, so it was red on Windows since efb75ad1f (11-10). Windows CI only
compiles the tests, and 023a56373 still listed it today. The product is
right: provider.CertPath reads "~\" as the home folder, so the shown
value saves back to the same file. The test now wants the system's
separator and checks that read-back.

Run:
- win-run (xiaomi-gpu, Windows 11) go test -count=1 -run
  TestProviderSaveClientCert ./internal/gui: ok (red at main before,
  "shown true \"~\\Downloads\\magpie-laptop\\client.pem\"", #5928).
- mote: go test -count=1 -run 'TestProviderSaveClientCert|TestMTLS'
  ./internal/gui: ok. gofmt -l clean.
Not tried: the rest of the Windows reds in #6068; test-only change, no
full suite.
2026-11-16 12:13:44 +08:00
yetone 023a563735 install: the Windows install dialog says the download can be deleted
@jiangshangmuyun on X updated on Windows and found a new magpie while
"the original is still there". That is by design since 14807bcf2: a
magpie-windows-amd64.exe kept in a folder of the user's own is asked
about and installed to <folder>\magpie\magpie.exe, a copy, and the
download is left where it was. Nothing said it could go.

Now the install dialog (installDialog, Windows' task dialog) has a
footer naming the exe it was opened from: "Once magpie is installed,
you can delete D:\Tools\magpie-windows-amd64.exe." It is in each
language the dialog speaks (en, zh, zh-TW, ja, de), and stays under a
refusal too. The file is never deleted by magpie; only the words are
new. The footer is TASKDIALOGCONFIG's pszFooter (offset 132 in the
packed 64-bit layout), left empty when the exe can't be told.

Tests: TestInstallDialogSaysTheDownloadCanGo (every language names
the exe once, no format error; none without an exe). Broken by hand:
zh's text without %s goes red with %!(EXTRA ...).

Run: go test ./internal/gui/ ./internal/update/ on mote (ok) and on
the Windows box: the new and existing install tests ok; 11 reds there
(TestGatewayHeldByAContainer, the four %AppData% import rows,
TestProviderSaveClientCert, TestPageAwayLetsStatsGo,
TestPluginAgentMissingSaysSo, TestGatewayModeStatsNameTheGatewaySessions,
TestUpdateThatWontStart, TestPackagedByDpkg) fail the same at a fresh
origin/main 9dcec6751 and are open (#6068, #4603, #6810, #5928, #6059); GOOS=windows go vet (amd64, arm64) of
internal/gui and internal/update on mote; gofmt -l clean. Real dialog:
a throwaway test (not committed) opened taskDialog on xiaomi-gpu's
console session with comctl32 6 and read it back through UI
Automation, en and zh: the footer is there under the buttons, full
path included.

Not run: a Linux go vet of internal/gui (the box has no gtk4/webkit
headers; installdir.go is pure Go and compiles on darwin). Not tried:
the real installed app's first start from D:\, or a screenshot of the
dialog (the console renders black over SSH-started captures).
2026-11-16 11:51:12 +08:00
yetone 9dcec67513 archive: the request archive in an S3 bucket is kept under a GiB, oldest calls removed
An R2 user on X: the sync bucket grew by 18 GB in under a month. The
backup and usage files are small and rewritten in place; what grew was
the request archive, every call written whole (bodies up to 32 MiB) as
archive/<date>/<id>.json and never removed. The archive on this computer
is capped at a GiB; the one in the bucket had no cap.

Now the bucket's archive is held to RequestArchiveMB (a GiB unless set,
carried by sync), down to a tenth under it past the cap, oldest first:
- only keys of ArchiveName's own shape under <prefix>/magpie/archive/
  are counted or removed; the backup, usage, other prefixes and anything
  else in the bucket are never touched (a test seeds seven such keys);
- uploads are counted as they go, and the bucket is listed again only
  after a tenth of the cap more is uploaded: one LIST for ~1000 calls,
  never one per call;
- the serving magpie lists once two minutes after it starts, archive on
  or off, so a bucket grown before this update is brought under the cap
  without the user doing anything (auto-cleanup chosen over a button:
  the objects are magpie's own, already capped locally, and a removal
  is logged);
- the Usage page's switch tooltip says the size ("…in <bucket>, up to
  1.1 GB"), in every language; the core script budget is kept, not
  raised: the two tooltips share one options object and the switch's
  aria-checked is set from a boolean.

The Nov 3 rise in Class B reads has no code cause found: archive reads
are click-driven only, and the backup's conditional GET runs every 3
minutes per computer online.

Red on the old logic (bucketAdded and KeepBucketArchiveBounded made
no-ops by hand, on mica): TestRequestArchiveKeptUnderItsSize "after 200
calls the archive holds 248 calls, 7629310 bytes, over its 1048576 (48
from 2020 left); 0 LISTs, 0 DELETEs"; TestBucketArchiveBroughtUnderIts
SizeAtStart keeps 30 calls / 3000 bytes; TestBucketArchiveListedPer
TenthUploaded "0 LISTs". With the fix: "200 calls: 44 kept, 986389
bytes; 4461157 bytes uploaded, 39 LISTs, 203 DELETEs".

Run at this tree (rebased on c6a67dd41):
- mote: gofmt -l internal clean; go test -timeout 45m -count=1
  ./internal/davsync ./internal/gateway ./internal/settings
  ./internal/settingsapi ./internal/cli: all ok (gateway 897s).
- mica: go test ./internal/gui ok (TestCoreScriptBudget included);
  GOOS=windows go vet of the six touched packages ok; GOOS=linux go vet
  of davsync, gateway, settings, settingsapi ok (gui and cli need
  WebKitGTK's cgo, not vetted for Linux).
- mica GUI, Chromium and WebKit, every language: request-archive,
  request-archive-usage, i18n-keys, i18n-en-no-cjk 22/22 at this tree;
  with call-headers, context-text, routing-bodies, routing-side-calls,
  usage-ledger-search and web-page 114/114 before the tooltip's last
  wording change.

Not tried: a real R2 or S3 bucket (fake S3 only), and the reporter's
own bucket contents.
2026-11-16 11:25:30 +08:00
yetone c6a67dd412 gui: the Windows main window is resized from its edges again (Puremilk_chun on X)
Since 0.1.4274 (dd77094ca) the main window on Windows is frameless, and
Puremilk_chun on X couldn't resize it. Wails' frameless window answers
WM_NCCALCSIZE with the whole window as the page, so Windows has no
resize border left: the invisible band outside a window's edge, where
Windows 11 users grab it, answered HTNOWHERE, and only Wails' 4px band
inside the page resized, which on the right lies under the page's
10px scrollbar (.view is overflow-y: scroll) and did nothing.

mainFrameCalc (mainframe_windows.go), asked first by appWndProc for
the main window alone, lets DefWindowProc work out the frame as for a
framed window and then puts the page's top back at the window's top.
The left, right and bottom are Windows' own resize border again; the
header is still the title bar, with the caption buttons, the shadow,
the rounded corners and snap as dd77094ca made them; the top is resized
by Wails' band. Maximised or in full screen Wails sizes the window as
before. keepResizeFrame names the window on Wails' runtime ready (the
first main window is made before the main loop runs) and has Windows
work the frame out again. gui-shell.md says so.

Run (at this tree, rebased on origin/main 3b643f397):
- gofmt -l clean. mote: GOOS=windows go vet ./internal/gui, go vet
  ./internal/gui, go test -count=1 ./internal/gui: ok.
- xiaomi-gpu (win-run): go test -count=1 ./internal/gui: TestMainWindowKeepsResizeBorder
  ok; 10 reds, all red the same at origin/main 3b643f397 run by name on
  the same box: TestPageAwayLetsStatsGo (filed #6810), the other nine in
  #6068, #5324, #5928 and #6059.
  WSL magpie-desktop: go vet -tags gtk3 ./internal/gui: ok.
- TestMainWindowKeepsResizeBorder (Windows): a real window answering
  as Wails' frameless one; the main window's left, right, bottom and
  bottom-right hit HTLEFT/HTRIGHT/HTBOTTOM/HTBOTTOMRIGHT, its page
  starts at the window's top, maximised the page is the whole window,
  and another window is left alone.
- Windows 11 on xiaomi-gpu, 100% scale, sandbox USERPROFILE, port
  3481, a real mouse (mouse_event) on each edge and corner, 2px inside
  and 3px outside, the window placed at 200,133 1000x640:
  - 0.1.4281: outside every edge hits 0 and nothing moves; inside, the
    right edge and bottom-right do nothing (the scrollbar takes the
    press, no mousemove reaches drag.ts), the others resize.
  - this tree: outside, right/left/bottom/br/bl hit 11/10/15/17/16 and
    resize 60px; inside as 4281; the header drags the window; the
    maximise button maximises to the work area and restore brings back
    the same rect; a screenshot shows the header at the top edge with
    the caption buttons, the border and the shadow.

Broken by hand: with mainFrameCalc answering false,
TestMainWindowKeepsResizeBorder is red (left/right/bottom/br hit 1,
"the page starts at the window's left edge").

Not tried: 150% scale (changing the display's scale would move other
sessions' windows on that box); snap (WS_THICKFRAME and the styles are
unchanged); the inside band under the scrollbar on the right is left
as it was, the outside border now covers that edge.

Rebased on f64c7e54f (routing, provider and a gui-shell.md paragraph
elsewhere): on xiaomi-gpu TestMainWindowKeepsResizeBorder ok; on mica
gofmt, GOOS=windows go vet and go vet ./internal/gui ok.
2026-11-16 10:50:49 +08:00
yetone 2ad38c8b3e provider: Baidu Qianfan's ended console sign-in asks for a new one in the editor, and a renewed cookie is kept (yuushabu_buyinn on X, #5860)
yuushabu_buyinn asked for AccessKey + SecretKey in place of the console
cookie, which expires. Baidu has no such route. Its documented OpenAPI has
no read for a Token Plan Personal:
- the Qianfan API catalog (doc/qianfan/s/Smownk4en): 量包
  v2/charge?Action=DescribePackageResources lists token packs by series,
  with no Token Plan;
- Finance's API (doc/Finance/s/ojxecslph): bills, balance, orders,
  vouchers;
- the Token Plan Enterprise's seat APIs (tokenplan?Action=...
  DescribeTeamSeatUsageDetail), which take an API key and are for team
  seats only.
The Token Plan Personal doc (doc/qianfan/s/Dmrabu8b6) shows usage only on
the console's 我的订阅 page. So the cookie stays, and what is mended is
what happens when it ends:

- Before, a session the console refused showed "Signed out of the Baidu
  Cloud console" on the card, while the provider's editor still said
  "Signed in" with only Sign out. Now the kept sign-in is marked ended
  (qianfanSession.Ended, set the first time only, and not when a newer
  paste has replaced the cookie the read used). /api/providers says
  qianfanPlan.ended, and qianfanplan.js draws "Baidu Cloud ended this
  sign-in. Bring a new one:" above the bookmarklet and paste steps. A
  new paste, or a later read the console takes, clears the mark.
- A cookie the console sets in a reply that read the plan (on the
  resource's path) is merged into the kept Cookie header as a browser
  would: replaced in place, added, or taken out when deleted or expired
  (mergeQianfanCookies). A session Baidu renews as it is used then stays
  the one magpie holds. The paste check keeps what its reply set too.

The StepFun sibling (the same "still Signed in" gap, drawn by
renderStepPlan in app.js) is #6808. The Qianfan fix adds no app.js bytes.

Run (mote, at 3b643f397 plus this change; go test, vet, gofmt, qianfan-plan
and i18n-keys again after rebasing on f64c7e54f, all ok):
- gofmt -l, go vet (darwin, GOOS=linux -tags nogui, GOOS=windows) for
  internal/provider and internal/gui: clean.
- go test -count=1 ./internal/provider ./internal/gui: ok.
- node --test qianfan-plan, i18n-keys, i18n-en-no-cjk: 12/12 (chromium +
  webkit, en + zh). stepfun-per-provider and qianwen-plan: all ok.
  old-webkit 4 and 5 are red the same on a clean 3b643f397 copy (#6030,
  #5919).
- Broken by hand: without the ended mark, TestQianfanSessionEnded fails
  "an ended sign-in should be kept, marked ended". Without the merge it
  fails "renewed cookie kept as ...s-1".

Not tried: no real Baidu Cloud account. How long the console's cookie
lasts was not measured (a third-party tool reports a few weeks), and
whether the console sets renewed cookies on this request is not known.
The merge does nothing if it doesn't.
2026-11-16 10:49:31 +08:00
yetone b34243823e routing: accounts' resets stay in their column, and resizing over many accounts is smooth (lexrus on X)
lexrus on X: on Routing's Accounts and keys, at some widths "resets in
3h" ran over the next column and the right column's words were cut, and
with many accounts dragging the window's edge was janky.

Overlap: the window parts' widths (--wk/--wv/--wr) were taken from the
widest window of the whole list, so one provider's long reset pushed
every row past its column. They are now per provider, and CSS caps each
part to its row.

Jank: the list was CSS columns, and the browser balanced every row again
on each layout. packActs (plugins/routing/client.js) places each
provider's box (and a long box's rows) itself under .rt-acts.packed with
--px/--py: down a column and on into the next, ends as level as a binary
search on the cap allows, a heading never last in a column. It runs on
the window's resize, on render, and a frame after a box's height changes.
Side mode (min1150, beside the requests) is unchanged: one scrolled
column, nothing placed. Measured on mote with a 100-row fixture, per
resize step: WebKit layout 26.6ms -> 5.9ms, frame p90 35 -> 18ms;
Chromium layout 8.24ms -> 2.86ms.

Test: routing-account-windows-fit.test.cjs, 4 and 20 Codex accounts, en
and zh, Chromium and WebKit, widths 420-1600: no window part runs past
or is cut, a provider's lines start together, the list isn't CSS
columns, boxes sit inside the list in column order without overlapping,
2+ columns at 700-1099. Broken by hand: the old assets are red on the
overlap; packing turned off is red ("the list isn't CSS columns").
gui-shell.md says how the columns are placed.

Run on mote at this change on origin/main 7bdda0450 (pushed on
3b643f397, which changes internal/provider only):
- the 209 GUI files that open Routing or read its files, plus
  i18n-keys and builtins: 3736 pass, 42 fail. Every red is red the same
  on a clean origin/main 7bdda0450 copy, or is filed: quota-bars-alike
  (#6700), ctx-session-line (#5801), quota-credits (#6807, filed now),
  routing-pin-away (#6512), routing-row-swap (#3799),
  routing-story-shrinks (#3954), mobile-web (needs .git for its
  origin/main baseline; #3952, #5013). routing-idle-frame's one WebKit
  red came under load (#3773) and passed 2 of 2 alone at this head.
- go test ./internal/gui: ok. gofmt -l: clean (no Go changed).

Not tried: the real Wails app, Linux WebKitGTK, Windows WebView2, and
lexrus's own accounts.
2026-11-16 10:42:18 +08:00
yetone 7bdda04509 settings: Update source's menu button shows its whole name (jiangshangmuyun on X)
Settings › About › Update source showed only a clipped glyph and the
chevron (reported on Windows, reproduced in Chromium and WebKit alike).
Cause: .pref-pick's max-width is min(230px, 45%), meant for a picker
that is the row's own child (Language). Update source's button sits in
the row's .val box, whose width is its content's, so 45% resolved
against the button's own width and shrank it each time. A .pref-pick
inside .val now takes min(230px, 100%); .val is held to 60% of the row
already. Only #updateSourcePick sits there (langPick and the sidebar
pages picker are the row's own children), so nothing else moves.

settings-update-source.test.cjs now checks the label is not clipped
for each of its three choices.

Run (mote):
- settings-update-source.test.cjs on the old CSS: 10 of 20 red (every
  language at 1100px in chromium and webkit, e.g. "自动: the label is
  clipped (24px in 0px, button 25.6px)"); with the fix 20 of 20 ok.
- node --test settings-update-source, segs-glide, uninstall-settings,
  update-mirror, update-download-steps, update-hide, update-quiet,
  update-row-steady, update-check, i18n-keys: 300 of 300 ok (both
  engines, every language).
- go test -run 'Budget|CSS|Asset|I18n' ./internal/gui: ok. gofmt clean.
Not tried: the real Windows app (WebView2); the whole GUI suite, as the
rule matches one element.
2026-11-16 09:43:49 +08:00
yetone ada0125303 providers: Antigravity's accounts move to agy-cli in one click (@tongzhenbao on X)
@tongzhenbao asked whether accounts signed in on the old Antigravity
plugin (opencode-antigravity-auth, withdrawn since 256910f17: it
keeps serving its users, with Google's suspension risk said) can move to the
agy-cli plugin in one click. They can: both hold refresh tokens from the
same Google OAuth client (agy's own, 1071006060591-...), so the token goes
to agy, the client that issued it, and to no new place.

What the user sees: on Providers, while the old plugin still holds
accounts agy-cli doesn't have, a line over the list says Antigravity's
accounts can move to Antigravity (local agy CLI), with Move and Not now.
Move installs agy-cli (>= 0.1.68, from the plugins repo's dist branch,
as npm doesn't have it) and the agy CLI when missing, then hands the
sign-ins to agy-cli's auth.import (plugins 9907c187), which gives each
account its own agy home and keeps it only once `agy models` works with
it. Accounts that fail are named with agy's reason, Try again retries
them, and the old plugin's sign-ins are never removed. While this line
shows it stands in for the withdrawn plugin's own line (256910f17's
"can get your account suspended ... Use Antigravity (local agy CLI)"):
it opens with the same risk and carries the Move itself; after the move,
or Not now, that line is back. The "antigravity" retired-move line steps
aside too. Plugins > agy-cli > Import accounts from a file stays the
manual route.

- internal/provider/agy_move.go: AgyMoveUsers (deduped by refresh token
  and email, skipping emails agy-cli has) and MoveToAgy.
- internal/gui: /api/provider/toagy, agyMove/agyMoved in the payload.
- app.js: the agy line is the lazy agymove.js, so app.js's core bytes are
  below its base and the budget is unchanged.
- i18n in zh, zh-TW, ja, de; docs/subsystems/providers-accounts.md row.

Run at 281d6ebb6 (before the rebase onto 8f3f7a46a), on mote:
gofmt -l clean; go vet ./... (only the existing proc cgo deprecation
warning); GOOS=linux go vet -tags nogui ./... and GOOS=windows go vet
./... clean; go build ok; go test -count=1 -timeout 45m ./... exit 0,
101 packages ok, no FAIL.
Run at a5289963f (rebased onto Qianfan), on mote: go test -count=1
-timeout 45m ./internal/gui/ ./internal/provider/ ./internal/cli/ ok.
Full GUI suite at f3e826b98 (base 52e83f7b5), both engines, every
language: 1,035 of 28,152 failed in 123 files; those 123 files rerun at
head and at base 52e83f7b5 alone: 1,038 and 1,029 failed, every red test
also red at base or flipping on both sides (key-replace, signin-proxy,
name-suffix-remote 1 of 3 at each, tray-cell-click, images-codex-one,
models-fold, rest-try-now). Filed: old-webkit #6030 and #5919,
plugin-move-unserved #4392 and #4410 (4 reds at both), video-gen-pick
#6792 (filed now); every other red file has its open gui issue.
Run at this head (ea4d55d72, rebased onto 103eff4d4, which brought
256910f17's withdrawn line and depLine), on mote: gofmt -l
clean; go vet, GOOS=linux go vet -tags nogui and GOOS=windows go vet of
internal/gui, internal/provider, internal/plugin ok; go test -count=1
-timeout 45m of internal/gui, provider, plugin and cli ok; node --test
agy-move, providers-withdrawn, retired-move, deprecation-notice,
plugin-move, providers-discovery-off, i18n-keys, i18n-en-no-cjk,
old-webkit and plugin-move-unserved: 92 of 98 ok; the 6 reds are
old-webkit's compat.js-first and Safari 15 styles (#6030, #5919) and
plugin-move-unserved's Try again (#4410), all red at base too.

Red by hand: dropping the email/refresh-token dedupe fails
TestAgyMoveUsersAreTheOldPluginsNotInAgyCLI (offers a2@x.com too);
dropping st.AgyMoved fails TestToAgyMovesAndSaysEachAccount;
drawing the withdrawn line beside the agy one fails agy-move.test.cjs
10 of 12 ("two lines for the same accounts"); clearing the
kept failures on a failed move turns agy-move.test.cjs not ok.

End to end, sandbox HOME on mote, no real credential: the real MoveToAgy
with a fake antigravity sign-in downloaded Bun, installed agy-cli 0.1.68
from dist, ran auth.import, and reported the account failed by name
("agy couldn't sign in with it: `agy models` says: Please sign in ...");
agy-cli kept 0 accounts and the old plugin still had its 1.

The plugins side's run had one red under load, agy-cli's
test/usage.mjs version deadline, filed as magpie-community/plugins#1191.

Not tried: a real Antigravity account moved through a running magpie,
and agy homes on Windows and Linux.
2026-11-16 07:22:47 +08:00
yetone 64c4261582 sessions: search what was said in every agent's sessions, from the page and an MCP server
cryingLiu on X asked to search the chat history of every agent magpie
reads sessions from: prompts and replies, from one place.

What the user gets:
- The Sessions page's search also lists, under the agent's own list,
  the other agents' sessions whose conversation says the words, each
  with a snippet. A hit opens the conversation in the sheet at the
  message that said it (transcript?find=), with "N earlier messages
  not shown"; the page itself never scrolls. While the index is still
  being built the head says "Indexing sessions…" or "Indexing N of M
  sessions…", and the page asks again every 3s until it is done.
- Magpie Sessions, a built-in MCP server in Library → MCP (Discover),
  opt in per agent like the other magpie servers. Its tools are
  search_sessions(query, agent?, limit) and read_session(id, around?),
  both returning text. It runs as `magpie mcp sessions` over stdio and
  reaches the gateway's /mcp/magpie/sessions, which serves only local
  callers that are not browsers.

How it works:
- internal/sessions/said_index.go keeps said-v1.db beside sessions.json:
  a contentless SQLite FTS5 index (detail=none) of the words each
  session says. It is built from the sessions list sessions already
  caches and refreshed at most every 10s: a new or rewritten file is
  read once, a grown Claude Code or Codex file only from where it ended,
  and a gone one is forgotten. A query asks the index which sessions
  have every word, then reads only those files for the snippet, for at
  most 6s. A search waits up to 2s for a refresh. While the first
  listing is still running the answer says `listing`, so an empty first
  answer is not read as "no session says it".
- Privacy: only agents sessions.Reads allows are indexed or searched;
  nothing is read until the user has answered the sessions question,
  and in gateway mode no agent's own files are read (the page doesn't
  ask). Reset forgets the index.
- /api/sessions/said for the page; the CLI parity list names it.

Run, at this tree (rebased on origin/main 256910f17):
- gofmt -l clean; go vet on mote for darwin, GOOS=linux -tags nogui
  and GOOS=windows: ok.
- go test -tags nogui ./... -timeout 45m on the WSL Linux box:
  every package ok at c8e445c4b (the tree before the one-hit wording,
  whose gateway tests ran again on mote: ok).
- GUI: the whole suite on mica at this head was still running when
  this was pushed (owner: never hold a verified change behind a full
  suite). Under mica's load, beside another session's full suite, 90
  tests had failed so far, all in files this change doesn't touch
  (accounts, Details, keys, plugins, providers); none in sessions,
  library or i18n. The files this change reaches passed on their own
  (below).
- Focused, green: internal/sessions (Said*, TranscriptAt),
  internal/gateway (SessionsMCP*, own MCP, read-only, key slots),
  internal/library (market, opt in), internal/gui (Said, Sessions,
  gateway mode); GUI sessions-said, sessions-search, library-sessions-mcp,
  vision-mcp-library, library-browser-setup and i18n-keys in chromium
  and webkit, every language, wide and narrow.
- Broken by hand, one at a time, each red and green restored: the
  index's Listing left out (TestSearchSaidWhileTheSessionsAreFound red
  in 2.5s); the page ignoring `listing` (sessions-said 6 of 7 red); the
  MCP's local/browser guard (TestSessionsMCPOnlyForAgentsHere red); the
  server's opt in (TestSessionsServerInDiscover red); every Reads check
  on the search path, the index's and SearchSession's together
  (TestSearchSaidLeavesOutAgentsNotRead red). With those gone the
  gateway-mode GUI test stays green, because the sessions listing
  leaves an unread agent out before the index sees it.
- Real use, in a sandbox HOME with GOPATH, GOMODCACHE and GOCACHE
  pinned, over the real history through symlinks (29 GB Claude Code,
  60 GB Codex, 14,102 sessions), sessions reads set to all in the
  sandbox: first listing ~60s cold (answers say still being found),
  whole index built in 9m50s while queries answered in ~6s each, index
  38 MB, a common word 4.9s and a rare word 1.0s warm, read_session at
  the words of a huge session 1.8s, peak footprint 442 MB for the whole
  process with the sessions cache. Nothing was written under the real
  ~/.claude or ~/.codex.
- The real binary end to end on mote, in a sandbox HOME: `magpie serve`
  on a free port and `magpie mcp sessions` over stdio with
  MAGPIE_GATEWAY, against a Claude Code session written there:
  initialize, tools/list, search_sessions found it with its snippet,
  read_session at the words started 3 messages before them, a word
  nowhere said "No session says", and a POST with a web page's Origin
  was refused 403. That run is how "1 sessions say" was found and
  made "1 session says" (TestSessionsMCPSearch red before, green after).

Not tried: a real agent (Claude Code, Codex) calling the server it was
given from the Library, and the page against a real backend (the GUI
tests fake the API). The index on Windows and Linux ran only through
the Go suite.
2026-11-16 07:19:18 +08:00
yetone 103eff4d44 routing: a group's model is dragged by its row, not only by its number (NovaStudiosss on X)
NovaStudiosss on X: "the models added to a routing group should be
draggable with the mouse; I move them often and Up/Down each time is
not handy enough". A member could already be dragged since 4dab45e3f,
but only by its number, whose grip shows on hover; the number reads as
a label, so the reporter only found Up and Down.

Now the whole row picks the model up too: its logo, the room around
its words and the row's own background, through the same dragRows the
number uses (one commit to moveMember, the same order saved as before,
so the gateway routes in it: members/placed in /api/groups/save as
group-member-drag already checks). The row shows a grab cursor. A press
on the model's name still selects its words, as the accounts' rows do
(the editor keeps them selectable, jiabubu), and its switch, number,
effort, weight, Up/Down and remove stay controls. The row has
touch-action pan-y, so a finger on it still scrolls the page; the
number keeps touch-action none for a finger's drag. The grip still
shows on hover only. No new strings, no new motion (the drag's lift
and shifts are dragRows', reduced motion as before).

Run (pushed tree's assets = this commit on 65e3dfa95):
- group-member-row-drag.test.cjs (new): Chromium and WebKit, en, zh,
  zh-TW, ja, de, at 1100px and 420px, 20 of 20 on mote. With
  origin/main's assets (MAGPIE_ASSETS) it is red: the cursor check,
  and with that check taken out the logo drag moves nothing
  (["one","two","three"] for ["three","one","two"]), both engines.
- group-*, routing-*, rt-*, route*, i18n*, strings*, click-scroll and
  core-* GUI files (250 files, 4008 tests) on mica under load: 18 red
  in 6 files. Rerun alone at concurrency 1, here and on an origin/main
  65e3dfa95 worktree: the same 17 red in 5 files on both, all filed:
  group-editor-selected (#5049), routing-pin-away (#6512),
  routing-row-swap (#3799), routing-signin (#6520),
  routing-story-shrinks (#3954). group-member-weight's webkit de 420
  1px red (#2387) passed alone.
- go test -tags nogui ./internal/gui/ on mote: ok.

Not tried: a real touch screen (the touch-action values are checked,
not a finger), and the Linux WebKitGTK app.
2026-11-16 06:44:38 +08:00
yetone e47abdf468 usage: the allowances' trend takes any last N days; a curve's hover reads the exact numbers
shangyuan0818 on X asked for exact numbers on the Overview's quota
curves when hovered, and for the trend to take any "last N days".

- Usage → Overview, the allowances' "Trends: …" button: the menu now
  has 7 days and 30 days beside Off, 2 days and Cycle, and "Other number
  of days…", which turns the button into a field for 1 to 45 (the days
  of history magpie keeps). Enter or leaving the field keeps it; Escape
  leaves the range as it was; a number out of range says so and keeps
  the old one. A custom N stays in the menu, and is kept across a reload
  (magpie.quotaRange).
- Hovering a quota curve shows a small tip at the reading nearest the
  pointer: when it was read, then each window's left to two decimals
  (70.46%), with a hairline at that time. A balance curve shows the
  balance in the card's currency. The curve's own tooltip (what the
  dashes mean) waits while the tip shows. A touch still zooms, as before.
- The trend menu, the days field and the hover live in the usage
  plugin's page.js, so app.js stays inside its budget.
- No animation: the tip follows the pointer, which a movement would lag.

Run, at d597b4d01 + this change, on mote and mica:
- quota-trend-days.test.cjs (new), 5 languages x 2 engines: red on
  2d106b5c1 ("7 and 30 days are offered"), green 10/10.
- The 18 GUI files that draw or pick the allowances' curves, i18n-keys
  and i18n-en-no-cjk, plus usage-exact-cost and quota-holds: 201 pass. The 6 reds are red alike on origin/main 2d106b5c1, each filed:
  quota-curve's "quota cards draw what was left over time" (#6789) and
  usage-fold's "17 subscriptions and 29 accounts" (#3415, #6003).
- go test ./internal/gui: ok (app.js 228 bytes inside appScriptBudget)

Not tried: Windows (WebView2) and the panel's Allowances tab by hand, a
real account's history, a touch screen.
2026-11-16 04:45:45 +08:00
yetone d597b4d010 usage: a priced cost without "≈", at least two decimals; cache hit rate to two
shangyuan0818 on X: Usage → Requests showed every cost as "≈$…", and
the cache hit rate with one decimal.

- A cost from known prices is what magpie counted, so "≈" is gone from
  every priced cost: Requests' Cost card and tiles, the agent, model and
  account rows, the quick panel's Usage, Routing's live rows. An estimate
  keeps it (a window's whole on an account card, a session file's times).
- fmtCost gives at least two decimals ($1.00, $100.00, $2500.50), three
  under $1 as before, and a sub-mill amount to its first two digits
  ($0.00040, $0.000012) instead of $0.000.
- Requests' Cache hit rate card has two decimals (93.97%); hitPct still
  never rounds up to 100% or down to 0%.
- A whole-window estimate from $100 up stays whole ($1235): its cents
  would claim a precision it hasn't (wholeCost, moved to page.js to keep
  app.js inside its budget).

Run, at 2d106b5c1 + this change, on mote (rebased onto fc41381d6,
whose three commits touch nothing under internal/gui):
- usage-exact-cost.test.cjs (new): red on 2d106b5c1, green 12/12.
- The 91 GUI files that read a cost or a hit rate, both engines, every
  language. Reds beside this change's own (fixed: mobile-web,
  panel-currency-provider, ledger-cache-unknown, usage-ledger-chart) are
  red alike on a 2d106b5c1 checkout, each filed: grip-inset #6293,
  key-balance-card de #6414, usage-cards-hide #6294,
  usage-hidden-way-back #6295, quota-curve #6789, old-webkit #6030,
  tray-cell-click #5215, usage-ledger return-to-live #4078, usage-upload
  #6743, zero-priced-free #5262.
- After the test fixes: mobile-web, panel-currency-provider,
  ledger-cache-unknown, usage-ledger-chart, usage-exact-cost, quota-holds,
  usage-unpriced-sum, currency, i18n-keys: 112 pass. The 14 reds are red
  alike on a 2d106b5c1 checkout: usage-ledger-chart's "metric is
  remembered" (filed in #6790) and mobile-web's "desktop matches
  origin/main", which needs git in the copy (mote-run has none; #5013).
- go test -run Budget ./internal/gui: ok (app.js inside appScriptBudget)

Not tried: Windows (WebView2), the reporter's own data, a real account.
2026-11-16 04:38:36 +08:00
yetone dd77094ca2 gui: on Windows the header is the window's title bar (258a14 on X)
With a wallpaper, Windows' main window had a white native title bar over
the page, cut off from it ("内容区域和标题栏有割裂感"). On Windows the main
window is now frameless (mainFrameless), as the Mac's header already is
the title bar: the page and its wallpaper run to the top edge. Wails v3's
frameless window keeps WS_OVERLAPPEDWINDOW, so the shadow, Windows 11's
rounded corners, snap (Win+arrows, drag to an edge) and Wails' resize
edges stay. The header draws minimise, maximise/restore and close at its
right (#wincap, wincap.js, imported in that window alone), Windows-sized
with Segoe Fluent Icons, in the theme's colour, Close red on hover
(.1s ease); the header's refresh and pin sit left of them and stay
no-drag. A double click on what drags the window maximises or restores
it. The app tells the page when the window is (un)maximised (captionJS),
which swaps the glyph and its tooltip and keeps Wails' resize edges off
while maximised so the corner pixel is Close's. The buttons stay over a
dialog's scrim (wincap.js undoes modalBackground's inert on them). The
Mac, Linux, the tray panel and the web page are unchanged.

TestCoreScriptBudget: +27 on both budgets for the one import line in
app.js, past the 29 bytes of room there were; the rest lives in
wincap.js and app.css.

Run (mote, at this tree on origin/main 256910f17):
- gofmt -l clean; go vet ./internal/gui, GOOS=windows go vet
  ./internal/gui, go test -count=1 ./internal/gui: ok.
- Linux: go vet -tags gtk3 ./internal/gui on WSL magpie-desktop: ok
  (at the tree before the rebase).
- GUI: win-caption (new), brand, header-centre, header-zoom-fit,
  i18n-keys, modal-backdrop, providers-withdrawn, text-size,
  sidebar-overlay-scrollbar, both engines, every language: 125 ok,
  7 red, all red on origin/main too: header-centre webkit (#3479),
  modal-backdrop Linux window/panel (#6663), text-size webkit (#6561).
- A 47-file run of every GUI file the header, modal or Windows path
  reaches (mica, before the rebase): the same reds plus mobile-web
  (no .git in a run copy, #5013) and sidebar-overlay-scrollbar de
  webkit once (#1863, commented).
- Whole GUI suite (mica, load ~99): started at the pre-rebase tree and
  synced to the rebased one mid-run, so it isn't a clean record. Its
  reds in 28+ files match main's: 10 of those files alone on mote give
  the same 121 of 218 red at origin/main 256910f17 and at this tree
  (#6709, commented).
- Windows 11 on xiaomi-gpu, built from this tree, sandbox USERPROFILE,
  port 3461: screenshots light/dark with and without a wallpaper, and
  maximised; double click on the bar maximises and restores, max/restore
  and min buttons work (IsIconic true after min), Win+Left snapped to
  half the screen, Win+Up/Down maximise and restore.

Broken by hand: win-caption is red on the old assets (5 of 5 cases);
without wincap.js's MutationObserver it is red 10 of 10 ("the caption
buttons aren't" inert); #457's +0.5 in fitTop turns header-zoom-fit red.

Not tried: Windows 11's snap-layouts flyout over maximise (it needs
Wails' composition hosting, not shown); dragging the window and its
resize edges with a real mouse (a firewall prompt of another session's
magpie dims the desktop and swallows input; buttons and double click
were driven through CDP instead).
2026-11-16 03:37:02 +08:00
yetone 256910f174 plugin: Antigravity's plugin keeps serving whoever has it, and is given to nobody new
The owner (11-15): "正在使用的继续正常,加个提示,新用户不让下载". Google
suspends accounts it sees on Code Assist through Antigravity's own client,
so 9cd5f3652 retired the plugin outright (0.2.0 answered every request with
a 410). Now its users keep it working and are told the risk; nobody new
gets it.

- internal/plugin/withdrawn.go: a list of withdrawn packages (Antigravity's,
  pointing to agy-cli). plugin.Add, the one place the CLI, the GUI,
  Discover and import links install through, turns a withdrawn package
  away unless this magpie has it listed already (on or off), and says
  what to use instead. Upgrade and AddExact (backup, sync) are not gated:
  they act on a plugin the user has.
- The mover installs it for the user's own accounts (move,
  keepMovedCurrent) under plugin.KeepWithdrawn; Adopt, which brings no
  accounts, is a new user and is turned away. Antigravity's min is 0.2.1,
  plugins c0c625ac: the 0.1.18 plugin restored, out of the registry.
- /api/providers lists the withdrawn plugins kept in `withdrawn`, and the
  Providers page draws a line over the list: the risk, why, and "Use
  Antigravity (local agy CLI)", which opens Plugins on "agy". New strings
  in zh, zh-TW, ja and de. depLine() now draws all three kinds of
  Providers line (discovery off, unmoved, this one), which keeps app.js
  inside its budget without a raise.
- AGENTS.md, provider-plugins.md and the site's subscriptions docs (en,
  zh, ja, search index) say the plugin keeps working for its users and
  is withdrawn for anyone new.

Run on mote at this tree (base 52e83f7b5). After the rebase onto
500f39886 (testenv, qianfan, LESSONS upstream), again at this head: go vet
and go test -count=1 of internal/plugin, internal/provider, internal/gui,
internal/testenv and the root package, all ok. Before it:
- go vet, GOOS=linux go vet -tags nogui and GOOS=windows go vet of
  internal/plugin, internal/provider and internal/gui: ok. gofmt -l clean.
- go test -count=1 ./internal/plugin ./internal/provider ./internal/gui
  (whole packages, TestCoreScriptBudget and the i18n guards in them): ok.
- node --test providers-withdrawn (new; chromium and webkit, en zh
  zh-TW ja de, 1100 and 420), deprecation-notice, plugin-move,
  plugin-move-overflow, retired-move, deprecated-subscriptions, i18n-keys,
  providers-discovery-off, plugin-movable-review, providers-off-fold: ok.
  plugin-move-unserved's 'Try again takes the models unticked' is red 4 of
  4, the same at origin/main 500f39886 alone: #4410.
- Broken by hand: without RefuseWithdrawn in Add,
  TestWithdrawnGivenToNobodyNew goes red (Add goes on to install); without
  KeepWithdrawn in move, TestWithdrawnPluginKeptForItsUsers goes red (the
  user's own move is turned away).
- Plugins: bun scripts/check.mjs all and bun test packages/antigravity
  packages/agy-cli scripts, 195 pass; dist index.json has 0.2.1.

Not tried: a real Antigravity account through 0.2.1 (it is 0.1.18's code,
which served until 11-15), and the CLI/TUI show no notice beyond Add's
refusal.
2026-11-16 03:00:18 +08:00
yetone 8f3f7a46af provider: Baidu Qianfan's Token Plan Personal shows its month through a console sign-in (yuushabu_buyinn on X, #5860)
A Qianfan Token Plan key tells nothing of the plan's usage: Qianfan's
OpenAPI has no read for it, and the console's own page asks
console.bce.baidu.com/api/qianfan/charge/tokenPlanPersonal/resource with
the signed-in cookie. So the plan is read as StepFun's Step Plan is: the
editor of a provider at qianfan.baidubce.com/v2/tokenplan/personal has a
"Token Plan usage" field, drawn by the same renderStepPlan (now told
whose sign-in it brings) from qianfanplan.js, imported when such an
editor opens. The bookmarklet, run on the console, checks the session
with that same request and copies the console cookie; a raw Cookie
header or a copied cURL is taken too, since document.cookie leaves out
HttpOnly cookies. The paste is checked with a real read before it is
kept, by provider id, in qianfan-auth.json (0600, lastgood-guarded,
moved and dropped with the provider). POST /api/qianfan/{id}/session and
/signout serve it.

The Usage page's card (qianfanPlanQuotas in PlanQuotas) is the running
plan's credits (billingMode credit) or tokens as one Month window up to
expiresAt, the plan's tier as its name and auto-renew beside it;
released and past plans are skipped, and routing reads the same windows
(accountPlanWindows). A redirect, 401, 403, an HTML page or a refusal
naming the login is a signed-out session: an error card saying so, never
0 left; any other failure is an error card too, the last reading kept
only on a passing network error. The per-plan apiKey in the console's
reply is never kept, logged or shown.

Not done: the Enterprise (team) plan has no card. The console has no
tokenPlanTeam/resource; it reads team plans through seat and admin APIs.

Not tried with a real account: no one here is signed in to Baidu Cloud's
console, and #5860 has no reply bytes posted. The fixtures follow the
field names in the console's own script bundle and in the
dsh-qianfan-token-plan reader (planType, resourceStatus, billingMode,
usedCredits/totalCredits, usedTokens/totalTokens as numbers or strings,
expiresAt, autoRenew), not a captured reply.

core budget +35 (app.js and core): the field moved to qianfanplan.js;
what is left in the core is the import and two quotaError lines.

Run (at the pushed tree, rebased on origin/main 8df7885d4):
- mote: go test -count=1 -timeout 45m ./internal/provider ./internal/gui
  ./internal/cli: ok (provider 279s, gui 209s, cli 113s)
- mote: GOOS=linux and GOOS=windows go vet of the three (linux with -tags nogui): clean
- gofmt -l internal/: empty
- mica: node --test qianfan-plan, stepfun-per-provider, qianwen-plan,
  i18n-keys, i18n-en-no-cjk, old-webkit (Chromium and WebKit, en and zh;
  i18n-keys over zh, zh-TW, ja, de): 40 of 42 pass. The two reds are
  old-webkit's headerpresets.js (#6030) and app.css :has() (#5919), the
  same on origin/main 8df7885d4, run there.
- Red before: qianfan-plan.test.cjs on origin/main 8df7885d4, 4 of 4 red
  (no field). Broken by hand on mica: with a
  redirect not read as signed out and Released not skipped,
  TestReadQianfanPlan, TestSaveQianfanPaste and TestQianfanPlanCard go red.
- Not run: the whole Go suite and the whole GUI suite.
2026-11-16 01:54:28 +08:00
yetone 8df7885d48 gui: an agent's current model, lifted to the top of its picker, says whose it is when another provider lists a model by the same name
ADNANYURTSEVER3 on X (Mac, macOS 27.2.1): with WorkBuddy and WorkBuddy AI
both serving Hy4 and DeepSeek-V4.1-Flash (WorkBuddy AI spells it
Deepseek-V4.1-Flash), the Agents page's picker showed WorkBuddy AI's
section with Hy4 alone, while dsh listed and ticked "Deepseek-V4.1-Flash ·
WorkBuddy AI".

Cause: not case handling. buildVia and the catalog keep both spellings
apart (checked with a probe test in internal/agent, not kept). openPicker
lifts the agent's current model out of its section to the top of the list
(#1229). There its note named only the account. With WorkBuddy's
DeepSeek-V4.1-Flash, a model of the same name, under the same icon, the
row on top could not be told apart, and WorkBuddy AI's section read as if
magpie had dropped the model.

Fix: when another provider lists a model by the same name, in any case,
the lifted row's note now starts with its provider ("WorkBuddy AI ·
b@…"). The rail's own provider view leaves the name out, since its
section already says it. Pickers with no such clash are unchanged.

A first try listed the current model both at the top and in its section.
It broke the "each model once" and "current first" contracts of
claude-picker-fold, claude-picker-magpie-first and others, so it was
dropped.

Siblings:
- The tray panel uses the same openPicker.
- The Routing member picker and modelfind do not lift the current model.
- The TUI's withCurrent lists the current row by its full value
  (magpie/workbuddy-ai/…), which names the provider.
- dsh already names the provider on every row.

Run (on mica via mica-run):
- New internal/gui/tests/picker-current-in-section.test.cjs: chromium and
  webkit, en/zh/zh-TW/ja/de, 1000 and 440px.
  - Red on origin/main, 20 of 20 ("it says whose it is: b@example.com").
  - Green with the fix, 20 of 20.
- Picker files at the change: picker-rail-current, claude-picker-fold,
  claude-picker-magpie-first, agent-path-same, codex-accounts-via,
  searcher-pick, images-codex-one, video-gen-pick.
  - 150 of 156 pass.
  - The 6 reds (images-codex-one and video-gen-pick, "reading 'x'") fail
    the same on origin/main f9807c5e8 and are in #6709.
- codex-memories-settings, desktop-tiers, fast-pick, fast-ultra,
  menu-scroll, mobile-web, omp-roles and zero-priced-free: no test went
  red that was not red on origin/main f9807c5e8 too (#6709, #6201, #5262,
  #6432).
- At the pushed head (rebased on 9e627c507): go test ./internal/gui, plus
  picker-current-in-section, picker-rail-current, claude-picker-fold,
  claude-picker-magpie-first and i18n-keys: go ok (135s), GUI 76 of 76 pass

Not tried: the real app with the reporter's two WorkBuddy accounts, the
Linux WebKitGTK app, and a whole GUI suite.
2026-11-16 01:42:40 +08:00
yetone 3173c4f41e gui test: a route the CLI's list doesn't name fails internal/gui too
TestEveryRouteHasACommandOrIsNamed (internal/cli) went red on main for a new GUI route six times in a week (#5946, #6162, #6677, #6724, #6786): GUI changes run internal/gui, not internal/cli. TestEveryRouteIsNamedForTheCLI reads the same HandleFunc routes and fails when one isn't a key in internal/cli/settings_parity_test.go, so the run a GUI change already does catches it. The CLI test still checks which command each route has. LESSONS: the 11-15 case and the rule that a check repeatedly missed goes where the work runs.

Run at origin/main ec5b96c44 plus this, on mica: go test -count=1 ./internal/gui ok (185s); TestEveryRouteIsNamedForTheCLI red with the quit/disconnect line taken out of notYet ("POST /api/quit/disconnect (api.go) isn't named ..."), green with it. gofmt -l clean. Not run: Linux and Windows vet (test-only file, os/filepath/regexp only).
2026-11-16 01:18:18 +08:00
yetone 38e60d7449 gui tests: a page's page-away beacon is left out of the writes they count, as update/using is (#6709)
80a315a70 (11-14) sends POST /api/page-away when the page is hidden.
WebKit's page fires visibilitychange hidden in agent-bulk-visibility,
so its write count read 6 for 5, red in every language in WebKit
alone since then (git bisect run from e430e2750, red alone every
time in 2.7s). The seven files that leave the window's update/using
ping out of their counts now leave page-away out too; it writes
nothing either.

Run (rebased on 47ce008da, mote): agent-bulk-visibility,
agent-disconnect-preview, library-bar-more, provider-find,
sessions-folder-delete, settings-search, signin-close: pass 74 fail 0.
Without the change: pass 69 fail 5 (the five WebKit subtests of
agent-bulk-visibility).

Not done: a shared helper for "the page's writes", which would carry
the next such ping to every counting test at once; each file still
has its own route.
2026-11-16 00:12:45 +08:00
yetone 47ce008da8 gui: Settings asks for HTTPS only while its rows can show (#6709)
renderHTTPS sent GET /api/settings/https on every renderSettings,
and renderSettings has 35 callers, so each Settings draw cost a
request, LAN or not. GUI tests count a request under /api/settings/
as a write, so checkin-now-account and panel-shortcut have been red
in both engines and every language since 4623f5419 (11-10): that
commit's record ran chosen GUI files and called the reds the same at
base. Now it asks while the rows can show (sharing on the local
network, magpie answering other computers, or HTTPS saved on), and
again once the saved switch differs from what the last answer said.
Its own writes still update the rows from their answers.

Run (origin/main 139a6be2b plus this, GUI files on mote; at the pushed
head, rebased on 261f48226, checkin-now-account + panel-shortcut +
https-settings: pass 54 fail 0):
- checkin-now-account + panel-shortcut: pass 42 fail 0. Without the
  change: pass 2 fail 40 ('write', '/api/settings/https' counted).
- https-settings, browser-access, cors-origins, side-gateway-lan,
  settings-search, i18n-keys: all pass. allow-ips, lan-join and
  remote-magpie: 14 reds, the same 14 subtests without the change
  (on #6709's list).
- go test -tags nogui -run 'Budget|Size|Asset|Plugin.*Page'
  ./internal/gui: ok.

Not changed: renderWebPage and renderRemote ask /api/web-page and
/api/remote on every draw the same way. They aren't under
/api/settings/, so no test counts them; filed as their own issue.
Not tried: the real app's Settings with LAN on (the GUI fixtures
cover the rows).
2026-11-16 00:09:14 +08:00