ac4af582301a4e8a29245dbba767eba31334ddf9
7089
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
5214d5114f |
claude: a run on a new account's first turn keeps its tool results
On the first request on a newly seen Claude sign-in, claude auth status
has no email yet, so the account is named from its plan ("Claude Max").
The bridged run's Claude Code then writes the profile, the account is
named by its email, and the turn's tool results came under another owner:
"tool results account changed", the run let go, and a new one told the
whole conversation (~8k more cache writes). Seen in a real run as
"claude\x00Claude Max\x00own" -> "claude\x00<email>\x00own".
- provider: Account.Unnamed marks the placeholder name;
ClaudeOwnName gives the own sign-in's name once it has one.
- gateway: the run's owner is an atomic pointer (owned()); an own,
unnamed owner ends in "\x00unnamed". takeNamedOwner lets such a run go
on as the same provider's own sign-in, named; every other owner change
still lets the run go. A turn that ends without a tool call takes the
name before its keys are made (nameOwner), so the next turn finds the
idle run.
- docs/subsystems/claude-subscription-bridge.md says so.
Run:
- TestClaudeToolResultsKeepTheSelectedAccount gains "named since" (kept)
and "unnamed, another account" (let go);
TestClaudeRunTakesOnlyItsOwnSignInsName; TestClaudeIdleRunKeptUnder-
ItsOwnSignInsName (named since / still unnamed); provider asserts
Unnamed on the plan-named account and not on an email-named one.
Broken by hand: without takeNamedOwner in serveSubscription "named
since" goes red (a new run replies); renaming any own owner goes red
(a@ -> b@ taken); without nameOwner the idle case goes red; with
unnamed never set the provider test goes red.
- Real run: sandbox HOME, dev build of this tree on 127.0.0.1:3741, the
owner's Claude Max sign-in with .claude.json and logins.json removed
first (auth status: no email), a real Claude Code 2.1.310 client in a
sandbox config asked to write, wc and read pelican.html. One Claude
Code pid for the whole turn, the log says the run "goes on as" the
email, no "account changed" line. Before this change the same setup
logged the owner change and "tool results account changed".
- gofmt; go vet darwin, linux -tags nogui, windows for gateway and
provider; go test ./internal/gateway ok 392.7s; go test
./internal/provider ok 89.3s with -skip TestUnreadLoginsWriteErrors-
KeepCredentials, which crashes the package on main alone (#3632,
filememo synctest, not this change).
- Full suite at this tree (
|
||
|
|
680b505687 |
claude: a run works in the caller's own folder, not magpie's temp folder
The bridged Claude Code told its model "Primary working directory:
<tmp>/magpie-claude-work-501", against the folder the client's own prompt
names. Under a real Claude Code client the model wrote pelican.html into
magpie's temp folder, through the client's tools, which run in the
client's folder.
startRun now runs Claude Code in the folder the caller names
(clientWorkDir): the last one in the system prompt or a non-assistant
message, as Claude Code ("Primary working directory:"), Codex (<cwd>),
OpenCode ("Working directory:") and pi ("Current working directory:")
write it, when it is an absolute path to a folder here. Otherwise (a caller
elsewhere, a WSL Claude Code, no folder named) the shared folder as before.
The caller's project's sessions are never swept; a run's session is still
removed by its id. CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS=1 keeps the
repository's status out of the prompt (setting sources and auto memory
were off already). The text sent upstream is unchanged apart from the
folder Claude Code reports itself.
Run:
- TestClaudeRunsInTheCallersWorkDir (Claude Code, Codex, OpenCode, pi,
named twice) and TestClaudeCallersWorkDirElsewhereIsNotUsed (missing,
relative, Windows path, none): red on the old code (the runs used the
shared folder). Broken by hand: sweeping the caller's folder goes red
("were swept"); dropping the env var goes red ("repository's status").
- Real run: sandbox HOME, dev build of this tree serving 127.0.0.1:3741 on
the owner's Claude Max sign-in (keychain linked in, login copies deleted
after), a client Claude Code 2.1.310 with its own CLAUDE_CONFIG_DIR,
ANTHROPIC_BASE_URL at the sandbox, run in $SB/wm and asked to write
pelican.html: it landed in $SB/wm; nothing new in magpie-claude-work-501
(its only pelican.html is the capture's, from before).
- go test ./internal/gateway at the staged tree (checkout-index), gofmt,
go vet; the full suite run is recorded in the next commit, at the pushed
head.
Not tried: a Windows client (a Windows path falls back, by the test), a
Claude Code in WSL (falls back by code).
|
||
|
|
42ec2700bd |
gui: markNewPartners' comment is shorter, so app.js is in its budget again (#3367)
|
||
|
|
3173440ca3 |
routing: a row made again in the middle of the list is swapped alone, not every row after it moved (#3164)
placeRows walked the wanted rows against the list's children and put each one out of place in front of the current child. A row going (its request moved on, so rowOf made it again) stayed where it was as that current child, so every wanted row after it was put in again in front of it, one insertBefore each. On a busy gateway the request in flight is rarely the newest, so each trace update (several a second) moved ~40 rows and laid the list out again. With two groups of hundreds of keys open, that is the 50ms+ frames WebKit showed at each update. Rows no longer wanted are taken out first, as replaceKeeping does; the rows kept are not touched, so WebKit's scroll position under a picked row (what the walk was for) holds as before. Run at this head (rows3164 worktree on origin/main |
||
|
|
ef3b9f85a4 |
gui: a new partner puts a still dot on Providers in the sidebar
yetone: 有新的合作伙伴的时候,侧边栏这个地方是否也应该有一个精致优雅的点来提醒 用户一下呀?…就是不要太打扰用户。 markNewPartners now lights Providers in the nav (window mode) together with the add button's dot: the same has-dot Plugins uses for an update (6px at the sidebar row's end, 5px at a tab's corner, accent, no animation), titled with the new partners' names. It goes out with the add button's dot, when the add sheet has shown the partners. prefetchProviders calls it once the background read lands, so an app opened on another page shows it too. Run at |
||
|
|
81a58d2f35 |
gui tests: routing-busy-frames counts paths measured again for the same d, not lengths against frames (#3557)
The bar was path lengths < 8 × frames drawn. The lengths follow the
paths the flights and the moving rows make (~1,800 in the 3s), not the
frames, so a busy machine that drew 228 frames instead of ~300 went red
with the page doing just what it should.
What the test is about is that a path is measured once for each d it
has. The page's getTotalLength and getPointAtLength are now wrapped to
remember the d each path was last measured at: a length measured again
for the same d, or a point again at the same distance along the same d,
is counted. The bars: lengths again ≤ 1/20 of lengths, points again ≤ 2
for each d measured (a wire's two ends are asked for by its tips and
among its points). Neither depends on the frame count.
Run at this head (frames3557 worktree on origin/main
|
||
|
|
8299409e44 |
site: APIKEY.FAN's in-app seat ends 11-24
APIKEY.FAN's seat runs one month from 10-24, so its partners.js entry is listed until 2026-11-24 00:00 +08:00. Its README banner has no end date of its own; it comes out by hand when the seat isn't renewed. Run: node --test site/*.test.mjs (31 of 31 ok). served() over partners.js keeps apikeyfan at 11-23 23:59:59 +08:00 and leaves it out at 11-24 00:00 +08:00. |
||
|
|
8d7d46e3bd |
site: WandAPI's in-app seat ends 11-25
WandAPI paid for one month from 10-25, so its partners.js entry is listed until 2026-11-25 00:00 +08:00. The README banner has no end date of its own; it comes out by hand when the seat isn't renewed. Run: node --test site/*.test.mjs (31 of 31 ok). served() over partners.js keeps wandapi at 10-26 and at 11-24 23:59:59 +08:00, and leaves it out at 11-25 00:00 +08:00. |
||
|
|
091153bf71 |
idle: the loops following magpie's files wake on its own writes, not a 1-2s poll (#3185)
An idle `magpie serve` (no providers, no requests) woke 12-13 times a
second. A runtime trace showed the wakers were polling loops: the
middleware observer's refresh every 1s, pluginrt.KeepFresh's stat of five
files every 2s, OTel's session watch every 2s and its exporter tick every
5s, all with nothing to do.
Now filememo.Forget, which every write magpie makes of settings,
providers, sign-ins and caller keys already calls, also closes a channel
(filememo.Written). The plugins.json, tools and plugins.yml saves call it
too. The middleware observer, KeepFresh and OTel's session watch wait on
it, and look every filememo.OthersEvery (5s) only for what another
process (the CLI, a second magpie) wrote. Each takes the channel before
it looks, so a write made during a look isn't missed. middleware's
current() also reloads at once when filememo's generation moved, rather
than after its 1s skip. OTel's session watch waits 5s, not 2s, while
sessions aren't exported, and its exporter's timer runs only while a
batch holds something.
Measured: sandbox HOME, MAGPIE_ADDR=127.0.0.1:3481, `magpie serve`,
proc_pid_rusage (idle + interrupt wakeups) over 30s after 40s warm-up,
old (
|
||
|
|
67271e7020 |
site: WandAPI is a README sponsor
WandAPI took a README seat with its in-app one. README.md shows its
English banner ("Connect to global AI models"), README.zh-CN.md its
Chinese one ("畅连全球AI大模型"). Their SVGs switch colours with a
prefers-color-scheme rule inside; each is kept as a light copy (the rule
taken out) and a dark copy (the rule's colours as the only ones), shown
through <picture> like the other sponsors. All paths, no text or outside
references. Both link usemagpie.ai/go/wandapi/readme, which sponsors.js
sends to wandapi.ai/r/magpierepo, the link WandAPI gave for the README.
Run: node --test site/*.test.mjs (31 of 31 ok). The four banners rendered
with rsvg-convert on white and on GitHub's dark background and looked at.
After the deploy, /go/wandapi/readme is checked for its 302.
|
||
|
|
43a831981a |
site: WandAPI is a partner in the Add sheet
WandAPI took an in-app seat. The partner "wandapi" serves Chat Completions and Responses at api.wandapi.ai/v1 and Anthropic Messages at api.wandapi.ai. Its key page is its magpieapp referral link, its website wandapi.ai. No langs were asked for, so it is listed in every language, with the tagline it sent in en and zh and a zh-TW one made from the zh. Listed from 10-25, no end set yet. The icon is their 512px logo at 128px (7.1KB PNG). Run: node --test site/*.test.mjs (31 of 31 ok). The served feed (worker.js served() over partners.js) parsed as []Partner and passed checkPartner and validPartners in a throwaway test in internal/provider: all three partners kept, wandapi's links /go ones. Against the real service with the test key it sent: /v1/models (28 models), Messages (plain and streamed) and Responses answered "OK". Chat Completions answered for gemini-3.5-flash and gpt-5.6-terra; for claude-haiku-5-5 and gpt-6-sol it says the model doesn't take that protocol, so those models go through Messages or Responses. Its Gemini endpoint (/v1beta) answered too, but a partner entry has no Gemini base URL. Not tried: adding it from the app's Add sheet. |
||
|
|
cec54c1d01 |
proc: main's two reds, the TUI's serve start through proc.Command (#3567) and an RSS read before the loader ran
Test (ubuntu, macos) on main has been red since
|
||
|
|
d42d27012b |
routing: a long wire is drawn as pieces of its curve, which WebKit dashes cheaply (#3164)
What was left of #3164 after |
||
|
|
a60493ab60 |
gateway: Codex run by Claude Code's Codex plugin is counted as Codex, not Claude Code
wyztony on X: "claude通过/codex skill时,用量不会记录codex的记录".
OpenAI's Codex plugin for Claude Code (codex-plugin-cc 1.0.6,
/codex:rescue and /codex:review) runs `codex app-server` with clientInfo
named "Claude Code". Codex 0.162.1 then sends "originator: Claude Code"
and "User-Agent: Claude Code/0.162.1 (...) (Claude Code; 1.0.6)", so
agentOf read every such turn as Claude Code's ("claude") and the Usage
page showed none of them under Codex.
agentOf now takes a "Claude Code" name back to Codex when the request
carries Codex's own turn headers (x-codex-window-id or
x-codex-turn-metadata), which Claude Code itself (claude-cli/...) never
sends. An app running Codex as its own engine under its own name (Lody)
keeps its name, as TestFromCodex already holds. fromCodex is unchanged,
so nothing sent upstream changes. Every path keyed on agentOf
(Codex subagent pick, spawn_agent models, drawing route, Codex backend
records, titles, search, active sessions, callerOf) follows.
Run:
- TestCodexPluginForClaudeCodeIsCodex: red on the old code with the
check turned off by hand ("plugin task: recorded as \"Claude\", want
\"codex\""), green with it. Cases: the plugin's captured headers,
originator only, claude-cli, the name without Codex's turn headers,
Lody with them.
- Real use in a sandbox HOME: codex-cli 0.162.1 wired to a sandbox
`magpie serve` on a fake Responses upstream, driven by the plugin's own
codex-companion.mjs (db52e28). Before: task and review rows were
"agent":"claude". After: both "agent":"codex". Plain `codex exec` (a
skill-folder /codex skill) was already "codex" through the gateway and
read from its rollout when direct.
- gofmt; go vet darwin, linux, windows.
- Full suite (go test ./... -timeout 45m, one suite on the machine) was
started at this tree and was still running at push; per the owner's
ship-at-once rule, a red it finds goes in its own commit.
Not changed, outside magpie: with Codex not routed through magpie,
/codex:review runs an ephemeral thread and Codex writes no rollout, so
there is nothing on disk for magpie to read; /codex:rescue writes one
and was already counted as Codex. Past rows stay under Claude Code.
|
||
|
|
a3232e3e11 |
routing: hundreds of keys in a group are read once, not each against all (#3164)
A group of 500 + 300 keys (the reporter's: several hundred gpt-5.6-sol
keys for load rotation) made the Routing page stutter. Every request in
the trace names each key it weighed, and the page read all of them over
and over:
- rankOf looked a key up in its provider's whole keyList for each sort
comparison (~50k findIndex a second). It now uses an index made once
per list (keyRank), rebuilt when the list moves under it.
- seated made each sort key once per member (decorate, sort, undecorate),
and setOf is made once per route's order array.
- at() parsed each trace time again for every row each second (~1M
Date parses over 3s). Each time string is parsed once (atOf).
- render() went through a route's whole order and tries for each of its
800 rows each second. Each route is read once per pass (findings).
- renderActs filtered the whole list for each key to fold it. Each
provider's keys are gathered once.
- rebuild looked ids up with Array.includes; it uses a Set.
- layout() read each row's box after drawing the wire above it, so an
open fold laid the stage out once per row. Every box is read first,
and only changed d attributes are written. The FLIP pass reads every
row's place before moving any, and --depth is set only when it changes.
Measured with a sandbox magpie (dev build, own HOME, ports 3474-3477),
providers solpool (501 keys) and solpool2 (301 keys) in group sol, a fake
OpenAI upstream (200 after 0.2s, 429 one in five), and requests every
0.3s. Playwright, 1280x900, 10s of rAF gaps, old and new alternated
twice on the same box (load average 160-215 from other sessions):
chromium, folds opened: 206/281 frames, 65/58 over 50ms, jank 6.8s/5.5s
-> 568/557 frames, 1/0 over 50ms, jank 1.0s/1.1s
webkit, folded: 410/422 frames, 43/45 over 50ms, jank 3.8s/3.8s
-> 566/554 frames, 4/12 over 50ms, jank 1.3s/1.5s
webkit, folds opened: 49/50 frames, max 310ms, jank 9.4s/9.2s
-> 129/134 frames, max 122ms, jank 7.9s/7.8s
CDP CPU profile, 15s under load, Chromium: folded, 27 long tasks
(1540ms) -> 1 (69ms); opened, 41 long tasks (3757ms, max 1533ms) -> 0.
Folded, first .rt-group in 305ms -> 170ms.
New internal/gui/tests/routing-many-keys.test.cjs: 800 keys, requests
coming, folded and opened, counts findIndex calls on lists of more than
100 entries, Date parses of strings, and box reads that follow a drawn
wire. On the old client.js it is red: 59094 lookups, 469919 parses, and
20885 relayouts when opened. Broken by hand, each part goes red alone:
at() without the memo gives 493972 parses, and layout() writing each
wire as it goes gives 22497 relayouts. Green in Chromium and WebKit, en,
zh and de.
Run at base
|
||
|
|
5e0d7c058b |
agent: WorkBuddy's own save of models.json after it starts no longer keeps its row saying restart (Sac2333o on X)
Sac2333o on X: the WorkBuddy row kept saying "已连接 · 重启 WorkBuddy 后生效"
after every restart of WorkBuddy.
WorkBuddy rewrites ~/.workbuddy/models.json itself a few seconds after
each start. 5.5.6 (Mac app.asar): registerLocalModelIpc checks whether the
computer can run local models (only some NVIDIA RTX GPUs and Intel Core
Ultra chips), and on "no" purgeLocalModelsOnGateFail saves the file
through ModelsJsonStorage.update even when nothing was purged. The live Mac
log says "Hardware eligible: false ... Purge complete: 0 models removed".
5.6.2 (Windows app.asar) does the same through the daemon's
deleteLocalCustomModel. Both save it with JSON.stringify(x, null, 2), so
magpie's trailing newline is gone. 5.6.2 also writes a bare list, and its
models-json codec encrypts apiKey (WBEF1) when its credential policy says
so. On the Windows box, WorkBuddy 5.6.2 started at 17:17:09 and
models.json was last written at 17:17:13 with no trailing newline.
AppBehind put magpie's last change at the time of the last write it
hadn't seen, using a digest of the raw bytes. WorkBuddy's own save
changes those bytes, so every start put "magpie's change" 4s after
WorkBuddy started, and the row asked for a restart forever.
appReads now digests workbuddyPart: magpie's entries (vendor magpie),
each with its keys sorted and its apiKey left out. The same models
written by magpie and saved again by WorkBuddy read the same. A model
magpie adds or removes, or a changed URL, still asks for a restart.
Upgrading users: the stash still holds the old raw digest, so the first
look after the update may still say restart once. One restart of
WorkBuddy then clears it for good.
Run:
- TestWorkBuddyOwnSaveAfterStartIsNoChange (darwin and windows subtests):
connect, WorkBuddy restarted, WorkBuddy's save 4s after its start
(Windows: apiKey encrypted). Red on the old appReads ("WorkBuddy's own
save after its start read as magpie's change"), green now. Broken by
hand (apiKey kept in the digest): the windows subtest goes red.
TestWorkBuddyRestart*, TestChangedAt* still pass.
- GUI: internal/gui/tests/agent-app-restart.test.cjs (every language,
chromium and webkit, wide/narrow/panel), 40/40. app.js is unchanged.
- gofmt -l; go vet darwin, GOOS=linux -tags nogui, GOOS=windows on
internal/agent.
- Full suite (go test -tags nogui -count=1 -timeout 45m ./..., one run
on this machine, no other suite running): running at push. A red it
finds gets a follow-up commit and an issue.
ZCode (the same report: "zcode接入通信失败") is not changed here. I could
not reproduce it. In a sandbox HOME on macOS, `magpie zcode provider
magpie` (a build of 4b3bdbe28; this commit doesn't touch ZCode), then ZCode 3.14.3's own app-server
(provider/testModelConnectivity, the call behind its settings' test
button) against the gateway: {"success":true}. The same on the Windows
box, with this tree's magpie.exe and ZCode 3.14.3 for Windows run with ELECTRON_RUN_AS_NODE in a
sandbox USERPROFILE/HOME: {"success":true}, and the request reached the
upstream.
Not tried: the reporter's own machine, upstream and ZCode model (ZCode's
probe streams with max_tokens 1 and the model's first reasoning level, so
an upstream that refuses that shows as 连接失败); WorkBuddy's real app
seeing a magpie sync in this build (its save was read from its code, its
log and file times, then replayed in the test).
|
||
|
|
39fed471cc |
gui: a connected agent's changes read before → now, not as disconnecting undoes them
Zhenzhen (Discord, 0.1.1521, omarchy, Pi on DeepSeek's API) opened Pi's
row: "改动了 ~/.pi/agent/settings.json · models.json", and every line
magpie had added (defaultModel/defaultProvider "magpie", the whole
"magpie" provider in models.json) was red, "−" and struck through, with
`"providers": {}` tagged "接入前的值". The row drew DisconnectPreview in
its own direction, what disconnecting does, so it read as magpie
deleting their config.
changesList now draws the forward view by default: a line magpie added
is a green "+", a value it replaced is "−" old then "+" new, nothing is
struck, and a file magpie created is tagged Created. The restore view
(↺ value before connecting, struck lines, Deleted) stays where it
belongs, in 断开并还原's dialog (askDisconnect passes back=1). Both
callers are the only ones: the row's connectPanel, which every
connected agent's row goes through, and askDisconnect. No new strings;
Created/Deleted/"value before connecting" already exist in every
language. app.js stays under its budget without a raise: eight
el+svg+append triples on the Agents page fold into one el call (same
DOM).
Test: agent-changes-before-now.test.cjs, a wired Pi with the preview
built from the real diffLines output for Pi-shaped files (captured with
a throwaway Go test). Chromium and WebKit, en/zh/zh-TW/ja/de, 890 and
420 wide: the row reads before → now, + green and − red, nothing
struck, magpie.json Created; the dialog keeps ↺, struck lines and
Deleted. Broken by hand: with origin's app.js and app.css it fails
("settings.json reads before → now"); with only the CSS reverted it
fails on the colours.
Run at
|
||
|
|
4b3bdbe28c |
masking: the flow's dots, scan and Live dot stop moving once played (#3185)
The Masking page never came to rest. Each dot in its agents-to-providers flow was an SVG animateMotion with repeatCount "indefinite", the scan mark on the middle line ran forever, and the Live dot pulsed forever. The SMIL dots alone made Chromium lay the page out ~700 times a second (6,965 layouts and 2,282 style recalcs in 10s, read with CDP Performance.getMetrics). Removing just those 22 elements took it to 0. Now each dot goes round twice when the flow is drawn, and the scan mark plays twice. The flow is drawn again only when the numbers change. The Live dot pulses once each time the list is drawn again, which happens on each 15s read. Reduced motion is unchanged: still no motion at all. Measured on a sandbox `magpie app` (origin/main, sandbox HOME, real deepseek provider, the real masking log copied in: 19,657 values over 577 requests). The Masking page was loaded in Playwright 1.62.0, and only that browser's own processes were sampled with proc_pid_rusage, 20s per sample: - WebKit, before: 180 wakeups/s, 2.8% CPU, 56 mW. After: 37/s and 9.7 mW while the motion plays out (8-28s), then 10.8/s, 0.1% CPU, 1.4 mW. - Chromium, before: 96-98/s, 17% CPU, 537-543 mW. After: 40/s, 2.0% CPU, 57 mW while the motion plays out, then 18.5/s, 0.5% CPU, 10 mW. - The other pages at rest: 12-30/s and 1.6-7.7 mW in WebKit. Test: masking-records' new "the masking page's motion ends" (chromium and webkit, 1100px and 640px). It moves the SVG clock on an hour and asks Chromium whether any dot is still in an interval. In both engines it checks that no SMIL element is set to repeat for good and that no CSS animation has an infinite end. All 4 cases are red on the old page.js/redact.css and green on the new ones. Run at this tree: - masking-records, held-animations and i18n-keys: 68/68. - account-mask-sessions, account-mask, mask-actions, mask-emails, provider-unmasked and redact-*: 172/172. - go test -timeout 45m ./internal/gui: ok. - GOOS=linux and GOOS=windows go vet -tags nogui ./internal/gui: ok. - gofmt: clean. Other states measured, with no change made: - Go main process at rest with the window open: 25/s, 7 mW. - Streaming 3 deepseek-flash replies (2,450 SSE events in 20s): 275/s, 3.5% CPU, 107 mW, about 2 wakeups per event. Not tried: the window hidden and the tray panel open; the WKWebView in the real app window on Masking (measured in Playwright's WebKit instead); the full GUI suite. |
||
|
|
41b0445ccf |
provider: a local server's address is a field shown first, and address= on the command line (LM Studio on another computer)
mengxiangziyou on X: "供应商里的LM Studio只能用本地的,怎么用局域网里其他机器 上的LM Studio, baseUrl 不能改". Moving a local preset (Ollama, LM Studio, oMLX, MLX-Serve) to another host has worked since #1165, but the window put the Address in a "Server address" fold under the key, while the Endpoints row showed http://localhost:1234/v1 as plain text. Reproduced in a sandbox: Add > LM Studio shows the URL and nothing to change it with unless the small fold is found. - GUI: the Server address field is shown first, above the key, never folded, for a new provider and a saved one alike (its label and hint are the strings the fold used, so no new i18n keys). Saving still sends the URLs moved only when the address was changed. - CLI: `magpie provider add|set <id> address=<host:port>` moves every URL the provider has (chat, Anthropic, Responses, decision), each keeping its path; from the preset's when it was saved with none, and `address=` alone puts a local server back at its preset's. A provider of the user's own moves its own URLs. Vertex refuses it as it does url=. Before, Ollama on another computer needed url= and anthropic=. - TUI: unchanged (asked on adding, `w` after). - docs/subsystems/providers-accounts.md: Local servers row. Security: only upstream URLs move. The gateway's own loopback/origin guards are about inbound requests and don't read them; the one rule that looks at an upstream being on the LAN (Unredacted) stays the user's own switch. Run at this tree (origin/main |
||
|
|
5be7d05d28 |
agent: Desktop on magpie offers its own import of the signed-in sessions (lambdua on X)
lambdua on X: "claude Code桌面端支持么? 我桌面端切换账号,对话都能全都不见".
Nothing is lost. Desktop on magpie runs in 3p mode, whose userData is
Claude-3p, a folder apart from Claude/. Desktop 2.7032 keys Code and
Cowork sessions by account and org (claude-code-sessions/<acct>/<org>):
in 1p the claude.ai login's, in 3p the install id in ant-did and a fixed
org. So the sessions made signed in stay in Claude/ untouched and show
again when Desktop is switched back; claude.ai chats are on Anthropic's
servers. magpie's on/off never writes or removes a session (desktopOff
removes only what magpie made, and only when empty).
Desktop has its own importer (Settings -> Import: the signed-in userData,
other Claude* folders, ~/.claude/projects; copies under new ids, originals
left), but in 3p only when the profile's claudeAiImport.enabled is true
(3p-only policy, default off, since 1.28929.0). magpie's profile now gets
"claudeAiImport":{"enabled":true,"bannerBehavior":"detect"} once per
folder set (desktopSeedImport, stash mark claude-desktop.import): on the
switch on, and from Sync at magpie's start for a Desktop already on
magpie. A claudeAiImport already there is kept; one the user removes is
not written back (the mark is read, never unstashed).
Run (suite at origin/main
|
||
|
|
07936ca890 |
gateway: a turn held before routing shows on Routing and is answered 504 after 2m
heyusaku6 on X: Codex desktop thought for over ten minutes on a model served through magpie (a routing group's DeepSeek, then Qoder CN's MiniMax, then GPT-6.1 Sol), the Routing page showed none of them, and only restarting Codex and magpie ended it. Codex waits for a reply's headers with no limit of its own, and a request shows on the Routing page only once a route is begun for it, so whatever held these requests held them before routing, in silence. The root cause was not found. Every pre-route wait read (the classifier, image description, plugin GatewayBegin, JS middleware, provider.Hold, the body read, pluginrt.Refresh, the trace lock) has a bound or follows the request's context. So this makes the stall visible and bounded instead, and records where it was held: - counted watches an agent's turn (Chat, Responses, Messages, Gemini generateContent, Codex backend /responses) while no route is begun for it (unrouted.go). After 15s a route of provider "magpie" shows it on the Routing page as routing; it gives way to the request's own route when one begins (noteRoute, trace.drop). - After 2m with no route and nothing written, the client is answered 504 in its own protocol, whole (Content-Length, Connection: close) so it has the error even if the handler stays stuck. The request's context ends with errUnrouted, its route ends with the error, and the log gets every goroutine's stack (at most once in 10 minutes), which says what held it next time. - The handler writes through heldWriter, which drops its writes once magpie has answered for it. A request waiting on another request's identical image description for over 2m is now answered 504 too; the retry finds the description cached. Run in the worktree at origin/main |
||
|
|
2f44e075a2 |
agent: TZ is not an agent's folder (#3600)
|
||
|
|
5df62c5cda |
pii: pf-serve is pf-v2, which holds the model once on a GPU (#3590)
pf-v2 is 642d430ec's pf-serve (weights-once.patch): on Metal and Vulkan the GGUF is read straight into the device's buffer instead of also kept whole in a CPU copy. serveSHA pins pf-v2's five zips, each checked against the release's SHA256SUMS. A user who turned the model on before has pf-v1 on disk, in a folder named for its tag. pf-v1 now still counts as installed and is run (oldTags), and starting it fetches pf-v2 in the background (upgrade): once fetched, the running pf-v1 is ended so the next request starts pf-v2, and pf-v1's folder is deleted. One that can't be fetched leaves pf-v1 running and is tried on the next start. A fresh download fetches pf-v2 and deletes an old tag's folder. Run: - go test ./internal/pii ./internal/redact (ok), -run TestLoopGuard ./internal/gateway and -run Privacy ./internal/gui (ok, the doc and the settings route); go build; GOOS=linux and GOOS=windows go vet -tags nogui ./internal/pii; gofmt -l clean. - TestOldServeRunsUntilUpgraded and TestUpgradeThatFailsKeepsTheOld are red with `go upgrade()` taken out of start (not upgraded / never tried) and with binDir looking at serveTag alone (the old pf-serve not taken for installed). - Real: a sandbox cache with the released pf-v1 darwin-arm64 and the real model, pii.Find through it: pf-v1 answered, pf-v2 was fetched from the real release, pf-v1's folder deleted, the next request started pf-v2 (ps shows its path), 1664 MB phys_footprint idle. - pf-v2's released darwin-arm64 probed alone: 1680 MB idle (pf-v1 4777 MB), spans identical to pf-v1's; load ~1 s both, alternated 3 times. Not tried: the upgrade on Windows, where the old folder can only be deleted after its pf-serve ends (upgrade ends it first; a folder left is deleted on a later start). |
||
|
|
254461829b |
gateway: a Codex Lite request is no longer decoded whole, nor parsed twice for its facts
XiaoYin_OK on X: after a long run the app's memory climbs toward 2 GB. The owner's own app (26h up) showed RSS 550 MB, HeapInuse 317 MB but HeapSys 992 MB: the heap peaks while requests are in flight. Its profile had 209 GB allocated, ~94 GB of it under codexBackend/serve, of which: - parseResponses 24.7 GB, liftAdditionalTools 14.9 GB of it; - factsOf 24.6 GB, reached from turnOf (13.6 GB) and dirOf (11.0 GB), the same conversation parsed twice per request. Three causes, each fixed where it is: 1. liftAdditionalTools decoded the whole Lite request into maps to move its additional_tools item, and wrote it all again: ~7.6x the body. Now only that item and the tools are decoded; every other item and member goes byte for byte as it came, written once into one buffer. 2. affine counted the turn in the masked body while dirOf read the plain one, two different slices, so factsOf's memo could never serve both. affine now counts it in the body as the agent wrote it. 3. That body is rarely the one readRequestBody held (requestModel, spawnAgentModels and the lift each write a new one), so factsOf's memo missed for it anyway. serve now holds it (holdBody), and holdBody lists a body once when it is held twice. Tests (internal/gateway/lite_lift_test.go), each red on the old code: - TestLiteLiftMovesOnlyTheTools: same result as the old whole decode (liftWhole, kept in the test) on testdata/context/codex.json, the merged-namespace case, a 2,000-word conversation and the no-op shapes; an item with its keys unsorted, \u escapes and 2.50 goes as written. Old: the kept item came back re-sorted and re-escaped. - TestLiteLiftAllocatesAboutTheBody: under 2x a 1.35 MB body. Old: 14,126,976 B (10.4x). - TestMaskedRequestParsedOnceForItsFacts: a served masked Lite request is parsed once for its turn and folder (factsParsed hook in readFacts). Old: 2. With only change 2 it was still 2 (cause 3). Measured (darwin/arm64, a 4,012,240 B Lite body): - liftAdditionalTools: 30.46 MB/op, 98,560 allocs -> 5.17 MB/op, 6,609. - readFacts of it: 54.0 MB/op -> 26.7 MB/op. - Served through New().Handler() with masking on, 8 concurrent x 5 rounds of a 4,010,268 B body, two runs each: allocated per request 215.6 / 220.7 MB -> 116.2 / 116.2 MB; peak HeapInuse 993 / 802 MB -> 612 / 561 MB; HeapSys 1001 / 892 MB -> 699 / 674 MB. - The live app's WebKit processes were ~8-9 MB RSS each, so the webview is not where the memory went on macOS; the live pid sat at 476-596 MB RSS over a 15-minute sample. Run at this head: gofmt -l clean; go vet ./...; GOOS=linux go vet -tags nogui ./...; GOOS=windows go vet ./...; go build (gui and nogui); go test -tags nogui -timeout 45m ./... in a sandbox HOME at |
||
|
|
642180a809 |
redact: Insights › Masking and Try it mark a made-up key as a placeholder (#3599)
With "Keep a key's form" on ( |
||
|
|
642d430ecb |
native: pf-serve on a GPU reads the model once, not twice (#3590)
On a GPU (Metal, Vulkan), privacy-filter.cpp read the whole 1.6 GB GGUF into a CPU ggml context, copied every tensor into the device's buffer, and kept the CPU copy "as source" for as long as pf-serve ran. #3590's Mac held 4.7 GB of physical footprint idle. patches/weights-once.patch opens the GGUF metadata-only when the backend isn't the CPU, and reads each tensor from the file straight into the device's buffer through one 16 MB chunk. The CPU backend still reads it whole and uses that buffer in place, as before. Run: build.sh for every target on CI (privacy-filter run 40188759504, green on all five), then a probe (start pf-serve, classify 7 texts in en/zh/code/cards plus a 57K and a 20K text, 20 hot requests, 3 long ones, read memory after 5 s idle) on the released pf-v1 and on this commit's CI build, with the pinned model (sha256 80efc180…): Mac M4 Pro, Metal, GGML_METAL_NO_RESIDENCY=1 as magpie starts it: idle phys_footprint 4777 MB -> 1683 MB, RSS 4798 -> 1706 MB hot request median 9.0/13.8 ms -> 10.8/9.9 ms (two runs each, load average ~180, so noisy); long 1.5-1.9 s both Mac, CPU: 1852 MB both, as before Windows, AMD 8060S, Vulkan: private bytes 6629 MB -> 1968 MB, working set 3258 -> 174 MB hot median 4.2-4.7 ms both, long 0.79-0.85 s both, load 1.2 -> 0.8 s Windows, CPU: 1810 MB working set both The spans are byte-identical before and after on each backend (Metal, Mac CPU, Vulkan, Windows CPU; each backend's own as before). Not tried: Linux's pf-serve-vulkan on a real GPU (the same code path as Windows' Vulkan); linux-arm64 and darwin-amd64 run on the CPU only, which this doesn't change, and were only built. |
||
|
|
83571db8ed |
provider: Command Code's plugin is at least 0.1.17, its Credits bar second where magpie shows two windows (01huadalang on Discord)
01huadalang said the Command Code card has no bar for the total quota left. The Providers account line (quotaLine) and the menu bar (trayusage) show a provider's first two windows. A plan account's plugin reported [5 hours, Weekly, Credits], so the dollars were only in the tooltip. Plugin 0.1.17 (plugins 8531ccc) puts Credits second, after the 5 hours. The min goes to 0.1.17 so keepMovedCurrent updates every moved user. npm view @magpie-community/opencode-commandcode-auth --prefer-online: latest 0.1.17, published by publish.yml run 40186792179 with provenance (its npm job is red only on think-tags 0.1.1's known E404, plugins#180). The plugin's bun test: 65 pass. The plugin's auth.usage, against the owner's real GOAT account: 5 hours 0.93%, Credits $0.63 / $70.00, Weekly 1.20% (before: 5 hours, Weekly, Credits). Plugins PR #303 was reviewed and not merged (it loses the $ on today's magpie and adds no bar); see its comment. At the pushed head (this and the provider commit, rebased on origin/main |
||
|
|
47689f9fd9 |
gui: the usage heatmap scrolls under the app's thin thumb, not the system's bar (cybercaius on Discord)
cybercaius said the usage heatmap's scrollbar looked out of place beside the rest of the window. .heat-scroll was the only scroller with scrollbar-width: thin. In Chromium (so WebView2) a non-auto scrollbar-width drops every ::-webkit-scrollbar rule and draws the system's bar, gray track and all; on a Mac the WebView draws only the overlay bar, which a mouse never shows. The line is gone, and the Mac rules pages, dialogs and framed editors use take .heat-scroll too, so the weeks scroll under the same 8px (Mac) or 10px thumb as the page. No layout change. heatmap-scrollbar.test.cjs: chromium and webkit, on and off a Mac, a 420px card of 53 weeks: the weeks overflow, scrollbar-width is auto, and the heatmap's bar gutter equals a .view's. What was run, at this commit's tree (base |
||
|
|
758be6d14e |
library: magpie-setup is first in the market's skills, so an agent can set magpie up as asked
Leyuu_5 on X: "功能越来越多,感觉可以来个skill让AI来帮设置需求了". The skill
lives in magpie-community/plugins (skills/magpie-setup, e513644) and
teaches an agent to turn a request into magpie's own commands. Listing
it in featuredSkills puts it first under Library › Market › Skills,
official, one click to add, with no setup.
What was run at this head:
- go test ./internal/library ./internal/cli: ok (library's first run
failed only with "no space left on device" while writing testlog.txt;
run again on its own: ok 193.7s)
- TestFeaturedSkills extended: magpie-setup first, quota second, both
Official/Featured with a description; "setup", "routing" and
"gateway key" find magpie-setup first, "quota" finds magpie-quota
and not setup. Red with magpie-setup taken out of the list.
- gofmt -l internal/: empty; go vet (darwin), GOOS=linux go vet -tags
nogui, GOOS=windows go vet on internal/library and internal/cli; go build
- library.InstallMarketSkill("magpie-community/plugins", "magpie-setup")
in a sandbox HOME against the pushed plugins repo: Installed
[magpie-setup], SKILL.md in library/skills/magpie-setup.
Not run: the full ./... suite (the disk had under 1GB free), the GUI
suite (no GUI asset changed; market-featured-skill.test.cjs fakes the
list).
|
||
|
|
fba554c7f8 |
library: magpie library mcp add without agents= says the server went to no agent
A server added with no agents= is kept in the library and given to no
agent, but the command printed "✓ every agent already has it". It now
says "<name> is in the library, given to no agent yet" and names
`magpie library mcp agents <name> <a,b…>`. With agents=, and for
`mcp agents`, the output is as before ("written into claude").
Found while trying the magpie-setup skill's commands in a sandbox HOME.
Not changed (#3598): `library instructions set` with no agents chosen still
prints "every agent already has it" while no agent is given it.
Instructions have sets, so its check needs the active set's agents.
Run: go test ./internal/cli -run TestLibrary -count=1 ok; the new
TestLibraryMCPAddNoAgents fails on the old library_cli.go (reverted by
hand: "✓ every agent already has it") and passes with it. go vet
./internal/cli and gofmt -l clean.
|
||
|
|
6bffcfe178 |
gateway-key: a key's monthly limit can be set from the CLI again
`magpie gateway-key limit <id> month --cost 5` (and `add month`) failed with "an N-hour cycle is a whole number of hours …: \"month\"": parseKeyLimit cut an h off any window ending in one before it looked for a named period, and month ends in an h. A named period (day, week, month) is now taken as itself before the <N>d and <N>h forms are read. Found while trying every command for the magpie-setup skill in a sandbox HOME. Run: go test ./internal/cli -run TestGatewayKey -count=1 ok; the new month cases in TestGatewayKeyLimitCLI fail on the old parseKeyLimit (reverted by hand) and pass with it. Tried the built binary in a sandbox HOME: limit <id> month --cost 5 sets "this month". |
||
|
|
7536477c8e |
gui: the Dock icon flaps its wing and tail as the header logo does
Clicking magpie's Dock icon plays the header logo's .logo.wag on the tile: the same keyframes, turn points, .9s and cubic-bezier(.3, 0, .3, 1), a frame every 30ms. The icon macOS draws (its glass tile and glossy bird) is cut into body, tail and wing by index.html's own clip paths, the tile under the bird filled with the tile's colour read either side of it, and each frame turns the pieces over it, set as the Dock tile's content view. The tile goes back to the system's icon after. It plays only when the Dock draws icons light (no AppleIconAppearanceTheme, RegularLight, or RegularAutomatic in light mode); a dark, clear or tinted Dock is left as it is. A click while it plays doesn't start another. Run: - go test ./internal/gui/ -run TestDockFlap: TestDockFlapIsTheLogos holds the keyframes, origins, length and easing to app.css and parses the bird and clips out of the embedded index.html. Broken by hand: changing one keyframe in flapkeys.go turns it red. - TestDockFlapFrames (MAGPIE_DOCK_APP=/Applications/magpie.app) wrote the 31 frames; looked at by eye. Frame 0 against the system's own 512px render: inside the tile 0.03% of pixels differ by over 40/255 (the tile's rim resampled); the pieces' seams were visible until they overlapped by 1px. - A sandbox bundle (own bundle id, sandbox HOME, ports 3446/3447) got the Dock's reopen event by pid: a burst of screen captures of the real Dock shows the tile in different poses. - go vet ./internal/gui/, GOOS=windows go vet, GOOS=linux go vet -tags nogui, GOOS=linux go build -tags nogui, GOOS=windows go build, gofmt -l. Not tried: a dark or tinted Dock (skipped by the gate, not drawn), a real mouse click on the Dock (the same reopen event, sent by pid). |
||
|
|
7ad6df865c |
whatsnew: many releases' notes read as one list, by kind
The owner: nine releases of a line each, in the update sheet's "What
changed since v0.1.1521", read as a scattered list. When more than one
release is shown, their notes are now merged: a line saying the range
("9 releases · v0.1.1522 – v0.1.1530"), then one heading per kind (New
features, Improvements, Performance, Bug fixes, Security, Provider
changes, Changes, Documentation, then any heading of their own) with how
many lines it has, each line with the version it came in, newest first.
A line two releases both carry is said once, at the newest; a line with
no heading goes under Changes. One release reads as before. Both the
update sheet and What's new (after an update, and Settings' range
picker) merge; the not-installed badge names its range.
Run at this tree (rebased on origin/main
|
||
|
|
db6d1540ef |
redact: eval cases that reach more of modelTakes/modelFits
TestMaskEval's cases reached 5 of the 36 checks on model spans: breaking any other one by hand left it green. This adds 21 cases (39 to 60), most of them texts from modelfits_test.go and vendorchecks_test.go, the places the model was seen misreading, and records the real model's spans on them (testdata/eval-model.json). Breaking each check by hand (breaks.py: one replacement in model.go, TestMaskEval run, file restored) now turns 13 red (5 before): secret-madeID, person-2runes, email-realEmail, person-zhTrim, person-assistant, account-numberLike, account-cue, address-letter, secret-wordstart, secret-uuid, secret-hexwords, secret-hexcue, edge-delimiter. Still green, because the real model gives no such span on any text tried (24 more probed) or another check catches the same span first: secret-namesThing, secret-len8, person-snakeWord, account-madeID, cut-from-word, person-chars, person-filedot, person-pathpart, person-colon, person-lowerword (person-chars keeps the same lower-case word), account-hex, account-version, the four phone checks, secret-pattern, secret-json, secret-link, secret-base64, email-wordstart, email-modcache, email-userinfo. Their unit tests in modelfits_test.go still cover them with recorded spans. A new real miss: "hex40 ok? 1 <sha1>" is one secret span "1 <sha1>" to the model, and the hex-words check only looks at the first field. Filed as #3597 and marked Known. Totals at this head (rules / model / both, masked and wrongly): 16/40 0/89, 38/40 28/89, 39/40 1/89. Run: MAGPIE_EVAL_CACHE=$HOME/.cache go test -run TestMaskEval -v ./internal/redact (recorded, then replayed green); go test -count=1 ./internal/redact ./internal/pii ok; go vet ./internal/redact for darwin, linux and windows; gofmt -l clean; breaks.py over all 36 checks. Not tried: the full suite (only test files changed in internal/redact). |
||
|
|
dc6f3d496c |
masking: the flow's logos sit on one disc each, before the name on both sides
Insights › Masking's flow card showed each agent's and provider's logo
bare in a 16px box. A logo's own drawing fills that box or not (Pi's
edge to edge, Codex's a small tile, Alma's a picture), so three logos
of one box read as three sizes (the owner's screenshot). And an
agent's logo came after its right-aligned name, so the logos and the
names on that side lined up with nothing.
- Every logo sits 14px on a 24px disc (card fill, hairline ring), the
disc the app's agent stacks use.
- Both sides read logo, then name over count, left-aligned. The
agents' nodes are one block against the lines (a grid track as wide
as the widest), so their logos make one column and their names one
edge, as the providers' do.
Run (rebased on origin/main of 19:00, 10-25):
- masking-records.test.cjs: 52/52, Chromium and WebKit, 5 languages,
1100px and 640px. Its flow check now asserts logo before name on
both sides, a 24px round disc for every logo, and one column of
logos and one edge of names per side.
- Screenshots with the owner's case (Pi, Codex, Alma → OpenRouter,
Codex, OpenCode Zen), dark, 1x and 2x, looked at.
Broken by hand: the agent's logo back after its name turns
masking-records red ("the logo before the name").
Not tried: the light theme by eye (the disc is drawn from theme
tokens), the real app on WebKitGTK or Windows. Budgets untouched:
plugins/redact isn't in the core.
|
||
|
|
30d3001a04 |
gui: a wheel or coast macOS 13's WebKit never tells the page of still scrolls the view (issenn on Discord)
issenn, on macOS 13.7.8 (system WebKit 18615, Safari 16.6's): no page of the window scrolls by trackpad or mouse wheel, the bar doesn't move, a forced trackpad scroll shakes and snaps back, and only dragging the bar works. Cause (hedged, not seen on a real WebKit 16.6): the view guard puts back every .view scroll outside a window the reader's own events open (wheel, touch, keys, scrollOnPurpose). The bar's drag goes past it (barDrag), which is why that alone works. WebKit 16.x can scroll a view under a wheel or a coast it never dispatches to the page (WebKit bug 256582, Safari 16.4.1: monitorEvents(window) showed no wheel over some elements). With no wheel heard, no window opens, and every reader scroll is taken as code's and put back. That is the shake, and the v0.1.1488 coast chain couldn't help, since it starts from a heard wheel. Fix, in puttingBack: three put-backs on one view in one direction within a second, with no click holding (held), are the reader's. They are given back, and the fling window opens. Each later put-back the same way within a second of the last is given back at once. So a wheel turned slowly, or one run broken on a loaded Mac, loses no step. A scroll by code happens once and makes no run: two at rest are still put back, and scrolls a click holds against still are. On a WebKit that does dispatch the wheel, nothing changes: the wheel opens the window first and nothing is put back. To stay under appScriptBudget with no raise, the guard header's click bullet was shortened, and its detail moved to gui-shell.md. Test: view-wheel-unheard.test.cjs (Chromium and WebKit, en and zh). A capture listener stops every wheel before app.js hears it. Then: - ten fast 20px wheels must move the view 190px or more; - five notches 400ms apart must land, down and back up; - six wheels up must bring it back; - two code scrolls at rest are still put back; - after a click on an agent row, a code scroll each frame leaves the row in place. Run: - At origin/main |
||
|
|
2c7f0ac12c |
plugin: options saved from a hooks package's own page reach its hook
SetPageOptions saved without starting the host again for any package whose
page and panels looked like all it had. Window() only reads main/exports,
so a package with magpie.hooks and a page (magpie-community/plugins#117's
PowerContext) counted as page-only. The host hands each hook the options it
loaded with, so a Service URL or key saved from the page did nothing until
magpie restarted. A gateway hook now goes through SetOptions, as a
middleware and an agent already did.
Run at
|
||
|
|
d2e0ea393d |
pii: pf-serve starts with ggml's Metal residency heartbeat off (#3185)
macOS's Energy Impact puts magpie at the top while CPU stays at ~6% (#3185). Energy Impact counts wakeups, and an idle pf-serve (the privacy filter's llama.cpp child) woke 134-146 times a second: ggml's Metal backend keeps a residency set alive with a heartbeat. pf-serve stays up for 10 minutes after each masked request, so any masking user pays that most of the day. GGML_METAL_NO_RESIDENCY=1 turns the residency set off. Measured with proc_pid_rusage (ri_interrupt_wkups, ri_energy_nj) on an M4 Pro, idle pf-serve, 20s windows: - before, pf-serve pf-v1 as magpie starts it today: 140.0 and 138.5 wakeups/s, 2.67 mW; the user's live v0.1.1370 pf-serve child read 134-142/s - after, pf-serve started through pii.Find at this commit: 0.4, 0.3, 0.3 wakeups/s, 0.02 mW - GGML_METAL_RESIDENCY_KEEP_ALIVE_S=0 or 1 instead: 143-146/s, no help - latency: hot requests 51-78ms either way; the first request after a 5-60s idle spell 57-77ms before, 105-518ms after; 90s idle through pii.Find at this commit 56-183ms Run at this commit: - go test -count=1 ./internal/pii/ ok; TestServeStartsWithoutResidencyHeartbeat red with the env line put back to os.Environ() ("residency " on both starts), green with it - GOOS=linux and GOOS=windows go vet -tags nogui ./internal/pii/ ok, gofmt -l clean Also measured: current main in a sandbox HOME with clones of the real Claude/Codex sessions and magpie cache (no logins), window open, after warm-up: main process 1.1-2.2 wakeups/s, 0.9-1.9 mW; its WebContent 0.5/s and GPU 0.3/s. The app.js intervals and the Go tickers were read and are already held while the document is hidden or cheap. Not tried: the full suite (an env-only change to one package); a logged-in instance. The user's live v0.1.1370 main process reads 69-217 wakeups/s and 25-120 mW, which the sandbox at main (no logins) doesn't reproduce, so its source is still unknown; Vulkan/Linux pf-serve (the variable is Metal's only and ignored there). |
||
|
|
0cba7fa680 |
provider: ZCode's mover min is 0.1.30 (plugins #387)
zcode 0.1.30 (plugins 57598ad) puts metadata.user_id
{"device_id":<sign-in's device>,"account_uuid":"","session_id":""} on a
GLM Coding Plan or team Messages request when the agent sent none, as
ZCode 3.14.3's client does on every Anthropic-format request
(glm/zcode.cjs Pst/MLs, vWr); before, only the Start Plan's dressed body
carried it. A key-only account's device is hashed from the key, the same
on every start. keepMovedCurrent brings every moved user up to it.
npm view --prefer-online @magpie-community/opencode-zcode-auth version:
0.1.30 when this landed.
Run at this tree: go test ./internal/provider/ -run
'Mover|Move|Moved|Migrat|ZCode|Retir|Adopt|HandOver' -count=1 -> ok.
Not run: the full suite (a one-line min change).
|
||
|
|
09c0a844bd |
gui: the tray panel draws its last allowances at once and asks for them beside the state (#3160, #3134)
The panel's Allowances tab stood on skeletons until the whole /api/state had been read and only then asked /api/usage/quotas: the request trace on the old code shows the quotas GET starting after the state ends every time (state 216+73ms, quotas at 321ms; a run whose state took 2704ms asked at 2825ms). On a machine with many agents the state alone is seconds, and the vendors' reads came after it. - The panel keeps the allowances last read in its webview's storage (magpie.panelQuotas) and draws them at once, each card's refresh turning (.quota-refresh.reading) until the read lands in their place (yiliang114's stale-while-revalidate, #3160). Kept cards wait for a state, the kept ?last=1 one or the read one, to say which are hidden. - The first load asks for the allowances beside the state, not after it (panelQuotasNow, the same opened/not-opened rule as before, #1588). - The core budgets go to the new size: the tray panel's, the core's own. |
||
|
|
f1537d9f95 |
context: the map counts on as a live request grows, and keeps its tip
The owner asked for the rest of what flohoeller's context map on X does,
keeping the A1 colours. On a live request's redraw:
- Every token count (the big number, the short head, the legend, each
tile's value) counts on from what it said to the new value over 620ms
(ease-out), instead of jumping. morph rolls any element with data-n;
a tile's value rolls as the tile glides. With motion reduced, or on a
first draw, the value is simply set.
- A tile pointed at keeps its tip through the redraw: the tip is told
again with what the tile holds now and kept over it while it glides
(followTip). Before, every redraw closed it.
- A tool's gathered results say how many ("exec_command ×20"), and the
small files gathered into one tile name the folder they share
("api/ · 6 files") where they share one; otherwise "N more" as before.
"{n} files" is translated (zh, zh-TW, ja, de).
A frame's time can be before the roll's start, which made the first
frame count back (40K, 39.8K, 40.7K); the progress is clamped at 0.
coreScriptBudget: 1,530,631 to 1,533,445: 2,810 bytes of context.js
(which the Routing page draws as well as Usage) and 4 bytes
|
||
|
|
b30734f964 |
sessions: Antigravity CLI (agy) conversations are listed, with title, folder, tokens and resume (RickyWei, #1718)
agy's conversations were on no Sessions page: internal/sessions had no lister for them, only the calls reader of #2097. Now each ~/.gemini/antigravity-cli/brain/<id>/.system_generated/logs/transcript_full.jsonl is a session (agy.go). Its steps give the start and last times, the first prompt (taken out of agy's <USER_REQUEST> wrapper), prompts, replies, tool calls, and tokens under the model "agy", since no step names one. A step written again replaces its tokens, read on or read whole. The title and folder come from the conversation's conversation_summaries.db row: title, and workspace_uris through agyFolder, which turns file:///C:/... and file:///c%3A/... into C:\... and a host into \\host\share on Windows. agy writes the title after the transcript, so the row is the file's rev. The database is read again only when it or its -wal changed, and a failed read keeps the rows read before. A row with conversations/<id>.db and no transcript (#1718's case) is listed from the row alone, with no tokens and no conversation to open. Resume is "agy --conversation <id>". When agy is set to use magpie, it is the agent's launch command (gateway variables and --model, the PowerShell form on Windows) with --conversation after it, through sessions.AgyStart, which package agent sets. The transcript (user text, thinking, text, tool calls, tool results) can be opened and searched. Format read from real files: agy 1.3.5 and 1.4.7 in a sandbox HOME against a fake Gemini endpoint, with plain replies, a read_file tool call with thinking, invalid tool calls, and a conversation picked up again with --conversation from another folder. testdata/agy-sessions is three of those conversations with paths rewritten to /work. Resume tried for real in the sandbox: `agy --conversation <id> -p again` from another folder appended steps 2-4 to the same transcript and kept the row's folder. Interactive `agy --conversation <id>` (in tmux) showed the earlier turns. Run at this tree, rebased on origin/main: - gofmt -l internal clean - go vet: darwin; GOOS=linux -tags nogui; GOOS=windows - GOOS=windows go build ./...; GOOS=linux go build -tags nogui ./... - go test -count=1 ./internal/sessions ./internal/gui ./internal/agent: ok before the row-only change. After it, sessions ok, and gui had one red, TestMainWindowCorners killed at its 40s deadline at load ~300 (#1936). It passes alone (47s). - GUI (playwright 1.62.0, chromium and webkit, en and zh): i18n-keys, gui-de, gui-ja, gui-zh-tw, session-terminal, sessions-bar-names, sessions-manage, sessions-talk, sessions-toolbar: 49 of 49. No GUI asset changed. Tab names come from the agent registry. Fails without the change (broken by hand, each one red): - agyFiles out of allFiles: TestAgySessions, TestAgyTitleLater, TestAgyTranscript - agy out of refresh's DBRevision check: TestAgyTitleLater - no dropUse of a rewritten step: TestAgyGrows (4510 input, want 3010) - AgyStart ignored: TestAgySessions (wired resume) - drive letter not handled: TestAgyFolder - agy out of HasTranscript: TestAgySessions, TestAgyTranscript - the row-only listing off: TestAgyRowOnly; readable() off: TestAgyRowOnly Not tried: agy on Windows. The Windows box (10.0.0.132) didn't answer ssh, so the Windows paths are covered by unit tests only (agyFolder, the Set-Location resume form). A wired resume through magpie's real gateway was not tried. Not done: subagents (parent_conversation_id), which I never saw agy write. The model name, which is only in conversations/<id>.db's protobuf (#3147). Deleting an agy session from magpie. agy in WSL: #3595. Side effect: agy's self-updater ran in the sandbox and replaced the live ~/.local/bin/agy, 1.3.5 -> 1.4.7. |
||
|
|
84c50f0328 |
update: an old "up to date" isn't said, and Settings' Version row asks again (RickyWei)
RickyWei (Discord, Windows, Chinese UI): Settings > 关于 said 版本 0.1.1402 ·
已是最新 with v0.1.1517 out on yetone/magpie-releases.
Cause, from the v0.1.1402 code (internal/gui/update.go is unchanged since):
state "latest" is set only when a check that worked found nothing newer,
and a failed read is state "error" ("Couldn't check for updates"), so the
row's claim is the answer of one check. Nothing aged it: the state stayed
"latest" until the next check, and the row only read it. v0.1.1402 was the
newest release from 13:14 to 13:37 UTC on 10-24 (v0.1.1403 at 13:37), so
a check then said up to date, and with automatic checks off (Settings'
"only when asked") or once a day that stood for the next day while ~115
releases went out. The feed itself is right: usemagpie.ai/api/latest,
with ?lang=zh too, answers 0.1.1517 (gh release list agrees), the version
order is numeric, and nothing on Windows skips the check. Hedged: the
user's settings aren't known, so the interval is inferred, not seen.
Now:
- jsonIn reports a "latest" older than freshAfter (5 min) as "" (not
asked lately), so no surface says up to date from an old answer.
- GET /api/update?fresh=1, which only Settings' Version row sends, asks
the feed again over a stale "latest" with automatic updates on; the row
shows checking and reads again. With them off nothing is asked by
itself, and the row says "Automatic updates are off" with Check.
The header pill's reads don't ask, so the feed's cadence is unchanged
for a window left open.
- app.js stays inside TestCoreScriptBudget: a comment word went.
Run, at this tree:
- TestStaleLatestIsNotUpToDate (new): 1402 checked while newest, then
the feed at 1517 and the answer aged past freshAfter: the plain read
isn't "latest" and asks nothing, the row's read finds 1517
("available"); with automatic updates off it is "" and asks nothing.
Red on origin/main's update.go ("an old answer still says up to date"),
green with it.
- update-check.test.cjs asserts the row reads with fresh=1: red on
origin/main's app.js (4 of 4 language/engine cases), green now.
- go test -tags nogui ./internal/gui ./internal/update (sandbox HOME): ok.
- The 21 GUI files that fake /api/update plus i18n-keys, Chromium and
WebKit, en/zh where they cover them: 299 of 300 pass. The red is
header-centre webkit (ResizeObserver loop as a page error), red the
same on untouched origin/main
|
||
|
|
c888ef2725 |
routing: a rule's hours are kept in the zone they were set in (gaubeebangeel on X)
magpie on a cloud server in UTC read a routing group's rule hours on the
server's clock, so a Beijing user's 09:00-18:00 held at 17:00-02:00
Beijing time, with nothing saying so.
- provider.TimeWindow carries the IANA zone its hours were set in
("zone": "Asia/Shanghai", omitempty). Holds reads From, To and Days in
that zone (time.LoadLocation, cached; Go's embedded tzdata, so Windows
knows them too). A window with no zone, every one saved before this,
stays on magpie's own clock (time.Local) as before. A zone magpie
doesn't know is refused on save (clean); one in a file edited by hand
makes the window never hold, so the rule is as if absent, never always
on and never hours off. Text() adds " (Zone)"; Line() writes tz=.
- GUI: changing a rule's hours or days in the editor saves the browser's
zone (Intl resolvedOptions().timeZone); hours left alone keep theirs.
/api/groups gives magpie's clock (clock: zone, offset in seconds), and
when its offset differs from the hours' zone the Routing page tells the
zone beside them, on the group's rules and in the editor: "Asia/Shanghai
time" (zh "Asia/Shanghai 时间"), or "server time, UTC+0" (zh "服务器时间
UTC+0") for hours with no zone. Nothing is added when the clocks agree.
zh, zh-TW, ja, de.
- CLI and TUI: time=09:00-18:00@Asia/Shanghai or tz=Asia/Shanghai; with
none, this computer's zone ($TZ, time.Local, the /etc/localtime link)
when it has an IANA name, otherwise none (magpie's clock). An unknown
zone is refused with what one looks like; tz= alone needs time= or
days=. Usage text updated.
- docs/subsystems/gateway-routing.md: the zone rules.
Older magpie reading a shared or synced group ignores zone and reads the
hours on its own clock, as before.
Run in a sandbox HOME with pinned Go caches, first at base
|
||
|
|
11907448e3 |
provider: the Cursor mover's min is 0.2.23, which sends a Team account's x-cursor-team-id (plugins#231)
npm view --prefer-online @magpie-community/opencode-cursor-auth: 0.2.23. Ran: go test ./internal/provider -run 'Mover|Moved|Min|Cursor' (ok), gofmt -l clean. Not run: the full suite (a one-line min change). The plugin change itself was reviewed and run against a real Cursor account in plugins#231. |
||
|
|
120264a49f |
sessions: a Codex line's marks are read in one pass, not one bytes.Contains each (#3493)
callHead and codexCallLine asked of every rollout line, with a
bytes.Contains each, whether it held "type":"user_message",
"role":"user", "type":"function_call_output" and nine more: up to twelve
passes over the line in each, a line of megabytes of tool output
included. A CPU profile of a cold usage read on Windows (20,807 Codex
rollouts, 44GB, magpie web in a sandbox home on the Windows box) put 37%
of its 270s of samples in that bytes.Contains (indexbody).
cxMarksOf reads them all in one pass: it walks each `":"` that ends a key
(in a JSON string the quotes are escaped, so never one inside a string),
and records the "type" values and the user's role it finds. It finds
what each value's own pass found: the same line, anywhere in it.
Run:
- TestCxMarksAsContains: twelve lines (long escaped strings holding the
values, a nested value past a long string, "subtype"/"xtype" keys,
"role":"users", empty and cut lines) give the same marks as a
bytes.Contains of each. Red when the role is not recorded (3 lines).
- Every line of the owner's real ~/.codex/sessions, read only: 619
files, 20,059 lines, 4.3GB, 0 lines whose marks differ.
- BenchmarkCxMarks, a 1MB exec_command_end line: 0.36ms a line, from
11.2ms.
- Windows box, cold (.cache\magpie removed), magpie web, 3 rounds each,
alternating, origin/main
|
||
|
|
d580537201 |
provider: the ZCode mover's min is 0.1.29, a sign-in keeping the account's user id
zcode 0.1.29 (plugins 5c9b7a4) gives each sign-in uid: ZCode's user_id, so the plugin host tells two ZCode accounts of one name apart (wakkana on Discord reported it for WorkBuddy), and the app's entry follows ZCode only while it is signed in to that user id. keepMovedCurrent brings moved users up to it. npm view --prefer-online @magpie-community/opencode-zcode-auth version: 0.1.29 at landing. go test -run 'Mover|Movers|Notice|Migrat' ./internal/provider: ok. |
||
|
|
552cdf8071 |
redact: a value the model spans from the delimiter before it is masked (#3591)
The model's span may start at the token before a value: the `":"` of
a JSON field, a CSV row's comma. A phone number in
{"phone":"+86 139 1234 5678"} came as `":"+86 139 1234 5678`, and in a
CSV row as `,+81 90-1234-5678`, which the PHONE check took for no
number, and it went as written. A name came as `"Wei Zhang"` and was
masked with its quotes, so the JSON lost them. modelSpans now trims
spaces and `"',;:` from both ends of a name's, a phone's, an
address's, an account's and an email's span; a secret's only spaces,
since a password may start or end with a quote.
Found by TestMaskEval: its 3 #3591 phones are no longer Known, and
"both" reads 33/34 masked, 0/40 wrongly (from 30/34).
Run: go test ./internal/redact and ./internal/pii ok; -run
'Mask|Redact|Privacy' ./internal/gui ./internal/gateway ok; go vet
darwin, linux, windows; gofmt -l clean.
Broken by hand: edge = isSpace for every kind: TestModelSpanLeavesDelimiters
red (both phones as written, the name's quotes gone) and TestMaskEval
red on the 3 phones.
Not tried: the full suite (internal/proc's #3567 is red on main), a
real request through the gateway with the model on.
|
||
|
|
033990e642 |
redact: the masking evaluation starts with nothing known
A value Mask masks is known from then on, and masked wherever it is again (known.go), Preview's too. TestMaskEval ran after the tests that masked hunter2pass, rina.k@fastmail.com and the like, so in the package's full run what they masked was masked in its cases too, and the rules' column was not the rules': with one test before it that masked the eval's phones, rules read 19/34 for 16/34. Forget (export_test.go) lets every value go before the cases. 180cfb565's body says 38 cases; there are 39. Run: go test ./internal/redact (TestMaskEval in the full run and alone: 16/34 rules either way) and ./internal/pii ok; go vet darwin, linux, windows; gofmt -l clean. Broken by hand: without Forget and with a test before it that masks the eval's phones, rules read 19/34. |
||
|
|
a30aed0162 |
provider: the WorkBuddy mover tells two accounts of one nickname apart by uid
wakkana on Discord: WorkBuddy accounts with one display name collapse into one, deduped by name (wbWho's nickname, addSideLogin's EqualFold). Where that runs today: WorkBuddy's built-in sign-in is gone, so addSideLogin no longer writes WorkBuddy accounts. A sign-in through the plugin goes to the plugin host, whose settle already keeps two accounts of one name with different uids apart and lets the same uid replace itself (#413, TestPluginSameNameOtherUID, passes at this head). What was left by name is the mover, for accounts not moved yet: - wbLogins dropped WorkBuddy desktop's account when an account magpie signed in had the same nickname, whatever its uid (the generic "one of magpie's stands for the agent's own" rule). Now it stands for it only when the uid matches; one removed in magpie stays out. - renewedSince matched by name, so the desktop's marker read as the other "Me" renewed and the move would never commit. Moving and movedAccount carry the vendor's id (WorkBuddy's uid), matched by it where both have one; the agent's own is never compared; putBack skips by plugin key, not name. Other movers have no id set, so they match by name as before; their built-ins name accounts by email or login. The live addSideLogin callers (Copilot, Google, ChatGPT API) name accounts by login or email too. Sibling plugin: zcode 0.1.29 (plugins 5c9b7a4) now gives a uid, its min is raised in a separate commit. Run on origin/main |