c51b0ca9fab9f1afc86d3098dfd1202ebbe673b3
8187
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
c51b0ca9fa |
sessions: the Antigravity app connected to WSL has its usage read from the distro (@guyng35955 on X)
@guyng35955 on X: on Windows, with the Antigravity app connected to a
WSL Ubuntu, magpie showed no Antigravity usage.
Why. Antigravity 2.x (dist/wsl.js and languageServer.js in its
app.asar) runs a Linux language server in the distro when it is
connected to WSL ($HOME/.antigravity-server/bin/<version>/
language_server, started through wsl.exe with --app_data_dir
antigravity), so the conversations go to the distro's
~/.gemini/antigravity, not %USERPROFILE%\.gemini\antigravity. magpie
read Antigravity's conversations only from this computer's folder:
- sessions.wslAgents had no antigravity (nor agy, whose
~/.gemini/antigravity-cli in a distro wasn't read either);
- internal/agent kept a distro for the Sessions page only when one of
wslKinds or the Copilot CLI's folder was there, so a distro with only
the app's data never reached sessions.WSLHomes;
- and, found on the Windows box: no SQLite database under
\\wsl.localhost opens in place. Every form (file: URI, plain path,
mode=ro, provider.OpenReadOnly) answers SQLITE_BUSY after its 3s
busy_timeout, since the share doesn't take the locks a WAL database
needs. So listing the files alone would have shown nothing still.
What changed.
- agent: wslKept keeps a distro with ~/.gemini/antigravity(-insiders),
and the probe looks for them (no agent row for them).
- sessions: wslAgents reads the app's conversations (insiders under
their own key) and agy's in a distro; their summary rows name the
distro's folders as Linux does (agyFolder with goos "linux", so
/home/me/site, not a Windows path). The distro's calls count in
Calls (wslFiles("antigravity"), wslCallFiles("agy")). The listing
kept on disk (sessions-wsl.json) carries each file's row, rev and
read-only, so a stopped distro keeps its titles and folders. A
distro's ~/.gemini that is this computer's own (a link) is read once,
as this computer's (sameDir).
- sessions: openAppStore opens agy's and the app's databases read only
in place, or, under \\wsl.localhost or \\wsl$, as OpenUntouched does
(immutable with no -wal, else from a copy of the db and its -wal).
- docs/subsystems/agent-wiring.md says which distros are kept for reads
only.
Not changed: session-read consent ("allow selected" names agents found
on this computer) doesn't look in WSL, as before for every WSL agent.
OpenCode's and ZCode's SQLite readers aren't used for a distro (not in
wslAgents), so they keep provider.OpenReadOnly.
Run (at the tree rebased on dc85a7ca5; then rebased on
|
||
|
|
c8290df259 |
provider: Devin's Adaptive and Fusion picks are no longer served
The live gateway's /v1/models listed devin/Adaptive and devin/adaptive, and Devin answered both with 502 "no API providers are available". They came from magpie, not the plugin: the plugin's list (and its cached copy in plugin-providers.json) has neither, since parseFamilies and parseConfigFamilies skip Adaptive and Fusion. The owner's providers.json keeps "Adaptive" and "adaptive" in the devin entry's picks (models), saved when the built-in still listed Devin's router families, before |
||
|
|
74c94b5db0 |
gui: a picked accent tints the theme's grounds (CHENGJIAHEGOXIS on X)
CHENGJIAHEGOXIS asked, on 0.1.4112 and again on 0.1.4116 ("依然没变,是不是
出bug了"), for the dark theme to follow the colour they picked. v0.1.4114
(
|
||
|
|
e36541ddf2 |
site: llms-full.txt names AIGoCode with the other preset relays
|
||
|
|
dc85a7ca59 |
providers: AIGoCode is a preset that takes a key (MindfulReturn on X)
MindfulReturn on X asked why magpie's plugins have no AIGoCode sign-in
and whether they have to add the provider by hand. AIGoCode has no
sign-in to plug in: it hands out API keys, each bound to one group. So
the answer is a preset, like 鱼鱼连线's, not a plugin: Add provider ›
AIGoCode asks only for the key.
From AIGoCode's own docs (www.aigocode.net/docs/api, openai-compatible,
anthropic-compatible, responses): one root, https://api.aigocode.dev,
with Chat Completions and Responses at /v1 and Messages at the root.
It runs on sub2api ("Model ... is not available for this group",
API_KEY_REQUIRED from /v1/models and /v1/usage, /api/v1/settings/public
answers), so a key's balance is read at sub2api's /v1/usage by the
relay probe already there; no BalanceURL is needed. A key spends its
plan (Pro/Max/Ultra) and then its balance, so its billing is unsaid,
like MiniMax's Coding Plan keys. Website is the invite AIGoCode
sponsors magpie with (site/sponsors.js has the same one); it is not
badged Sponsored, as 鱼鱼连线 isn't. Keys page: /dashboard/keys.
- presets.go: the aigocode preset (KindRelay, icon aigocode).
- billing.go: aigocode in unsaidPresets.
- icons/aigocode.png and pngIcons: AIGoCode's own logo
(www.aigocode.net/images/algocode-logo.png), trimmed to 124 in 128.
- core_budget_test.go: +12 for the name in pngIcons; main was at the
budget to the byte, and the list is read wherever an icon draws.
- site docs (en, zh, ja): import's preset ids and relay's preset list.
Not wired: AIGoCode's Gemini-native endpoint (PresetDef has no Gemini
field). A key serves only its group's models, so a third-party
("可外接") group such as Claude API(AWS) or ChatGPT API(Azure) is
the one to use. If AIGoCode later takes the in-app seat, its partner
entry needs an id other than aigocode (checkPartner).
Tests: TestAIGoCodePresetTakesAKey: kind, key, endpoints as documented,
keys page, balance probed at api.aigocode.dev, billing unsaid. Broken
by hand: without aigocode in unsaidPresets it is red (billing "payg").
Run on mote (mica and mote both over their cores, so no full suite;
CI runs it), at origin/main
|
||
|
|
b005d1a473 |
update: a fresh install of Stable's version stays on Stable (fishmagic80 on X)
The site now offers Stable's downloads, but the app's Update channel is Every version until changed, so a Stable install was offered the newest at its first check. Before that check, a fresh install (no version run before and magpie's folder new, from whatsNew.start) asks the feed for Stable's version and the newest; when it is Stable's and a newer one is out, settings take "updateChannel": "stable" (settings.TakeStable, under the file lock, keeping a channel already set). A feed that can't be read is unknown and asked again at the next check. A version that is both Stable's and the newest stays on Every version: its download can't be told apart. update.LatestStable never falls back to GitHub. docs/reference.md and the privacy pages (en, zh, ja, llms-full.txt) say a fresh install asks ?channel=stable once. Old installs: nothing changes for them. Until a release with this becomes Stable, a Stable download (0.1.3078 today) is still offered the newest unless Settings → Update channel is set to Stable. Run at 936c70756, on mote: gofmt -l internal/ clean; go vet (darwin), GOOS=linux and GOOS=windows go vet of internal/gui, update, settings ok; go test -count=1 ./internal/update ./internal/settings ./internal/gui ok (gui 99.9s). TestFreshStableInstallStaysOnStable goes red (2 subtests) with the takeStable call removed (broken by hand, on mica). llms-full.txt regenerated and current. Not run: the full go test ./... (mote and mica each had several suites queued on the lock); not tried with a real Stable install. |
||
|
|
60ad579979 |
site: show Stable's version and offer its downloads (fishmagic80 on X)
fishmagic80 asked on X for the site to show the Stable channel's version
and download it directly. The home page now asks /api/latest and
/api/latest?channel=stable together. When Stable is known and isn't the
newest, the hero's version line adds "· Stable <v>", and a quiet
two-button control over the platform cards switches every download link
between the newest (/download/<platform>) and Stable
(/download/stable/<platform>). #stable opens the page on Stable. While
Stable is unknown, or is the newest, the page is as before.
The worker serves /download/stable/<platform or file> from Stable's
release (the same stableOf ledger as ?channel=stable) and answers 503,
not the newest, while Stable is unknown. The download event's link
property gets a "stable/" prefix; no new property is sent.
Words in en, zh, ja, de, matching the app's (稳定版, 安定版, Stabil).
Run at 936c70756 (rebased on origin/main
|
||
|
|
24effac0ec |
gui: the tray keeps the words it asked for, not a language's whole table
The tray tooltip says each usage window's name and unit the way the Usage page does, from i18n.js's table. pageWords kept the language's whole parsed table for good: ~2 MB of an idle tray magpie's live heap (pprof inuse_space, real-account tray run on mote), for the dozen words a card asks for. Now pageWord keeps only the words asked for (capped at 512). A new word parses the table once, and the table is kept a minute for the other new words of the same card, then let go on the next ask. A word asked before is answered without parsing again. |
||
|
|
7b002b6be8 |
library: an MCP command's %USERPROFILE%, $USERPROFILE and ~\ are the home on every system (0xBCD18E on X)
0xBCD18E's Library server ran
"%USERPROFILE%\AppData\Local\Programs\Pinky\pinky.exe", and the check
said it couldn't find "%USERPROFILE%\A…": magpie read $NAME, ${NAME}
and ~ in a command but not cmd.exe's %NAME%, so the only way to share
one server across computers with different user names was a per-device
command.
Now HOME and USERPROFILE are both the home, on every system, as $NAME,
${NAME} or %NAME% (either case), and a leading ~ or ~\ too:
- library.json (and so sync and backups) keeps them as written;
- an agent that reads references in a command (Claude Code, CodeBuddy,
WorkBuddy, Grok, Gemini, omp/Qoder/AtomCode, OpenCode, Cursor) is
given the home's own variable where it runs: ${USERPROFILE} on
Windows, where an agent seldom has HOME, ${HOME} on a Mac, Linux and
in WSL, where nothing has USERPROFILE. Before this, $HOME went to
Claude Code on Windows as ${HOME}, which it usually hasn't;
- every other agent (Codex, Kiro, Droid, Copilot, Crush, Goose, Pi, ...)
and magpie's own start (the check, the router, Codex through the
gateway) get the home's path;
- any other %NAME% (%APPDATA%) is a variable on Windows only, and is
left as written elsewhere, so 100% or %Y% in an arg stays as it is;
- a command's environment: a leading ~ and %USERPROFILE% / %HOME% in a
value are put in as the home for every agent and for magpie's start
(homeEnv); ${NAME} there stays envref's.
No cwd: a Library server has none.
Tests: TestCmdVarsUserProfile forces cmdOS to windows, darwin and linux
for Codex, Claude, Cursor, OpenCode and Claude in WSL, command, args
and env; TestCmdVarsUserProfileLaunch starts a real server by
%USERPROFILE%<sep>prog, %HOME%/prog and $USERPROFILE/prog.
TestCmdVarsPerAgent pins the Unix variable; TestCmdVarsSync expects
${USERPROFILE} in .claude.json on Windows.
Run: the red was checked on origin/main e0889719c's cmdvars.go,
mcp_check.go and mcp_run.go with these tests: all 8 subtests of
TestCmdVarsUserProfile and TestCmdVarsUserProfileLaunch FAIL; with the
change, ok on mote (darwin), on xiaomi-gpu (Windows 11, win-run: the
real check starts the server by %USERPROFILE%\prog, and Claude Code's
.claude.json gets ${USERPROFILE}/bin/x) and in WSL magpie-desktop
(wsl-run). Full suite at b84b6dc3c (this change on
|
||
|
|
8df4239a8b |
lessons: 11-14 core budget raised again for one line (c5b40bf89)
Docs only; no code run. |
||
|
|
a4937f8ff9 |
gateway: the effort tests' fake upstream answers only the turns
TestEffortUpdateRefused went red on macOS CI at
|
||
|
|
6d8fcb93a7 |
memdistill: switched off, the background read asks no model
Keep called auto() before Run looked at the switch. auto is
gateway.AutoVision, which ranks every provider's models and loads the
whole models.dev catalog: 3.6 MB of a tray-only magpie's live heap
with real accounts, for a run that read nothing, five minutes after
start and every hour after. Memory reading is off by default.
Keep now reads distill.json first and skips the round when it is off;
a file it can't read goes on to Run as before, which reports it.
Run: go test ./internal/memdistill on mote, ok.
Broken by hand: skipping the check turns TestKeepOffAsksNoModel red
("switched off, it asked for a model"); the test then switches it on
and waits for the ask, so it can't pass on a loop that never runs.
|
||
|
|
6333ee5586 |
filememo: a parse unread for five minutes is let go
filememo kept every parse for the life of the process. What start up reads once, RenameLegacy's look at every agent's config (a 1 MB YAML look, a 600 KB JSON), stayed in a tray-only magpie's live heap: ~2 MB of its 12.8 MB with real accounts. A read sweeps when idleFor (5 minutes) has gone by since the last sweep, dropping the parses not read since. What a poll reads (the tray's every 3 minutes, the window's every 15 seconds) stays; a parse goes 5 to 10 minutes after its last read, and the next read parses it again. Swept on a read, not a timer, since a timer armed inside a test's synctest bubble is the bubble's. Run: go test ./internal/filememo on mote, ok. Broken by hand: never deleting turns TestUnreadParseLetGo red. |
||
|
|
b76016676f |
provider: Gemini's and Antigravity's offered models are kept per stamp, so the tray's usage read lets the catalog go
visibleQuotas built exposedIDs("gemini", "antigravity") on every usage
read, and each build loaded the whole models.dev catalog through
knownElsewhere → catalog.ListedBy. The tray reads usage every few
minutes, so a tray-only magpie with real accounts kept 5.6 MB of
catalog (of a 12.8 MB live heap) that loadIdle never got to drop.
keptExposedIDs keeps the answer while provider.StampNow is the same
(no provider, account, setting, plugin or catalog change) and for 30
minutes at most, for what a stamp can't see.
Run: go test -run 'ExposedIDs|Quota' ./internal/provider on mote, ok.
Broken by hand: always building turns TestKeptExposedIDsBuiltOncePerChange
red ("built 5 more times while nothing changed").
|
||
|
|
90932ed1fa |
gateway: Claude Code's model discovery is shown every model by an id it keeps
Claude Code's Gateway Model Discovery (CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY)
puts in /model only the ids matching /(claude|anthropic)/i: Tvi in the
2.1.316 bundle, te.data.data.filter((se)=>/(claude|anthropic)/i.test(se.id)),
on GET <ANTHROPIC_BASE_URL>/v1/models?limit=1000 with User-Agent
claude-code/<version> (Xs(), not claude-cli/) and anthropic-version:
2023-06-01. A remote magpie's Kimi, GLM and DeepSeek never showed (zent00
on X, tweet 2121440002244747428).
That request alone (claudeCodeDiscovers: the User-Agent and the header,
never another magpie) is now shown a chat model whose id says neither by
Claude Desktop's alias anthropic/magpie-<n> (aliasFor), which unprefixed
already serves as the model for every client, before any provider's
model of that spelling; no Claude id is spelled so. Its display_name is
the agents' list name, which /model shows. Ids Claude Code keeps, names a
gateway key gives models, and every other client's list are unchanged; a
bare-id row it wouldn't keep is left out (its full id's row is there).
"anthropic/<magpie id>" was not used: a provider named anthropic (the
Anthropic preset's id) serves any model asked by that spelling. Zero
config, so no switch.
Run:
- TestClaudeCodeDiscoveryKeepsEveryModel, on mote: red on the old
gateway.go ("not shown anthropic/magpie-9301644634 for auto/kimi-k3"),
green with the change; with the anthropic-version check broken by hand
it fails on the claude-cli/ client. TestCindyDiscovery and the Desktop
tests green.
- Real Claude Code 2.1.316 binary on mote, sandbox HOME, against the
gateway with a fake Anthropic upstream: its cache gateway-models.json
held {"id":"anthropic/magpie-4484984192","display_name":"DeepSeek V4 ·
DeepSeek"}; `claude -p --model anthropic/magpie-4484984192` answered
PONG and the upstream was asked model deepseek-v4. Claude Code warns it
assumes a 200k window for an id it doesn't know, as for any non-Claude
id.
- gofmt -l: clean. Package vets/builds and go test ./internal/gateway
started on mote; the full suite (go vet, GOOS=linux/windows vet,
builds, go test -tags nogui -timeout 45m ./...) is queued under
mote's suite.lock and runs after the push, per the ship-at-once rule;
its reds get their own commits.
Not tried: interactive /model screen (the rows come from that cache
file), a real remote magpie over LAN with a gateway key.
|
||
|
|
c5b40bf898 |
claude-desktop: after Use Claude Magpie the lit row is Claude Magpie, and its Code tab's row says it is on magpie (xMopf7RF on X)
xMopf7RF on X, 0.1.4111: clicking Use Claude Magpie seemed to connect their own Claude Desktop, and left "Claude Code · Claude Magpie" saying "Not connected · uses its own settings" with its switch off. The wiring was right: with the Separate app on, connecting claude-desktop writes only Claude-Magpie-3p's config (desktopSets), and the user's own Desktop is left alone. The page said otherwise twice: - the row that turned on was still named Claude Desktop. While the Separate app is on, state() now names the claude-desktop row Claude Magpie (desktopiso.Name), since that is the only config it wires. - the claude#magpie-desktop row is not wired itself, and need not be: Desktop's Code tab runs Claude Code with CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST, so its requests go through Claude Magpie whatever that folder's settings.json says. While Claude Magpie is on magpie, the row carries twinCode (agent.DesktopTwinCode) and its line, lit, says "On magpie through Claude Magpie" (en, zh, zh-TW, ja, de). The core script budget goes up 67 for that one connectLine line, cut to the shortest words that say it; the Agents rows draw it, so there is no page to move it to. docs/subsystems/agent-wiring.md says both. Tests: - TestClaudeMagpieCodeTabRowIsOnThroughIt (agent): DesktopTwinCode only for claude#magpie-desktop, only while Claude Magpie is on magpie. - TestClaudeMagpieRowsAfterUseClaudeMagpie (gui): sandbox HOME, POST connect after turning the Separate app on: the wired row is named Claude Magpie, the Code tab row has twinCode, the user's own Desktop config is unchanged and no Claude-3p folder is made. - desktop-twin-code.test.cjs: clicks Use Claude Magpie; no lit row is named Claude Desktop, the Code tab row's line is lit and fits, the click doesn't scroll; en/zh/zh-TW/ja/de, 1100 and 640 wide, Chromium and WebKit. Run (mica; mote's load was over its cores), at |
||
|
|
b325718f0a |
antigravity: turned-away lines go reworded, not broken up; Antigravity min 0.1.12 (#1118)
Since 11-14 Google's check reads past invisible characters. A system prompt with Claude Code's billing line and Agent SDK line, broken up with two U+200B in every word as the cloak sent them, was turned away 5 of 5 with the bare 429 "Resource has been exhausted". Claude Desktop's Code tab through magpie to Antigravity failed every turn (hc295971796 on X, tweet 2121429628019781849), and on v0.1.4110 with the Antigravity Cloak plugin Antigravity hit 429 very often (daoche_wuzui, tweet 2121432333769433178). The built-in cloak (codeassist.go) now rewords each line Google turns away, in plain words: - the x-anthropic-billing-header line is left out to its line's end; a system part or message holding only it is dropped; - "built on Anthropic's Claude Agent SDK" -> "built on the Claude Agent SDK by Anthropic"; - Codex's "based on GPT-5" -> "built on GPT-5"; - Hermes' "created by Nous Research" -> "built by Nous Research"; - omp's RFC "keywords" -> "key words". A copy an older magpie or middleware broke up (U+200B, U+2060, soft hyphen, inside or between words) is matched and reworded as the line. The Code tab's main line passes as written and is kept. The plugins repo's packages carry the same rewording (plugins 5bb41941: opencode-antigravity-auth 0.1.12, opencode-agy-cli-auth 0.1.41, middleware-antigravity-cloak 0.1.7 on the dist branch). The Antigravity mover's min goes to 0.1.12, the version dist has (these packages are not on npm); the cloak middleware is Official and updates itself. Run: - real Antigravity account, sandbox HOME, gemini-3.8-flash, 10 sequential requests each through the new plugin: Code tab main prompt as Claude Desktop sends it 10/10 200, Agent SDK subagent line 10/10, an old two-U+200B copy 10/10, Codex GPT-5 10/10, Hermes' earlier persona 10/10, omp's RFC line 10/10. The zero-width break went 0/5. - mote-run: gofmt -l; go vet, GOOS=linux go vet -tags nogui and GOOS=windows go vet of internal/gateway, provider, cli; go test -count=1 -timeout 45m ./internal/gateway/ ./internal/provider/ ./internal/cli/ ./internal/middleware/: all ok (gateway 926s); vet clean, gofmt clean. Broken by hand: codeassist.go from origin/main with these tests: 6 fail (TestAntigravityCloakClaudeCode2316, ...RewordsEveryLineItTurnsAway, ...AnswersHermesAndCodexByDefault, TestOnlyAntigravityIsSentThePrompt Reworded, ...LineWrappedOrWidened, ...TurnsCodexsGPT5ThreadAwayOnce). Not tried: models other than gemini-3.8-flash; the whole go test ./... (only the four packages this touches); Claude Desktop itself (its Code tab's system prompt was captured and replayed instead). |
||
|
|
71a806749d |
sessions: a paginated Codex rollout moves to a longer provider id by its row (@xMopf7RF on X)
@xMopf7RF on X (tweet 2121441393424113800): the Sessions page's Move refused an old Codex session with "rollout-2026-03-09T09-25-….jsonl.zst keeps its history by byte, and "magpie" is longer than the provider it names: Codex couldn't open it moved", and offered nothing else. Since |
||
|
|
a83fe23252 |
gui: a picked accent tints the chosen thumb too (CHENGJIAHEGOXIS on X)
「强调色是按照颜色走的,但是主题深色依然还是灰色」 and 「就是我截图的原来的 灰色,还是没变化」: after |
||
|
|
e0889719c8 |
gateway: a Responses WebSocket turn streams without the HTTP stream field (#5291)
OpenAI's WebSocket mode doesn't use the HTTP stream field: a
response.create leaves it out and is streamed all the same. magpie made
each frame into the HTTP body its route would have had and kept the
field as the frame said it, so a client that left it out (M4n5ter on X,
AnacondaKC's Niko in #5291) got the provider's reply unstreamed and
every frame of it at the end. Codex sends stream:true itself, so it
never showed there.
turn now sets stream:true on every generating turn, whatever the frame
says (left out or false). It is the one place the three socket routes
(/v1/responses, /responses and Codex's backend route) make their body,
so all three are covered; a warmup (generate false) still answers
locally before it, and HTTP POSTs are unchanged.
Ported from AnacondaKC's patch in #5291 (62e3fd1ad), with these
differences: the test runs on /v1/responses and /responses, with stream
left out and with stream:false, checks the body sent upstream, and
TestCodexSocketStreamsWithoutStreamField covers Codex's route.
Tests: TestResponsesSocketStreamsWithoutStreamField and
TestCodexSocketStreamsWithoutStreamField, both red with responses_ws.go
at origin/main
|
||
|
|
8ed2ae030c |
claudetui: an image goes into the interactive mode on Windows 10 as a long paste, not -p (ok123now on X, #5061)
ok123now (magpie v0.1.3901, Windows 10 LTSC 21H2, Claude Code 2.1.316,
Claude Desktop): text worked, one 64x64 PNG was a 502 every try, and the
client asked again without end.
Cause: the helper pastes an image as its file's path in bracketed-paste
marks. Windows 10's conhost (10.0.19041) drops the marks on the way in
(the reporter's lead; #5061 and #5205 measured it on 19044 and 19045),
so Claude Code got the path as typed words, the helper waited out
pasteWait and exited 1, and the gateway answered 502.
Fix:
- claudetui: Claude Code reads its console as VT input (mode 0x208, read
from a real claude.exe 2.1.316) and takes one read of over 800
characters as a paste with or without the marks ($X=800 in 2.1.316,
q6=800 in 2.1.281), a path with spaces after it as the image alone. On
Windows the path is sent padded with spaces to 900 characters, no
marks: over 800, and under the 1024-byte blocks the same conhost loses
of a longer write (#5205). Elsewhere it stays bracketed.
- If the interactive mode still doesn't take a message (an image, or a
block it can't paste), the helper ends the turn with an error result
beginning claudetui.Unpastable instead of exiting, the gateway asks it
once as claude -p with the image itself, and remembers that for 12
hours. A redo that can't run is a 400, not a 502, so no client loops.
- The reporter asked to keep images interactive: -p counts at about
twice the plan quota and has none of the interactive run's cache. The
-p reason (Routing chip, all four locales, and the log line) says so.
Run, at this head (rebased on
|
||
|
|
925bc7188b |
usage: the Requests card's up arrow opens what the bytes sent upstream were made of
theforeveriris (X, 2121408745616162998) saw 8169 requests send 8.6 GB up and 1.0 GB down and wanted to know why. About 1 MB a request is normal: every request sends the whole conversation again, with the system prompt and the tools' definitions. This shows it. Gateway: promptOf, which already parses the body off the request path, now also counts the bytes of the system prompt, the tool definitions and images in the body it read. upParts scales those to the wire bytes and puts them on Record.UpParts. Nothing new runs on the request path, and a body that isn't parsed stays "Not measured". Usage: a packed row keeps the mix in 255ths under flag rowUpParts (32768); the row stays 152 bytes. Totals gain up_calls, up_measured, up_system, up_tools and up_images, and Shares carry up_bytes and up_calls by agent and by model. settledCountVersion goes 4 -> 5, so settled days are counted again once on the next start. GUI (Usage -> Requests): the "↑ 8.6 GB" on the Requests card is a button that opens a "Sent upstream" card: the average per request, one sentence on why, a bar and legend for Conversation / Tool definitions / System prompt / Images / Not measured, and the top 8 agents and models with bytes sent and per request. The open state is kept; × closes it. A request's details get a "Made of" line. zh, zh-TW, ja, de strings. Entrance is 200ms ease-out, no movement under reduced motion. Run (mote, at this head on |
||
|
|
27e43ed26c |
LESSONS: 11-14, a budget guard left out before a push, a red fixed twice, a clock read twice
From the loop review of |
||
|
|
d6cb404754 |
gateway: the live reasoning fixture allows the time its first event really took
TestLiveVisibleReasoningFixture set start to now minus the event's at_ms and then called see, which reads the clock again. Any time between the two lands in the measured start, so on macOS CI (run 43530452364, |
||
|
|
14f0046e7d |
agent: Pi's offered thinking levels are kept per stamp, as the model lists are
v0.1.4108 kept the drift poll's "is this value magpie's" answers. After it, real accounts on mote (acgui6, w75, the window open) showed the poll's cost had moved into Pi's Values: piOffered on every Drift, every 15s. Each call walked the agent's model list and built the model's whole models.json entry, which reads settings again under GroupHasNative. That was 23 MB of the window's three minutes. piOffered is now kept per agent and model in a stampedLists, as sharedModels is: built again when provider.StampNow moves, or a minute after it was. Its callers (Pi-like Values, their effort options, Aside) only read it. Run: TestPiOfferedKeptPerStamp (new), TestThinkingWithoutLevels* and the Pi tests on mica. Broken by hand (the kept entry dropped on every call): red, "built again while nothing changed". Suite on mica at this commit: gofmt clean; go vet internal/agent for darwin, linux and windows; go test ./internal/agent ok (281.1s). |
||
|
|
f1f34d624f |
gui: a model's key tag is drawn from keyrates.js, back under the core budget
|
||
|
|
8ce32d7008 |
agent: the window's drift poll remembers which values are magpie's per stamp
/api/drift runs every agent's Drift every 15s while the window is up. Each Drift asked every field's whole option list whether a value is one of magpie's, and the model lists under them are built again once a minute. With real accounts on mote (acgui6, w74), that was 27 MB of the 50 MB magpie allocated in three minutes with the window open. DriftShown, which only /api/drift calls, keeps magpieValueIn's answer per agent, field, value and settings while provider.StampNow stays the same, 5 minutes at most. Drift is unchanged for Reapply, rewiring, a launch and /api/state, which act on the answer. A provider resting or a model retired by its date is something the stamp can't see. The window's drift row now shows that within 5 minutes, not 1. Run: TestDriftShownAsksAValueOncePerStamp and the Drift tests on mica. Broken by hand (the memo never hit): red, "five polls built the options 5 times, want 1". Suite on mica at |
||
|
|
ed63a5be5e |
gui: a picked accent colours what is chosen (CHENGJIAHEGOXIS on X)
「选中任意强调色没反应」: picking an accent in Settings › General seemed
to do nothing. The token did apply. With the real server, in Chromium
and WebKit, under light, dark and system, with and without a background
image, --accent was set by lookCSS and kept. Neither the theme nor the
wallpaper overrode it. But nothing on Settings, the sidebar, the header
tabs or the panel's tabs used --accent: every chosen option is graphite,
var(--fg), by design. So the colour only showed in a few buttons
elsewhere.
The fix is a --mark token, the ink of what is chosen.
- It is var(--fg) by default, so magpie's own look is unchanged, like a
Mac's Graphite.
- accentVars sets it once the user picks an accent. It is moved toward
black (light) or white (dark) until it reads at 4.5:1 on the surfaces a
chosen option sits on: --pill-hover #e9e9ee, and the dark switch thumb
#4c4c52.
- It is used by .seg/.opt/.ptabs/.warm-tabs/.am-seg/.klf-tab/.day-chip/
.apptab .on, the header nav's chosen tab, the side-nav's open-page icon
and Settings icon, and Library's switches and radios. Each is the same
"chosen" role, so all of them follow the accent, not just one.
Tests:
- appearance_test.go's TestAccentReadable checks --mark's contrast on
each surface, in both themes.
- appearance-look.test.cjs adds 8 tests, in Chromium and WebKit, light
and dark:
- Settings' theme and bird options and the side-nav icon at 1200 with a
wallpaper set: graphite by default, the mark for #0d9488 and #db2777,
and back to graphite on Default.
- The header tabs at 900 and the panel's tabs at 380.
Run:
- gofmt clean. go vet ok on darwin, GOOS=linux -tags nogui and
GOOS=windows (at 75bdc85fe, the same change on an older main).
- At 6f5549b1f (this change on
|
||
|
|
6c88d61f0d |
mobile-web: drop the Claude Code mode row exemption 98cff4b0d left stale
|
||
|
|
2c0d203156 |
i18n: zh drops the "Also sync" that 459d668b3 left behind
|
||
|
|
57dc64ba12 |
usage: the Overview's lists rank by tokens, cost, calls or name (onducoder on X)
onducoder asked for a ranking of Usage › Overview's Agents, Models, Gateway keys and Accounts by what each used. Each list's heading now ends in a quiet pick (the order's name and a chevron) that opens the app menu: Tokens (the default, the server's order), Cost, Calls or Name. By tokens the list stays in the server's order (most tokens first, the cache left out) unless "with cache" is on, when the cache counts too; other orders fall back to tokens, then calls. By cost, a row with no price goes last; by name, a row with no name goes last. Each list keeps its own order in localStorage (magpie.usageSort), and a folded list hides its pick. The code is in the Usage plugin (page.js, its i18n.js); "Calls" is a core word, since other files say it. The core script doesn't grow (TestCoreScriptBudget passes). gateway-caller-keys and usage-accounts read the heading's .label, since the heading's text now includes the pick; mobile-web takes the picks out until BASE_REF has them. Run: usage-sort.test.cjs (new; chromium and webkit, en zh zh-TW ja de, 1100 and 420 wide). On mica, with the next two commits, these files at this head and at origin/main |
||
|
|
2a75aafc16 |
provider: Antigravity's mover min is 0.1.11, which says omp's RFC 2119 line as "key words" (eric_li8983 on X)
magpie-community/plugins 4170d0e8 published antigravity 0.1.11 (dist branch has magpie-community-opencode-antigravity-auth-0.1.11.tgz; the package isn't on npm, as every earlier version). keepMovedCurrent brings every moved Antigravity user's plugin up to it. Run: go test -tags nogui ./internal/provider on WSL magpie-desktop: ok |
||
|
|
0b64846bf7 |
gateway: Antigravity's cloak says omp's RFC 2119 line as "key words", and finds every turned-away line in any white space
eric_li8983 (X, 11-14): oh-my-pi (omp) on Windows with an Antigravity
account got "Antigravity answered 429 to this system prompt" for omp's
first line, "RFC 2119 keywords: MUST, REQUIRED, SHOULD, RECOMMENDED, MAY,
OPTIONAL." (omp 18.20.0's system-prompt.md, advisor/system.md and
live-instructions.md all start with it, byte for byte).
The built-in Antigravity path didn't know the line at all, and matched
the other turned-away lines only with single spaces. On a real account
on 11-14, Google's check turned omp's line away wrapped with LF or CRLF,
indented, with a tab, two spaces or a no-break space, so a literal match
misses copies that are refused. Now:
- agTurnedAway has omp's line, and each line is matched in any case with
any run of white space between its words (agLineRe, agSpace: JavaScript's
\s, as the plugin matches), Codex's and Hermes' lines too.
- omp's line goes as "RFC 2119 key words: …" (RFC 2119's own term), its
white space as it was, rather than broken up by zero-width spaces: a
broken-up copy was still refused 1 to 3 times in 10 (U+200B, U+2060 or
a soft hyphen alike), "key words" 0 in 30 (plugin numbers below).
- A refusal of it gets its own hint (antigravityRFCHint, word for word the
plugin's RFC_HINT), shown on the Routing page (AG_RFC) in en, zh, zh-TW,
ja and de.
The plugin half is magpie-community/plugins 4170d0e8 (antigravity 0.1.11,
agy-cli 0.1.40, antigravity-cloak 0.1.6); the next commit raises the
mover min to it.
Real account (sandbox HOME, copy of the live Antigravity account,
gemini-3.8-flash, sequential, through the plugin's same rewrite): omp's
literal prompt 10/10, the full template 10/10, the line wrapped after
"REQUIRED," 10/10. Zero-width before it: 3, 1 and 5 bare 429s in 12 each.
Run at this tree (rebased on
|
||
|
|
92e760f3d1 |
providers: a model says which keys list it when not all of them do (cliddO11 on X)
cliddO11 on X asked for a tag or colour on the provider editor that shows
which key each model came from when several keys fetch models. fetchPerKey
already marks each merged model with the keys whose list has it
(catalog.Model.Keys), but the editor never received that. providerInfo now
sends it as modelJSON.keys: the ids of the keys in use that list the model,
in the keys' order. The field is left out when every key in use lists the
model, when only an off key does, or when the list was not asked per key.
At most six ids are sent, with keyCount when there are more, so a provider
with a thousand keys does not send a thousand ids with every model.
On the chip, after the name, a grey tag in the 1M tag's look (never the
accent, no stripe) shows one key's name (or its masked value, as its row
shows it), two names, or "3 keys". The tooltip lists the keys. One new
string, "Listed by {keys} only", in zh, zh-TW, ja and de.
Run (on mote, at this tree):
- go test -tags nogui -run 'TestModelSaysItsKeys|TestModelKeysCapped'
./internal/gui: ok. Broken by hand (every model tagged, keysApart not
dropping "all keys"): both red.
- node --test model-key-tag, model-same-name-tell, i18n-keys: 32/32 ok
(Chromium + WebKit, en zh zh-TW ja de at 1100px, en zh at 420px). With
the tag call removed from app.js: webkit 0/7.
- GOOS=linux and GOOS=windows go vet -tags nogui ./internal/gui: ok.
- gofmt -l: clean.
- Full go + GUI suite queued behind ~/suite.lock on mote; its result is
posted on the follow-up.
Not tried: a real relay that gives each key its own models; the tag reads
catalog.Model.Keys, which fetchPerKey has filled since #904.
|
||
|
|
4e770f733a |
library: subagents imported from a repository
CHENGJIAHEGOXIS on X asked for an easy way to install a repository of
subagents such as msitarzewski/agency-agents. Library → Subagents now
has a find line. It takes what the skill installer takes: owner/repo, a
GitHub or GitLab link to a repository, folder or file, any git address,
or a folder on this computer. It lists the subagents found, lets the
user tick all or some, and imports them as Library subagents for the
agents ticked.
- Fetching is the skill importer's: resolvePluginRoot's source handling
moved into fetchSourceRoot, which both use. tooBig still refuses a
whole repository that is too big and asks for the folder's link.
- A subagent is a Markdown file whose front matter has a description.
- Its name is the slug of `name`. In an `agents` or `droids` folder
with no `name`, it is the file's own name.
- The description is folded to one line of at most 1000 characters.
- The body is the prompt.
- Dropped: every other front-matter key (agency-agents' color, emoji
and vibe, and tools, model, author or anything else). A Codex TOML
role is not read. A skill's folder (one with SKILL.md) and .git,
.github and node_modules are skipped.
- Two files with one name: the shallower is taken, and the other is
listed as left out, with why. So is a file Subagent.check refuses.
- An imported subagent records its source and file (From) and a hash
of its description and prompt as imported (FromHash). Imported again,
a subagent from the same file is:
- have, when it is unchanged;
- update, when upstream changed and the library's copy still matches
FromHash (description and prompt replaced; agents, skills, servers
and model kept);
- edited, when the user changed it in magpie (left as it is).
- A name the library already uses for another subagent is never written
over: the import takes the next free name-N.
- A carried library carries From.
- The page has Select all, a filter past eight, a tag per state, the
files left out, and a summary of what was imported and updated.
i18n: zh, zh-TW, ja, de.
- The fixture is agency-agents' own files in
internal/library/testdata/agency-agents. No test reaches the network.
Run on 80ae5ba24, which is this change on
|
||
|
|
eb1b830004 |
gateway: Cindy is told each model by its name with its provider's (cdredfox on X)
Cindy's picker listed magpie's GLM-5.3-Flash three times, 千问 3.8-Flash
and DeepSeek-Flash twice each, with nothing to tell them apart. Cindy
0.1.94's model discovery (parseModelsListResponse in its app bundle)
names a row by display_name before name, and magpie's display_name is
the bare model name. /v1/models asked with Cindy's key (magpie-cindy, as
its import link gives it) now gives display_name the name the agents'
lists use, provider.LabelsFor("cindy", ...): "GLM-5.3-Flash · Zhipu",
"... · routing group" for auto/, following Cindy's Provider in model
names (the picker the Agents page already showed for Cindy, which
changed nothing there before), a name the user gave a model kept as
they wrote it. Every other client's display_name is unchanged. In Cindy
a discovered model's shown name follows discoveredMetadata.name, which
its 刷新模型列表 updates for existing models; a name the user typed in
Cindy (nameExplicit) still wins there.
Run:
- TestCindyDiscoveryNamesModelsApart (new): on, own and off, three
providers' GLM-5.3-Flash apart, a user's own name kept, another client
plain. Red on the old gateway.go ("on: Cindy told
map[... or/glm-5.3-flash:GLM-5.3-Flash zp/glm-5.3-flash:GLM-5.3-Flash]").
- Real use: this tree's magpie built and served in a sandbox HOME on
mica with two custom providers serving glm-5.3-flash; its /v1/models
with magpie-cindy fed to Cindy 0.1.94's own parseModelsListResponse
(extracted from /Applications/Cindy.app's app.asar): "GLM-5.3-Flash ·
OpenRouterX", "GLM-5.3-Flash · ZhipuX", "GLM-5.3-Flash · routing
group"; with magpie-pi's key all three still "GLM-5.3-Flash".
- Full suite on mica at base
|
||
|
|
9366957788 |
gateway: a resent conversation shares the bytes a kept turn holds
A client that sends its whole conversation each turn, naming no earlier response and not sending store:false, had previousResponse copy the whole input out of the body on every turn (ownItems, ~2 MB a request for a 2 MB conversation) and keep each copy for prevTTL, so the store held the same history once per turn, up to prevCap (256 MB) for six hours. Now the leading items one of the four newest kept turns of the same scope holds the same bytes of are shared with that turn, and only the rest is copied. A turn keeps its items as chunks (prevChunk), each counted once in the store's size for as long as any turn holds it, so the cap still bounds what is held, and a chunk's bytes leave the count only when its last holder goes. A turn that names an earlier one shares that turn's chunks the same way, where before it counted only its own. Run (mica, at dcf6e440f): gofmt -l clean, go vet ./internal/gateway for darwin, linux and windows, go test -count=1 -timeout 45m ./internal/gateway ok (915s). Broken by hand: counting a shared chunk again on each holder, and sharing nothing, each turn both new tests red. BenchmarkLargeRequest/responses: 22.0 -> 20.0 MB a request, ~23 ms either way. Real DeepSeek (deepseek-chat), a 3-turn Responses conversation resent whole with no store:false: 200 each turn, and the third recalled the first turn's code word. |
||
|
|
f53c4a1a14 |
usage: three tests hold the clock, so midnight never falls between a call and Today (#6486)
TestAliasCallsAreTheGatewaysNotDirect stamped its direct call 6 minutes
before time.Now() and asked Direct(Today), so in the six minutes after
local midnight the call was yesterday's: red on mote at 00:00 PST and on
macOS CI at 00:07 UTC (run 43523008440). TestLoopsCountedPerModel and
TestRequestsCountedOnceWithTheirRetries do the same with stamps up to 9 s
back (same class). All three now take their time from holdClock at a
fixed noon, as TestPeriodsReadTheClock does.
Run (mica, at
|
||
|
|
783b69b8cf |
gateway: a Chat request's call ids and messages are read without copying them
Every Chat attempt ran chatCallIDs, which decoded the whole body into maps of json.RawMessage to see whether a call lacked an id: each level (the body, its messages, each message) was copied, ~3.8 MB a request for a 2 MB conversation, and silentAssistantsOut copied the body once more. editMessages and silentAssistantsOut now decode with decodeJSONView, sharing the body's bytes: an edit replaces a member, never writes into one, keeps none past its return, and a changed body is marshalled anew. chatCallIDs first scans the raw body (callIDsSet): when every call has a non-empty string id there is nothing to give, as a tool message is only given the id of a call that had none. BenchmarkLargeRequest/chat (mica, 200x, count 3): 23.4 -> 21.8 ms, 23.8 -> 16.4 MB and 69.4k -> 38.1k allocs a request. Anthropic and Responses unchanged (22.7 ms, 21.2 / 22.0 MB). TestCallIDsSetNeverSkipsAnEdit holds callIDsSet to the decode over 20000 random conversations (escaped keys and roles, null, numeric and empty ids, non-object calls), each answer and edits 1000+ times. Broken by hand (every id counted as set): red; restored: green. Dropping the tool-message check stayed green, which is why it isn't there. Real account (mote, sandbox HOME, deepseek/deepseek-chat through /v1/chat/completions with tools): paired call 200 "It's 18°C and sunny in Paris."; unpaired 200; empty call and tool_call_id 200 "It's 18°C and sunny in Paris right now." (the id given). Run (mica, at fcb88a13c; rebased since onto main, which changed only internal/update): gofmt -l clean, go vet ./internal/gateway for darwin, linux and windows, go test -count=1 -timeout 45m ./internal/gateway ok (949s). Real DeepSeek Chat with tools (paired, unpaired, empty call ids): 200 each. |
||
|
|
830177ae53 |
update: a restart on Windows waits for the old magpie's WebView2 to end (vsoullai on X)
vsoullai on X (0.1.4096, Windows 10.0.26300): "自动更新 relaunch 未等待旧
WebView2 释放 EBWebView 导致新实例死锁" - after an update's restart the new
magpie hung.
Two holes, both in what the new process waits for before its WebView2
opens the same profile folder:
- AwaitPredecessor waited 20s at most for MAGPIE_REPLACES. An old magpie
still in OnShutdown after that (Codex rollouts, agents' configs put back,
an update installed) still holds Wails' single instance mutex, so
webView2Ready's instanceHeld shortcut skipped the folder wait and
application.New handed the start to the magpie quitting
(SendMessage to its -siw window) and exited: no magpie at all.
- The old magpie gone is not its WebView2 gone: the folder's lockfile is
let go before the browser's last msedgewebview2 processes end (seen on
the box: lockfile free at 0.07s, two of the old one's processes ending
at 0.10s).
Now, on Windows, AwaitPredecessor (awaitGone) opens the old magpie by pid
first (so its pid is no other's), takes every msedgewebview2.exe under it
from a Toolhelp snapshot and opens those too, then waits up to 60s for the
old magpie and up to 30s more for those processes, logging when it goes
on without them. Mac and Linux keep the 20s poll. Every restart passes
here: the update's restart and Settings' restart (RelaunchBinary), the
folder move's, and Respawn after a WebView2 failure, since all set
MAGPIE_REPLACES and every start runs AwaitPredecessor (cli startUp)
before gui.Run.
Tests (Windows):
- update TestAwaitGoneWaitsForTheOldWebView: a fake old magpie with a
copy of the test binary named msedgewebview2.exe that outlives it by 3s.
Red with the old 20s poll put back by hand ("went on after 402ms, while
the old magpie's WebView2 still ran"), green with the fix (3.5s).
- gui TestRestartWaitsForTheOldWebView: real Wails windows and WebView2
with Wails' single instance on, in the signed-in session on xiaomi-gpu
(skips in session 0). The old app, its page loaded, starts the new one
detached with MAGPIE_REPLACES and quits; the new one starts as Run does
and must load its own page. slow (OnShutdown 25s) is red on the old
code: the new one went on at 20.09s, handed over and never came up.
Green with the fix: quick 1.3s, slow 27.4s, page loaded both times.
Run at this head (6faac2636 rebased on origin/main
|
||
|
|
e730a14dc7 |
gateway: a Chat request's tool pairs are checked without decoding it
toolPairsOut decoded every Chat request that mentions a tool into
[]map[string]any to learn whether its calls are answered, which they
nearly always are: 0.79s of 5.1s in BenchmarkLargeRequest/chat, ~10 MB
of allocations a 2 MB request. rawToolsPaired reads the roles, the
tool_call_id and the calls' ids from the body as it came, and the
decoding path runs only when they aren't paired, or for a shape it
would read differently (a message that isn't an object, tool_calls
that aren't a list of objects). A key named twice counts as its last,
as decoding into a map does.
BenchmarkLargeRequest/chat on mica, 200x: 28.1 -> 23.4 ms, 33.7 ->
23.8 MB and 94.5k -> 69.4k allocations a request; the other protocols
are unchanged.
TestRawToolsPairedAsDecoded holds it to the decoding path's answer on
20000 random conversations (answered twice, out of order, left open,
ids repeated, missing or not strings, escaped roles, null messages).
Broken by hand (a repeated id no longer refuses the pairing) it is red;
restored, green.
Real account: the built app (mote, sandbox HOME) sent DeepSeek a 6KB
/v1/chat/completions request with tools and a call answered ("It's
18°C and sunny in Paris.", 200), and one with the call left unanswered,
which the decoding path still mends (200, "the request was
interrupted").
Run (mica, at this head): gofmt -l clean, go vet ./internal/gateway for
darwin, linux and windows, go test -count=1 ./internal/gateway ok (858s).
|
||
|
|
a8fa771a63 |
gateway: the rest of the body checks look for the rarest byte too
|
||
|
|
63c91cae5f |
gateway: the body's key checks look for the needle's rarest byte
Each request ran ~45 bytes.Contains over its whole body to ask whether
a key is there at all ("developer", "compaction, "display", the
passthrough key...). Most needles begin with a quote, JSON's commonest
byte, so bytes.Index stopped at every quote, gave up on that and
compared at every byte: on a 2 MB body ~9 ms a request, 36% of the
gateway's CPU in BenchmarkLargeRequest's profile.
bodyHas/bodyIndex find the needle's rarest byte (a static rank of the
bytes JSON, English and code use most) with IndexByte and compare the
needle only there; a needle of common bytes only hands the rest to
strings.Index after 64 misses, so it is never slower than before, and
it allocates nothing (a []byte(sep) of a needle over 32 bytes did).
148 literal and constant needles in internal/gateway use it, and
mayHoldHEIC's "eXB" walk uses bodyIndex.
mayHoldOddBase64 walked every byte through a switch (~2 ms a 2 MB
body); a run it looks for ends a string, so it now looks back from each
quote with a class table and gives the same answer.
Run on mica (Apple M6) at this tree:
- BenchmarkBodyHas, 7 needles over a 2 MB body: 4.43 ms -> 0.38 ms,
0 allocs (was 1).
- BenchmarkLargeRequest -benchtime 200x, before -> after:
anthropic 31.2 -> 28.9 ms, anthropic-group 31.4 -> 27.8,
chat 35.7 -> 32.8, responses 39.8 -> 29.8.
- go vet ./internal/gateway; gofmt -l clean.
- go test ./internal/gateway -count 1 -timeout 45m: ok (858s).
- Broken by hand: bodyIndex's start off by one -> TestBodyIndexIsIndex
red (wrong index on 5 needles and the random bodies); the URL-safe
class never counted -> TestOddBase64LooksAsItWalked red. Both green
again restored.
TestBodyIndexIsIndex holds bodyIndex to bytes.Index on a large
conversation and 3000 random bodies of common and rare bytes;
TestOddBase64LooksAsItWalked holds the new check to the old byte walk
(kept in the test) on 20000 random bodies and the three protocols'
large conversations.
Real account: the built app (mote, sandbox HOME) sent a 6KB request to
DeepSeek on /v1/responses and /v1/messages, both 200 "pong". Not
tried: Codex (the sandbox's sign-in is stale, and renewing it there
would rotate the live refresh token).
|
||
|
|
08f77528f4 |
usage: the serials sourceDigest met go when idle
sourceDigests.by and .last, the serials met this turn and the one
before, stayed for the life of the process: 577 KB of a real history's
idle heap. They only order which digests heat-digests.bin keeps first
when there are more than it holds (2*65536, against ~17k session
files). dropDerived, the 3-minute idle drop, now writes what was made
and lets them go; sourceDigest notes a read (derivedUsed) as the other
per-chunk caches do.
TestDigestTurnsGoWhenIdle: the turn's serials are nil after the idle
drop and the next key hashes nothing again. Red with the nil-ing taken
out by hand ("kept 1 and 0 serials when idle").
Run at this commit on mote (load 23.7, over its 18 cores; mica's disk
was full): go vet for darwin, linux and windows ok; go test
./internal/usage ok (52s), ./internal/gui ok (132s). Real Codex history
in a sandbox HOME (~/r2278), page open 30s then 8.5 min idle: liveHeap
13.13 MB against 13.68 MB before; the heap diff shows sourceDigest's
577 KB gone. Not run: the full suite.
|
||
|
|
a532b646eb |
usage: the set of listed session paths is not kept on the index
readRequestBlocks makes a set of every session file's path (on), and noteBuilt kept it on the index for save, the only reader, which it calls right after. The set outlived the chunks' forget: 853 KB of a real Codex history (pprof inuse_space at request_page.go:1214, the make of on) at 8 minutes idle. save takes it as an argument now; the field is gone. Run at this commit on mote (load 24): go vet for darwin, linux and windows ok; go test ./internal/usage ok (57s), ./internal/gui ok (158s). Real Codex history in a sandbox HOME (~/r2278), page open 30s then 8.5 min idle: liveHeap 13.68 MB, against 17.07 MB for v0.1.4089; the heap diff shows readRequestBlocks' 853 KB gone. One earlier capture read 22.3 MB with 5.2 MB under prefetchEach/sharedBuild; a goroutine dump of the next run had no prefetchEach goroutine left, so that was a build in flight when the heap was taken, not a stuck reader. Not run: the full suite. |
||
|
|
39a00e6f38 |
gui: the panel's Usage tells all providers' calls apart by model too (OHHHHHH05 on X)
OHHHHHH05 asked on X for usage by model in the tray panel's Usage tab, which ranked all providers' calls only by provider. The card's head now has a Provider / Model switch beside the metric switch. Model ranks and charts the same answer by.model and the series' by.model, with no new request, the same drawLedRank and drawLedColumns the window's Usage page draws. The choice is kept (magpie.panelUseSplit). With one provider picked the ranking is already its models, so the switch is left out. A click in the ranking still picks a provider only when it ranks providers. The labels reuse the Provider and Model words, so no string is new. panel-usage-models.test.cjs (new), Chromium and WebKit, en zh zh-TW ja de: the switch's labels, Provider on by default, Model's ranking and chart keys, no request on the switch, both switches inside the card at 440px and 320px with nothing sideways, the choice kept on reopening, the switch gone with a provider picked, no page errors. panel-usage.test.cjs: its metric selectors skip the new switch. Run: - panel-usage-models + panel-usage on mote: 14 pass, 0 fail. - Broken by hand: the old app.js is red 10 of 10 in Chromium (no switch); the split forced to provider is red 10 of 10 in WebKit (the ranking keeps providers). - WSL magpie-desktop (Linux): the 116 GUI files that reach the panel or the usage answer (.pu-, panelUse, usage/requests, panel-*, tray-*, i18n-*): 1712 pass, 93 fail, panel-usage and panel-usage-models green. The 17 red files run again at origin/main |
||
|
|
7670295019 |
copilot: list each model's long-context tier, as Copilot Chat asks /models (gtliuu on X)
gtliuu on X: Copilot's Claude Opus 5.5 has a 200K and a long tier, and magpie
offered only 200K. magpie asked /models at X-GitHub-Api-Version 2026-01-09,
and at that version Copilot lists only the default tier's
max_prompt_tokens. Copilot Chat 0.68 never sends 2026-01-09:
@vscode/copilot-api 0.5.2's _mixinHeaders sets 2026-08-01 on every Copilot
API request, Models included, over networking.ts's 2026-01-09. At
2026-06-01 and later, /models gives each model its whole window (Opus 5.5
1M) and billing.token_prices with a default tier and a long_context tier.
- The editors' sign-in asks GET /models at 2026-08-01
(copilotModelsVersion). The Copilot CLI's sign-in keeps its own
2026-07-01, which already lists the tiers. Chat requests are unchanged:
Copilot served prompts past the default tier at 2026-01-09. The other
requests still on 2026-01-09 are #6571.
- The window follows Copilot Chat (languageModelAccess.ts and
agentIntent.ts). A long tier at the default's prices gives the whole
window: Claude Opus 5.5 1M, and the Sonnet, Fable and Gemini models
936K or 983K. A long tier with a surcharge keeps the default tier's
prompt as the window agents are told. The whole window becomes
MaxContext, which the user can raise the window to. GPT-6 Luna gets
272K and 872K, and Claude Haiku 5.5 100K and 936K. The whole window is
the limits' max_prompt_tokens, not the long tier's prompt: Grok 4.7's
long tier says 500000, but Copilot takes 372000.
- Price: Copilot's own list (AIU per batch_size tokens / 100 = USD per M)
is the list price, ahead of models.dev. A long tier with a surcharge
becomes a Tier above the default's prompt. Both 2026-06-01's field
names (cache_price, context_max) and 2026-08-01's are read. GPT-4.1's
all-zero list is no price. A flat, older list changes nothing.
Run (base origin/main
|
||
|
|
ab4b1cf38f |
sessions: a long Codex rollout is read on after a restart, not read again whole
shangyuan0818 on X: on Windows, Usage > Sessions took over ten seconds to open with one very long session (tens to 100 MB), though there were only a few sessions. Cause: a Codex rollout's summary window (state.Codex) and its calls' window (cxRun) lived in memory only. After a restart, or once the window had been dropped, the first line a live rollout gained made parseRead, prepareCalls and readsWhole read the rollout again from its first line: once for the summary and once for the calls. Claude Code sessions were already read on through their kept windows (#3493). Fix: the window of a rollout being written (changed within the hour, the same files memory keeps windows for) is now kept on disk with the parser version, a window version, and the size, offset and content hash of the read that made it. The summary's goes in codex-windows/<hash>.gob next to sessions.json. It is written with sessions.json, and it is removed once the cache drops that window. The calls' window goes in the shard's .rev file next to Claude's. Each is used only when all of those match, so a window from another read, or from an older layout, is never used; the file is read whole instead, as before. Measured (100 MB rollout built from testdata/codex-native-paginated.jsonl, plus a 100 MB Claude Code session, GET /api/sessions in a sandbox HOME): mote (M5), before: after one line appended following a restart, 2.51 s (Codex alone 2.25 s). After: 9.7 ms (Codex alone 6.3 ms). Windows (xiaomi-gpu), before: 2.61 s. After: 22.8 ms. The first read with nothing kept is unchanged: 2.6 s on mote, 2.8 s on Windows. Warm and plain-restart opens were already 10 to 30 ms. stats and overview stayed at a few ms throughout. A real 32 MB rollout: 24 ms after an append, with 2 KB and 4 KB windows. A 100 MB rollout with a unique response id per turn: 11 ms, with 623 KB and 834 KB windows. Tests: TestCodexSessionReadOnAfterRestart reads a rollout, restarts, then appends a replayed token_count and a new turn. It checks that neither reader starts at offset 0, and that calls and the session's tokens, models and cost match a read from scratch. TestCodexWindowLeavesWithItsSession covers writing, reading back, refusing another read's window and removal. TestPlainRolloutReadOnceForSessionsAndCalls (#4369) expected both readers to start from 0 after a restart; it now expects them to read on. Broken by hand, each red: the summary window not read (starts [319830 0]); the calls window not read ([0 319830]); a summary window emptied of what it had seen (it panicked in codexUsageState.count, which is why the version guard was added); a calls window emptied (62 calls vs 61). Run: gofmt -l clean. GOOS=linux and GOOS=windows go vet -tags nogui ./... on mote. Full go test -tags nogui -timeout 45m ./... on Linux (wsl-run, magpie-desktop) at this change on |
||
|
|
7b50e1f2c6 |
provider: Claude Code's version-2 model catalog lists an account's models too (#6418)
Claude Code 2.1.323+ keeps an account's models in
<config dir>/cache/model-catalog/<organizationUuid>-<sha256(accountUuid)[:12]>-cc.json
(version 2, catalog.config.models), and magpie read only .claude.json's
additionalModelOptionsCache / modelAccessCache. A model only that catalog
has, and models.dev's anthropic list lacks, was missing from the Claude
provider, `magpie models` and Claude Code's own picker (pwn2ooown).
readClaudeCodeModels, which every reader of those caches goes through
(claudeModels, claudeModelsOf/claudeLists, ClaudeCodeModels,
claudeCodePrice), now adds the catalog of the account its .claude.json
names, from that config directory or Claude Code's own (~/.claude keeps
every account's that signed in there), the one fetched last. A model
models.dev doesn't describe takes the catalog's window, reply limit,
effort levels and mm_images. The legacy caches are read as before.
Another account's catalog is never read; a file of another version or
surface is unknown; a .claude.json or catalog that doesn't parse
(halfway through a write) is what it said last (readKeepingGood), a file
gone is gone.
The name and shape come from this Mac's Claude Code, read only: 7 files
in ~/.claude/cache/model-catalog and 2 in saved account dirs; the name's
first part is organizationUuid and its second sha256(accountUuid)[:12]
for every account whose .claude.json is here.
Run (mote):
- go test -tags nogui ./internal/provider ./internal/agent ./internal/cli
./internal/catalog ./internal/filememo ./internal/proc: all ok (provider 166s, agent 357s, cli 67s)
- go vet ./...; GOOS=linux go vet -tags nogui and GOOS=windows go vet of
internal/provider and internal/agent; gofmt -l clean
- built magpie, `magpie models` in sandbox HOMEs (the issue's repro
adapted): baseline, other account's catalog, half-written catalog: no
Fable 5.2; the issue's catalog: listed; legacy cache: listed; a copy of
a real Claude Code catalog's bytes under synthetic ids: all 13 models
listed.
- after rebasing on
|
||
|
|
58629a0f8e |
usage: a trim that lets most chunks go gives back the map's table
The usage page's index of session-file chunks is let go when no page has asked for it in requestIdle + requestForget (trim(0)). A Go map never shrinks, so the emptied map kept its table: 853 KB of a real Codex history's index (pprof inuse_space at request_page.go:1461, the map assignment in keep) stayed for the life of the process, 8 minutes after the page was last open. trim now copies what is left into a map of its size when it dropped more than it kept. TestRequestTrimGivesBackTheMap fills an index with 100k chunks, holds the keys, and checks trim(0) gives back the table. Broken by hand (the copy skipped): red, heap 9,054,088 -> 9,051,552. Fixed: 3 of 3 green. Real Codex account sandbox (mote, acctp HOME, page open 30s then 8 min idle, memprofilerate=1): liveHeap 18.00 MB -> 17.07 MB; nothing held under requestIndex.keep (was 853 KB). One earlier run read 23.1 MB with a usage build in flight at the capture (sharedBuild 5.2 MB); the rerun had none. mica: gofmt clean; go vet ./internal/usage for darwin, linux, windows; go test ./internal/usage ./internal/gui ok. Not run: the full suite. |