Commit Graph
7507 Commits
Author SHA1 Message Date
yetone 1ccacad632 agent: Obsidian is listed only when a vault has Copilot (iEthan333 on X)
detect was "obsidian's config folder exists", so every Obsidian user got a
row whose provider field could only fail ("no Obsidian vault here has
Copilot"). It now needs a vault in obsidian.json with Copilot installed
(.obsidian/plugins/copilot/manifest.json) or magpie's provider already in
its data.json, so a wired vault can still be disconnected. Every OS's config
folder (mac, Windows, Linux, Flatpak, Snap) is already read by obsidianDirs.

Siblings checked: Zoo Code and Copilot (JetBrains) already require the
plugin installed; VS Code forks and Raycast are the apps that hold the
setting themselves. None changed.

Run: go test ./internal/agent -run Obsidian (wsl-run); the new no-Copilot
vault assertion is red on the old detect (checked by hand). Full agent
package, gofmt, linux and windows vet: see push notes. Not tried: a real
Obsidian install.
2026-11-11 14:34:37 +08:00
yetone e1a2226405 library: EverMe Memory and Nowledge Mem are offered in the market as memory sources, added in one step (OipsAnthony on X)
Both publish an MCP server: EverMe's @everme/memory-mcp (stdio, agent id and evt_ token, managed backend preset) and Nowledge Mem's Streamable HTTP endpoint at 127.0.0.1:14242/mcp (optional Bearer key for a Mem reached over Access Anywhere). Added beside Magpie Memory; their memories stay in their service, and magpie's digest and Memory tab don't read them (docs/subsystems/memory.md).

Run (wsl-run, magpie-wt/memprov at origin/main 032340056): go test -count=1 ./internal/library ok, GOOS=windows go vet ./internal/library, go vet -tags nogui ./internal/library, gofmt -l clean. TestThirdPartyMemoryServers is red without the two entries (the market has no such server). Not tried: a real EverMe token or a running Nowledge Mem; GUI market tests (the page lists servers from the API, no GUI file changed); mote was out of disk, so nothing ran there; full suite not run.
2026-11-11 14:34:30 +08:00
yetone d62220d43e gui: a proxy's web page regexps compile when first used (TestNoEagerPackageRegexps)
059d995d5 added webPageStart and webPageTitle as package-level
regexp.MustCompile, which TestNoEagerPackageRegexps refuses: every
package regexp goes through lazyre so start-up doesn't compile them.
CI at 61a04f42a was red on ubuntu and macOS for it.

Run (Windows box, win-run; mote is out of disk and refuses ssh):
- go test -run TestNoEagerPackageRegexps . : ok (red on CI before)
- go test -run 'TestFailSaysAProxyPage|WebPage' -v ./internal/gui:
  TestFailSaysAProxyPageByItsTitle, TestWebPageHandlerEveryWhere pass
- go vet ./internal/gui, gofmt -l: clean
2026-11-11 14:33:37 +08:00
yetone f5e1b10913 settings: longest context can hold a model's own window too (WJaunita45604 on X)
v0.1.3681's Longest context left a window the user set for a model, or "*"
on its provider, alone even when longer. Settings > Models > Routing now has
a menu beside the field: "Models without their own" (the default, as before)
or "Every model". In both modes the shorter of the cap and the user's own
window is told; they differ only when the user's own is longer (own keeps it,
every model brings it down). Settings.ContextCapAll, Settings.CappedOwn,
POST /api/settings/context-cap-mode {all}, magpie model context-cap all|own.
Applied in provider.windowIn (so /v1/models, catalogs, compaction), Codex's
CodexNativeWindow/CodexWindow (the list's ETag tag carries the mode) and the
gateway fallback window. i18n in zh, zh-TW, ja, de.

Run (wsl-run, mote's disk was full): provider (full), settings, settingsapi,
codexcat packages; cli -run ContextCap; gateway -run ContextCap|ModelsList;
GUI context-cap, i18n-keys, model-load, settings-places, settings-general in
chromium and webkit; TestCoreScriptBudget; gofmt; go vet nogui and
GOOS=windows vet. Broken by hand: windowIn's CappedOwn removed turns
TestContextCapAllHoldsTheUsersOwnWindowsToo red.
Not tried: the whole Go and GUI suites, a real Codex reading the list, macOS
or Windows runs, GUI in zh-TW/ja/de beyond the i18n-keys check.
2026-11-11 14:28:17 +08:00
yetone 032340056e gateway: a context kept after its handler returns no longer reaches the request's body (#5250)
TestSocketTurnBodiesFreed went red on ubuntu CI at a3d2a85dd ("turn
bodies [8] of 12 still kept"), after a268aadc4 had let the unrouted
watch's own timers go. Two more paths kept a turn's request, and with
it the whole conversation it was sent with:

- A context timer. Any WithTimeout under the request's context, stopped
  as its call ended, is kept with its context in the timer heap of the
  P that set it until that P tidies its heap, and an idle P never does.
  Through the context's values it reached the watch twice: the
  unroutedKey value held the watch itself, and inflightOf's value held
  the inflight, whose f.unrouted is the watch. The watch holds the
  request (u.r), and the request's Body and GetBody the bytes.
  The unroutedKey value is now the watch's held pointer, as its timers
  already were (unroutedOf), let go as the handler returns; done clears
  f.unrouted too. Its readers (noteRoute, showRedacting, notDescribed)
  run inside the handler, before done.
- An asynchronous release. holdBody and the body room let go of a body
  in a context.AfterFunc, which runs in a goroutine of its own once the
  turn's context ends, so under load the test's one collection could
  come first. The test now collects until every body is gone, within
  10s: far under unroutedShow (15s) and unroutedMost (2m), the times a
  real holder kept one for.

Run (the Linux box, wsl-run, since mote is out of disk):
- origin/main 4ddc150c6, TestSocketTurnBodiesFreed -race -cpu 1,2:
  1 red in 80. With a probe, the red was a body still held after 10s,
  and in 9 of 300 runs bodies were freed only 30-120ms after the first
  collection (the async release).
- With the context-value half only: 3 red in 200, each held over 10s.
  With holdBody's sharing turned off: still 1 red in 200, so it isn't
  a decoded string sharing the body. A goroutine dump at the red had 7
  goroutines, none of the gateway's: a heap reference, not a runner.
- With both halves and the new test: 300 of 300 green (-race,
  -count=150, -cpu 1,2).
- TestUnroutedContextLetsGoOfRequest, new, holds the request's context
  past its handler: red 5 of 5 on the old code, red 5 of 5 with only
  the context-value half, red 3 of 3 with only the f.unrouted half,
  green with both. TestUnroutedTimersLetGoOfRequest still passes.
- go vet ./internal/gateway on Linux: ok. gofmt -l: clean.
- The whole internal/gateway package runs next on the Linux box; its
  result goes on #5250.

Not tried: macOS and Windows runs (mote is out of disk and refuses
ssh); other context values that might hold a request are not audited.
2026-11-11 14:24:25 +08:00
yetone 69453574d7 docs: a key's usage cap (@wanggenjidev on X)
gateway-routing.md and providers-accounts.md: a key whose usage windows magpie reads takes the same usage cap an account does.

Record for the three commits (@wanggenjidev on X: Codex-style percent cap for OpenCode Go keys, generically for every key with windows magpie reads):
- Run at the pushed head (rebased on 08a852a36): TestKeyTakesUsageCap and TestKeyUsageCapPassesTheKeyOver ok; gofmt clean; key-usage-cap, key-spend-cap, account-cap, window-cap, i18n-keys: 180 pass, 0 fail on WSL, chromium and webkit. window-cap in webkit alone: 60/0 on this head and on origin/main a3d2a85dd.
- Earlier on mote at the previous base: provider/gateway/cli targeted tests ok; ./internal/gui ok 188s with -timeout 45m; vet darwin, linux nogui, windows clean.
- Broken by hand: the gateway hold removed, TestKeyUsageCapPassesTheKeyOver goes red.
- mote's disk filled during checking (52 webkit window-cap fails there, 60/0 on WSL on both main and this head); not a window-cap bug found on this change.
- Not tried: a real OpenCode Go key with live windows, Windows/Linux GUI runs, WebKitGTK. The whole GUI suite and the Go suite run after the tag.
2026-11-11 14:21:06 +08:00
yetone a46c90e7c3 providers: a key's usage cap is set from its row, as an account's is (@wanggenjidev on X)
GUI half of the previous commit; same pill and words as the account cap. key-usage-cap.test.cjs passes in chromium and webkit, en zh zh-TW ja de, 900 and 400px.
2026-11-11 14:18:11 +08:00
yetone 4a7d222dc8 providers: an OpenCode Go key takes the usage cap an account does (@wanggenjidev on X)
Backend only; GUI follows. Tests: provider TestKeyTakesUsageCap, gateway TestKeyUsageCapPassesTheKeyOver (red with the hold removed by hand).
2026-11-11 14:18:10 +08:00
yetone 08a852a369 provider: a model off for an agent stays off while the vendor's list lacks it; zcode min 0.1.59 (WJaunita45604 on X)
ZCode's GLM-5.3-Flash-Trial is listed only from about 23:00. SetHiddenModels
rebuilt the agent's off list from the models listed right now, so an off
choice for an absent model was dropped on the next Save, and the model came
back on at 23:00. It now keeps hidden ids that ListedFor no longer lists.
(Provider picks and per-agent PickedModels already survive a relist; a
3-day flip test with an editor Save in between guards that.)

The display half is in the plugin, zcode 0.1.59 (npm checked): a reply the
gift answered names the -Trial entry, so Usage, sessions and the request log
show the model served. The mover min is raised to 0.1.59.

Run: go test ./internal/provider (wsl, ok); gateway zcode/trial tests ok;
gofmt clean; go vet linux, windows, darwin ok. Plugin: bun test in
packages/zcode 243 pass.
Broken by hand: SetHiddenModels reverted -> TestHiddenModelAbsentStaysHidden
red ("an unlisted model's off choice lost"); plugin trialNamed removed -> the
2 new gift tests red.
Not tried: a real Start Plan reply or live account; mote was out of disk, so
tests ran on wsl. GUI not touched.
2026-11-11 14:13:01 +08:00
yetone 198ac57401 site: a Raycast docs page in en, zh and ja
/docs/raycast says how magpie puts its models in Raycast AI (Raycast
Pro, Mac and Windows): the entry, id magpie, magpie adds to the
providers list of ~/.config/raycast/ai/providers.yaml with the gateway's
OpenAI-compatible address, a key of Raycast's own and magpie's models;
Raycast picking the file up with no restart; the picker listing the
models picked for Raycast on the Agents page; each model's abilities
spelled out (tools on, vision, reasoning effort, temperature off where
refused); Windows' Reveal Providers Config folder; the user's other
providers, tools block, comments and own keys kept; and switching back
removing the entry, the list and an empty file. Each claim is from
internal/agent/raycast.go and the CLI's first-field handling in
internal/cli/main.go. Linked from each language's Crush page; in the
sitemap, llms.txt and llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test worker.test.mjs install.test.mjs on the WSL box
(magpie-desktop, wsl-run; mote has refused SSH this session): 71 pass,
0 fail.
Not tried: Raycast itself on magpie for this page; it names only what
magpie's source says.
2026-11-11 14:11:52 +08:00
yetone d936be7639 usage: Claude's card shows the extra-usage cap and its spend (Shinji_Zl on X)
Claude Code's `claude -p /usage` text omits extra usage, but with
`--output-format json --verbose` a message carries
usage_report.rate_limits.extra_usage (cap and spend in cents). The gateway
adds it as a line; parseClaudeUsage reads it as an Aside "Usage credits"
window (n / cap USD), so a spent cap never marks the account used up.
magpie asks Anthropic nothing itself, and cannot make a request spend
credits: Anthropic decides. The prepaid balance is a separate endpoint and
is not shown.

Run (wsl-run, linux): TestClaudeUsage*/TestClaudeOverage in provider and
gateway, go vet linux/windows/darwin, i18n-keys, i18n-en-no-cjk and
claude-overages GUI files (chromium + webkit).
Broken by hand: Aside false -> TestClaudeUsageCredits red.
Not tried: a real account with extra usage on (the owner's is off); full
suite after the tag; Windows run.
2026-11-11 14:08:18 +08:00
yetone 0052c860e0 library: billion-context installed with bun is found on Windows (Zerenjie on X)
biliPath looked for bili.cmd on PATH and in %APPDATA%\npm only. bun add -g
puts bili.exe (with a bili.bunx) in the bin of BUN_INSTALL or ~\.bun\bin,
so a bun install was never found. It now asks proc.FindTool, which tries
.exe and .cmd in every folder a user's tools are installed in. proc's
UserBinDirs also takes BUN_INSTALL's bin (Windows and elsewhere), and
Kiro Crew's adapter search gets ~/.bun/bin, BUN_INSTALL's bin and, on
Windows, %APPDATA%\npm, its siblings that had the same hole.

Run: on xiaomi-gpu (Windows 11) really `bun add -g billion-context` into a
sandbox BUN_INSTALL with PATH holding no bun bin. Before the fix biliPath
was "" ; after, it was bili.exe and `bili --version` answered 0.1.213. go
vet and go test -run Bili|KiroCrew|ToolIn|UserPath for library, agent and
proc passed on Windows and in WSL (magpie-desktop). The three new tests
fail on the old code in WSL (broken by hand with the sources stashed).
Not run: the full suite, a darwin vet and a mote run (mote's disk was
full, 226Mi free), the GUI suites (no GUI file touched).
2026-11-11 14:04:37 +08:00
yetone 465e9f721f gui: library-bili waits for the sidebar's sections before it picks a tab by place
The sidebar list is drawn once in the strip's order and again in sections
once navicons.js is loaded; Pi packages then sits before RTK, so a click by
an index read before the redraw landed on another tab.

Run: library-bili and library-groups on Windows (xiaomi-gpu), Chromium and
WebKit: 100 of 100. Red before this wait in WebKit on mote, 2 of 4 cases.
2026-11-11 13:53:34 +08:00
yetone 29d37b4a6c gui: Library's sidebar list is in sections: every agent, one agent, magpie (@ConatusMoon2222 on X)
The list under Library in the sidebar was one flat column mixing what every
agent shares, what one agent has and magpie's own add-ons. It now has three
quiet section names, as a Mac source list's: "Every agent" (Instructions,
Memory, MCP servers, Skills, Hooks, Subagents), "One agent" (Claude plugins,
Pi packages) and "magpie" (RTK, billion-context). Same pages, same strip,
same routes; the page's own strip is unchanged. A section with no tab showing
has no name, and a list of one section (agentless) has none at all. The names
are said in zh, zh-TW, ja and de ("One agent" is new; "Every agent" was
already there); no colour, no gradient, no border.

The grouping and the sort live in navicons.js (loaded with the first list,
which then draws again), so the core script budget holds; a few navSubs
comments were cut for the bytes.

Run:
- library-groups.test.cjs (new): the three names and the rows' order in en
  zh zh-TW ja de, no names in the strip, a name is no tab, quiet style, a tab
  still opens, hidden-only section loses its name, one section none, 420px and
  dark: Chromium and WebKit, 16 of 16 on mote before the rebase, 100 of 100
  with library-bili on Windows (xiaomi-gpu) after it, and with sidebar.test.cjs
  on WSL.
- Broken by hand: names always shown made the hidden-section case red in both
  engines.
- go test -run Budget ./internal/gui: ok before the rebase.
- Screenshots zh light/dark at 900 and 420, before and after, in
  magpie-wt/library-groups-scratch/shots.
- Wider sidebar and library set on mote: 302 of 304; the 2 reds were
  library-bili in WebKit, a click by an index read before the redraw
  (fixed in the next commit). mote could not launch browsers afterwards.

Not tried: the whole GUI suite (mote refused connections and then browser
launches for hours; run after the tag), the real Linux WebKitGTK app.
2026-11-11 13:53:34 +08:00
yetone ce0cbff616 netproxy: an IPv6-only host is not stuck on IPv4 after one IPv6 failure (ZeHeaton23141 on X)
A remote magpie on an IPv6-only address worked, then stopped until magpie
restarted. v4Fallback marks a host:port whose IPv6 connection ended before a
byte came back and dials it over tcp4 for 30 minutes; for a host with no IPv4
that dial can only fail, so every request failed for the whole window. Now a
failed tcp4 dial clears the mark and goes on over tcp at once, and an IPv6
literal address is never marked.

Run (wsl-run, magpie-desktop; mote's disk was full): go test ./internal/netproxy,
go vet for linux, windows and darwin, gofmt. TestIPv6OnlyHostRecovers (an A
record that fails, an AAAA that serves on [::1], a prior mark) fails on the old
code and with clearV4 commented out (mark kept). Not tried: a real IPv6-only
remote magpie, the full suite, GUI tests (no GUI change). No per-remote
"IPv6 only" setting: the cause is fixed instead.
2026-11-11 13:50:15 +08:00
yetone d8b6a2f555 site: a Crush docs page in en, zh and ja
/docs/crush says how magpie runs Charm's Crush on magpie's models:
providers.magpie in crush.json (~/.config/crush, XDG_CONFIG_HOME,
%LOCALAPPDATA%\crush on Windows) with the gateway's address, a key of
Crush's own and magpie's models; the large and small slots and the
large model's reasoning_effort (low, medium, high); the picks written to
Crush's data file (~/.local/share/crush, XDG_DATA_HOME), which wins over
the config, and the previous model's picker settings dropped from a
pick; the user's own keys in the provider kept; WSL; and the provider
removed once neither slot uses magpie. Each claim is from Crush's Agent
in internal/agent/agents.go. Linked from each language's Zed page; in
the sitemap, llms.txt and llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test worker.test.mjs install.test.mjs on the WSL box
(magpie-desktop, wsl-run; mote has refused SSH this session): 71 pass,
0 fail.
Not tried: Crush itself on magpie for this page; it names only what
magpie's source says.
2026-11-11 13:37:14 +08:00
yetone 61a04f42a2 library: a project's Skills menu groups the skills by source, a heading ticks the whole group (Elorynth on X)
The project card's Skills menu listed every library skill flat. It now
lists them as the Library does (skillGroups(true): by repository or the
user's own group, this computer's last, whatever sort the list has), with
a heading over each group. Pressing a heading ticks all of the group's
skills, or unticks them when all are in; it is half-ticked while some are.
A typed filter keeps a group's heading over the skills it finds, and
matches a skill by its group's name. One group only stays the flat list.
openProtoMenu takes a `group` option (the values it ticks) for this.
Paid for in app.js by five comments cut, no budget raise.

Run on the Windows box (mote's Chromium launch hung, SSH refused at
times): project-skills-groups.test.cjs, new, in chromium and webkit,
en/zh/zh-TW/ja/de at 400px wide: red on the old code (6 of 6), green
after. With project-*, i18n-*, menu-*, proto-menu-overflow and
skill-group* GUI files in both engines: all green except
menu-input-scroll and menu-scroll (14 chromium, 13 webkit), which are
red the same at origin/main aa2ea5c90 on the Windows box (commented on
#3402). TestCoreScriptBudget ok at the rebased head.
Not tried: the full suite, the real Linux app (WebKitGTK). Part 2 of the
report (instruction presets bundled into a toolkit) is not built: a
project has no instructions of its own yet.
2026-11-11 13:31:23 +08:00
yetone aa2ea5c906 agent: Claude's main model is written as a tier alias, so Claude Desktop on a subscription no longer sends magpie's prefixed id (iryan_sun on X)
Claude Desktop's Code tab sets CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST=1. Claude
Code then ignores the env block of settings.json (base URL, token, tier model
vars) but still honours the top-level `model`. magpie wrote `model` as the
provider-prefixed id (anth/claude-opus-4-7), so the official API rejected it
and WebFetch failed.

writeTiers now writes `model` as the tier alias (opus/sonnet/haiku/fable, with
[1m]) whose ANTHROPIC_DEFAULT_<TIER>_MODEL already maps to the main model, on
this machine's ~/.claude only. A distro file, the claude-magpie launch file and
a main with no tier keep the id. The model field reads the alias back through
the tier env, also while the gateway is unreachable (drift). Unwire drops
`model` when magpie wrote the alias.

What happens to old values: a settings.json an older magpie wrote with the
prefixed id (model "up/big-x") is rewritten to the alias at the next catalog
sync, for every user, with no step on their side; the tier env already maps it
to the same model. A prefixed id picked from the modelPicker rows is brought to
the alias the same way. A model the user set themselves (claude-haiku-9,
own/xyz, opusplan) is never rewritten.

Ran:
- Real Claude Code CLI (~/.local/bin/claude) in a sandbox HOME and
  CLAUDE_CONFIG_DIR, wired by a magpie built from this tree (gateway :38760)
  to a scripted upstream that logs each request's model: main -> big-x,
  `--model haiku` -> fast-x, a subagent (Agent tool) -> sub-x, WebFetch's
  extraction of https://example.com -> fast-x (haiku's). Old prefixed file
  migrated to "sonnet" by a catalog sync; the three user models above stayed.
- TestClaudeMainModelIsAnAlias: red on the old code, red again with mainWord
  broken by hand, green with the fix; it also covers the user's own models.
- 11 existing tests read the raw `model` as an id; they read it through
  writtenModel now. TestWSLClaudePick compares the distro's file with the
  native one after normalising `model` (the distro keeps the id by design).
- go test ./internal/agent ok at the pushed head; gofmt; go vet darwin, linux
  nogui, windows for internal/agent.
- internal/cli: TestGatewayKeyLimitCLI is red on origin/main b39a793c9 too,
  untouched here: #6082.
Not tried: the real Claude Desktop UI (only Claude Code with the
host-managed flag, 2.1.312/.314/.316); a user whose Claude runs in a WSL
distro is not covered; the full suite is run after the tag.
2026-11-11 13:28:02 +08:00
yetone b39a793c98 codex: the Codex app, left showing fewer projects after a switch while it ran, says to quit and reopen it (linsm66 on X)
"为什么codex在触发自动更换账号后侧边栏已有的项目文件夹会消失呢".

v0.1.3600 (10bef5fe0) shares every account's projects while the Codex app
is closed. A switch while the app runs can't be helped by a file: the
app (ChatGPT.app 26.1103, early-bootstrap-133 selectRendererOwner, run on
every principal change) parks the old identity's projects and loads the
new one's from memory, and writes its memory over the file. An app open
since before the sharing, or a project added since it was last closed,
shows the new account's empty list. magpie does not quit the app unasked
(15acba534, 248268ce4); the owner chose a hint instead.

codexProjectsLook, from codexProjectsStep's loop while the app is open,
reads the state file: the owner's local projects' folders against those
parked under the other identities. When the owner changed since the last
look and the owner lacks a folder, /api/providers says codexProjects, and
Codex's accounts show "The Codex app shows fewer projects than you have:
quit and open it again" (Got it hushes it; dismiss-projects). A project
removed on the account the user is on is no switch and says nothing. A
closed app clears it: the share runs and the app loads every list as it
opens. The notice is in codexprojects.js, loaded when the state says so,
so the core's budget is unchanged. i18n in zh, zh-TW, ja, de.

Run (mote refused ssh all session; so wsl-run on the Linux box):
- go test -tags nogui -run 'TestCodexApp|TestCodexProjects' ./internal/provider: ok.
  TestCodexAppProjectsShortAfterALiveSwitch drives the repo's app
  simulator through a live switch to an unshared account and, after
  shareCodexProjects, to a shared one. Broken by hand (every look counts as
  a switch) TestCodexAppProjectsRemovedByHandIsNoHint went red.
- node --test codex-app-projects-short.test.cjs (new), codex-app-stale,
  i18n-keys, i18n-en-no-cjk: all pass, chromium and webkit, 5 languages,
  900 and 480px (70 tests for the first two).
- TestCoreScriptBudget ok; gofmt clean; go vet -tags nogui and GOOS=windows
  of internal/provider and internal/gui ok.
- old-webkit.test.cjs: "compat.js is the first of the page's own scripts"
  and "the styles hold up in Safari 15.0" are red on origin/main
  4ddc150c6 too, same names. GOOS=darwin vet of internal/gui fails at
  traywindows_darwin_test.go:30 (trayImagePNG) on origin/main too, from
  WSL without cgo.

Not tried: the real Codex app switching live (the simulator follows the
bundle's selectRendererOwner, not a launched app); the whole GUI suite
before the push (started after the tag); mote.
2026-11-11 13:26:49 +08:00
yetone 4ddc150c66 gui: a hover hint beside the account switch says how it works and why it is the agent's own use
The owner (11-11): "在这个切换开关旁边有一个 hover 的提示,提示这个原理是啥,
以及它为什么不会让你的账号被封禁". Beside Switch {agent}'s account
automatically, an ⓘ mark; resting on the row (or a key reaching the
switch) shows settingshints.js's card with three lines:

- how: the next account's sign-in is written where the agent keeps its
  own, as /login or codex login does; what is left is read by Claude
  Code's own /usage, or where Codex's /status reads it; sessions already
  open keep their account until restarted;
- why it is the agent's own use: Claude Code still sends every request
  itself, straight to Anthropic, unchanged, and magpie sends none (an
  account's own proxy kept); for Codex, only which of your own accounts
  it is signed in to changes;
- the limit: the same as switching by hand; use only your own accounts,
  sharing one is against the vendor's terms. It promises nothing about
  bans: that is the vendor's call.

Only where the switch moves the sign-in. Under the gateway it moves
Claude Code's requests instead, and the "straight to Anthropic" line
would be false, so SignInMovesOf now says `routed` on a kept Claude
whose requests go through the gateway, and the hint shows for `moves`
and for `kept` without it.

The lines and mark are in autoswitchtip.js, imported when the switch is
drawn; app.js gets the one import line, paid for by cutting this branch's
own two comments: the core is 1,533,771, under 1,533,802, no raise.
Strings in zh, zh-TW, ja and de.

Run (xiaomi-gpu, Windows 11, win-run; mote refuses ssh):
- node --test sign-in-moves, keep-login, pool-ends, old-webkit, i18n-keys,
  i18n-en-no-cjk, settings-hints, editor-hints: 148/152. The 4 reds are
  the same at the base 156861b3a: old-webkit's headerpresets.js (#6030)
  and Safari 15.0 :has() (#5919), and settings-hints webkit de at 420px,
  filed as #6073.
- the new test (Chromium and WebKit, en and zh): the mark sits beside
  the switch on its line, the lines rest out of sight, hovering shows the
  card with the three lines beside the row, a press on the mark posts
  nothing; no mark for kept+routed or gateway.
- Broken by hand, each red: the mark's preventDefault removed (a press
  turned the switch off); the routed check dropped (kept+routed showed
  it); Routed not set in SignInMovesOf (TestSignInMovesSaysWhatSwitchDoes).
- go test -run "SignInMoves|ClaudeRoutedSignIn|KeepLogin|SwitchOnly"
  ./internal/provider ok; go vet ./internal/provider ok;
  TestCoreScriptBudget ok; gofmt -l clean.
- A Chromium screenshot of the card in zh looked at.

Not tried: the Codex variant's card in a browser (its strings pass
i18n-keys); the real app; macOS and Linux.
2026-11-11 13:05:16 +08:00
yetone e31625f641 gui: one helper builds a lib-switch button, one a button that opens a menu
origin/main's core scripts were 1,533,806 bytes, 4 over their budget
(TestCoreScriptBudget red), and the accounts list's automatic-switching
switch (the previous two commits) added 2,248 more. Ten places built the
same lib-switch button by hand (type, role, aria-checked, aria-label,
the knob); libSwitch(cls, on, label) builds it. Five set aria-haspopup
and aria-expanded=false in a row; menuOf(b) does. The switch's own
comments are cut to a line each, and the routing note's gateway sentence
comes from signInMovesLine instead of a second copy. The core is
1,533,756 after, under its budget with no raise; the budget's history
says so.

What each switch does is unchanged: same classes, role, aria-checked and
label. Two differences: providerSwitch's button now has type="button"
like the rest, and Only models I pick's aria-checked is "false" rather
than "undefined" when the setting is unset.

Run (Windows box, win-run): node --check app.js; TestCoreScriptBudget
ok. The whole GUI suite: see the push record.
2026-11-11 13:05:16 +08:00
yetone fc24a89183 gui: switching the agent's account is a switch of its own
The owner (11-11): "这个轮换做成一个开关". The used-up switch was off
behind a "Keep Claude Code signed in to" tick box, and the tick box read
as something else. Under the accounts of a Claude Code or Codex with
more than one account there is now a "Switch Claude Code's account
automatically" switch:

- on: the line from the previous commit sits under it, saying when the
  sign-in moves and whether it comes back;
- off: "Keep Claude Code signed in to [account]", the picker that was
  the tick box's (first account, or the one picked);
- switch-only: held on and disabled, with a title saying why, since
  switch-only always moves the sign-in.

The switch posts provider/keeplogin as the tick box did (keepLogin is
the switch off), so nothing on the server changes and a user's saved
keepLogin reads as the switch off. The name is a label for the switch:
clicking it flips it too. `.editor label`'s text-align: right is undone
for it, so its words start at the left. The two "Automatic switching is
off" strings give way to the switch's name and title in zh, zh-TW, ja
and de. docs/subsystems/providers-accounts.md says it under "Used-up
switch".

Run (Windows box, win-run; mote refused ssh and WSL's GUI runs failed
with E_UNEXPECTED):
- sign-in-moves, keep-login, pool-ends, i18n-keys, i18n-en-no-cjk,
  routing-signin, account-return in chromium and webkit, en and zh:
  100 pass
- after the alignment fix: sign-in-moves, keep-login, pool-ends: 72 pass
- TestCoreScriptBudget (wsl-run): PASS
- screenshots, chromium en and zh, on and off: name at the left, switch
  at the right, line or picker under it
- after rebasing on origin/main: see the push

Broken by hand:
- posting !on from the switch: sign-in-moves red 4 of 16;
- dropping the text-align fix: the "words start at the left" check red
  (160 to 224px in), where the old box check had passed.

Not run: the whole GUI suite with the switch (mote and WSL down). At the
previous commit it was cut short on mote with load timeouts; the account
reds there (account-arrange, agent-switch-accounts, claude-switch-only's
"page doesn't move") also fail on origin/main d1b4eff5a and are #6010,
#5925 and #4344. Not tried in the real app with the owner's accounts;
their keepLogin (the switch off) is left as it is.
2026-11-11 13:05:16 +08:00
yetone 8a3dbf0232 gui: the accounts list says what magpie does with the agent's sign-in
A user with two Claude accounts read the used-up switch as gone. Their
"Keep Claude Code signed in to" box was ticked, which turns the switch
off, and nothing on the page said so. Under the accounts of a Claude Code
or Codex with more than one account, a line now says what the switch
does, as NextLogin decides it:

- kept: switching is off, the agent stays on the first account (or the
  one picked) even once it runs out;
- gateway: Claude Code's requests go through magpie, which picks an
  account per request; its own sign-in stays put;
- moves: the share it moves at (98%, or used up for In order / Until
  used up), and whether it comes back to the first (returnsToFirst).

provider.SignInMovesOf gives the mode from the same checks NextLogin
makes (leftAlone, keep, ClaudeThroughMagpie && !SwitchOnly, SpentShareOf,
returnsToFirst). /api/providers carries it as signInMoves on the agent's
own provider row. The Routing tab's sign-in note says the gateway case
too. Strings in zh, zh-TW, ja and de.

Run (mote, through mote-run):
- go test -run 'TestSignInMoves|TestClaudeRouted|TestKeepLogin|
  TestClaudeSwitched|TestNextLogin|TestCodexLogin' ./internal/provider: ok
- go test -timeout 45m ./internal/gui ./internal/provider: ok (script
  size budgets included)
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows on
  provider and gui: ok
- GUI: sign-in-moves, keep-login, i18n-keys, i18n-en-no-cjk,
  routing-signin, account-return in chromium and webkit: 60 pass
- whole GUI suite (make test-ui): see below
- screenshots in WebKit, en and zh: the line sits inside the list at the
  rows' inset; zh sentences join with no space

Broken by hand: dropping NextLogin's keep case from SignInMovesOf turns
TestSignInMovesSaysWhatSwitchDoes red; not appending the line turns
sign-in-moves.test.cjs red 4 of 4.

Not tried: the real app with the owner's accounts; the user's own
keepLogin is left as it is.
2026-11-11 13:05:16 +08:00
yetone ec7596581e site: a Zed docs page in en, zh and ja
/docs/zed says how magpie runs the Zed editor's agent panel on magpie's
models: language_models.openai_compatible.magpie in settings.json
(~/.config/zed on macOS and Linux, XDG_CONFIG_HOME, %APPDATA%\Zed on
Windows) with the gateway's address and magpie's models, and
agent.default_model set; the key saved in the system credential store
(Keychain, Secret Service, Credential Manager) and the restart when Zed
still asks for one; each model's window, reply limit and images;
reasoning_effort high or the model's strongest, a level the user set
kept; a proxy address of the user's kept; and switching back. Each
claim is from internal/agent/zed.go, its credential files and its
notice. Linked from each language's Droid page; in the sitemap,
llms.txt and llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test worker.test.mjs install.test.mjs on the WSL box
(magpie-desktop, wsl-run; mote has refused SSH this session): 71 pass,
0 fail.
Not tried: Zed itself on magpie for this page; it names only what
magpie's source says.
2026-11-11 13:04:01 +08:00
yetone 1315ac7d99 update: the first update finds a magpie without gateway.json, and a restart waits a bounded time (ljlwlcz on X)
Two edges of v0.1.3687's gateway.json:

1. The first update from a magpie older than the record found no gateway.json,
   asked 3425, said "isn't running" and left a service on MAGPIE_ADDR=0.0.0.0:10100
   on the old version. With no record, no MAGPIE_ADDR and no answer at the usual
   address, `magpie update` now tries the installed service's MAGPIE_ADDR (read
   from its unit or launch agent, daemon.Addr), the port in Settings and 3425,
   and takes the first that answers as magpie. --addr and MAGPIE_ADDR stay the
   user's word.
2. A restart asked by `magpie update` waited on "N requests" with no end (Windows
   hands nothing over, long streams never finish). The app and magpie serve now
   wait at most 10 minutes for that ask, then restart; the output says so
   ("or in 10 min at the latest, which cuts what is still running"). `magpie
   update --force` restarts at once (gateway.SetForceRestarter), and says if the
   running magpie is too old to know --force. The app's own look at the disk
   (followReplaced) and autonomous serve follow still never cut a request.

Run (mote refused SSH; win-run on xiaomi-gpu): go vet cli/gui/gateway/daemon
(windows), linux nogui vet; go test -run TestUpdate|TestServeFollow|
TestTerminalUpdate|TestRestart over cli, gui, gateway, daemon: ok except
TestUpdateThatWontStart, red on origin/main on the same box too (#6059).
Broken by hand: drain bound off, record fallback off, serve bound off: the new
tests TestTerminalUpdateWaitIsBoundedAndCanBeForced, TestUpdateFindsAMagpieThatWroteNoRecord,
TestServeFollowDrainIsBounded go red.
Not tried: a real systemd service upgrade; darwin cross vet (cgo) and the full
suite (started after the tag if mote is back).
2026-11-11 13:01:11 +08:00
yetone 059d995d56 gateway keys: the list reads the ledger once for all keys, and a proxy's web page is said by its title (aiandcloud on X)
aiandcloud (2.98B tokens, 12,654 requests a day, server mode behind a
proxy) saw Gateway keys draw a Cloudflare 524 page as raw HTML.

Slow list: every poll of /api/caller-keys read up to a month of ledger
rows once per window per key. budget.AllOf now reads each distinct window
once for all keys, and keeps the settled blocks' sums with a cursor
(usage.VisitFrom), so a poll only reads what was appended since; the
unfinished tail block is always read again. A rewritten or shorter log
resets the cursor. All(k) is AllOf of one key.
Numbers (BenchmarkAll vs BenchmarkReadEach, 8 keys x day/week/month,
31 days x 12000 rows/day = 372k rows, warm): 211-228 ms before, 23.5 ms
after.

Raw HTML: fail() now turns an error string holding a web page (a remote
magpie's or a vendor's 524/502 page inside the JSON error) into a short
said/what pair, "A proxy in front of magpie answered, not magpie ({what})"
with the page's title, translated in all 5 languages (key already in
i18n.js). The browser already handled non-JSON bodies (notJSON, #2032).

Run (Windows box, mote ssh was down earlier): go test budget, usage, gui
(AllOf, Budget, FailSays, I18n, Keys); gateway-keys-proxy-page and
gateway-key-limit GUI files in chromium and webkit, 5 languages: 24/24;
gofmt; vet windows, linux nogui, darwin (mote, only a clang deprecation
warning). Broken by hand: with the old fail() TestFailSaysAProxyPageByItsTitle
is red; with VisitFrom's reset() removed TestAllOfIsWhatEachWindowRead is red.
Not tried: a user-scale cold ledger, a server behind a real Cloudflare,
the full suite before the tag (started after).
2026-11-11 13:00:54 +08:00
yetone 1ae2241538 gateway keys: the model picker offers image and video models (aipha2025 on X)
/api/caller-keys/models listed provider.Catalog() only, which leaves out
image and video models (Codex's gpt-image, a catalog's drawers, ...). The
gateway already holds a key to them on /v1/images and /v1/videos
(keyHolds + modelAllowed in draw.go, video.go), so a key held to some models
could not be let draw. Each provider's Drawers and Videomakers now follow its
chat models in the picker.

Run: TestCallerKeyModelsOfferImageAndVideoModels red on old code (pix/gpt-image-2
offered 0 times), green now; gofmt; vet darwin/windows/linux-nogui on mote.
Not tried: GUI suites (no JS change); full ./internal/gui run timed out at
600s on loaded mote.
2026-11-11 12:58:36 +08:00
yetone a3d2a85dd3 site: a Droid docs page in en, zh and ja
/docs/droid says how magpie runs Factory's Droid CLI on magpie's
models: one customModels entry per catalog model in
~/.factory/settings.json (FACTORY_HOME_OVERRIDE), with the gateway's
address and a key of Droid's own, each on the API its provider speaks;
sessionDefaultSettings.model set; the models in droid's /model picker
under Custom models; a starting reasoningEffort so the picker offers
levels, and a built-in model's own levels through baseModelId; a model
droid would warn about written on the API it expects; the user's own
custom models kept in front, a field they changed in magpie's entries
kept, config.json left alone; WSL; restarting droid; and
`magpie droid default`. Each claim is from internal/agent/droid.go and
its notice. Linked from each language's Goose page; in the sitemap,
llms.txt and llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test worker.test.mjs install.test.mjs on the WSL box
(magpie-desktop, wsl-run; mote has refused SSH this session): 71 pass,
0 fail.
Not tried: droid itself on magpie for this page; it names only what
magpie's source says.
2026-11-11 12:31:06 +08:00
yetone b42383e6ca lessons: a new route or setting runs the packages whose guards list them
Three commits on 11-11 turned the route and settings guards red (fixed in
c1a072636 and the next commit), and three more left the core's scripts
over budget together (61a93b531).
2026-11-11 12:28:15 +08:00
yetone dd3c9042c5 tests: the saved proxies' routes and settings are named in the guards
58fb07095 (named proxies) added POST /api/proxies/save, /delete and /test
and settings.Proxies and ProxyNames with no line in either guard, so
TestEveryRouteHasACommandOrIsNamed and
TestSettingsSaveKeepsWhatItDoesNotSend went red again a minute after
c1a072636 mended them for context-cap.

The three routes are a setting saved by its own route (stage 2), beside
POST /api/proxy/check. The settings-keep test sets a saved proxy and its
name, and a Settings save keeps both (KeepOwn already carries them; no
code change).

Run on mote at origin/main 61a93b531 plus this: both guards red at
61a93b531, naming these five; ok with this, with TestCoreScriptBudget and
the gui, cli and settings packages' Proxy tests.
2026-11-11 12:28:15 +08:00
yetone 61a93b531f gui: the core's scripts back under their budget, by a comment cut
Main at 245f07b19 had the core's scripts at 1,533,806 bytes, 4 over
TestCoreScriptBudget's 1,533,802. Each of eb56de0b5, 914fcf59b and
4df5256db fit at its own base; together they don't. The comment eb56de0b5
put over its modelSamePick call, which names the file the line imports, is
cut. No raise.

Run on mote: go test -run TestCoreScriptBudget ./internal/gui red at
245f07b19 (1,533,806 > 1,533,802), ok with this.
2026-11-11 12:26:53 +08:00
yetone c1a0726369 tests: context-cap and the catalog's model list are named in the route and settings guards
747632890 added POST /api/settings/context-cap and settings.ContextCap,
and eb56de0b5 added GET /api/catalog/models, with no line in either guard,
so TestEveryRouteHasACommandOrIsNamed and
TestSettingsSaveKeepsWhatItDoesNotSend were red on CI from 8aae124b0 on
(run 42954436265, ubuntu and macOS).

context-cap has its command, magpie model context-cap; the catalog list
is the model editor's Same as picker, with no command yet (stage 2). The
settings-keep test now sets ContextCap, which has its own route, and checks
a Settings save keeps it (it does: the test passes with no code change).

Run on mote at origin/main 245f07b19 plus this: go test -count=1
./internal/cli ok (42s). ./internal/gui: both guards ok; the package's red
tests there were TestCoreScriptBudget (next commit) and eight AppKit window
tests that wait 30s for a window over ssh (TestPanelCloseHidesIt,
TestMainWindowCorners and the like), which this change doesn't reach.
Red before: both guards on CI at 8aae124b0, naming these three.
2026-11-11 12:26:53 +08:00
yetone 58fb070953 settings: named proxies, chosen as inherit, direct or a saved one anywhere a proxy is (@tsingchao on X)
Settings > Network keeps named proxies (name, address, optional login)
with a Test that says reachable and the latency. Everywhere a proxy can be
chosen (global, plugin downloads, a provider, a key, a Claude account) now
has a Saved mode beside the others; the value is "@<id>". Addresses typed
before are read exactly as before, nothing is migrated or overridden.
netproxy.Parse/Resolve/Redact/EnvWith/Dispatch resolve a reference at the
lowest layer, so a proxy edited once reaches the gateway, usage reads,
sign-ins and the plugin host at the next request; Claude Code's
settings.json env (a snapshot) is rewritten by provider.ProxyEdited.
A reference this computer lacks fails closed (DeadProxy), says the proxy's
name in the request error and as "Proxy missing: {name}" on the provider
row, and never goes direct. The password lives in settings.json (0600), is
never read back by the page, logged, or put in Settings sync. The list
rides with the providers part of a sync (Bundle.Proxies, MergeProxies by
id, passwords only with keys). A proxy in use can't be deleted (409).
The saved list's page code is in proxies.js, loaded when Settings draws it;
app.js grew by Saved-mode helpers only, paid for by 16 long comments cut
(core budget unchanged, no raise).

Run (mote refused ssh all session, so Go and GUI went through win-run on
xiaomi-gpu, Windows 11; gofmt and darwin/linux-nogui/windows go vet were
clean on mote before it went down, at the pre-sync tree):
- go test settings, netproxy, backup, settingsapi, davsync: ok on Windows
  (earlier on mote: also gui, provider, plugin with real Bun, gateway).
- saved-proxies.test.cjs 20 of 20 (chromium+webkit, en zh zh-TW ja de,
  420px) twice more on Windows; provider-proxy-missing.test.cjs 20 of 20.
  One webkit de 420px run of saved-proxies failed once under 4-way
  concurrency and passed 3 of 3 alone; not reproduced.
- TestCoreScriptBudget ok after the move (it was 3.4KB over before).
Red on this tree and on origin/main alike (Windows run, not mine):
settings TestSharedCheckedReadsOnceAndKnowsUnknown; provider
Codex keychain/Git tests; plugin TestHostRunsAsMagpieBun, TestPiPackage;
gui TestGatewayHeldByAContainer and others; old-webkit "compat.js is the
first" (headerpresets.js) and ":has() (Safari 15.4)" on origin/main 245f07b19.
Broken by hand: restore skipping Proxies (TestSavedProxiesTravelWithProviders
red), Parse returning nil for a dangling ref (netproxy tests red), the
Proxy-missing badge disabled (provider-proxy-missing 0 of 20), and the Claude
env snapshot failing open (found by reading, test added).
Not tried: real vendors, the real Claude Code, a real two-computer sync, the
macOS suite and the whole GUI suite on this final tree (mote down; the whole
suite ran to test ~3700 on the earlier tree with reds owned by others).
A proxy missing whose sender never had it is named by its id.
2026-11-11 12:26:43 +08:00
yetone d7978141bb sessions: WSL sessions go when the last agent in a distro is uninstalled (_SekiBetu_ on X)
wslList kept every distro's listing, cold, whenever WSLHomes named no
distro. That is also what it names once the last agent in WSL is taken away,
so the sessions of a removed agent stayed listed for good, unopenable and
undeletable. internal/agent now says whether wsl.exe answered the list of
distros (sessions.WSLListed); an answer with no distro an agent is in drops
the listings, no answer keeps them as before.

Run (win-run, xiaomi-gpu; mote refused SSH all session): the new
TestWSLAgentsGoneListingDrops and TestGoneAgentLeavesNoSession (native
Claude and Codex folders deleted: nothing listed, no parse kept; green on
the old code, so macOS/Linux/Windows native lists were already right),
go test ./internal/sessions ./internal/agent, go vet on both.
Broken by hand: with the WSLListed check turned off the new test is red
(7 sessions listed after the agents were taken away).
Not tried: a real WSL distro with a real uninstall; GUI; full suite.
2026-11-11 12:22:45 +08:00
yetone 245f07b19e agent: the pages that poll name rows from a list built once a while
The Sessions page polls its list and its stats every 15s, the Usage
page its clients, and each asked agent.Clients() only for each agent's
id, name and icon. Clients() builds every agent (30+ constructors):
2.5 ms, 378 KB and 3411 allocations a call on the Windows box with
discovery's real 2s look window, mostly os.Stat, filepath.Join and
Getenv. On the real-account run (t69, 4 min) agent.All under the
sessions handler was 22 MB of 210 MB allocated.

agent.Looks keeps that id/name/shared-name/icon list for 30s, built
again at once when the plugins' agents change (agentplug's set) or the
Agents page's refresh (Rescan). A new omp or QwenPaw profile shows by
its id for up to 30s. Nothing is kept in a test binary unless a test
says, so tests that add an agent read it at once. The GUI's sessions
list, stats, one session, markdown export, trash, manage and reads
views, and usageapi.Clients, read Looks.

Tests: TestLooksBuiltOnceAWhile — six asks build once, the list equals
Clients(), a plugin agent switched on and off shows at once, Rescan
builds again. Broken by hand (memo check made false): "six asks built
the agents 6 times; want once".

Run on the Windows box: go test ./internal/agent ./internal/gui
./internal/usageapi at the pre-rebase base 0cc91af3d: usageapi ok, agent
and gui with 38 reds. Those tests, run at 8aae124b0 with and without this
change: the same 37 fail on both (#6068). TestLooks/TestPlugged/TestRescan
ok and go vet ok at 8aae124b0. mote (macOS) refused ssh all session, so no
macOS run and no real-account measurement yet.

Rebased on 156861b3a after the runs; its new commits touch library,
plugin and site only.
2026-11-11 12:02:52 +08:00
yetone 5399c33728 healthcheck, update and status find the running gateway by its own record (ljlwlcz on X)
The gateway now writes gateway.json (addr, pid, role, version) in magpie's
config folder while it serves; healthcheck, update, status and the other
CLI clients read it when MAGPIE_ADDR is unset, trusting it only if the pid
on GET / matches. --addr overrides. New: magpie status [--json] for
watchdogs (role, pid, listen address).

Run: new gateway and cli tests on Windows via win-run (pass); broken by
hand (record disabled): they go red; gofmt; vet windows and linux nogui.
Not run: mote/Linux (SSH down, WSL broken), darwin vet, a real systemd
service. TestEveryRouteHasACommandOrIsNamed is red on the base for two
GUI routes, unrelated to this change.
2026-11-11 12:00:19 +08:00
yetone 156861b3a2 site: a Goose docs page in en, zh and ja
/docs/goose says how magpie runs Block's Goose, its CLI and desktop app,
on magpie's models: the custom provider custom_providers/magpie.json
beside config.yaml (XDG_CONFIG_HOME, or %APPDATA%\Block\goose\config on
Windows) with the gateway's address, a key of Goose's own and magpie's
models, each with its context window and whether it takes a thinking
level; Goose loading custom providers at start-up, so a restart; the
effort field GOOSE_THINKING_EFFORT (off, low, medium, high, max); the
two config layouts magpie writes to as found; the user's own keys in
the provider file kept; the file removed once Goose leaves magpie's
models; WSL; and `magpie goose default`. Each claim is from
internal/agent/goose.go and Goose's Agent in agents.go, its notice
included. Linked from each language's Cline page; in the sitemap,
llms.txt and llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test worker.test.mjs install.test.mjs on the WSL box
(magpie-desktop, wsl-run; mote has refused SSH this session): 71 pass,
0 fail.
Not tried: Goose itself on magpie for this page; it names only what
magpie's source says.
2026-11-11 11:57:30 +08:00
yetone cc659c7559 library: Instructions reach MiniMax Code and WorkBuddy (lysyscy8 on X)
MiniMax Code reads AGENTS.md in its data folder ($MINIMAX_DATA_DIR, else
~/.minimax) before every conversation (readGlobalInstructions in
@minimax-ai/code 0.7.6's chunks), so its target now names that file.

WorkBuddy and WorkBuddy AI keep their instructions as the string
personalization.customPrompt in app/app-config.json of their folder
(PersonalizationCollector and AppConfigService in 5.5.6's app.asar, both
builds). Target.Field says the instructions are a JSON string rather than a
file; instrRead/instrSave read and write it through edit.SetJSON/DelJSON, so
every other key, its order and indentation stay, the user's own prompt stays
in the field around magpie's marker part, and taking the part back leaves
the file byte for byte as it was (an empty personalization object magpie
made goes too). A file that is not JSON, or a field that is not text, is
unknown: reported, never written over. Import takes the user's prompt into
the library the same way.

Run: TestMiniMaxCodeInstructions, TestWorkBuddyInstructionsAreAJSONField,
TestWorkBuddyInstructionsFromNothing, TestWorkBuddyInstructionsUnreadFileIsLeftAlone,
TestWorkBuddyInstructionsImport and TestWorkBuddyAIInstructions, in a sandbox
HOME, on Linux (wsl-run) and Windows (win-run); all fail with the two target
assignments taken out (broken by hand), and pass with them. internal/library
whole on Linux (ok) and Windows: 3 reds, TestGoneAgentListedToTakeOut,
TestCheckMixedServerEachSide (both #4115) and TestPluginImportCarryOnOffRemove
(#6065), all three red the same on origin/main d1b4eff5a on Windows.
Not tried: a running WorkBuddy or mcode reading the written values (the apps'
sources were read; WorkBuddy loads its config as it starts, so a running one
may need a restart); WORKBUDDY_USER_DATA_DIR is not followed.
2026-11-11 11:54:21 +08:00
yetone a982f34130 plugins: async gateway hooks get the request's kind, subagent or not (ahwulv on X, #4655)
GatewayContext had no subagent marker, so OpenViking could not skip memory
recall for Claude Code's subagents. It now carries kind: "subagent" when the
client says so on that request, "" otherwise (main conversation, or a client
that doesn't say). hookKind (internal/gateway/middleware.go) reuses the
gateway's own readings: Claude Code's x-claude-code-agent-id (subOf), and
Codex's x-openai-subagent collab_spawn (callKind + usage.PurposeOf, so a
Codex review or compaction is not a subagent). Headers from #4655's real
Claude Code 2.1.312 capture. It is read per request, so onRequest and that
request's onResponse see the same value and the main turn after a subagent
in the same session is "". Never guessed from the prompt or Agent tool
history. Documented in docs/subsystems/gateway-request-hooks.md.

Before/after: a hook's ctx had no kind; ctx.kind is now "subagent" for such
requests (the OV plugin already reads ctx.kind === "subagent").

Run: TestHookKindFromClientHeaders (claude subagent, claude main in the same
session, codex collab_spawn, codex review, none) and
TestAsyncGatewayHookKindReachesPlugin (real gateway + Bun: main, subagent,
main again; onRequest and onResponse) on mote at the commit before the final
rebase and on a WSL box; with Kind dropped from the context the e2e test
goes red (saw "" want "subagent"). go vet darwin green. Not tried: the real
OpenViking plugin; Claude Code itself against this build; linux/windows vet
was still queued on mote when this was pushed.
2026-11-11 11:50:13 +08:00
yetone 4df5256db8 plugins: a plugin's page shows its README in the UI's language (ahwulv on X)
A plugin that ships README.zh-CN.md still showed README.md on its details
page with magpie in Chinese. GET /api/plugins/page now takes ?lang= (the
page's document language) and plugin.ReadmeIn picks the README named for it:
README.zh-CN.md, README_zh.md, README-zh.md, README.zh-Hans.md, README.CN.md
and the like, any case (readmeTag/pickReadme). Order: the language's own tag,
then its base (zh-TW takes a simplified README over English), then the plain
README.md as before.

Where it reads from: an installed plugin's folder; an npm package not
installed from its files through jsDelivr's file list (the registry entry
holds README.md only), public registry only, never a user's private one;
a GitHub repository not installed from its contents list. Any failure keeps
the old README.md path. The page cache in plugins.js is keyed by package and
language. A package only on the community dist branch still shows the
README its index carries (English).

Before/after: zh UI + a package with README.zh-CN.md showed README.md; now
shows the Chinese one. en UI, no such file, or jsDelivr down: unchanged.

Run: TestPickReadmeByLanguage, TestReadmeInUILanguage (fake npm, jsDelivr,
GitHub, installed folder) on mote at the commit before the final rebase and
on a WSL box; broken by hand (lang forced to "" in ReadmeIn) the test goes
red. GUI plugin-readme-lang (new, chromium + webkit, en and zh) green, red
when &lang= is dropped from the request; plugin-detail-escape green. go vet
darwin green. Not tried: a real npm package with a localized README against
the live jsDelivr; the other plugin GUI files and linux/windows vet were
still queued on mote when this was pushed.
2026-11-11 11:50:13 +08:00
yetone 8aae124b02 gateway: Claude Code's tool-list notices after a result are not the user's message, so a steer sent with them reaches the model (magicalaciw18 on X)
Claude Code's deferred-tools and MCP-server notices ("The following deferred
tools are now available via ToolSearch…", "…are no longer available…",
"# MCP Server Instructions", "The following MCP servers have disconnected /
failed to connect / are still connecting…", literal strings from its own
transcripts) were not in `injected`, so agentNotice passed them to the run as
the user's words. The model read a new "user message" that was only the notice
(and a steer sent beside it arrived with the notice glued on its front).

Run on the Windows box (xiaomi-gpu, win-run; mote and WSL refused every
connection), at the pushed head (rebased on 914fcf59b):
- Old prompt.go: TestClaudeToolListNoticesAreNotTheUsersMessage (7 subtests)
  and TestClaudeSteerBesideToolListNoticeGoesOnAlone red; the lone-steer
  tests pass on old and new code (they guard that a steer alone still goes
  through, as a text after the result and as 2.1.296's system message).
- Fix: the new tests, TestClaudeHook*, TestAgentNotice*, TestUserWords green.
- go vet ./internal/gateway on Windows: clean. gofmt clean.
- -run 'Prompt|Classify|Turn|UserWords|Reminder|Notice|Claude' on the package:
  only TestClaudeAsRootEnv red, a known Windows red (#2425), untouched here.
Not run: mote (down), darwin/linux vet, the full suite, a real Claude Code.
The first quote of the report (a steer read as command output) is #1878,
fixed in v0.1.1220; not reproduced here.
2026-11-11 11:41:40 +08:00
yetone 914fcf59b0 gui: Sessions' Settings › no longer scrolls the whole window (kalicyh on X)
Settings' explanation lines are held out of sight with position:absolute
(hover mice), but their row had no positioned ancestor, so each sat at the
window's top-left corner, below the fold for the rows far down a page. The
document (body is overflow:hidden, still scrollable by script) then had
~870px of scroll, and Sessions' Settings › (openSettingsAt ->
scrollIntoView on the Privacy session-history rows) scrolled the window as
well as the page: Settings' top, the header, was pushed off the screen.

The row's .who is now the line's box (position:relative), in Settings and
in the provider editor's prefs (same rule, same hole). Every other
openSettingsAt link (Privacy rows, General's name row) shared it.

Run (win-run xiaomi-gpu; mote refused SSH all session, WSL tar errors):
- sessions-to-settings, all 5 languages x 1100/420 x chromium+webkit:
  20 of 20 ok. The new check (window scrollTop 0, Settings top >= 0,
  document no taller than the window) is red on the old CSS, 4 of 4 in zh
  (both engines, both widths).
- settings-hints/-lines-wrap/-places/-back/-search/-tabs-stick,
  editor-hints/-roomy, provider-prefs: 15 failures on this change against
  18 on the old CSS, the same names minus three the fix cleared (webkit de
  440 line-wrap, webkit hover hints); the remaining 15 (chromium de 440
  line-wrap, Settings' search, both engines) fail the same on the old CSS
  on the Windows box.
Not run: the full GUI suite, go test, macOS/Linux WebKitGTK.
2026-11-11 11:40:24 +08:00
yetone d1b4eff5aa agent: version detection and updates for agents installed in WSL distros (mewcoder on X)
A WSL twin row (<kind>@wsl:<distro>) showed no CLI version and no Update
button; the host path's cliupdate machinery only knew host binaries.

Now a twin in a running distro is read and updated inside the distro, for
every cliSpecs kind that has a command (cliupdate_wsl.go):
- one `wsl.exe -d <distro> -e sh` probe prints the command's real path,
  --version and exit code, with its own folder, npm prefix, ~/.local/bin and
  ~/.bun/bin first on PATH (wsl.exe -e has no login PATH, node CLIs exit 127);
  kept 10 min in wslProbes, dropped by Rescan and after an update.
- wslHowInstalled applies the host rules to the Linux path: own updater
  (spec.self), Homebrew, npm, bun, pnpm; volta, yarn and unwritable prefixes
  are left alone.
- the update runs in the distro through wsl.exe (wslRunUpdate); a Linux
  brew's newest is asked in the distro too.
- a stopped distro is never started: no version, and an update says to
  start it. CLIs() lists twins, so Update all takes them in.
No GUI change: the Agents row is keyed by agent id.

Run: gofmt clean; go vet darwin, linux, windows on internal/agent;
go test ./internal/agent ok on mote. TestWSLAgentCLIVersionAndUpdate (fake
registry + fakeWSL distro with an nvm prefix) goes red with the CLI hook
removed from CLI(). Real: win-run on xiaomi-gpu, magpie-desktop's own codex
read 0.162.1, Update true, updated to 0.167.1.
internal/gui on mote: only TestPanelHiddenByWailsMarksPageOutOfSight failed
(AppKit test killed at 120s, mote load ~80; no GUI file touched).

Not tried: real brew in a distro, proxy env inside the distro, sudo-owned npm
folders, kinds without a bin (Goose, mu), starting a stopped distro. Host's
proxy settings are not carried into the distro.
2026-11-11 11:35:41 +08:00
yetone 6d15f63d52 site: a Cline docs page in en, zh and ja
/docs/cline says how magpie runs Cline's CLI, VS Code extension and
desktop app on magpie's models: Cline's built-in openai-compatible
provider set to the gateway and made the one in use (a provider of
one's own is refused as a session starts), magpie's models in
models.json in place of the built-in list, what is stashed and put
back, new sessions taking the change, the effort field (none, low,
medium, high, xhigh), the extension's own state set too and its window
reload, the desktop app's composer picker, and `magpie cline default`.
Each claim is from internal/agent/cline.go and its notices. Linked from
each language's Hermes page (whose English link list now reads as
one); in the sitemap, llms.txt and llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test worker.test.mjs install.test.mjs on the WSL box
(magpie-desktop, wsl-run; mote refused SSH): 71 pass, 0 fail.
Not tried: Cline itself on magpie for this page; it names only what
magpie's source says.
2026-11-11 11:23:06 +08:00
yetone 7476328901 settings: one longest context for every model (WJaunita45604 on X)
Settings > Models > Routing has a Longest context field (magpie model
context-cap [<size>|off], POST /api/settings/context-cap). It lowers every
model's window to it, so a user need not set each model. A window the user
set on a model, or on its provider with "*", wins and is not capped; a model
whose window is unknown stays unknown.

It is applied where the window is derived, provider.windowIn, so /v1/models,
every agent's catalog, group windows and the compaction thresholds that
follow the window all agree. Codex's own models take it through
CodexNativeWindow, CodexWindow and codexcat.Cap on the list the gateway
serves; the list's ETag carries the cap so Codex asks again. The provider
editor's Listed value stays the vendor's.

Run (mote): provider, codexcat, cli, settings, settingsapi, gateway tests;
GUI context-cap, model-load, settings-places, i18n-keys, settings-general in
chromium and webkit (en, zh); TestCoreScriptBudget; gofmt; vet on darwin,
linux nogui and windows. Broken by hand: windowIn without the cap turns
TestContextCapHoldsEveryModelButTheOnesTheUserSet and TestModelsListContextCap
red.
Not tried: the whole GUI suite (one row added to an existing list, no new API
read on page load), a real Codex reading the capped list, Windows run.
Not covered: Claude Code's own [1m] choice (claudeRunName) and agent/claude.go's
fallback when a ref has no window.
2026-11-11 11:07:57 +08:00
yetone eb56de0b59 gui: a model's Same as can be picked from models.dev's list, filtered (timfang4162 on X)
In Model settings the Same as box, which binds a provider's model to
another model's metadata (window, reply limit, levels, images, list
price), was a bare text field. A button beside it now opens the app's own
menu (not a <select>) with the models of the models.dev catalog magpie has
already synced: id, name, window and price on each line, a Filter… box over
id, name and maker, the current one ticked. A pick fills the box, so it is
staged and saved with the editor's Save like a typed id, and a value typed
afterwards still wins; nothing about how Same as is read changed.

GET /api/catalog/models lists the cache with one entry per model
(catalog.SameModel), taken from the provider that lists its window and
price. It fetches nothing. The picker lives in modellimits.js, loaded with
the model rows, so the core script budget is not raised (five comments in
renderModels cut to pay for the strings, 613 bytes of room before).

Run on mote at this tree:
- TestCatalogModelsListsTheSyncedCatalogOnce; broken by hand (last
  provider wins instead of the one with window and price) it fails with
  "kimi-k3 = {ID: ... }; want the provider that lists its window and
  price".
- model-same-pick.test.cjs, 22 cases (chromium and webkit, en zh zh-TW ja
  de, 400 and 900px): filter by maker, name and id, Enter picks, the
  current one ticked, one catalog read, no scroll, no <select>, saved as
  modelPrefs same; a failed read says so. With the filter argument taken
  out of openProtoMenu it fails. provider-same-as.test.cjs still passes.
- gofmt, go vet (darwin, linux nogui, windows) on internal/gui,
  TestCoreScriptBudget.
Full GUI suite at this tree (rebased on 5c05ac41b): the only reds are not this change's, each also red or flaky at origin/main 1f99f6f0b run alone, and filed: account-arrange #6010, account-eye #5052, account-refresh-holds #5814, accounts-own-signin's Antigravity test #6038 (a webkit access-control flake that moves between languages).
Not tried: the real app's WebKitGTK; the full suite is started after the
push.
2026-11-11 10:56:41 +08:00
yetone 0378c10187 lessons: a patch on an open red issue is reviewed when posted (#5433)
skygunner's fix for #5433 sat three days unowned until the red came
back on CI (296a9292c); landed in 855b97a40. Docs only, nothing run.
2026-11-11 10:51:09 +08:00
yetoneandvincent 855b97a407 library: an MCP call's stream is open before its request reaches the server (#5433)
ServeRun sent a call to the child server and only then opened the call's
SSE stream. A server that asks roots/list at once could have the ask
land before that stream existed: it went to an older session stream, or
nowhere, and the call's own reply came first. That is #5433's red,
TestRunServerAsks seeing "roots " with nothing after it, which came back
on ubuntu CI at 296a9292c. The stream is now opened before the send and
closed on every return, a failed send included.

This is skygunner's patch (5acae7bee on their fork, posted on #5433 on
11-08), applied to main unchanged.

Run on mote at origin/main 0cc91af3d plus this change: TestRun* -race
-count=10 ok; ./internal/library ok (190s); go vet ok, and GOOS=windows
and GOOS=linux -tags nogui vet ok; gofmt clean.
Red on the old code: the new TestRunServerAsksOnCallStreamBeforeSendReturns,
with main's mcp_run.go, fails 3 of 3: "roots/list delivered to session
stream instead of call stream".
Not tried: Windows and Linux runs (the WSL box answered
Wsl/Service/E_UNEXPECTED), and the full suite.

Co-authored-by: vincent <vincent@users.noreply.github.com>
2026-11-11 10:49:46 +08:00
yetone 2f7bc20e0e site: a Hermes Agent docs page in en, zh and ja
/docs/hermes says how magpie runs Hermes Agent and its bots on magpie's
models: the magpie provider it adds to config.yaml's providers (chat
completions, the catalog as its models), model.provider and
model.default, the stash put back on switching back, the magpie/...
names in Hermes's picker, the effort field (agent.reasoning_effort, as
/reasoning), the profile `hermes` starts in (HERMES_HOME, the sticky
`hermes profile use`, else the default), the provider spread into every
other profile, per-bot pickers and bots following the connected one, a
model of the user's own keeping magpie's provider, WSL, the restart
Hermes needs, and `magpie hermes default`. Each claim is from
internal/agent/hermes.go, its notice and the CLI's usage text. Linked
from each language's OpenClaw page; in the sitemap, llms.txt and
llms-full.txt.

Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
mote: node --test worker.test.mjs install.test.mjs: 71 pass, 0 fail.
Not tried: Hermes itself on magpie for this page; it names only what
magpie's source says.
2026-11-11 10:49:18 +08:00
yetone 1f99f6f0b5 provider, gateway: a backend that only streams is tested and served (Cyrus_4433 on X: claude-relay-service "400 · Stream must be set to true")
A CRS Responses endpoint, like Codex's own backend, turns away a request that
doesn't ask for stream:true. The editor's Test models and protocol detection
send one small body, so every model of such a relay was red; an agent that sent
stream:false got the same 400 through the gateway.

Probe: probeAt asks once more with stream:true when a 400/422 says the stream
must be set (provider.StreamRequired, WithStream). Chosen over streaming every
probe so a vendor that takes one body keeps being asked for one; every probe
(model test, per-model check, detect, key check) goes through probeAt.
Gateway: passthrough marks the model stream-only on that 400 for a request
asking one body and returns done=false; attempt then translates on the same
API (always streamed upstream, whole reply to the client), and asks so at once
from then on, as a refused custom tool is.

Run (mote): new tests built from the reporter's literal error, red on the old
code (TestProbeStreamsWhereTheBackendOnlyStreams, TestDetectFindsAStreamOnlyBackend,
TestWholeReplyFromAStreamOnlyBackend), green on the new; go vet darwin, windows,
linux nogui; go test ./internal/provider ./internal/gateway ok. Each fix broken
by hand (probe retry stashed, gateway hook stashed): red. Not tried: a real CRS
relay; the rest of ./... (started after the tag).
2026-11-11 10:37:13 +08:00