/docs/ds-bot says how magpie adds itself to DS Bot (once DeepSeek Bot,
an Electron app on the DSH it ships): the data folder found in DS Bot's
own order (DS_BOT_HOME, locations.json's dataDir under DS_BOT_SHELL_DATA
or <config dir>/DS Bot with the older DeepSeek Bot folder, ~/.ds-bot),
an unreadable locations.json touching no folder; the route in
profiles/ds-bot/cordis.patch.yml, the key in .env and DSH's key store
and agent-default-model, as for DSH; new Bots starting on it unless a
Bot default is set in DS Bot, older Bots keeping theirs; the web search
notice; setting it up before the first open, the patch list kept; the
plugin in DSH Desktop following the DSH row; switching back. Each claim
is from internal/agent/dsbot.go. Linked from each language's Tuanjie
Cowork 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 site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
115 pass, 0 fail.
Not tried: DS Bot itself with magpie for this page; it names only what
magpie's source says.
/docs/tuanjie-cowork says how magpie adds itself to Tuanjie Cowork
(团结 Cowork, Unity China's coworker app on Codely): a provider and a
model with id magpie in ~/.codely/settings.json's customModelProviders
and customModels (the gateway's /v1, magpie's key for Cowork, authType
openai, wireApi chat, supportsMultimodal from the catalog); the user's
entries and fields on magpie's kept, a new file made 0600, and a
same-id entry of the user's or an unreadable file left alone; Cowork's
model menu pick made once, since the id stays magpie and a later model
change in magpie is what that pick sends; the notice; switching back
removing magpie's entries and an empty file magpie made. Each claim is
from internal/agent/tuanjiecowork.go. Linked from each language's
OpenBot 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 site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
115 pass, 0 fail.
Not tried: Tuanjie Cowork itself with magpie for this page; it names
only what magpie's source says.
With any model alias set, every Stats read copied each kept range's
days and every session's summary into a second, aliased Stats, and kept
that copy (aliasedKept) beside the unaliased one. With a long history
(~14k sessions) the copy held ~5 MB of summaries for as long as the
kept ranges lived.
Now statsKept aliases a range's Stats in place right after
statsOfRange made it (aliasOwned: only st's own Days and Sessions
arrays are written; the usage, model and effort slices are replaced,
never written into) and keeps that one. keptStats carries the alias
names it was made under, so a changed alias makes the ranges again,
as a changed price or title already did. aliasedKept, aliasKept and
aliasStats are gone.
Tests: TestSessionsCountAliasedModelsAsOne now checks that the kept
range's summaries are the very ones the read returned. Broken by hand
(a copy of Sessions before keeping): it went red ("an aliased read
keeps a copy of its summaries beside the kept ones"), and so did
alias_kept_test's "range 0 named again with nothing changed".
TestAliasOwnedLeavesSharedSlicesAlone replaces
TestAliasStatsLeavesItsInputAlone.
Run at 846cc2b9b (rebased on 96c65e3e7), on mica: gofmt -l clean; go vet,
GOOS=windows go vet and GOOS=linux go vet -tags nogui ./... ok;
go test -timeout 45m -count=1 ./...: 97 packages ok, none failed.
Real account (mote, sandbox HOME with the owner's history and an alias
set), late.sh at 120s, v0.1.3814 vs this: footprint 127 → 124 MB, live
heap after GC 100.8 → 95.9 MB; aliasStats' 5.01 MB is gone from the
profile.
Not tried: Windows and Linux runs of the package (no OS-specific code).
qhyqhy1s asked for best-practice templates in routing groups, as only
three were offered. The Routing page's template cards and Templates menu
(and `magpie group template`) now carry three more, each only a setting
the engine already has:
- Plan first (plan): the strongest model of up to three providers, the
ones billed by a plan (Provider.BillingKind) ahead of pay-as-you-go
ones. Not made when no provider is on a plan (NeedPlan).
- Fastest first (fast): the same members, routing "fast".
- Spread evenly (even): the one strongest model from up to four providers
that serve it, routing "rotate" over all their keys and accounts.
Names, one-line descriptions and the new "Needs a subscription or token
plan" are in zh, zh-TW, ja and de. docs/subsystems/gateway-routing.md has
a Routing recipes section.
Run on mote at the pushed tree: go test ./internal/provider ./internal/cli
./internal/gui (Template|SizeOf|Group) ok; gofmt -l clean; group-template,
getting-started, i18n-keys and i18n-en-no-cjk GUI files, 98 tests, chromium
and webkit, 420px, every language, ok. Broken by hand: routing left unset
on Fastest first, TestRecipeTemplates red. Not tried: a real account
adding each template; the full GUI and Go suites are started after the tag.
amhcwushuang on X runs Claude Code -> new-api -> magpie on a server ->
the Claude subscription, and says the thinking level is lost.
Read from new-api (QuantumNous/new-api main): a Claude channel keeps
thinking and output_config as written (relayconvert shared/claude
ApplyReasoning passes a native request through), including the
{role: system} turn's output_config; an OpenAI channel turns the request
into Chat with reasoning_effort (reasoning.ApplyToOpenAIChat), and an
OpenRouter-dialect channel into a `reasoning` object. Claude Code's own
fixture (claude-code-2.1.296.json) carries top-level output_config.effort,
thinking adaptive, and the same effort on a system turn.
magpie already passed, to the spawned Claude Code's --effort: Messages with
a thinking budget or a top-level output_config, Chat reasoning_effort,
Responses reasoning.effort (checked by the new test on the old code).
It did not take the level from:
- a Messages request whose only effort is the last turn's output_config;
- a Chat request with reasoning.effort (an object), output_config.effort
or a thinking budget in place of reasoning_effort.
Those now set the request's effort. reasoning_effort, when present, stays
the client's word; no setting of the user is read or overridden.
Run: TestClaudeBridgeTakesTheEffortOfEveryRoute red on the old chat.go and
decide.go (4 of 9 cases), green now; gofmt; go vet darwin, linux nogui,
windows on internal/gateway; internal/gateway full package on mote.
Not tried: a real Claude subscription behind new-api; Claude Code's
interactive mode with a message-only effort (the -p stand-in was used).
Claude Code's refusal for a used-up window is "You've hit your limit" and
names no window, and its rate_limit_info may carry no rateLimitType (the
transcript's rejected row). restAfter read the account's windows as they
were cached before the Fable week filled (Fable 60%, nothing full), so
Pooled said no and the whole account rested for the refusal's time:
Opus, Sonnet and Haiku with it, though the other weekly quota was left.
A quota refusal on an account whose reading holds a window of some models
only that counts the model, none known full, now asks for the reading
again and narrows the rest to the model when it shows that pool full
(narrowWhenRead, as for an unread account, #2036). Every route rests
through restAfter, so Messages, Chat Completions, Responses and the group
fallback share it; Claude is not a plugin.
Run at this tree (mote): TestClaudeFableWeekRestsFableOnly red on the old
routing.go (rests the account), green with the fix; internal/provider,
gofmt, vet on darwin, linux and windows. Full internal/gateway follows.
Not tried: a real Fable-limited account; a usage reading that keeps
failing leaves the account resting whole, as before.
0.2.29 pins WorkBuddy AI's free window at the reset a routed-past refusal names (yetihan, plugins #910, #1022). 0.2.28 lists an enterprise's custom: models (plugins #1015). Both are on npm (npm view --prefer-online: latest 0.2.29).
Ran: go test -count=1 ./internal/provider/ on mica, ok.
/docs/openbot says how magpie adds itself to OpenBot (the Electron
workspace running Codex, Claude, OpenCode and others): where
openbot-custom-providers-v1.json is on each OS; the entry magpie writes
(version 1, id magpie, baseUrl /agent/openbot/v1, secret null since the
key is sealed with safeStorage, which magpie doesn't open; the path is
how the gateway counts OpenCode's requests as OpenBot's); a file OpenBot
can't read left alone; the user's name, harness and key on magpie's
entry kept; models limited to those picked for OpenBot, at most 64,
with ids and context windows OpenBot accepts, since one bad entry
empties the list; the start-up read and the restart notice; MCP servers
in its SQLite database added by hand; switching back removing only
magpie's entry, and the file when nothing is left. `magpie openbot
provider magpie` and `magpie openbot default`. Each claim is from
internal/agent/openbot.go and internal/cli/main.go. Linked from each
language's miniQ 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 site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
115 pass, 0 fail.
Not tried: OpenBot itself with magpie for this page; it names only what
magpie's source says.
What the user saw: Codex on Google Vertex AI stopped right after "Viewed an
image" with "Requests ending with a model turn are not supported".
Why: Codex's view_image answers with a function_call_output whose output is
[input_text, input_image] (as ~/.codex/sessions rollouts record it). The
Gemini build kept a tool's images in the same user turn as its
functionResponse. Vertex AI answers a response turn mixing in anything else
with that 400 although the last role is user (#1533 showed it for text, and
ce11b1801 split the text out but left images with the response).
What changed: buildCodeAssistSent, for Vertex AI, puts a tool's images in a
user turn after the responses (with what the user said, if anything). The
image and the words are kept. AI Studio, Code Assist (Gemini CLI,
Antigravity) are unchanged: Gemini CLI itself sends a read image beside the
response, and no refusal is known there. Chat and Messages clients reach the
same builder, so they are covered; the image-under-assistant and trailing
model turn cases already end with a user turn (continueText).
Tests: gemini_view_image_test.go posts Codex's real view_image shape (array
output, image-only output, image in a following user message, image in a
model-role message) to /v1/responses against a fake Vertex that refuses as
the real one does; vertexTurnsAway now also refuses an image beside a
response. Reverting codeassist.go makes it fail with the reporter's exact
message, and TestGeminiToolResponseTurnHoldsNoText fails too.
Run: go test ./internal/gateway ./internal/provider on mote, gofmt -l, go vet
-tags nogui for darwin, linux and windows.
Not tried against real Vertex AI: no Vertex credentials on this machine.
A start read sessions.json whole onto the heap (24.6 MB on a real
history) and decoded it; then each `named` object was copied again by
gjson.ParseBytes before being read. Nothing decoded keeps a byte of
the file: json.Unmarshal, ccStr and unique.Make all copy, and the keys
are cloned.
On unix the file is now mapped read-only and unmapped once decoded (it
is only replaced by a rename, never written in place); elsewhere it is
read as before. `named` parses its bytes in place.
Run:
- go test ./internal/sessions (mica): ok 63s.
- GOOS=darwin/linux/windows go vet ./internal/sessions: ok.
- Broken by hand: read onto the heap again, TestCacheFileReadWithoutACopy
is red ("allocates 688976 bytes; want it mapped"); a key left
pointing into the file (no Clone) faults it with SIGSEGV after the
unmap. The fixture has plain and escaped names, since an escaped one
is unescaped into a copy anyway.
- Every custom UnmarshalJSON in internal/sessions read for bytes it
keeps: none.
- Real account, mote sandbox HOME, start to 50s (pprof alloc_space):
sessions.loadCache 29.5 MB -> 4.4 MB, os.readFileContents 46.7 MB ->
22.0 MB. Footprint peak unchanged (163 to 164 MB); it is set later.
Not tried: a real Linux start; Windows reads the file as before.
/docs/miniq says how magpie adds itself to miniQ (the desktop coworker
and the miniq terminal, clients of one miniq-daemon): where
settings.json is (MINIQ_DATA_DIR, the folder miniq-data-dir.json names,
else %LOCALAPPDATA%\miniq or ~/.local/share/miniq, macOS too); the
provider magpie writes (the gateway's /v1, magpie's key for miniQ since
miniQ sends no User-Agent of its own, the catalog id, apiProtocol
chat_completions rather than auto); the rest of settings.json left as
it is, and a new file made 0600; a running daemon told through
settings.update over daemon.json's WebSocket, with a restart notice
when it can't be; switching back restoring the stashed provider, or
removing magpie's and an empty file magpie made. Each claim is from
internal/agent/miniq.go. Linked from each language's Empryo 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 site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
115 pass, 0 fail.
Not tried: miniQ itself with magpie for this page; it names only what
magpie's source says.
A start's first dsh round read every profile through the yaml emitter to
find what the last magpie's round had found: nothing to write. On a real
account that was ~60 MB of the first minute's 523 MB.
The round's key (dsh's files, the gateway, the models) is now summed with
sha256, the same in every process, and a round that ends with nothing to
write records it in the cache folder (dsh-rounds.json, temp + rename).
A start's first round goes by that record when it is this magpie
version's; a dev build never does. A file, the models or the version
changed has the round run as before.
Run:
- go test ./internal/agent (mica): ok 188s.
- GOOS=darwin/linux/windows go vet ./internal/agent ./internal/gateway
./internal/appdir: ok.
- Broken by hand: with the record not read, TestDshFirstRoundGoesByTheLastMagpies
is red ("read and wrote dsh's files 1 times").
- Real account, mote sandbox HOME, a start after one start (pprof
alloc_space at 50s): dshRounds.once 101 MB -> 38 MB (the catalog
only), yaml emitter 43 MB -> none, total 522 MB -> 463 MB. Footprint
peak 168 MB (w11) -> 165 MB.
Not tried: Windows and Linux real starts; the record is plain JSON in
appdir.Cache() there too.
/docs/empryo says how magpie adds itself to Empryo (formerly SoulForge):
a provider with id magpie in ~/.empryo/config.json's providers array
(OpenAI-compatible, baseURL and modelsAPI at the gateway's /v1, no
envVar so no key of the user's is sent, listed because GET /v1 answers),
defaultModel set to magpie/<catalog id> and split at the first "/"; a
project's .empryo/config.json going over the global one; Empryo in a
WSL distro reaching the gateway at that distro's address; the
restart-on-start-up notice; switching back restoring the stashed
defaultModel and removing the provider (and an empty file magpie made).
`magpie empryo <ref>` and `magpie empryo default`. Each claim is from
internal/agent/empryo.go. Linked from each language's Lody 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 site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
115 pass, 0 fail.
Not tried: Empryo itself with magpie for this page; it names only what
magpie's source says.
tuiCalls.call made Claude Code's MCP call with httptest.NewRequest, whose
context is never done, so a call a test didn't answer waited in mcpCall
until the package ended. macOS CI's 30m alarm at e787e7b5c (run
43102520567) showed one such goroutine blocked 24 minutes in mcpCall from
claude_tui_call_test.go:76. The request now carries a context the test's
cleanup cancels, and the cleanup waits for the call to return.
Run (mote, at origin/main 152734cd1 plus this change): a throwaway probe
test, run after the TUI tests, counting (*tuiCalls).call goroutines still
alive: old helper "1 tuiCalls calls still running after their tests",
fixed helper ok. go test -race -count=5 -run TestClaudeTUI ./internal/gateway
ok (240s); that pattern covers every user of newTUICalls and schemaTUI.
Not the cause of that run's timeout: the package took 1801s where the
last green macOS run took 888s, with the alarm landing on a 5s-old
ZCode test (#2191).
A Sessions poll watched each Codex day folder and each Claude Code
project folder through dirent.Watch, and every call ran its own sync1
probe (a mkdir, an unlink and a wait for the write to be heard). On a
real history that was ~130ms of 1.47s CPU per 40 polls, and the
syscalls around it more. WatchSince(dir, mark) skips the probe when a
probe begun after mark was heard; sessions takes the mark when a hold
begins, so one poll makes one probe. A folder watched for the first
time still probes, since its watch hears only what comes after.
Run, real account (mote, the owner's Claude Code and Codex history,
40 back-to-back /api/sessions polls, sandbox HOME):
- CPU: w10 1.47s -> w11 0.54s; under sync1: 130ms -> 10ms.
- Allocated: 25.98 MB -> 25.08 MB.
Tests (mica): go test ./internal/dirent ./internal/sessions ok at the
pushed head. TestWatchesFromOneMarkProbeOnce is red with covered
forced false ("round 0: 3 probes from one mark") and green on this.
./internal/gui: TestPanelHiddenByWailsMarksPageOutOfSight fails under
-count=3 on an origin/main copy (4ae833f84) too and passes -count=1;
recorded on #6203.
/docs/lody says how magpie adds itself to Lody (the desktop app running
Claude Code, Codex, Pi, dsh, Kimi Code, Grok and Bub): Lody's
lody://provider/import link, confirmed in Lody's dialog; the decoded
JSON (custom provider Magpie, Lody's own key, anthropic-messages at the
gateway for claude-code, openai-responses at /v1 for codex,
openai-chat at /v1 for the rest, models from /v1/models); how magpie
finds Lody (~/.lody, ~/.lody-oss, its data folder; OSS and Nightly);
no "added" state, since Lody has no public status API; loopback HTTP
only, with magpie saying why otherwise; on Linux, Lody started from its
desktop entry with the link, since xdg-open turns lody:// away;
`magpie lody add`. Each claim is from internal/agent/lody.go and
internal/cli/main.go. Linked from each language's Cindy 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 site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
115 pass, 0 fail.
Not tried: Lody itself with magpie for this page; it names only what
magpie's source says.
/docs/cindy says how magpie adds itself to Cindy (the desktop app that
runs Claude Code, Codex and Pi): Cindy takes a provider only through its
cindy://provider/import link, confirmed in Cindy, so magpie writes
nothing there; the link's decoded JSON (custom provider Magpie, Cindy's
own key, anthropic-messages at the gateway for claude-code,
openai-responses and openai-chat at /v1 for codex and pi, models from
/v1/models); the data folder (Cindy, CindyGlobal); the check that
something opens cindy:// links; `magpie cindy add`; how "added" is read,
read-only, from cindy-<account>.db or cindy-local-v1.db, unknown when
unreadable. Each claim is from internal/agent/cindy.go, applink.go and
internal/cli/main.go. Linked from each language's Shelley 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 site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
115 pass, 0 fail.
Not tried: Cindy itself with magpie for this page; it names only what
magpie's source says.
ClaudeHomesIn and CodexHomesIn run on every Sessions poll, and keyed
each folder they found by filepath.EvalSymlinks, which Lstats every part
of the name: ~3 MB of garbage per 40 polls on a real home. On unix a
folder is now keyed by its device and inode, which a link to it shares;
a folder that can't be looked at is keyed by its name, and other systems
keep EvalSymlinks. The folder checks use DirStat, moved here from
internal/sessions so both share one.
Run (mica, at this tree): go vet for darwin and windows of appdir,
sessions, provider and gui, for linux of the first three (gui needs cgo
there); GOOS=freebsd go build; go test ./internal/appdir ./internal/sessions
./internal/provider ok. TestHomesLookAllocatesLittle: 55 and 68
allocations a look now, 387 and 400 on the old code, which fails it.
Real account (mote, 40 polls of /api/sessions): w9 31.28 MB allocated
with os.lstatNolog 3 MB; w10 25.98 MB, lstat gone from the top list.
CPU over 30s 1.47s, within noise of w8's 1.29s at mote's load.
readDirectory looked at each folder with os.Stat on every Sessions poll
to see whether its cached listing still held. os.Stat builds a FileInfo
and a name each time, ~6 MB per 40 polls on a real history. dirStat reads
the same mod time, size and kind with unix.Stat into a stack Stat_t;
other systems keep os.Stat.
Run (mica, at this tree): go vet ./internal/sessions for darwin, linux,
windows; GOOS=freebsd go build ./internal/sessions; go test ./internal/sessions
ok (61.8s). TestDirStatAsOSStat passes; with the old discovery.go it fails
("an unchanged folder's look allocated 2 times").
Real account (mote, 40 polls of /api/sessions): w8 34.16 MB allocated,
os.statNolog 6 MB; w9 31.28 MB, os.statNolog not in the top list.
byIDOrWas, which every model's price (BasePriceIn, UserBasePriceIn)
and a few model preferences go through, read All(): a copy of every
provider, its keys, headers, models and account maps, to find one. A
Sessions poll prices every model of every call, so that was the next
largest allocator of a poll. It now looks among the shared providers
(sharedAll, as Find does) and clones only the one it found, which stays
the caller's to change.
Measured on mote with the owner's real account, 40 /api/sessions
polls, `magpie heap` alloc_space diff:
before (w7): byIDOrWas 9.74 MB (All 9.74: its copies 5.7, sharedAll
4.0)
after (w8): byIDOrWas 3.52 MB, all of it sharedAll's rebuild when
the hold expires; All gone from the poll
CPU over 30 s of polling: 1.37 s (w7) -> 1.29 s.
Test: TestByIDOrWasCopiesOnlyItsOwn (new), 40 providers of 5 keys each
under Hold: a change to the returned provider doesn't reach the shared
ones, and the lookup allocates under a tenth of All. With the old
models.go it fails (1560 allocations, against 1560 for All).
Run on mica at 10c331531 plus this change: go vet ./internal/provider
for darwin, linux and windows clean; go test ./internal/provider ok
(130 s).
Not tried: Windows or Linux runs; the change is which list is read.
/docs/shelley says how magpie wires Shelley (boldsoftware/shelley, the
coding agent for exe.dev): its models live in its database, so magpie
uses Shelley's own API on its Unix socket ($SHELLEY_SOCKET, else
~/.config/shelley/shelley.sock, or shelley-2.sock and on); one openai
custom model per picked model at the gateway's /v1 with Shelley's own
key, reasoning and image support from magpie since models.dev doesn't
know them; the pick made the default profile's model, thinking_level
cleared for a model that doesn't reason; new conversations only;
Shelley must be running; switching back restores the stashed model and
level and deletes magpie's models, a hand-made one staying the user's.
Each claim is from internal/agent/shelley.go. Linked from each
language's AtomCode 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 site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
115 pass, 0 fail.
Not tried: Shelley itself with magpie for this page; it names only what
magpie's source says.
Every 15 s Sessions poll built every Claude Code file's and Codex
rollout's list again, and merged and filtered them into more new
lists, while nothing on disk had changed. On the owner's real history
that was ~120 MB of garbage per 40 polls in listedRollouts,
claudeFiles, listCCFiles and filesKept.
Each lister now keeps its last list (listsKept). A listing walks the
folders as before and compares each file with the kept list's file at
the same place; while they match nothing is allocated, and the kept
list itself is returned. On the first difference it copies the matched
part and goes on, so a grown, new or gone file is listed as a fresh
listing has it, and the kept list is never written. listCCFiles reuses
its walk's scratch slice per lister. distinctPaths and
distinctCodexFiles return their input when nothing is dropped and never
filter in place; codexFilesIn's twin filter clones before deleting.
rolloutsSeen's day entry is its part of the kept list (clipped), not a
clone. The idle cache drop forgets all of it.
Measured on mote with the owner's real account (75 GB history),
40 /api/sessions polls, `magpie heap` before and after, alloc_space
diff:
before (w6): 155.7 MB; listedRollouts 42.8, claudeFiles 32.2 (71.1
cum), listCCFiles 31.0, filesKept.distinct 18.0
after (w7): 34.8 MB; none of the listers in the top; distinct 4.5,
provider.All 9.7 (next)
CPU over 30 s of polling: 1.79 s -> 1.37 s.
Tests: lists_kept_test.go, red on the old code (an unchanged listing
made a list of its own; distinctPaths wrote its input), green now.
TestClaudeFilesMadeAtTheirSize expects the clipped kept list.
Run on mica at this tree (rebased on 0cff3429f, sessions vet + test again ok): go vet ./internal/sessions for darwin, linux
and windows, ./internal/gui for darwin; go test ./internal/sessions ok
(64 s); go test ./internal/gui ok but TestPanelHiddenByWailsMarksPageOutOfSight
(#6203, flaky on mica, passes alone). -race of sessions: #4360 and
#6213, both red on the old code too, no stack in the changed code.
Not tried: Windows and Linux runs of the new test (the codex subtest is
darwin-only).
/docs/atomcode says how magpie wires AtomCode (AtomGit's Rust terminal
agent): ATOMCODE_HOME or ~/.atomcode (Linux's in WSL); in config.toml a
[provider_accounts."magpie"] table (openai-compatible at the gateway's
/v1, AtomCode's own key) and one [models."magpie/<ref>"] table per model
with its context window (128000 when unknown), output limit, vision and
effort levels; default_provider and default_model on the pick,
default_model winning; reasoning_effort kept per model, none picked for
the user; the restart; switching back putting the stashed defaults back
where AtomCode still has them. Each claim is from
internal/agent/atomcode.go. Linked from each language's Reasonix Studio
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 site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
115 pass, 0 fail.
Not tried: AtomCode itself with magpie for this page; it names only what
magpie's source says.
TestGrokBalanceExhaustedRestsToReset (ac6db8933) swaps awaitAllowance
and puts it back in a defer. Its "no window known" case is an unread
quota rest, so restAfter starts narrowWhenRead, which reads
awaitAllowance off the test; nothing waited for it, and the race job
went red at 0d0a1a567 (write in the test's defer, read in
narrowWhenRead at routing.go:956). The Factory pool tests that swap
awaitAllowance already defer narrowing.Wait(); this one now does too.
Those two files are the only tests that reassign awaitAllowance.
Run (wsl-run, magpie-desktop): go test -race -count=200 -run
'^TestGrokBalanceExhaustedRestsToReset$|^TestFactory' ./internal/gateway
ok. Not reproduced red here: 500 race runs of the old test, with a pause
injected in narrowWhenRead or at the test's end, stayed green, so this
rests on the CI stacks and the Factory tests' rule.
RenameLegacy looks for model fields still holding a legacy provider id.
It read every field's value, Pi's defaultThinkingLevel too, and Pi's
effort Get checks the level against the models Pi offers: the whole
catalog built for Pi at every start, though no thinking level is ever a
model id. A field whose key ends in "effort" is now skipped.
Measured on mote with a real account (its providers, Codex and dsh
homes), the profile 8s after start, two runs each:
- before (w5): RenameLegacy 67 MB allocated, piOffered/sharedModels
46-48 MB of it
- after (w6): RenameLegacy 25 MB, piOffered gone from the profile;
the diff of the two profiles: sharedModels -47 MB, but the dsh round
now builds its own list (+27 MB) where it used the one Pi built, so
~20 MB less allocated at start. liveHeap 104.5 MB both, footprint
134-137 MB both: this is garbage saved, not memory kept.
Run: TestRenameLegacyBuildsNoModels (new) passes; with the old
legacy.go it fails ("RenameLegacy built pi's models"). gofmt, go vet
and go test ./internal/agent on mica at 40c8d0c81 plus this change: vet clean, ok internal/agent 287s.
Not tried: Windows or Linux; the change is a string check on keys.
/docs/reasonix says how magpie wires Reasonix Studio 2.x and its CLI:
REASONIX_HOME, %APPDATA%\reasonix on Windows or ~/.reasonix (Linux's in
WSL); a [[providers]] entry named magpie in config.toml (openai kind at
the gateway's /v1, api_key_env MAGPIE_REASONIX_API_KEY with the key in
.env, every model with its context, output, vision and efforts) and
default_model magpie/<model>; provider_access joined; the executor and
[agent] planner_model chosen apart, the provider kept while the planner
uses it; refusing a magpie provider or key it didn't make; the restore
record holding settings only; a new process to load changes; switching
back undoing only magpie's part. Each claim is from
internal/agent/reasonix.go and the CLI forms from internal/cli/main.go.
Linked from each language's jcode 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 site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
115 pass, 0 fail.
Not tried: Reasonix itself with magpie for this page; it names only what
magpie's source says.
A Cursor account signed in through its plugin (pooled plan, or on-demand
or free credit that can pay) sets every window aside, since none can stop
the account. Routing's allowance then holds no figure for it, so the
Accounts and keys row (and the stage row) said "what's left not known
yet" while the Usage page showed its percentages. This is true of any
plugin-served subscription that sets all its windows aside, not only
Cursor.
Both Routing rows now say the card's first window (as Usage read it) when
routing has no figure, the rest on hover; with no card the unknown line
stays. Display only: how accounts are weighed is unchanged.
Run: new routing-pooled-card.test.cjs (5 languages, 1100/420px, chromium
and webkit) 22 pass; red 22 of 22 with client.js put back to origin/main's
(broken by hand). Routing, i18n-keys, use-first, account-mask and
codex-credits GUI files on mote: the only reds are in routing-context-fold,
routing-pin-away, routing-row-swap, routing-story-shrinks, many-keys and
accounts-narrow; the first four fail the same on the origin/main client.js
(umbrella #4494, #5475).
Not tried: a real Cursor account; the Go suite starts after the tag.
/docs/paseo says how magpie puts its models in Paseo (getpaseo/paseo):
Paseo lists Claude models itself (its own list, settings.json's model and
the ANTHROPIC_*_MODEL tiers) and never reads modelPicker, so magpie writes
agents.providers.claude.additionalModels in $PASEO_HOME or ~/.paseo
config.json, with Claude Code's /model ids, [1m] marks and names and a
description ending "via magpie"; the user's own entries first and kept,
an id they listed not added again, an unreadable list left alone; Claude
Code connected to magpie first; the daemon restart; switching back takes
out magpie's entries only. Each claim is from internal/agent/paseo.go and
the CLI forms from internal/cli/main.go. Linked from each language's T3
Code 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 site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
115 pass, 0 fail.
Not tried: Paseo itself with magpie for this page; it names only what
magpie's source says.
Each Sessions poll calls Watch twice, and each wait made a folder with
one file and then RemoveAll'd it, which looks, opens and lists the
folder first. On mote's real account profile, RemoveAll was half of
sync1's 0.16s over 40 polls. Now it removes the file, then the folder,
with RemoveAll kept only for when one of those fails.
Run (mica, darwin/cgo): gofmt -l internal/dirent (empty), go vet,
go test -count=3 ./internal/dirent ok. TestProbeLeavesNothing checks
that the probe's folder is empty after five Watch calls. A throwaway
benchmark of 1000 Watch calls, 3 runs each, user+sys: new 1.43/1.42/
1.48s, old (RemoveAll) 1.62/1.52/1.47s, about 5% less CPU per
Watch. Wall time is the FSEvents latency, ~12ms, the same on both.
Not tried: a new real-account poll profile on mote (load 77 at the
time).
zcode 0.1.60 (plugins 7c44d027) keeps the last coding plan key when reading it fails for a network reason (ECONNRESET, a timeout), or answers a wall that magpie sends once and then rests the account. Before, a thrown error was retried about 8 times over six minutes. Free first also no longer replays onto a coding plan whose usage read showed a window full. Raising the min lets keepMovedCurrent update every moved user.
npm view --prefer-online: 0.1.60 at the time of the change.
Run on mica: go test -count=1 ./internal/provider/ ok (129s). gofmt -l clean.
Not run: the full suite. This change is the min string only.
Reported-by: takomitkm
A custom provider at a New API / Sub API / One API relay with no Balance URL
has its balance query found by magpie (provider/balance_probe.go). This keeps
what was found, or not found, in balance-probes.json (keyed by origins and a
hash of the key, written through temp-and-rename, an unreadable file read as
empty), so a restart does not probe again. The editor gets an Auto-detect
switch (NoBalanceProbe), a Detect again button (ForgetBalanceProbe) and a line
saying where the balance was found, or that none was, with the Balance URL
field as the way out. A found balance is a balance card on the Usage page.
Run at the rebased head (parent 6a3f162f0 = origin/main), on mica:
- gofmt -l: clean.
- go vet ./... (darwin), GOOS=linux -tags nogui, GOOS=windows: clean (at the
previous base e6bf4adf1; go vet ./internal/... again at this head).
- go test -count=1 internal/provider internal/gui: ok, at this head.
- GUI, both engines, five languages: balance-found, gui-de/ja/zh-tw, i18n-keys,
i18n-en-no-cjk, provider-billing, provider-detect*: all ok except gui-de and
gui-ja "has every zh string" ({agent} twice in sessions' "isn't installed
here"), which are red the same at e6bf4adf1 (filed).
- At e6bf4adf1, 79 provider/gui/i18n files: 80 reds, the same 80 on the
unmodified base (provider-fetch-again #5232/#5057, provider-picks-stay
#4397, provider-models-rest #4396, provider-typed #4673, menu-scroll #1550,
provider-max-output and provider-many-keys filed with the rest).
Not tried: a real New API / Sub API relay with a real key; the full Go suite
(started after the tag).
/docs/jcode says how magpie wires jcode (1jehuang/jcode): $JCODE_HOME
or ~/.jcode; [providers.magpie] in config.toml (openai-compatible at the
gateway's /v1, a key naming jcode, requires_api_key since jcode sends no
key to loopback) and [provider] default_provider/default_model; every
model in the profile's models (context window, 128K when unknown,
images, reasoning for effort levels) for /model and /effort; the restart
jcode needs; the stashed [provider] and the user's own keys kept; an
unparsable file left as it is; [[providers.magpie.models]] tables folded
back; switching back. Each claim is from internal/agent/jcode.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 site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
115 pass, 0 fail.
Not tried: jcode itself with magpie for this page; it names only what
magpie's source says.
60fde6fb1 added the MCP server accounts route and ran chosen packages,
so TestEveryRouteHasACommandOrIsNamed has been red on main since. It
joins the other library MCP routes under stage 3.
Run (wsl-run): the test is red on origin/main 5d5d57cbb and passes with
the entry; GOOS=windows and GOOS=darwin -tags nogui go vet clean.
On WSL the interop PATH holds a dozen /mnt/c directories, reached over 9P.
proc's look cache stats every PATH directory, and in tests it is never
fresh (lookFreshInTests is 0), so every command a test runs paid for a
dozen 9P stats. internal/cli took over 40 minutes on the magpie-desktop
distro and timed out at 45m; two of its tests alone took 34.9s each with
/mnt in PATH and 0.27s without. A test also found Windows programs
there (VS Code's `code`) instead of the fake it set up.
Isolate now drops every /mnt/<drive> entry from PATH when it runs under
WSL (WSL_DISTRO_NAME, WSL_INTEROP or binfmt_misc's WSLInterop). /mnt/wsl
and /mnt/wslg stay.
Run (wsl-run, magpie-desktop):
- go test ./internal/testenv: ok. TestIsolateDropsWindowsPath is red
with dropWindowsPath returning early, green with the fix.
- internal/cli: 36.7s, was over 40m; its one red is
TestEveryRouteHasACommandOrIsNamed, from 60fde6fb1, fixed in the next
commit.
- internal/proc ok (3.5s), internal/library ok (68s), internal/agent ok
(113s).
- GOOS=windows go vet and GOOS=darwin go vet -tags nogui of
./internal/testenv ./internal/cli: clean.
Not run: the full suite (mote and mica were over their load bar).
A skill's key set once as a Library variable (ANYSEARCH_API_KEY and the
like) now goes with the library: Bundle.Env carries name, value and agents
(nil from an older magpie, and Put then keeps this computer's). It follows
how servers' tokens are carried: a backup or sync without keys keeps the
names and empties every value (whatever the name, since a variable's name
says nothing of its value), WithSecrets fills them from this computer's, and
one with keys is sealed under its passphrase. A variable with no value is
not written into an agent (syncEnv), and a value the user set in the agent's
file is still never overridden. Not built: showing the variables a skill
needs on its sheet; nothing in a SKILL.md says them reliably.
Run (mote): go test ./internal/library ./internal/backup ./internal/davsync
ok; gofmt clean; go vet darwin, windows, linux -tags nogui clean.
Broken by hand: WithoutSecrets leaving the value turns TestEnvIsCarried red.
Not tried: real Claude Code / Codex reading the carried key; a real WebDAV
or S3 round trip; the full suite; GUI tests (no GUI file touched).
a5e805f57 added the core string for Model settings while the routing plugin
already had it, so i18n-keys failed "no language has a key twice" and "a
plugin's words are its own". The plugin reads core words, as it does Fast and
Ultrafast.
Run on mica at the rebased head: i18n-keys and i18n-en-no-cjk 8 of 8 from the
repo root (red before: 2 of 8). Chromium and webkit: model-speed, group-*,
routing-group*, routing-save*, routing-js, i18n-*: 775 of 778; the red are
group-editor-selected (#5049, red on a clean main) and i18n-keys' "a plugin's
words are its own" when run with -C internal/gui, where the test's repo root
becomes mica's home and it reads another session's run copies (the same file
passes from the repo root); not a code red.
Not tried: the full GUI suite.
v0.1.3800 (729be88e1) has allFilesForTitles give back the list it keeps
from poll to poll, and other polls read it meanwhile. Titles then
wrote each asked ZCode session's message count and time into that list
in place (zcodeTitleStamps): a data race with any poll reading it, and
the kept list no longer matched the rows, so it was made again on the
next pass. The stamps now go in a copy made at the first one that
changes a file; a poll with nothing to stamp copies nothing.
Audited the other users of allFiles/allFilesForTitles and the
in-place writes in internal/sessions (&files[i], .w(), sort.Slice):
the rest write into lists of their own (byKey copies, traceLineFiles
concatenates, callSources goes through distinctOf).
Run (mica): go test -count=1 -timeout 45m ./internal/sessions/ ok;
go test -race -count=3 -run 'TestZCode|TestFilesKept|Titles' ok; vet
ok; gofmt clean. Broken by hand: stamping in place again makes
TestZCodeTitleStampsLeaveKeptListAlone red ("the kept list was
stamped in place: size 1, mod 1790496500000").
Not run: the full ./... and GUI suites (one package touched).
/docs/zoo-code says how magpie wires VS Code's Zoo Code (a fork of Roo
Code): its profiles sit in VS Code's secret storage, so magpie writes
globalStorage/zoocodeorganization.zoo-code/settings/magpie-import.json
(one OpenAI Compatible profile "magpie" at the gateway's /v1, the
model's window, output and images in openAiCustomModelInfo) and points
zoo-code.autoImportSettingsPath at it in every VS Code profile's
settings.json, a value of the user's own kept aside; the import on each
start, so Reload Window after a pick and back on magpie's profile each
start while connected; ZooCode/<version> usage; why Zoo Code for
JetBrains isn't wired; and Disconnect leaving the imported profile in
Zoo Code. Each claim is from internal/agent/zoocode.go. 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 site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
115 pass, 0 fail.
Not tried: Zoo Code itself with magpie for this page; it names only what
magpie's source says.
Every 15 s poll made the whole deduped file list again (~1.5 MB on a
real history, distinctOf's 58 MB over 40 polls). allFiles and
allFilesForTitles now compare each pass with the last list, held
weakly so a magpie with the page shut keeps none of it, and give the
same array back while nothing differs. A changed or gone file makes a
new list; the old one is never written into (cap == len). An empty
pass is an empty slice, never nil: refresh reads nil as "not listed"
and kept the parses of deleted files (TestGoneAgentLeavesNoSession
went red on the first try, caught before commit).
Run (mica): go test -count=1 -timeout 45m ./internal/sessions/
./internal/dirent/ ok; go vet of both ok; gofmt clean.
Broken by hand: the nil return makes TestFilesKeptWhileTheSame ("an
empty pass: nil") and TestGoneAgentLeavesNoSession ("5 parses kept")
red; a fresh slice on every pass makes TestFilesKeptWhileTheSame red.
Real account on mote, 40 unchanged /api/sessions polls, alloc_space:
179.5 MB (v0.1.3794 build) -> 147.9 MB; distinctOf gone, the kept
list's own compare 12 MB. /api/sessions body sha identical on both.
Not run: the full ./... suite (mote over its cores; this touches the
sessions package only) and the GUI suite.
The previous commit read len(magpieModels(...)) in dshThrough; the guard test
that lists readers of the shared catalog went red. Run (mica): go test -tags
nogui ./internal/agent: ok (202s); ./internal/library: ok (139s); go vet
darwin, GOOS=linux -tags nogui, GOOS=windows on agent and library: clean;
GUI library-bili, library-all, i18n-keys, i18n-en-no-cjk and site node --test:
exit 0 at the commit before.
VantH_off asked for DeepSeek Harness in billion-context's support.
Library's billion-context tab offered Pi, omp, OpenCode, Claude Code, Hermes
and Zed. bili's dsh route is `dsh plugin add billion-context` (billion-context
0.1.213 README), which loads in dsh's process and takes traffic by proxy
settings; magpie's dsh route is baseURL http://127.0.0.1:3425/v1, plain http
on loopback, so that never sees it and the plugin would add tools and fold
nothing (the Hermes case, 00e8242e8). dsh's route baseURL is editable, so it
takes the route Zed and Hermes take, bili's documented /bili/ prefix.
Turned on, magpie runs `bili start --port 8787` and writes magpie's route
baseURL in every dsh profile and the home layer as
http://127.0.0.1:8787/bili/<gateway>/v1 (Anthropic route: no /v1)
(agent.DshThrough: dshSyncFresh with the prefixed gateway). dshReach reads the
prefix back from the profiles' routes (loopback path before the gateway's
address) and Check, Sync, a pick and the serving round (dshWiredWith, which
read gateway.URL() directly) keep it; an address that isn't a local proxy's
goes back to the gateway. Off writes the gateway back. Empty-list string (en,
zh, zh-TW, ja, de), docs (en, zh, ja), llms-full.txt and
docs/subsystems/library.md name dsh. bili's dsh plugin installer is never run
for it. The remaining agents are #5915.
Run (mica, at the pushed head unless said):
- TestDshThroughBili, TestBiliDshThroughPrefix: ok
- see below for the packages and GUI files
Broken by hand:
- dshReach returning gw: TestDshThroughBili red (a sync drops the prefix)
- no "dsh" URL lane: TestBiliDshThroughPrefix red (dsh not offered)
Not tried:
- a real dsh and a real `bili start`; tests fake bili and the probe, so
whether dsh's SDK sends to the prefixed address is by analogy with Hermes
- Windows run (vet only)
TestNoEagerPackageRegexps (root package) was red on main: fc615339f
added aliWindowField in internal/provider/alibaba_usage.go and
e174b5515 added envName in internal/library/env.go, both with
regexp.MustCompile at package level. Both now use lazyre.New; each has
one call site (FindStringSubmatch, MatchString), which lazyre has.
Run (WSL magpie-desktop, origin/main 2bb201162 + this):
- red first, unchanged main: TestNoEagerPackageRegexps named
env.go:57:15 and alibaba_usage.go:374:22.
- after: gofmt -l clean; go vet -tags nogui ./internal/provider
./internal/library ok; -run TestNoEagerPackageRegexps . ok;
./internal/library ok; -run 'Ali|Alibaba' ./internal/provider ok.
A call got the conversation it answers only in park(), after the whole
reply ended. Claude Code's AgentSummary that arrived while the reply
still streamed (a call shown, park not yet run) found no line with that
conversation, so branch() said "no run waits on a reply to this
conversation" and a new Claude Code was told the whole transcript
(108K cache tokens written). emit now registers a call's line with the
run's conversation when the call is shown; park and noteLines keep it.
Run (mica, load on mote): TestClaudeBranchForSummaryWhileTheReplyStreams
(attach, KStart, KToolStart, no park, then the summary) is red on the old
code ("no run waits on a reply to this conversation") and green now.
go test -run 'Claude|Branch|Fork|Park|Subscription' ./internal/gateway ok;
gofmt clean; go vet darwin, windows, linux nogui ok.
Broken by hand: the fix reverted, the new test goes red.
Not tried: a real AgentSummary on a live TUI run; the full suite is
started after the tag.
Claude Code's AgentSummary and its auto mode classifier name themselves
nowhere in the request, so there is no client marker to read. The gateway
tells them by their content (inferredKind: a claude-cli/ request on the
Messages API; the classifier by autoModeClassifierAsk, the summary by its
last user text "Describe your ... in 3-5 words") and records them as
agent_summary_inferred and auto_mode_check_inferred. The purpose catalog
names them "Progress summary (inferred)" and "Auto mode check (inferred)"
and puts each with its plain kind's purpose, so the existing Purpose filter
lists both; nothing known and nothing inferred share a name. A tool that
printed the same words, a chat, and another agent's request stay unmarked.
A requests page now also holds BigWrite, the gateway-served row that wrote
the most to the cache (cells, page-v1.json and pageFromLedger all carry it;
rows from session files have no request to open). The Requests line shows
it as "109K largest write", a button that opens that request through
openUsageRoute. settledCountVersion is raised to 3, which keys the cached
pages.
Not done: the per-request branch recovery result asked for in #6199. No
structured field holds it.
Run on mote (load 21-24 of 18 cores, mica was higher): go test ./internal/usage
./internal/usageapi, the gateway and gui purpose tests, go vet for darwin,
linux (nogui) and windows, gofmt; the GUI files usage-big-write (new),
purpose-filter, routing-kind, i18n-keys and usage-ledger in chromium and
webkit. Broken by hand: inferredKind returning "" turns
TestClaudeHelperRequestsAreLabelled red; the larger-than test of BigWrite.add
turned round turns TestRequestPageBigWrite red on both paths; the jump off
turns usage-big-write red. Not tried: a real Claude Code session against a
live subscription, Linux WebKitGTK.
An environment variable is kept once in the Library and written into each
agent picked: Claude Code's settings.json "env", Codex's config.toml
[shell_environment_policy.set] (a sub-table or inline set is edited; a
dotted spelling is refused). It follows Hooks: Applied.Env records what
magpie wrote, so turning it off or removing it takes out only that, and a
value the user set or changed in the file is never overridden (a conflict
is a problem on the row). An unreadable file is an error, nothing is
written. The tab has name, value and agent chips, an edit sheet and a
row Remove with a confirm; its sidebar entry is in "Every agent". Not
carried in backups, as hooks first were. docs/subsystems/library.md updated.
Run (mica, sandbox HOME): internal/library and internal/gui go tests ok;
gofmt clean; go vet darwin, linux -tags nogui, windows clean; GUI
library-*, i18n-* in chromium and webkit (en, zh, zh-TW, ja, de, 440px):
all green except "the Library while it loads", red on the merge base too
(not from this change). Existing tab-list assertions in library-hooks,
-subagents, -groups, -loading now include Variables.
Broken by hand: syncEnv overwriting the user's value turns
TestEnvNeverOverridesTheUsers red.
Not tried: real Claude Code / Codex reading the written env; other agents
(Gemini .env, Qwen, Droid); WSL; env in backup carry.
/docs/qwenpaw says how magpie wires QwenPaw (formerly CoPaw): the
working folder (QWENPAW_WORKING_DIR, a legacy ~/.copaw, ~/.qwenpaw) and
secret folder (QWENPAW_SECRET_DIR, <working>.secret); the
providers/custom/magpie.json provider (OpenAIChatModel at the gateway's
/v1, each model in extra_models, 0600) and the agent's active_model and
thinking_level in agent.json; the plain key QwenPaw encrypts at its next
start; the one restart after connecting ("Provider 'magpie' not found"
until then) and a new pick used from the next message; qwenpaw and
qwenpaw#<id> rows; ACP backends refused; fallback and subagent models
left alone; switching back, and custom/magpie.json removed only once no
agent names it. Each claim is from internal/agent/qwenpaw.go. Linked
from each language's AstrBot 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 site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
115 pass, 0 fail.
Not tried: QwenPaw itself with magpie for this page; it names only what
magpie's source says.
kdajenks (magpie 0.1.3739, Codex on ChatGPT Pro) could set Fast only from a
routing group's member row and had no Ultrafast there, and no way to set the
speed in the model's own settings. Ultrafast exists: Codex's catalog lists
the `ultrafast` service tier, the code already sent it for agent picks and
Codex's service-tier row, and the live account's service_tiers hold it.
- Group member: the button steps Standard speed, Fast, Ultrafast (where an
account offers it, `ultraOK`), back to Standard. `Group.Ultra` is a subset of
`Fast`, kept through rename, fold, share, gone-filter and the CLI
(`magpie group ... ultra=`). The gateway marks the candidate `ultra`.
- Per model: `settings.ModelTiers` ("<provider>/<model>" to priority or
ultrafast), `provider.SetModelTier` (refused where CanFast/CanUltra say no),
`ModelPref.Tier` in Model settings (Standard speed / Fast / Ultrafast, in
modellimits.js), and `magpie model tier <provider/model> [fast|ultrafast|usual]`.
The gateway sends it on a direct pick for an agent with no fast pick of its
own, through fastPick, so an account without Ultrafast gets priority. A group
member goes as the group says.
- Docs: gateway-routing, providers-accounts, reference.
Run (mica, at the rebased head over a6d84e13a):
- gofmt -l clean; go vet darwin, linux nogui, windows clean.
- go test internal/provider, internal/settings ok; internal/gui and
internal/cli ran: the one red of mine (TestSettingsSaveKeepsWhatItDoesNotSend
wanting ModelTiers) is fixed in this commit; the others are not mine and
red on a clean origin/main: TestEveryRouteHasACommandOrIsNamed (#6202),
TestPanelHiddenByWailsMarksPageOutOfSight (#6203, not checked on main).
- internal/gateway ok (984s).
- GUI, chromium and webkit: new model-speed.test.cjs (30, five languages, 1200
and 420px), plus model-*, group-*, fast-*, i18n-*, text-size,
codex-service-tier, panel-*, routing-group*, routing-save* files. Red and not
mine, same on a clean origin/main worktree: fast-pick and fast-ultra (#6201),
group-editor-selected (#5049).
- New tests TestModelTierSentToEveryAgent, TestGroupMemberUltrafast,
TestCleanModelTier, TestSaveGroupUltra.
Broken by hand: removing the gateway's model-tier branch and the candidate
`ultra` copies turned both gateway tests red; turning off the Ultrafast choice
in Model settings turned 20 of 30 GUI tests red; reverting the member button to
two states turned 10 of 30 red.
Not tried: a real ChatGPT account sending Ultrafast through the new setting;
the agent picker's bolt does not show a model-level default; Windows and Linux
GUI runs.
Every 15 s Sessions poll listed every Codex day folder and Claude Code
project again (~18k files in a few hundred folders on a real history),
and those getattrlistbulk calls were ~63% of the poll's CPU while
nothing had changed. dirent now keeps an FSEvents watch on the Codex
and Claude Code homes, and Stats of a folder under one gives its last
listing back unless the system said something in it changed since.
What makes the word trustworthy:
- FSEvents is a moment late, so each Watch (once per read) writes in a
new folder of its own under the watch and waits for that write to be
heard; events come in order, so every earlier change is heard by
then. An earlier write's late word can't end a later wait: each wait
has its own folder (an earlier version shared one, and the test went
red 4 of 30 at load 73 on mica).
- A write to a file held open is heard only when it closes, and Codex
holds its rollout open. So a folder with a file written in the last
15 min is listed every time, a change in a home's own folder
(history.jsonl, at each prompt) relists everything under it, and no
listing is trusted past 2 min.
- Dropped events, a moved root, a mount, a wait over 1 s, another
volume, or no Watch in the last 2 s: the folder is listed.
Linux and Windows have no watcher, so they list as before.
Run:
- mica: go test -count=30 of the dirent watch tests at load 73, green;
with the shared probe folder put back by hand, 4 of 30 red.
- mica: go test -count=1 -timeout 45m ./internal/dirent ./internal/sessions
./internal/gui, ok (sessions 253s, gui 159s), one change before the
per-wait probe folder; dirent and the real-account checks after it.
- go vet: darwin, GOOS=linux -tags nogui, GOOS=windows, CGO_ENABLED=0.
- mote, real Codex + Claude Code account (sandbox HOME copy), 40
unchanged /api/sessions polls: 3.54 s CPU sampled on the base
binary, 2.28 s with this; getattrlistbulk gone from the top.
What is left is GC and os.Stat in claudeFiles.
- Same account: an event with a new timestamp appended to the newest
rollout changes the sessions tag on the next poll, as on the base.
Not tried: Linux and Windows (no change there); a rollout held open by
a real running Codex for more than 15 min without a prompt.