d6cb404754a68bfdfedff322dbd17eeab5e8d3d4
8164
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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. |
||
|
|
71079b69f5 |
gui tests: old-webkit knows appearance.js is imported lazily (#6467)
|
||
|
|
70bd270ae2 |
agents: Antigravity says how its own sign-in's models come back on magpie (T_t__biu on X)
T_t__biu on X: once magpie wires the Antigravity app, the Gemini models of
their own signed-in Google account leave the app's model list. Cause: magpie
connects the app through Google's Enterprise Gateway (gateway block in
~/.gemini/config/config.json and ~/.antigravity/settings.json). On a gateway
the app's language server runs in AUTH_MODE_ENTERPRISE_GATEWAY and drops the
Google sign-in (Google's docs: the two can't be used at once), so Code
Assist's fetchAvailableModels, which listed the account's models, is never
asked. No key in the file keeps both.
What does keep them: the same Google account signed in under magpie's
Antigravity subscription (the antigravity-auth plugin). The gateway's
antigravity catalog then lists that account's own models beside magpie's,
on that account's quota, pooled with any other Google account added there.
The notice shown on connecting now says so while magpie has no Antigravity
account (provider.Logins("antigravity") empty); with one, it reads as
before. Translated in zh, zh-TW, ja, de; the site's Antigravity page (en,
zh, ja), llms-full.txt and docs/subsystems/agent-wiring.md say the same,
and the subsystem page names what is not built: keeping the app's own
sign-in and adding magpie's models beside it would need the backend's
Code Assist endpoint (--cloud_code_endpoint / CLOUD_CODE_URL) pointed at
magpie.
Run at this head (base
|
||
|
|
331057743d |
agents: a provider an agent's visibility keeps is in its model list, off, and ticked is shown it (whysugarsweet on X)
whysugarsweet on X (v0.1.4066): OpenCode Go is in Pi's model list but
not in Claude Desktop's. Desktop's list showed Google Gemini, DeepSeek,
Anthropic, Codex and Grok only.
Nothing leaves OpenCode Go out by protocol. What can narrow one agent's
catalog to some providers is settings.Visible: `magpie visible`, a
profile or settings sync writes it. A provider added later is kept out
of that agent's /v1/models, its config and the Agents page's list. The
page showed no sign of it and had no way to undo it, so the user could
only see Go missing. I haven't seen the reporter's settings, so this is
the likely cause, not a confirmed one.
- GET /api/agent-models/{id} now lists the models the visibility keeps,
after the rest, as hidden and `kept`. They sit under their provider
in the list and its rail, so they can be found and ticked.
- POST takes `widen`: kept models that were ticked. provider.Widen adds
each one's provider (or group) to the agent's visibility. When nothing
is kept after that, the agent is no longer narrowed at all. The
provider's other models are then listed and off, so ticking one adds
just that model.
- A kept model is never saved as hidden or picked one by one. The row's
count leaves kept models out of "listed".
- Every agent's list shares this code, so the fix applies to every
narrowed agent, not only Claude Desktop. The gateway's model list and
Desktop's inferenceModels both come from CatalogFor, so a widened
provider is served and routed too.
Run, at
|
||
|
|
48f9764027 |
plugins: a model served on more APIs keeps the client's (gaubeebangeel on X)
gaubeebangeel on X: OpenDesign's Anthropic requests to an Open Design Cloud account were all sent upstream as chat completions. The Open Design plugin declares each model on one AI SDK package (chat completions for most, Responses for deepseek-v4-pro and claude-haiku-5.5, plugins#141), and pluginAPIs gave a plugin model that one API alone, so attempt never relayed a /v1/messages request and translated it, though amr-link serves every model on all three (plugins#888). A DeepSeek API-key provider, the case first suspected, relays to /anthropic/v1/messages as sent: tried with OpenCode's, node's and no User-Agent, bare and prefixed ids, and web search. A plugin model can now list the other APIs its vendor serves it on, as their AI SDK packages (m.also; plugin.Model.Also through host.js, config model and models hook). pluginProtocols gives the model's own API first, then those; ListedAPIs, the catalog's APIs and the provider's bases come from it, so a client's request on any of them is relayed as sent. usable puts a plugin model's own API first, so a request on an API it isn't served on is still translated to the declared one. A model with no also is unchanged. opendesign 0.1.13 (plugins 397da020) sets also on every model. Test: TestPluginModelServedOnMoreAPIsKeepsTheClientAPI (fake plugin, FAKE_ALSO): Anthropic, Responses and Chat requests to the also model reach the upstream on their own path; fake-1 (no also) is still translated to /chat/completions. Red on HEAD's plugins.go: Anthropic and Responses reached /v1/chat/completions, ListedAPIs and usable were [chat]. Run (mote unless said): go test ./internal/provider ./internal/plugin ./internal/catalog ok; go test ./internal/gateway ok (972s); GOOS=linux/windows go vet of the three packages ok; gofmt clean. Not run: the full ./... suite (mote and mica each had full suites queued under suite.lock); not tried against a real amr-link account (keyblues's plugins#888 measurements are the evidence it serves /v1/messages for every model). |
||
|
|
db9d6507bb |
dsh: a thinking level set on magpie's route by hand is what its sessions start on
ming_li52905 on X set a level per route in dsh's config:
providers:
magpie-responses:
reasoning: high
and magpie "overwrote" it. magpie never dropped the key. llm-pi-ai starts
a route's models on profile.reasoning only when the session names no
effort (options.reasoningEffort ?? profile.reasoning, dsh-llm-pi-ai
0.2.2-rc.3). agent-default-model's reasoningEffort, which magpie's
thinking setting writes, is the effort every new session names, so the
user's level never applied.
Now the route's own level wins over magpie's one default:
- A start magpie writes on such a route (switch, set) carries no effort
of magpie's.
- A sync or round takes out an effort magpie wrote there before
(dshStartYields). magpie keeps what it last wrote into each list's
start (dsh-effort:<file> in the stash), so an effort dsh saved itself
(a composer pick, #1392) is the user's and stays. When the home layer
mirrors a profile's start, it takes that profile's record too.
- Thinking reads the route's level when the start names none, and
setting it writes the route's reasoning wherever it is set: each
profile, the home layer, settings.yaml. It writes no reasoningEffort.
- A route without a level still gets magpie's effort, as before.
Tests: TestDshRouteLevelOfTheUsersOwn (sync, round stability, a switch
away and back, thinking set, dsh's own saved effort kept),
TestDshRouteLevelInTheHomeLayer, TestDshRouteWithoutLevelTakesMagpiesEffort.
Run:
- The three tests at the old dsh.go: red (start keeps "medium" over
high, thinking reads medium, thinking low leaves the level).
- Broken by hand, each red: the record check ignored (dsh's own effort
stripped); Get not reading the level; the round's dshStartYields
removed (both level tests red).
- go test -count=1 ./internal/agent on mote: ok (237.9s).
- GOOS=linux go vet -tags nogui and GOOS=windows go vet of
./internal/agent on mote: ok. gofmt -l: clean.
Not run: the full ./... suite. mote's suite lock had four full runs
queued ahead of it. The change is internal/agent only.
Not tried: a real dsh. The precedence comes from dsh-llm-pi-ai
0.2.2-rc.3's source, not from a session.
Risk: a start written before this release has no record. If its effort
differs from a route level the user set, it is taken for magpie's and
removed once, even if dsh had saved it.
|
||
|
|
ea9f2639b9 |
LESSONS: a docs edit left llms-full.txt stale, unseen behind cancelled runs
|
||
|
|
3d88600100 |
site: llms-full.txt carries the sync page's pick, preview and undo
|
||
|
|
640304a165 |
edit: a TOML file's table names are let go after 5 minutes unlisted
Codex's real config.toml (1.5 MB, ~11k project tables) had its table
names kept for the process's life once the start-up rename
(agent.RenameLegacy) listed them: 1.16 MB of packStrings in an exact
heap profile (memprofilerate=1) after 8 minutes idle in the real-account
sandbox, the largest holder left under cli.init. The whole parse was
already let go after a minute (tomlIdle); the names now go after
namesIdle (5 min) with no list, the other kept answers (GetTOMLTop,
GetTOMLTable, polled every 3s) stay, and a list a caller holds is not
touched.
Cost of a list after the let-go: BenchmarkTOMLTablesCold on that config,
9.0 ms and 21.5 MB of garbage per list (mote, M5 Pro).
Run: go test ./internal/edit (mote), TestTOMLNamesLetGoWhenIdle red with
the drop made a no-op by hand ("the names were kept past namesIdle"),
green with it.
Real-account sandbox (mote, real Codex config.toml), 8 minutes idle after
the page closed. Exact heap (memprofilerate=1): liveHeap 19.47 MB before
(v0.1.4082) -> 18.00 MB after, and RenameLegacy's held bytes 2.24 MB ->
0.86 MB, with no packStrings left. Without the profiler: liveHeap 19.57
-> 18.01 MB, heapInuse 33.1 -> 31.0 MB; footprint 71 vs 75 MB, within
one run's noise of each other. Also run on mica: gofmt, go vet for
darwin, windows and linux, go test -race ./internal/edit, and go test
./internal/agent ./internal/library ./internal/cli, all ok.
|
||
|
|
82512bb640 |
usage: the probe chunk is let go when the pages rest and after warm-up
probeChunk memoised its last chunk for the polling page (#2278), and nothing ever cleared it: ~5 MB of unpacked probe rows held for the process's life on a real gateway's history, the largest single live holder left in an idle heap profile (makeProbeChunk -> rowChunk.add). ReleaseScratch (page rest) and ReleaseMatchScratch (after warm-up) now drop it with the rest of the reads' scratch; the next page read makes it again, and while a page polls the memo still answers. Run (mica): go test -run 'TestProbe|TestAnswered' ./internal/usage/ ok. Broken by hand: without the two releaseProbes() calls, TestProbeChunkLetGoAtRest fails ("ReleaseScratch kept the probe chunk"). Measured on mote, real accounts in the sandbox HOME, idle after the page was open 30 s and closed 60 s (memv.sh), base vs this, two runs each: heap profile in use: 52.5 MB (4.91 MB under makeProbeChunk, held from gui.warmStart) vs 46.9 MB (none under it) liveHeap: 40.0 / 45.7 MB vs 40.4 / 40.4 MB footprint: 94 / 117 MB vs 102 / 107 MB (noisy run to run) go test ./internal/usage/ ./internal/gui/ on mica: ok. |
||
|
|
6112dd37c1 |
agents: Use Claude Magpie shows with Claude Magpie made too, and the row names it (xMopf7RF on X)
xMopf7RF on 0.1.4076: "没看到按钮". The Use Claude Magpie button beside
Claude Desktop's switch showed only while Desktop wasn't on magpie and
Claude Magpie was off (`!a.isolated.on`). The reporter had tried Claude
Magpie since 0.1.4064, so it was on while Desktop wasn't on magpie, the
one state where the button hid. The row then still read "on magpie,
Claude Desktop opens a separate profile…", though connecting there wires
only Claude-Magpie-3p (desktopSets), never their own Desktop.
States where Desktop isn't on magpie, before → now:
- Claude Magpie off: button shown (unchanged).
- Claude Magpie on, app there: no button, wrong line → button, and the
line says connecting puts Claude Magpie on magpie and their own Desktop
stays signed in with Anthropic.
- Claude Magpie on, app deleted from ~/Applications (launcher ""): no
button, so nothing made it again → the button, whose
settings/desktop-isolated on:true remakes the app (desktopiso.Add over
nothing), then connects.
- isolated missing (not a Mac, WSL): no button (unchanged).
Run (mica, mote over its 18 cores):
- desktop-twin.test.cjs, new cases: Claude Magpie made with and without
its app, every language, 1100 and 640px, Chromium and WebKit: 62/62 ok.
Broken by hand: the same file on origin/main's app.js: 40 red (every new
case), 22 ok.
- TestCoreScriptBudget ok (within the room app.js had).
- Every GUI file naming claude-desktop or isolated (31) with i18n-keys and
i18n-en-no-cjk, both engines: 760/762; the two reds are
desktop-tiers' Chromium cases, red the same on origin/main
|
||
|
|
d5585933f1 |
usage: heat-digests.bin is read mapped, not copied into the heap
The heatmap's key names each session file's chunk by a digest kept on disk by serial (#2278). The file holds up to 2*sourceDigestsKept digests at 40 bytes each, 5MB on a long history, and every start read it whole into the heap and kept it there for the process's life. After a save the encoded bytes stayed instead, the same 5MB. Where the system maps files (unix), the file is now mapped read-only, as requests-v1.bin already is (mapDiskFile), and kept is read from the mapping: its pages are clean file pages, not footprint, and a lookup is a binary search that touches a few of them. After a save the file just written is mapped in place of the encoded bytes, when it is still those bytes. The file is only ever replaced by a rename, so a mapping stays as it was read. Windows reads it into memory as before (mapsFiles). Run (mica, go1.26.8): - go test ./internal/usage/: ok (54s) - go vet ./internal/usage/, GOOS=windows go vet ./internal/usage/: clean - Broken by hand (no mapping on load, no keepMapped after save): TestSourceDigestsKeptAcrossStarts red, "after a save the digests are kept as encoded"; green again with the change. Real account (mote, the owner's history in a sandbox HOME, magpie web with the page open, 90s idle, footprint + Go MemStats): - before (w63 = v0.1.4074's code): footprint 109MB, live heap 44.9MB - after: footprint 101MB, live heap 39.6MB - wsl-run and win-run: go test -run 'SourceDigest|Heat' ./internal/usage/ ok on Linux (the mapped path) and Windows (read into memory). Not run: the full ./... suite (only internal/usage is changed). |
||
|
|
65f745dd4c |
plugins: Installed is narrowed by Discover's kinds and origins
WJaunita45604 on X asked for the Installed tab to be filtered by Discover's categories, and by whether a plugin is official, with Discover's own categorisation. Installed now has the same strip and menu as Discover: - the kinds strip (All, Subscriptions, Middleware, Agents, Tools, Pages), each with how many are installed; - the Origin menu (magpie community, other authors, unofficial on GitHub), without Discover's "Not installed only". browseBar's strip and Origin button are split out (kindStrip, originButton) so both tabs draw the same component. The rest is in plugininstalled.js, imported when Plugins first draws, as plugingrid.js is (old-webkit lists it); until it is in, the list is drawn whole. What is left in the core is 674 bytes, within its budget's room. A plugin Discover lists is put where its card is (kindOf, srcOf). One it doesn't list (a folder, an unlisted npm package) is put by what it is: middleware or gateway, agent, tools only, a page, else a subscription; from GitHub, @magpie-community, else other authors. The strip shows only when two or more kinds are installed, and the menu only when two or more origins are. A pick that leaves nothing says "No plugin matches" with Show all. Installed keeps its pick across tabs and Discover keeps its own. The list head grows when it wraps (.pm-listhead.pm-bar), so a narrow row doesn't run under the list. There are no new strings, no native select (the app menu), and no left-border accents. New plugin-installed-filter.test.cjs: seven installed plugins of every kind and origin, two of them GitHub repos from fixtures/plugins-github-31. It runs in every language, both engines, at 1100px and 420px. Run (on mote, Playwright 1.62.0, chromium + webkit): the new test, 20 of 20. Red on origin/main |
||
|
|
b3d1334458 |
providers: the Add sheet's search shows its hint whole
WJaunita45604 on X: 输入框里面的提示的字显示不全. Since |
||
|
|
36126daeff |
gui: the scroll buttons don't watch the room kept under a held click
scrollends.js watched every child of the open page for a size change, app.js's .view-room among them. "Where the reader is" (hold) sizes that room from its own ResizeObserver, while sizes are being told, so WebKit ended the turn with "ResizeObserver loop completed with undelivered notifications" as a page error. It showed once the Add sheet's search got its hint's width: in German at 420px, a provider's sign-in opened from its tile made hold give the page room, and plugin-api-prompt-key and plugin-password-prompt went red in WebKit (de 420, every run). hold sets scrollTop with the room, and that scroll is heard, so the buttons still follow. Found by wrapping ResizeObserver to report each callback that changed an observed size: hold (app.js heldSizes) took .view-room from 61px to 30px. Run (on mote, Playwright 1.62.0, chromium + webkit), at this commit with the next one (the search's width): - plugin-api-prompt-key, plugin-password-prompt: 22 of 22, three times in WebKit; without this change 8 of 8 runs red at de 420. - add-sheet*, provider-env-paste, old-webkit, and every file that touches the scroll buttons or the room (add-button, click-scroll, phone-no-sideways, rollup-short, routing-editor-foot, routing-save-blank, routing-save-keeps-the-row, sessions-paging, signin-closes-sheet, text-size, view-ends-relayout, view-ends): every test green but the reds below. Reds that fail the same on origin/main |
||
|
|
25e4d19c04 |
providers: an editor closed before its certificate rows load draws none (#6216)
drawEditor imported tlscerts.js and, once it was in, called tlsCertRows with the module-wide draft. An editor closed (or swapped for another) before the import resolved handed it null, and drawPin threw "Cannot read properties of null (reading 'serverPin')". add-sheet.test.cjs opens and closes editors quickly and went red on that pageerror under load (#6216). The rows are now drawn only while the draft is still the one the editor was drawn for. That is 50 bytes of core script, the hook itself, within the core budget's room at |
||
|
|
a82bae2bd3 |
routing: a request's row says the service tier it went at (Anotiaww on X)
Anotiaww on X: with Codex's fast mode on, the Routing page's request log didn't show that a request went in fast mode. Two gaps. Codex on its own ChatGPT sign-in (codexUpstreamOn) set only the route's tier, never its tries', and the Routing row drew only a group member's fast flag, never a tier. - codex_backend.go: the try (first and askAgain) carries the body's tier (bodyTier), and its end notes tier_served through servedTierAt. The handed-on usage record has tier_asked/tier_sent too. - plugins/routing/client.js: the row shows a quiet tag beside the model (fast for priority, Ultrafast, flex) from the try's tier, or the route's asked tier while in flight. Its title says the tier and, when the reply said another, what it said. No new column. rowSays' sig takes the tier, so the row is drawn again when it changes. - "flex" is a core word in i18n.js (i18n-keys: a plugin can't own a word other code says); its title strings are the routing plugin's. - docs/subsystems/gateway-routing.md says the Codex relay's tries carry the tier and what the row shows. Price: a priority turn is still priced at the standard rate. Pricer and catalog.Price don't read the tier. That is #1784's open work, in hhh2210's fork PR (hhh2210/magpie#1, catalog.ServicePrice), so nothing is duplicated here. No Flags bits added or changed. Run on mica (mote and mica both over their core count; mica the lower), at 74b5f2420 on origin/main |
||
|
|
1730c75b97 |
library: Claude Magpie is an agent of its own (xMopf7RF on X)
xMopf7RF asked for Claude Magpie, the separate Claude Desktop, to show on its own in the Library's instructions, skills and MCP, like an independent agent. Before, Claude Desktop's target wrote its servers (DesktopConfigs3p) and Cowork skills (desktopdir.Everywhere) into Claude-Magpie-3p too, and the twin's Code tab folder ~/.claude-magpie-desktop (a claude# row) got nothing from the Library. - agent.DesktopTwinApp: claude-desktop#magpie, "Claude Magpie", an app target while the Separate app is on and its folder is there (macOS). MCP to Claude-Magpie-3p's claude_desktop_config.json, Cowork skills to its skills-plugin. No instructions file: noPlace points to its Code tab's row. - Claude Desktop's target leaves Claude-Magpie-3p out (DesktopConfigs3p, desktopSkillRoots). - Every claude#<name> row takes CLAUDE.md, skills/ and .claude.json in its folder (~/.claude.json for ~/.claude itself). settings.json features (hooks, env, tools off) stay keyed on claude. - Old data: carryTwin, on load and only while nothing is recorded for the twin, ticks for Claude Magpie each server and skill magpie gave Claude Desktop that is in Claude-Magpie-3p already, so an update takes nothing away. library.json syncs, so another Mac's twin sees the same ticks. Unticked later, it stays unticked. - Not changed: desktopCarryMCP still copies the user's own Desktop servers into the twin when it is wired. Run (mote, sandbox HOME in the tests): - go test -tags nogui ./internal/library ./internal/agent ./internal/desktopiso ./internal/desktopdir: ok (167s, 251s). GOOS=linux and GOOS=windows go vet of library and agent ok; gofmt clean. - TestClaudeMagpieIsItsOwnLibraryAgent: InstallSkills, SaveServer and SaveInstructions write only Claude-Magpie-3p and ~/.claude-magpie-desktop; Claude Desktop's config and manifest, ~/.claude/settings.json unchanged; ~/.claude.json, ~/.claude/CLAUDE.md and ~/.claude/skills/pdf not written. TestClaudeMagpieKeepsWhatDesktopWasGiven. - GUI, both engines: library-*.test.cjs (76 files), by-agent, every-skill, group-skill-chips, pick-skills, project-*, skill-*, i18n-keys and the new library-desktop-twin.test.cjs (separate chips for Claude Magpie and Claude Code · Claude Magpie, lit only for what they were given, a click on Claude Desktop's asks for it alone; en, zh, zh-TW, ja, de at 980 and 420px). 1850 of 1878 the first run, with a library.css hand change since dropped; the 28 reds were all in library-new-skill, library-subagents, library-wsl-asleep and skill-where, and those four files plus the twin test, run again without it: 174 of 174. Broken by hand, each red then restored: carryTwin off (fs/pdf not ticked, nothing recorded); Desktop's skill roots with the twin's folder (target reaches Claude Magpie's folder); the claude# branch off (Code tab target nil); DesktopConfigs3p with the isolated config again (library and agent tests red). Filed: #6558, a row's chips reach past its edge at 420px (ja with four agents, before this too with six); the twin test skips that check for ja at 420px until it is fixed. Not tried: a real Claude Magpie.app on a desktop reading the new files. |
||
|
|
d0fb3c0084 |
provider: Claude accounts can be set not to spend extra usage (baksili_ on X)
baksili_ on X asked for a way to keep magpie off Anthropic's paid extra usage on Claude subscription accounts. magpie can't flip Anthropic's own switch, so it holds the account itself. Providers -> Claude -> Advanced has a new "Spend extra usage" row: On, as before, by default (nothing changes for anyone who doesn't touch it). Off saves claudeNoExtraUsage. While it is off, HoldCaps holds every Claude account at 100% of any plan window with no cap of its own (the same Credits hold a Codex account set not to spend its credits gets), so a Claude account whose 5-hour or weekly window is used up gets no requests until it renews and the other accounts take them. What its plan has left is still used; a cap the user set lower still holds first. A cap on an account's "Usage credits" window (its extra-usage spend, set as an amount or a share on the usage card) now holds the account the same way once that much extra usage is spent (Allowance.extraCapped, called from CapHeld and NearCap). Before, aside windows carried no amount, so an amount cap on one never held anything; allowanceOf now gives aside limits their Amount, Of and Unit. Every route that picks an account goes through capHeld, so the gateway, groups and fallback obey it alike. Claude Code switching (NextLogin) already moves off an account on overages. The warm-up sends a held, used-up account nothing (codexWarmer.held / spentPast; claudeHeldFull for Claude), since that request would be billed as extra usage. With every account held, the client is told "has used up a usage window and is set not to spend extra usage" and how to turn it back on, and the call's record says "set not to spend extra usage" (Weighed.ExtraUsage). Not done: Claude Code's hidden /limit-reset. It resets or buys limits through endpoints Anthropic hasn't published, and calling them would be mimicking Claude Code's client, which magpie doesn't do. A Claude Code signed in on its own, not through magpie, still spends extra usage. Run on mote at |
||
|
|
ce2ce86ab4 |
gui: windows drawn again when the screen comes back, WebView2 without occlusion tracking (aquaarboraurum on X)
aquaarboraurum: on Windows the window that comes back after every
auto-update restart is white. Its title bar and status bar are there,
and its page is alive. A restart by hand or a reload draws it.
AutoRestart only restarts once nothing is going through magpie and the
window has sat unused, which is when the user is away, often with the
screen locked or the display off. A WebView2 window first shown then
can keep a white surface: Chromium's native occlusion tracking takes
every window as covered while the screen is locked, and a surface first
drawn in that state may not be drawn again. Closing the window to the
tray and opening it again, which the reporter did by hand, draws it.
- windowsOptions starts WebView2 with CalculateNativeWinOcclusion
disabled (occlusionOff), after the user's own features. A user who
enables it in WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS keeps it on.
Wails still tells a hidden or minimised window so (put_IsVisible).
- Wails' main-thread window registers for session and display-state
notifications (watchScreenBack). The app's WndProcInterceptor
(appWndProc, which still calls screensWndProc) draws each open window
again (redrawShown) when the session is unlocked or the display comes
on after being off, as mendOnWake already did on wake.
Not reproduced: the white window never showed on xiaomi-gpu (Windows
11, WebView2 157.0.4341.46). The tries:
- quiet and asked restarts, behind other windows, maximised, under a
full-screen cover, cloaked, minimised then restored;
- the real sandboxed AutoRestart update path (v0.1.9000 to v0.1.9001
from a local feed).
The box's screen can't be locked for a test, so the locked-screen case
the fix is aimed at wasn't tried.
Run:
- Windows (xiaomi-gpu, signed-in session):
- TestRestartedWindowIsDrawn: all 13 modes pass on the fix. The test
is new and plays the update restart (old process, markQuietRestart,
AwaitPredecessor, openMain). Each mode now also posts an unlock to
the app's own main-thread window, checks that the window is drawn
again and stays drawn, and checks that the msedgewebview2 browser's
command line has CalculateNativeWinOcclusion disabled.
- Broken by hand (the interceptor ignoring the unlock, occlusionOff
returning the list unchanged): red on both checks.
- go vet ./internal/gui; TestScreenBackFrom,
TestAppWndProcSaysTheScreenIsBack, TestWebView2* pass.
- The real update path with exes built from this tree: the new
process's window came up drawn (10 of 360 sampled points white,
the same as the old window) over 22s of samples.
- mote:
- gofmt -l;
- go vet ./internal/gui/..., GOOS=linux -tags nogui, GOOS=windows;
- GOOS=windows go build ./..., GOOS=linux go build -tags nogui ./...;
- go test ./internal/gui (142s) and -tags nogui (95s): ok.
Not run: the full ./... suite. mote and mica were both over their load
(mote's suite.lock had four suites queued). The change is in
internal/gui only.
|
||
|
|
6f2d1a5ac0 |
gui: a read under a tight GC runs on four Ps
A collection every few MB wakes an idle-mark thread on every idle P,
and the reads' own workers keep them spinning in between. On mote
(18 cores), a request-index rebuild spent ~2 s in pthread_cond_signal,
~1 s in usleep and ~0.5 s in pthread_kill out of its ~16 s of CPU. The
reads use 4 workers (prefetchEach) or at most 8 (decodeCache), so they
gain nothing from more Ps. tightenGC now sets GOMAXPROCS to 4 for its
first read, and the last read to end calls runtime.SetDefaultGOMAXPROCS.
A GOMAXPROCS the user set in the environment is left alone.
Run: TestTightGCNarrowsProcs plus the other tight-GC tests in
internal/gui (ok, on mica, 12 cores), go vet and GOOS=windows go vet
./internal/gui, gofmt -l. Broken by hand (narrowProcs not called):
TestTightGCNarrowsProcs fails with "two reads on 12 Ps, want 4".
Real account on mote (75G sandbox HOME, network blocked, mote at load
23-47 on 18 cores): each run forced a request-index rebuild with a new
Anthropic price, then read the process CPU after the page closed and
again 20 s later. v0.1.4061 against this build, alternating:
15.3/15.6, 15.9/14.9, 16.8/14.8, 17.7/14.8, 15.0/12.5 s. Mean 16.1 s
before, 14.5 s after, about 10% less. Earlier, v0.1.4061 itself with
GOMAXPROCS=4 in the environment: 17.0/12.8, 15.6/13.5, 15.6/14.0,
15.9/15.5, 15.2/14.2 s. Peak cores during the rebuild: 2.8 and 2.9
before, 1.9 and 3.1 after.
At the pushed head (rebased on
|
||
|
|
5b0572ae3b |
agents: Use Claude Magpie is its own button beside Claude Desktop's switch (xMopf7RF on X)
xMopf7RF read Claude Desktop's row as "connect Desktop first", and
connecting is what changes their own Desktop. They asked for one button
beside Claude Desktop that makes the clone and touches neither their
Desktop nor ~/.claude. The button that does this has been in the row
since v0.1.4029, but it was a quiet link at the end of a long status
line that warns about connecting. Their screenshot has no button at all,
so it was easy to miss or they were on an older version.
Now it is a real button (ag-add) beside the switch, where Claude Code's
model picker stands. The status line no longer holds it. What it does
is unchanged: Separate app on, then connect, which wires only
Claude-Magpie-3p (v0.1.4064 keeps ~/.claude out of it for a new twin).
It shows only while Desktop isn't on magpie and the twin isn't made yet,
on a Mac.
Run:
- At the pushed head, after the rebase: desktop-twin, desktop-isolated, desktop-isolated-claude and i18n-keys
in Chromium and WebKit, every language, at 1100 and 640px: 38/38 per
engine. desktop-twin now checks that the button isn't in .ag-st, sits
level with the switch 8 to 28px left of it, and that the status ends
before it. It waits for the fold's animations first.
- Every GUI file whose fixture has claude-desktop or isolated (38
files), both engines: WebKit 345/345. Chromium 343/345: the two reds are
desktop-tiers ("no tiers square"), red the same at origin/main
|
||
|
|
55327848bb |
LESSONS: a budget raise that cut a menu item, and a move out (23457a51f, 817d35ffa)
|
||
|
|
6e03b746be |
gui: plugin pages load on Windows again, their sandboxed frame kept in the window's process (Mute06162 on X)
Mute06162 on X (0.1.4066, Windows): every plugin page (用量速览, 对话,
模型指纹, GPT号池) showed "This page stopped working / <page> didn't
answer", and Codex found "Worker request cancellation setup: The
parameter is incorrect" and "Resuming Windows asset request: The
parameter is incorrect" in the log. Both are Wails' own lines
(request_cancellation_windows.go, v3.0.0-beta.24).
Cause, reproduced on xiaomi-gpu (WebView2 157.0.4341.46): WebView2 runs
the plugin page's frame (sandbox="allow-scripts") in a process of its
own (Chromium's IsolateSandboxedIframes; CDP lists it as an "iframe"
target). Wails registers its WebResourceRequested filter with
AddWebResourceRequestedFilter, and that isn't raised for this process's
requests: the frame got its index.html (a navigation), but bridge.js,
app.js and style.css went to the network as http://wails.localhost/...
and failed with net::ERR_CONNECTION_REFUSED. The bridge never said
hello, so after 10s the page was broken. Wails' request cancellation
auto-attaches the frame's target, takes it for a worker, and its setup
on that session fails with E_INVALIDARG: that is the log line.
Fix: windowsOptions starts WebView2 with IsolateSandboxedIframes
disabled (sharedFrameProcess), merged into the one --disable-features
with the user's own, unless the user enables it in
WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS. This is app-wide, so it covers
every sandboxed frame magpie makes: plugin pages and plugin panels
(pluginpages.js, the only two), in the main window and the tray panel.
The frame keeps its sandbox: an opaque origin (its context's origin is
"://"), its CSP, messages only.
Run:
- Real repro on xiaomi-gpu, sandbox HOME (C:\Users\yeton\magpie-wvf),
testdata/page-plugin (magpie-usage-glance, the reporter's 用量速览),
`magpie app` started in the console session by a one-shot scheduled
task, driven over CDP:
- origin/main
|