72facf72e2ff87c481a6728de5a35dfccd59ffdf
7552
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
72facf72e2 |
memory: a search or save can name its project, and every answer says whose and where (Norethcy on X, #6392)
The memory tools had no target-project argument and no way to see the caller context they resolved, so a scoped migration run from one project couldn't keep memories for another or check where they went. - memory_search and memory_save take `project`: a folder on this computer (absolute, or relative to the caller's own folder), or the key of a project memory knows (github.com/owner/repo, with or without project:, or a project's one name). A project named goes with scope project (a save's default then) or a search's all; global or agent with a project is refused, and an unknown project says which ones memory knows. - Answers name what was used: a memory reads "this project (<key>)" and "only for you (<agent>)", and a search ends "(looked in: everywhere, project <key>, agent <id>)". - New read-only memory_context: the agent the server takes the caller for and how it was found (router _meta, magpie mcp memory's initialize, key/User-Agent, the session's initialize), the project with its folder and source, the scopes a search looks in and the server version, as text and structuredContent. Given `project`, it shows that one. - HTTP and stdio are the same server (magpie mcp memory relays), and OwnMCPTools lists memory_context with the others. Run (mote, -tags nogui unless noted): - TestMemoryMCPProjectArgumentAndContext (new): folder, key and relative folder; the caller's own project untouched; refusals; memory_context's text and structuredContent; tools/list. Red with the project argument ignored by hand. - TestMemoryBridgeContextAndProject (new): the real gateway behind magpie mcp memory over stdio, initialized as codex as in the report. - go test ./internal/browsermcp ./internal/cli ./internal/library: ok; go test -run 'Memory|OwnMCP|Hub|RootDirs|Tool' ./internal/gateway: ok. - Windows (xiaomi-gpu, win-run): the new gateway, browsermcp and cli tests ok (a test's own unquoted Windows path was fixed on the way). - go vet darwin, linux nogui, windows for the four packages; gofmt. Not tried: Codex desktop itself over /mcp/run/magpie-memory; the full suite runs after the tag. |
||
|
|
e39b9d5df7 |
cli: magpie tool reads an event-stream answer and names its folder (Norethcy on X, #6049, #6392)
`magpie tool memory_search --scope project --json` exited 1 with "isn't JSON-RPC: is it magpie? (invalid character 'e' ...)", and memory_save said the same after it had saved. The CLI sent no X-Magpie-Cwd, so the memory server asked it roots/list on the call's own event stream (it accepts text/event-stream), waited 3s for an answer that never came, and sent the result as a second SSE event; rpc() then read the whole stream as one JSON body. Now magpie tool sends the folder it runs in (X-Magpie-Cwd), as `magpie mcp memory` does, so --scope project is that folder's project and no roots are asked. rpc() also reads a text/event-stream answer: it takes the data event whose id is the call's, answers a server's roots/list with its folder and refuses any other ask at once, so no server's question breaks the CLI or makes it wait. Run (mote, -tags nogui): - TestToolMemoryThroughTheGateway (real gateway, sandbox HOME, a git repo as cwd): red on the old code with the reporter's exact error; green now, both calls under 2.5s. - TestToolReadsAnEventStreamAndAnswersTheServer: red on the old code. - go test ./internal/cli: ok. Broken by hand: without the header, the event-stream test is red (no folder named); with stream reading off, it is red with the reporter's error. Not tried: the reporter's macOS app build itself; Windows. |
||
|
|
e630c003cd |
usage: Devin CLI's own calls are read from its sessions (aohan0905 on X)
Usage counted none of Devin CLI's requests. Devin's CLI (3000.11.234, run for real in a sandbox HOME) keeps its sessions in <data>/devin/cli: sessions.db (SQLite: sessions, and message_nodes with each chat_message), or with DEVIN_SESSION_STORE=files a folder per session (log.jsonl + meta.json), whose first run copies the database's sessions in and leaves the database. Each assistant message names its call: request_id, generation_model (swe-2-high, effort and all), created_at and metrics (input/output/cache read/cache write tokens, ttft_ms, total_time_ms), written as two nodes per reply. - sessions: calls_devin.go lists both stores (a session in both once, from the store written last), reads each session whole, one call per request_id (Msg devin:<id>), with the cwd. Registered in callSources and wholeCallReaders; Found lists "devin" for the consent page. - provider: DevinModelEffort splits a variant id into model and effort (claude-haiku-5-5-low -> claude-haiku-5-5, low), so the catalog prices it. swe-2 has no catalog price and shows as unpriced. - agentenv clears DEVIN_SESSIONS_DIR in test sandboxes. Fixtures are the real runs' files: 3 sessions in sessions.sql (schema verbatim, triggers dropped, assistant and user rows only), one session only in the folder store and one in both, project folder renamed. Run (mica): go test ./internal/sessions ./internal/provider ./internal/agentenv ./internal/usage ./internal/usageapi ./internal/cli ./internal/gui ok; go vet darwin, linux -tags nogui, windows on the touched packages ok; gofmt clean. win-run: the Devin tests ok. A built binary's `magpie usage all` / `--csv all` in a sandbox HOME holding the real Devin data: 5 calls under Devin, the two claude-haiku-5-5 calls priced from the catalog ($0.000277, $0.000986), swe-2 unpriced. Broken by hand: devinCallFiles out of callSources (TestDevinCalls and TestDevinDBReadAgain red, 0 calls); a session in both stores listed twice (TestDevinSessionListedOnce red, 9 calls); the per-request dedupe off (red, a request counted twice); DevinModelEffort returning the id whole (TestDevinCalls and TestDevinModelEffort red). Not tried: Devin's folder on Windows (taken as %APPDATA%\devin\cli, as its credentials.toml; not seen on a real Windows install); a long real session or subagents; DEVIN_SESSIONS_DIR set (read from the CLI's behaviour in the sandbox, not from a GUI-started magpie's environment). |
||
|
|
54b6d4d397 |
gui tests: editor-thumbs-batched checks the thumbs shown, then Advanced opened (#5886)
editor-thumbs-batched went red on main from |
||
|
|
6bba0572d6 |
gui: an open editor's readings redraw its accounts list, not the page (#5310)
When a provider editor opens, its accounts' readings load after it (loginUsageOf), and their arrival called renderProviders(true): every Providers row and the whole editor drawn again. With 600 accounts that was a second full draw of the editor. redrawAccounts now draws only the editor's accounts list again and puts it where the old one was. A full draw is kept for the cases it was there for: another provider being edited, a rename or a focused field (left alone, as before), and an arrangement in progress or no open list (drawn in full). What a full draw did, the in-place redraw does too: - the list's inputs are named and described as field() names them; that part of field() is now fieldInputs(label, control), shared; - the focus goes back to the same control of the same account, matched by tag and first class (a pressed refresh is "busy", so the whole className is not the same after), not its index in the list, which the readings' new controls move; - that focus is given back, not pressed (modalRefocus), so the dialog keeps holding the pressed element where it was; - the body's scroll is put back after the swap: the focused element taken out moved it by scroll anchoring (120 to 124 in editor-quota-quiet). The full draw also hid a gap it no longer covers: the provider editor's folds learn the labels' column from their own size (edAlign's ResizeObserver), and the prefs fields (Resets, Warm up, Check in, Claude Code) shown after the prefs load widen that column without changing a fold's size. The readings' full draw made new folds that measured it again. mountProvPrefs now aligns the editor's folds after showing its fields (edAlignAt, the observer's body made a function). Measured before (mote, 600 Claude accounts): the in-place redraw saves ~45ms in WebKit and ~30ms in Chromium of the editor's open. The rest of the ~1s is the first layout of 600 rows. Tests: - editor-readings-in-place (new): 12 accounts, readings held until the editor is open and the 3rd account's first button focused. After they arrive the Providers row and the editor's head are the nodes drawn before, the focus is that same button, and the list's labels match a full renderProviders(true). Chromium and WebKit, en/zh/zh-TW/ja/de: 10/10 green. - editor-quota-quiet's "redrawn" watch also counts the accounts list replaced alone; before, it waited for a new .ebody and failed "never came, so this tested nothing". Broken by hand: - the readings back to renderProviders(true): editor-readings-in-place 10/10 red on "the provider's row is the one drawn before". - the focus matched by the whole className: account-refresh-holds red in Chromium, "the focus stays on the pressed refresh" (null). - the refocus without modalRefocus: account-refresh-holds red, "the pressed refresh moved 186.875px". - without the scroll put back: editor-quota-quiet red 8/8, "the body keeps its scroll" (124, 120). - without mountProvPrefs' edAlignAt: editor-advanced-align red in Chromium, "en 1000: Advanced starts at 284.765625, its fields at 349.265625". Run (mote, load 25-45, other sessions' runs beside): - account-refresh-holds, claude-quota-onboarding, editor-advanced-align, editor-hints, editor-quota-quiet, editor-thumbs-batched, one at a time, on this change and on origin/main |
||
|
|
468102b721 |
gui: a move's done line, a sign-in page's open and the other-ways row each written once
Three pieces of app.js were written out more than once, word for word:
- movedSay(p): "{name} now runs on its plugin — {accounts}, {models}."
and the state read after it, in unmovedLine and renderMove.
- signInPage(url, id): open the sign-in page, and on a failure keep its
message on the sign-in still shown, in startSignIn, followSignIn and
startPluginSignIn.
- acts(): the sign-in's row of other ways, made when the first goes in,
five times in one function.
No behaviour changes. This pays TestCoreScriptBudget for the next
commit, the readings redrawing an open editor's accounts in place
(#5310); main was at the budget to the byte. Code bytes, as the budget
counts them: -1043.
Run: see the next commit, whose runs include this one.
|
||
|
|
c2fd48782b |
Put back what 1f05c311d took out of main by mistake
|
||
|
|
1f05c311d9 |
library: an open memory holds still while the Memory tab polls (Nietzsche_Li on X)
"资源库-记忆中,被展开的记忆的表单会定时抖动". While search by meaning
still has memories to read (read < of, which can last up to a minute
between memembed.Keep's reads) or a learn-from-conversations run goes,
the Memory tab reads its row again every 2s, and each read drew the
whole page anew. The open editor was a new .lib-detail each time and
played its content-in entrance (opacity .5, 2px slide) every 2s.
- semWatch/distWatch draw nothing when the read changed nothing, and
redraw only their own row (redrawRow) when it did; the whole tab only
when the memories changed.
- render() marks a .lib-detail open before it (same data-detail) as kept,
so it doesn't replay its entrance. This covers every render of an
open editor in the Library: memories, instruction sets and agents'
files (the siblings; no other Library tab polls into render()).
- A new memory's text no longer takes the focus back on every render.
Run (mote): library-memory-steady.test.cjs, all 5 languages, 980/420,
chromium + webkit: green 4 of 4 whole-file runs after the last change
(webkit alone 2 of 2 before it). Broken by hand: the same test against
origin/main's client.js and library.css: 22 of 22 red ("the editor
played its entrance again"). One webkit de 420 red was the test's own
first row click intercepted by the header at 420px while the page
settled; the test now opens rows with a DOM click.
Also run, both engines, every language, 980/420: library-memory, library-memory-select, library-memory-suggest, memory-icon, library-instr-busy, library-instr-sets, library-linked-set, library-follow-server: all green. No Go code changed, so no go test or vet.
Not tried: the real app on a real memory store mid-read.
|
||
|
|
6a506e2834 |
agent: pi-magpie's source pattern compiles on first use (TestNoEagerPackageRegexps)
|
||
|
|
70f4593e62 |
provider: a key's typed balance can refill each day (Kelen_Yc on X)
A key's balance typed by hand refilled each month or each week. A relay
key with a daily allowance had no way to say so. Now it can refill each
day, at local midnight, like the others:
- provider: Refill{Every: "day", Day: 0} (RefillDay). Last is today's
midnight in now's location, Next tomorrow's. check takes it with day 0
only; ParseRefill reads daily/day/d (daily:1 refused); String is
"daily". A magpie before this drops such a refill on read, as one
written by hand that isn't one, and counts from when it was typed.
- CLI: `magpie provider key-balance <id> <key> --refill daily`; usage
lines updated.
- GUI: the pill's menu has "Refills each day" after "Refills each
week…", posting {every: day, day: 0} at once (no day to pick, so no
ellipsis), with its toast; en, zh, zh-TW, ja, de.
- docs/subsystems/providers-accounts.md names it.
Tests: TestRefillDays gains daily rows (midday, exactly midnight, a
month's and a year's end, Asia/Shanghai). New
TestTypedBalanceRefillsDaily holds the clock in Pacific/Kiritimati
(UTC+14), Pacific/Pago_Pago (UTC-11) and UTC: a minute before local
midnight the spend counts from when it was typed, a minute after it
counts from local midnight and the next refill is the following one.
TestOwnBalanceParsedInYuanAndRefill and TestTypedBalanceRefills cover
parsing, the bad {day, 1}, and read-back; TestKeyBalanceCmd sets
--refill daily. key-own-balance.test.cjs picks Refills each day in
every language, both engines, 900 and 400px, checks the post and that
the menu then shows it picked.
Run on mica at
|
||
|
|
a095e40279 |
usage: a start doesn't hash every session file's rows again for the heatmap's key (#2278)
The heatmap's settled days are named by a digest of each session file's chunk of rows (sourceDigest). The digests were kept in memory only, so every start unpacked and hashed every chunk again: 0.14-0.16 s of CPU in the first 40 s of a start on a real history (startpg profile, w50v). A chunk's serial names its file as read under one root and meta (sourceSerial: root, meta, path, size, mtime), the same in every run, so the digests are now kept in heat-digests.bin next to heat-v1.json, by serial, under requestDiskBinary()'s key of the code that makes the rows: another build's rows are hashed again. A file that can't be read, was cut short or names other code is nothing kept. It is written as heat-v1.json is (temp file renamed over it), only when a digest was made, with this run's digests first and then those kept it hasn't met, at most two turns' worth (2 x 65536 x 40 bytes), sorted by serial. The file is kept as read and searched in place: a map of its 17k entries beside sourceDigests' own cost 1.4 MB of live heap in a first try (w51v). Measured on mote with the real-account sandbox (acctp, 17k chunks), a start with the page opened, second start of each build: - CPU profile, first 40 s: 2.00 s (w50v, v0.1.3978) -> 1.54 s (w52v); sourceDigest/heatSettledKey 0.12-0.13 s -> gone - pageheap at the mark: CPU 2.48 s -> 2.12 s, Footprint 134 -> 131 MB, liveHeap 79.1 -> 79.4 MB Run (mote, Go 1.26.8): - go test -count=1 -timeout 45m ./internal/usage: ok - GOOS=windows and GOOS=linux go vet ./internal/usage: ok; gofmt clean - TestSourceDigestsKeptAcrossStarts (new): a second start hashes 0 of 2 chunks with the same key; a start of one file keeps the other's; a new file hashes 1; other row code hashes again; a cut file hashes again. - Broken by hand (the disk lookup ignored): the new test goes red, "started again, hashed 2 chunks". |
||
|
|
4431e31f7c |
library: a project gets subagents of its own, per agent (jinpwng on X)
The Subagents tab now lists the projects as Skills and MCP do. Opening
a project shows each library subagent with chips for the agents that
read a project's own subagent folder: Claude Code (.claude/agents),
Codex (.codex/agents, TOML), OpenCode, Gemini CLI, Qwen Code, Droid
(.factory/droids), Cursor and Copilot (.github/agents/*.agent.md). A
tick writes the subagent into that project only, in the agent's own
format; the agent's global folder and other projects are untouched.
Each file is recorded by its hash and rewritten or removed only while
it is exactly as magpie wrote it, so a same-name file of the user's is
left alone. A rename in the library follows into each project. The
files are kept out of git by the project's info/exclude block, and
follow the repository's other worktrees (syncTrees now copies
Subagents, and clears it for a worktree let go).
POST /api/library/projects/subagents {dir, name|names, agents}. No CLI
yet, like project servers. Hooks, instructions and Claude plugins have
no project scope yet (filed separately).
Run (mica / mote via mica-run, mote-run):
- go test -count=1 ./internal/library ./internal/gui: ok
- node --test, chromium + webkit: project-subagents, project-scope,
project-servers, project-skills-pick, project-skills-groups,
project-remove-keep, library-subagents, library-all, library-items,
i18n-keys, i18n-en-no-cjk, claude-subagents-pick,
codex-subagents-lead, subagent-effort: 150/150 pass
- gofmt -l clean; go vet darwin, linux -tags nogui, windows on
internal/library and internal/gui: ok
Broken by hand: dropping Subagents from syncTrees' copy made
TestProjectSubagentsFollowWorktrees red ("the worktree hasn't the
project's subagent"); the earlier session broke the fix by hand and
saw the new library tests go red.
Not tried: a real Claude Code/Codex session picking up the project
subagent; the full go suite (started after the tag); Windows/Linux
runs of the GUI.
|
||
|
|
889758605f |
import: open CC Switch's ccswitch:// provider links (coder_shaun on X)
A relay's one-click ccswitch://v1/import?resource=provider&app=…&name=… &endpoint=…&apiKey=… link now opens magpie's own import confirmation. The format is read from CC Switch's source (src-tauri/src/deeplink/parser.rs and provider.rs at 3c76d3b): host v1, path /import, resource=provider only, app, name, endpoint, apiKey, apiFormat, model/haiku/sonnet/opusModel, homepage, iconUrl, and the base64 config (claude env, codex auth + config.toml provider table, gemini env) filling what the URL leaves out. The link is translated into a magpie://import's parameters and goes through the same checks (https only, key shape, id rules, balance host) and the same confirmation; usage scripts, configUrl, enabled and notes are never taken, a codex env_key is refused. Registration, so as not to take CC Switch's links: Linux writes a separate magpie-ccswitch.desktop and sets the default only when `xdg-mime query default` is empty or already it; Windows writes HKCU ccswitch only when HKCR has no live handler of another program; uninstall and install.sh remove them only while they are ours. macOS declares the scheme in Info.plist (static), so with CC Switch installed too the system picks. Run: provider, gui (macOS mote; Linux gtk3 on WSL for the scheme tests), uninstall, cli, update packages; vet darwin, windows, linux nogui. The test parses CC Switch's own 11 provider examples (testdata/ccswitch_links.txt, copied from its repo) and refuses the other resources. Broken by hand: claude's default endpoint kind (4 reds) and the Linux "another app has it" check (TestRegisterSchemeLeavesCCSwitchItsLinks red). Not tried: Windows registry (vet only), a real CC Switch installed beside magpie, a browser click on a real relay's button. Rebased on |
||
|
|
48afb27b0f |
library: Claude plugin rows show counts, the dialog keeps its width and folds the parts (jinpwng on X, #6309)
The plugin dialog's description, part lists and source line sat in the
editor grid's 132px label column, so even Plannotator (3 hooks) read as a
narrow column: the Hooks heading landed in the right column, the names
under it on the left and the GitHub line in the middle. Description, parts
and hints now span the grid. The list row showed every skill name (PStack
lists a hundred); it shows "Skills 12 · Hooks 3", and the dialog lists each
part's names in a fold, closed by default.
Run at this head (rebased on
|
||
|
|
610ae1f541 |
library: handing skills over turns off the all-in-~/.agents/skills setting and takes magpie's links out (ConatusMoon2222 on X)
Put skills in "~/.agents/skills" (SharedSkills) gives every agent that reads
that folder every skill, so it cannot go with choosing agents per skill,
which is what "Manage in magpie" (HandOverSkills) is for. With the setting
on, a handed-over skill's entry was taken away and the next sync linked it
back there, so the link stayed (reproduced in a sandbox HOME). Handing over
now turns the setting off in the same write; the sync then removes magpie's
own links there (sweepShared: only ours, never the user's entries). The
confirm sheet says so, only while the setting is on. The Put skills in note
says the skill router lists nothing while every skill is in
~/.agents/skills (the "none" the reporter met), only when both are on.
Strings in zh, zh-TW, ja, de.
Run (on mote, at this tree):
- TestHandOverWithSharedSetting: red with the l.SharedSkills = false line
commented out ("a link is left in ~/.agents/skills"), green with it.
- go test ./internal/library ok; go vet darwin, GOOS=windows, linux nogui
on internal/library ok; gofmt -l clean.
- GUI: skill-handover, shared-skills, i18n-keys, i18n-en-no-cjk in chromium
and webkit, 23/23 each.
Not run: the full GUI suite and go test ./... before the tag; a real
account's Library; WebKitGTK.
|
||
|
|
e979553ba1 |
sessions: a start doesn't read Claude Code forks' uuids again to judge them (#2278)
Each start judged every group of Claude Code files that start alike
(ccFamily), then read what each copy or branch holds that its keeper
doesn't (ccRest). Both read every file's message uuids through
scanThin, and what they found was kept in memory only: ~0.2-0.25 s of
CPU on each start for a real history with forks, and a uuid set held
for each file.
What a group came to depends only on its files, so it is kept in
cc-families.json next to sessions.json, by a hash of each member's key,
path, size, change time, first and last message and start; a group none
of whose files changed is not read. A copy's or branch's rest is kept
in cc-rest.json by both files' path, size and change time, encoded the
way the parses are (encodeCache), so another time zone, cache version
or parser version reads it again. Both are written behind mu through a
temp file renamed over the last, in order; Saved and Reset wait for
them. Groups unused for 30 days are dropped.
Run (mote, at this tree):
- go test ./internal/sessions ./internal/usage ./internal/gui: ok
(128 s, 64 s, 151 s); GOOS=windows and linux go vet
./internal/sessions: ok; gofmt clean.
- New TestClaudeFamilyKeptAcrossStarts: a start after one that judged
the group reads no file's uuids, and a copy that went on with a turn
is judged again (a branch). TestClaudeBranchRestKeptAcrossStarts: two
starts count the same 80 tokens in and read no uuids.
- Broken by hand: ccFamilyKept always nil -> the first test red ("read
the uuids of 3 files"); ccRestLoad never reading -> the second red
("start 0 read the uuids of 1 files"). Dropping size and mod from the
group's hash left the first test green: the changed copy's last
message changes the hash anyway; size and mod are there for a file
rewritten in the middle.
- Real accounts (acctp sandbox, pprof of the first 40 s of a start with
the page open): sessions.Warm 0.78/0.79 s -> 0.52/0.57 s, statsKept
0.39/0.43 -> 0.18/0.21 s, ccFamily/ccUUIDsOf gone from the profile;
pageheap: CPU at mark 2.84 -> 2.65 s, Footprint 132 -> 127 MB,
liveHeap 80.2 -> 78.4 MB. The first start of the new build reads and
writes them once (2.70 s at 40 s, as before).
Not tried: Windows and Linux real starts; the files are plain JSON in
the cache folder.
|
||
|
|
dc356402ab |
memory: Codex's earlier agent memories (kept as codex-mcp-client) are still found (#6392)
Follows c9c10b960: Codex's MCP client name now reads as codex, so a search as Codex also looks in agent:codex-mcp-client. TestMemoryMCPSharedAcrossAgents now expects codex. Ran on mica: -run 'TestMemory|TestRun' ./internal/gateway ok; gateway+library+browsermcp full run: library and browsermcp ok, gateway cut at the 10m default timeout under load (suite follows the tag). Windows/linux-nogui/darwin vet clean on gateway and library. |
||
|
|
8f82e08b4f |
memory: Codex over HTTP is known as Codex (Norethcy on X, #6392)
Codex reaches Magpie Memory at /mcp/run/magpie-memory, which starts `magpie mcp memory` per Codex session. A session magpie never saw start (Codex keeps its session id across a magpie restart) started the server with the default initialize, client "magpie", so memory_save scope=agent said it couldn't tell which agent called. Now: such a session (and an initialize naming no client) is started as the request's agent, Codex on this route; the direct HTTP route keeps the client an initialize named under its Mcp-Session-Id; every codex* client name (codex-mcp-client, codex-tui) is Codex. Ran on mica: new tests (red on the old code with the reporter's error text), internal/gateway, internal/library, internal/browsermcp (see below). Not tried: a real Codex Desktop. |
||
|
|
4f72725e39 |
gateway: a drawn SVG is served under a CSP that runs nothing
The image server's files (
|
||
|
|
dd9b2bcef5 |
gui: the new sign-in row and sentences within the core script budget, +296 (Wing8Aqua on X)
No page left to move them to; the row is packed to its shortest form.
Budget raised by exactly the 296 bytes over.
Record for this stack (Wing8Aqua's three reports: cap toggle wording,
Smart is not load balancing, Sign in on another computer), run on mica at
this head's content (rebased on
|
||
|
|
4b34020354 | gui: shorter Japanese cap toggle label, so it stays on its line at 420px (Wing8Aqua on X) | ||
|
|
2f34649a6e |
gui: Claude and Codex accounts get "Sign in on another computer…", the link alone (Wing8Aqua on X)
Adding an account opened the local browser, the only way not to being a
Privacy setting nobody finds. The ideal sign-in is often another machine
(another region). Under Claude's and Codex's accounts a row starts the
sign-in kept to its link: /api/signin takes linkOnly, opens nothing here
and the window shows the link with Copy and Open in browser (
|
||
|
|
de0a237693 |
gui: Smart routing says it is not load balancing and where to pick it (Wing8Aqua on X)
Smart sends requests to one account at a time (the soonest to renew) and moves on at 90% or on failure, by design: spending what would be lost and keeping the prompt cache. The hint now says so and names In turn and Least used first for an even spread, in en, zh, zh-TW, ja, de. |
||
|
|
0ae77bad59 |
gui: the cap toggle says what it does: off, fallbacks take over at the cap (Wing8Aqua on X)
"Stop when every account is at its cap" read as if off meant not stopping at all. Off, requests go on to the provider's fallbacks; on, they get 429. Renamed "Don't go to fallbacks when every account is at its cap", with a tooltip naming both states, in en, zh, zh-TW, ja and de. The field (capStop) and its behaviour are unchanged. Run: pool-ends GUI test updated to the new labels (see push notes). |
||
|
|
861a0442c1 |
agent: Codex in a running WSL distro is connected once Codex on Windows is (@not_4O4 on X)
The Codex app's work mode on a project whose run environment is WSL starts
its app-server inside the distro, on the distro's ~/.codex (the app resolves
CODEX_HOME there with `bash -lc 'printf %s "${CODEX_HOME:-$HOME/.codex}"'`).
magpie wired Codex on Windows and, as a separate Agents row, the distro's
twin (codex@wsl:<distro>) only when the user connected that too, so the
picker listed OpenAI's models alone there.
ConnectCodexTwins, run at the start of each SyncCatalog, connects the twin
of each running distro once while Windows' Codex is connected. It leaves a
twin alone that is connected or disconnected already, whose config names a
provider or base URL of the user's own, or whose distro is stopped (asking
one starts it). A stash mark (<id>.autoconnected) keeps it to once, so a
later Disconnect stands. docs/subsystems/agent-wiring.md says so.
Run: TestConnectCodexTwins and TestConnectCodexTwinsKeepsOwnProvider; go
test ./internal/agent on mote (ok, 305s); TestWSL* and the new tests on the
Windows box (ok); gofmt; go vet darwin, linux and windows (nogui).
Broken by hand: Windows-connected check removed (red), own-provider check
removed (red). The Disconnected check is covered by the mark alone.
Not tried: the Codex app itself with a WSL project (read its bundle for the
CODEX_HOME resolution only); the reporter's distro and networking.
|
||
|
|
092a86ad22 |
gateway: Mistral's API gets a stable per-session x-affinity (daoche_wuzui on X)
Mistral routes a conversation to the server holding its KV cache by the
x-affinity header. Checked against the sources: mistral-vibe's CHANGELOG
("KV cache warming via x-affinity in count tokens"), its
_runtime_config.py request_headers (sets x-affinity every turn), and
pi-ai's buildMistralHeaders (earendil-works/pi, mistral-conversations.ts:
sessionId unless the model's or call's headers name one).
forwardOnce now sets x-affinity for a Mistral API key provider
(mistralAffinity): the client's own value as sent, else a hash of the
session or conversation, never the id itself, the same every turn. Other
vendors, accounts and plugins get none; the user's own provider headers
are put on after it. Every route (relayed, translated, count_tokens)
goes through forwardOnce.
Run: go vet on darwin, linux nogui and windows for internal/gateway, and
go test -count=1 ./internal/gateway at the branch head via mote-run, ok
(1370s). New: TestMistralAffinityHeader.
Broken by hand: header setter off, red ("affinity \"\" \"\" \"\""); the
isMistral scope removed, red ("another vendor got x-affinity").
Not tried: a real Mistral key, so whether Mistral's cache hit rate
changes is unmeasured. Full ./... not run.
|
||
|
|
cba704d5f0 |
library: with the skill router on, the page says when no skill is listed for an agent and when its own skills stay in its prompt (ConatusMoon2222 on X)
ConatusMoon2222 turned the Skill router on and reported it "does not take
effect". Reproduced in a sandbox HOME: the router lists only the library's
skills ticked for an agent. An agent with nothing ticked, or each skill kept
direct, got no magpie-skills, yet its row said "on"; and skills in an
agent's own folder that the library lacks stay in its prompt with no word
on the page.
AgentView.SkillRouter is now "none" for an agent whose folder takes the
router but has nothing listed (Applied.Router false), and the Skills tab
names those agents, and the agents that have skills of their own the
library lacks, under the switch (.lib-hub-why data-why none / found). Four
languages (zh, zh-TW, ja, de). docs/subsystems/skill-router.md updated.
Run on mote: go test -tags nogui ./internal/library (ok, 260s);
skill-router.test.cjs in chromium and webkit, all four languages, narrow
and wide (22 pass, with the new found line asserted); go test ./internal/gui
Asset/Budget/Script ok; gofmt clean; go vet nogui darwin/linux/windows clean.
Broken by hand: sync.go back to the parent, TestSkillRouterLastSkillUnticked
goes red ("nothing listed, the view says on").
GUI i18n-*, library-*, skill-* files: all green except skill-fold-all and
skill-manual, red on origin/main from the window's /api/update/using POST
(#5982, not this change).
Not tried: a real agent on Windows; the reporter gave no agent, OS or
version, so the cause for their machine is inferred, not confirmed.
|
||
|
|
5d93f6b3d9 |
gateway: a day's history is gzipped a route at a time and capped in size (tsingchao on X)
gzipFile read the day's whole file (and its .gz) into memory, so a 7.25 GB day took a 1.6 GiB host down in a restart loop. It now streams: the file's routes are remembered by an 8-byte hash, the new .gz goes to a temp file beside the old one (the old .gz copied raw, the new routes a gzip member after it) and is renamed over it; any failure leaves the file and the .gz as they were. Nothing bounded a plain day either. A day now goes on in a numbered file (DAY.1.jsonl) past 256 MB, and today's files past 1 GiB in all lose their oldest. History, HistoryRoute and the Context tab's stamp read the numbered files too. Run (mote): gofmt, go vet gateway+gui on darwin, windows, linux nogui; gateway and gui packages. TestGzipFileHoldsNoWholeDay (64 MB day, with a .gz to dedupe against) allocated 149 MB on the old code, now under 24 MB. Broke dayAppendPath by hand: TestDayGoesOnInANumberedFile went red. Not tried: a real 7 GB file; full ./... suite (run after the tag). |
||
|
|
ff865b47a1 |
gateway: the TTFT and reasoning speed tests wait until the agent has each event (#5948)
TestGroupFailoverTimesEachTry went red on a loaded box with TTFT equal
to FirstText: "ttft_test.go:260: the answering try: {... Millis:304
TTFT:233 FirstText:233 ...}". The paced vendor kept its reasoning and
its text 80ms apart on the wire, and a gateway that read late got both
in one read and timed them as one. TestUsageKeepsTimeToFirstToken had
the same gap and was fixed for #2575 with paced's heard hook: the gap
before each marked event starts only once the agent has been sent the
one before. The failover test now posts with that hearing agent and
gives the answering vendor its heard, so the text comes a gap after the
agent had the reasoning, and the end a gap after it had the text.
The same gap stands under four more tests, which get the same hook.
TestCodexBackendTimesFirstToken, in the same file, checks u.Millis >
u.FirstText across the text and the end (its request is now built by
codexServe, which codexPost uses too). In reasoning_speed_test.go,
TestReasoningSpeedThroughGateway and TestSpeedEndsWithTheReply need
their thoughts read apart, 100ms at least (TestReasoningPacingEdges),
for a speed; the fixture's gap is 150ms. TestSpeedEndsWithTheReply's
first thought is now marked too, so the gap after it is guarded as
well (a first marked event is sent at once). In
reasoning_uncounted_test.go, TestStreamedReasoningWithoutCount's Chat
cases, paced 80ms apart, get it for their three thoughts; its
Anthropic cases replay DeepSeek's 33 deltas and are left as they were.
What was run (tree d6c1100b, on origin/main
|
||
|
|
46e338923b |
copilot gemini: unions fold to one object, $ref branches resolve, a nullable keeps no type, a bare array gets items (Novello42 on X)
DaVinci42's four cases on #4374 (v0.1.3925), fixed in the Copilot Gemini tool-schema translation only: - copilotGeminiToolUnions renamed a disjoint object anyOf to oneOf, which Copilot's Gemini takes with 200 but strips of its branches, so the model sent a string. The rename is gone; copilotGeminiToolShapes folds the branches into the one object (same-named properties join their enums, so a discriminator keeps "project" and "none"). - a union of local $ref branches is resolved against $defs/definitions (a copy; a target that refers on is not followed) before it is judged, instead of being dropped to an untyped string. - a type written beside a nullable single-branch anyOf is removed (400). - an array with no items gets items {} (typed after by geminiTypes) (400). Run (mote, -tags nogui): TestCopilotGeminiFoldsCodexUnions, TestCopilotGeminiReporterSchemas (the reporter's four schemas verbatim), TestCopilotGeminiShapesLeaveOthersAlone (claude / no agent: body unchanged), and the TestCopilot*/TestGeminiTypes*/TestAntigravity* set pass. With the three changed non-test files put back to origin/main the first two go red (all four reporter subtests). gofmt clean; go vet darwin/linux/windows and the gateway package run: see the next commit/tag notes. Not tried: a live Copilot account (the fake refuses by the reporter's recorded rules). |
||
|
|
d52e2feaff |
pi: with the pi-magpie extension installed, magpie's models.json block goes (KenyonCode on X)
pi-magpie (npm, tinysnake) serves provider "magpie" from the live catalog and warns at every start while models.json still names providers.magpie (one baseUrl for every model, a frozen list). magpie wrote that block itself, so the user was told to delete it by hand. When Pi's settings.json "packages" lists pi-magpie, Pi's Sync and model pick now drop magpie's own block (only one pointing at this gateway with magpie's key; a block the user wrote stays) after keeping models.json.before-pi-magpie, through the atomic JSON delete, the rest of the file untouched. Check no longer calls the missing block a broken wiring. Without the extension nothing changes. Run: TestPiMagpieExtensionTakesOverTheBlock (sandbox HOME) and ./internal/agent on mote, vet darwin/linux nogui/windows. Broken by hand: viaExt forced false -> the test goes red with the block still there. Not tried: a real Pi with the extension installed. |
||
|
|
b2ccfe25dd |
gateway: a drawn image is kept on disk for its hour, and the reply it came in is let go (tnt12231 on X)
The image MCP server kept every drawing, and every video, in memory for an hour (up to 256 MB), and swept them only when another image arrived. A drawing also held its reply, the base64 strings parsed from it and the decoded bytes at once. Now: - imageMCPKeepFile writes the image to <config>/image-mcp (emptied at the first use in a run) and the file URL serves it from there; only the metadata is in memory. A timer removes it at its hour. If it can't be written the bytes stay in memory, as before. - imageMCPDrawn drops the recorded reply and each b64 string as it is decoded; the stdio server (internal/imagemcp) clears each b64 once decoded. - both hand the heap back (debug.FreeOSMemory) when a drawing is done: the Go scavenger gives it back slowly, and Task Manager showed it as magpie's. The foreground/background numbers in the report (WebView2 processes a few MB when hidden) are WebView2 suspending, not a leak. Run: TestImageMCPKeepsDrawingsOffTheHeap (new; 6 x 12 MB drawings kept): heap +71 MB on the old code, +0 after. internal/imagemcp and the gateway's Image/Video/MCP/Browser/Record tests, gofmt, and vet for darwin, linux and windows on mote. Broke it by hand: the old image_mcp.go with the new test is red. Not run: the full suite, a real vendor's drawing, Windows. |
||
|
|
2abfe2b644 |
codex: the editor extension's bundled Codex version is read, so the threshold is written (HermanHongbb on X)
The background-compaction table is written only when every Codex that reads the config is known to be new enough. The openai.chatgpt extension's reader was always made with no version, so any machine with the extension installed counted as "unknown" and the table, with the threshold, was held out: Codex compacted at its own 65%. The extension ships bin/<target>/codex-package.json beside its codex (checked in the real Open VSX packages of chatgpt 26.51111.21308, Linux x64 and Windows x64: "version": "0.169.0-alpha.11.1"). It is read now, one reader per installed copy, in every dot folder's extensions (VS Code, VS Code Server, Cursor, Windsurf, VSCodium, ...); copies in .obsolete are skipped. A version that can't be read stays unknown, not old. Settings' existing note (codexAsyncHeld) names the editor extension and its version when it is what holds the threshold back. Run: TestExtensionCodexVersionRead (new; red with the version read turned off by hand: got map[:4]), go vet darwin/linux/windows, gofmt, and go test ./internal/agent on mote, ok. Not tried: a live VS Code with the extension; the full suite before the tag. The macOS extension layout is the same package (darwin vsix not unpacked). |
||
|
|
382c8c0bdf |
proc: magpie serve reaps the processes it adopts (Kling__Lab on X)
254 <defunct> children of `magpie serve` after 7 days, growing ~9 an hour (magpie, uv, node, npm, magpie-bun, code-review-graph), only a restart cleared them. Every command magpie starts is waited for (the AST guard TestEveryStartedCommandIsWaited holds, and I read each Start site and Output/StartTree/StartReaped by hand: none is missed). The zombies are the grandchildren: an agent CLI's MCP servers whose parent ended are adopted by magpie where it is PID 1 (a container) or a child subreaper, and nothing waits for a process it never started. proc.KeepReaping (Linux, from serve) does nothing unless magpie adopts (PID 1 or PR_GET_CHILD_SUBREAPER), and then reaps a child of its own that was a zombie at two looks 5s apart. Not tried: the reporter's container; the cause (PID 1 / subreaper) is inferred from the report, not seen. Run: TestAdoptedOrphansAreReaped (subreaper test process, 6 orphans) and the proc package through wsl-run on magpie-desktop: ok. Broken by hand (KeepReaping returning at once): 6 adopted zombies left, red. |
||
|
|
422f90e80b |
davsync: WebDAV answers a Digest challenge, MD5 and SHA-256 (caelum1990 on X)
Sync signed in with Basic only, so a server that takes Digest only (Apache mod_auth_digest, some NAS and nginx setups) answered 401 and magpie said the password was wrong. digestTransport (RFC 7616, qop=auth, -sess too) wraps the dav client: a 401 with a Digest challenge is sent again with a Digest header made from the same user name and password, SHA-256 chosen over MD5 when both are offered, and the challenge is kept, so the requests after it carry Digest with a rising nc and Basic is not sent to that server again. A PUT's body is made again from GetBody. A Basic server is untouched. Run: go test ./internal/davsync under mote-run, ok; vet darwin, linux nogui and windows on the package. New: TestDAVDigest (MD5, SHA-256 against a fake Digest-only server that checks response, nc replay, opaque, uri and the PUT body), TestDAVDigestWrongPassword (still reads as a wrong password; a Basic server is left alone). Broken by hand: newDAV without the transport, TestDAVDigest red with "refused the user name or password (HTTP 401)". Not tried: a real Digest server (only the fake, built from the RFC's formula); auth-int and SHA-512-256 are not answered. The first request of a connection still carries Basic, as before, so a Digest-only server over plain http sees the password once; nothing else was changed in that path. |
||
|
|
efc3e1e56b |
remote quotas: a Remote with no picks tells every card, a usage-only provider's included (fcooji on X)
On 0.1.3959 Claude Code set to usage only on the remote magpie showed no usage on the local magpie that added it as a Remote. A usage-only provider lists no model there, so a Remote with nothing picked here exposes only what the remote lists, and cfd49e36a/93b855d90's filter by enabled models dropped the Claude card. Only the user's own picks (Provider.Models) narrow cards now; no picks, or Select none, tells all of them. Run (mote): TestRemoteUsageOnlyProviderStillShowsItsCard is red with the new rule turned off by hand (map[office/codex:true]), green with it; -run 'Remote|Quota|Card' in internal/provider and internal/gateway ok; go vet darwin/linux/windows of internal/provider ok; gofmt clean. Not tried: two real magpies in sandbox HOMEs (a fake peer and list server in the test), the GUI suite (Go only), the full Go suite (started after the tag). |
||
|
|
2ae8e61a4f |
usage: an upgrade reads session files again only when the code of their rows changed (#2278)
requests-v1.bin and log-v1.bin were keyed on a hash of every .go file in internal/usage, so nearly every release that touched the package threw both away. The first start after such an upgrade read all ~24k call shards again: on the owner's real accounts (mote, acctp sandbox) that is 13.8s of CPU and ~3.4GB allocated before the page settles, against 2.4s warm. Each file now keys on the source its rows are made, written and read through: rowSource (15 files) and logSource (23 files), embedded by name. The row pricer and a file's chunk builder are lifted out of readRequestBlocks (sessionRowPricer, sessionChunk) so they can be roots. TestRequestDiskNamesTheCodeOfItsRows type-checks the package and walks every declaration reached from those roots (uses, package vars assigned elsewhere, interface calls, encoding/String/sort methods); it fails when a reached file is not embedded or an embedded one is not reached. Of the last six usage-changing releases, four (3962, 3958, 3941, 3908) would have kept the cache. Run: - go test -count=1 ./internal/usage on mote: ok 51.9s. - go vet ./internal/usage for darwin, windows, linux on mica: ok. - Broken by hand: session_provider.go left out of rowSource's embed -> "rowSource: session_provider.go is reached but isn't in its go:embed", FAIL; restored. - Real accounts on mote (pageheap.sh, page open, CPU at mark): w47v first start after an older binary 13.80s, numGC 217 (rebuild, expected); w47v again 2.45s; w48v (w47v plus a live init() in effort_split.go, a different binary) 2.59s, numGC 56; back to w47v 2.43s. Before, the same swap cost ~14s. Not tried: Windows or Linux real start. |
||
|
|
363adb3528 |
plugin: the auth-lock test checks the loop ran while the lock was held, not how often a timer ticked (#5271)
TestAuthLockWaitDoesNotFreezeTheHost counted a 20ms setInterval over a 300ms sleep and wanted 8 ticks. A loaded runner fires the timer late and counts fewer while the loop is free all the same: 7 of 8 on mote (#5271), 6 on ubuntu CI at |
||
|
|
6af6ae9885 |
usage: a log of MCP calls and probes keeps its blocks on disk too (#2278)
log-v1.bin was written only once a gateway block had filled. A log of
MCP tool calls and probes has none (the real-account sandbox's 8.3 MB
log is 25,223 MCP lines and 2,539 probes, 54 probe blocks, 0 gateway
blocks), so full.n stayed 0, the file was never written, and every
start parsed all 27k lines again: readLogSnapshot took 60 MB of the
start's allocations. The probes that were kept went as JSON and were
parsed back a record at a time.
A full point is now marked too when a probe block fills while no
gateway row stands after the full blocks, and it records how many probe
blocks were full there (logFull.probes). Those go to the file as binary
entries, as the gateway blocks do, read from its mapped pages; only the
probes after them, up to the full point, still go as records. The file
is written again when its full point reaches further (by offset, not
the gateway block count). The magic is magpie-log-v2, so a v1 file is
parsed over once.
Run:
- go vet ./internal/usage; go test ./internal/usage ./internal/gateway
(mica, -timeout 45m): ok usage 31s, ok gateway 859s.
- TestStartReadsKeptProbeBlocks (new): an MCP-only log of 3 blocks + 100
is kept, a start reads 3 blocks from the file, and reads as a whole
parse. Broken by hand (no probe full point): red, "a log of probes
wasn't kept".
- Real-account sandbox on mote (acctp, page open 2.5 min, version
0.1.3961 builds): log-v1.bin written on the first start (645 KB);
warm starts, w45v (v0.1.3961) against this:
CPU at mark 3.21s, 3.00s -> 2.50s, 2.39s
allocated 701 MB -> 646 MB, 629 MB
readLogSnapshot cum 60 MB -> 2.6 MB
numGC 66 -> 56
Footprint 128-133 MB -> 132-135 MB, liveHeap ~80 MB both: the same
within noise.
Not tried: a log with both gateway and probe blocks across a v1 -> v2
start on a real account (the unit test's mixed log covers the format).
|
||
|
|
5a44051eb5 |
gui: Discover's long-list hook moves into plugingrid.js, and the core budget carries the rest
TestCoreScriptBudget has been red on main since |
||
|
|
abacab7207 |
provider: a model's listing providers share one copy of each provider
listedBy, the providers listing each model (for a model no catalog entry
has), appended a copy of the whole Provider (1.3KB) for every model of
every provider. It now keeps one copy per provider and every model points
at it; the one caller copies the provider it returns, as before.
Measured on mote with a real-account sandbox HOME (network blocked),
2.5 min with the usage page open, alloc_space of listedBy:
w44 (
|
||
|
|
61be687ffa |
claudetui: /usage's saved figures are not told when the refreshed panel's redraw stalls (#6376)
TestShimWaitsPastSavedUsage/refreshed went red on macOS CI at
|
||
|
|
482653868b |
gui: a provider row's read-once test measures the row's own work apart (#6375)
TestProviderInfoReadsTheListOnce was red on main since |
||
|
|
5a0e0378c0 |
plugins: Discover draws only the cards near the view in a long list
The owner, 11-13: "这个页面有点卡,记得做列表虚拟化" (Plugins › Discover with Subscriptions picked, 369 cards). Every redraw of Discover's body (npm's numbers coming in, a count changing) made all of them again. A grid of 48 cards or more (a kind picked, a search that matches hundreds, npm's hits) now draws only its rows near the view, 700px past each edge, and keeps the whole list's height in its padding above and below. The rows follow the scroll and the width (a ResizeObserver on the page): columns are read from the grid's own computed columns, so narrow widths and every language lay out as before. Row heights are measured as they are drawn. A card with focus stays in the page, held where it would be, so keys go on from it. Cards are made once per list and kept, so a click lands on the same node. A list shorter than 48 is drawn whole, as before. The code is in plugingrid.js, imported when Plugins first draws, so the core doesn't grow: TestCoreScriptBudget was 3,299 bytes over with it in plugins.js. Until the import lands, a long list is drawn whole, and the body is drawn again once it has. Measured with plugin-discover-virtual.test.cjs's PERF=1 on mote (load ~25 to 55, so the times are high). The time is from the Subscriptions click to the cards drawn, with a market of 503 plugins (370 subscriptions). - Before (origin/main): chromium 69.0ms at 1180px and 56.5ms at 420px, webkit 77ms and 74ms. 370 cards and 9,312 nodes in #view-plugins. - After: chromium 6.2 to 9.7ms, webkit 10 to 13ms. 30 cards and 810 nodes at 1180px, 10 cards and 312 nodes at 420px (de: 9 and 285). Guard: plugin-discover-virtual.test.cjs (new), in chromium and webkit, in en, zh, zh-TW, ja and de, at 1180px and 420px. It checks: - at most 72 cards are drawn, and the list keeps its whole height; - wheeling to the middle never shows an empty stretch, and the focused card is kept; - at the bottom pv-369 is in view and its Install posts its spec; - "pv-12" lists all 11 matches, and "pv" draws at most 72; - nothing scrolls sideways, and there are no page errors. Broken by hand: VMIN at 1e9 (every list drawn whole) turned it 22 of 22 red. Run on mote at this tree, before the rebase (mote-run): - go test ./internal/gui: ok (the budget too). gofmt -l: nothing. - plugin-discover-virtual: 22 of 22. - Every GUI file that draws plugin cards or Plugins (the 54 that grep finds pm-card, view=plugins or pluginAgentsTo), with i18n-keys and i18n-en-no-cjk: all pass, except the reds below. Reds, the same at origin/main |
||
|
|
aa84b568d6 |
claudetui: the undrawn-Claude test leaves its fake room to start
TestShimSaysWhatAnUndrawnClaudeWaitsOn/keychain went red on macOS CI
at
|
||
|
|
5f5307ab6d |
gui: each embedded file is hashed once, not on every load
revalidated read each embedded file again on every request to make its
ETag, and the page "/" read and hashed every file it names to version
their URLs. A release's files never change, so each one's sum (and the
versioned page) is now kept in a sync.Map after its first read. A dev
build (-tags dev) reads from disk and keeps nothing.
Measured: TestStaticFilesHashedOnce, 20 loads each, on mote:
with the memo green (app.js under 1x its size, page under 6x its)
memo off by hand app.js 26,516,856 B; page 165,916,424 B (~8 MB a
page load) - red
Run on mote: go vet ./internal/gui and -tags dev; go test -run
"StaticFilesHashedOnce|VersionedFilesKept|WebCompresses|PageFilesRevalidate|Revalidat"
./internal/gui ok.
Not tried: the full GUI suite (no change to what is served).
|
||
|
|
a8b0e80f65 |
usage: the request page's probes are made into a chunk once per change
readRequestBlocks made probeChunk again on every poll of the Requests and Usage pages: a rowChunk holding every probe since the period's start minus a day, interned again each time. On the real-account sandbox it was ~45 MB of 952 MB allocated in two and a half minutes (rowChunk.add under probeChunk, #2278). probeChunk now keeps the last chunk it made, with the probe blocks, since, renames and hosts it was made from. A frozen block is never written again (a new probe reopens the tail as a copy), UsageRenames hands back the same maps while providers.json is unchanged (Renames.Same compares them by identity), and hosts are compared by content, so the same inputs make the same chunk, which no reader writes. Any of them changing makes it again. TestProbeChunkMadeOncePerChange: the same inputs give the same chunk; a later since, a changed host and a new probe each make a new one. Measured on mote with the real-account sandbox (pageheap.sh, the request page polled to the mark): probeChunk allocated 43.81 MB at the base (w42) and 24.54 / 24.10 MB with this (w43, two runs). It is not zero there because the sandbox's network is blocked, so every probe fails and logs a new row, which makes the chunk again. Run on mote: go test ./internal/usage ok (33.9s); the test is red with the memo turned off by hand. |
||
|
|
e6184b368a |
provider: a provider's models.dev models are read, not copied three times
Provider.available, the base of every Available and Exposed, made three copies of a provider's catalog models on each call: catalog.Provider cloned the built list, available appended it into a list of its own to drop an id two catalogs share, and the list without experiments and previews was grown from nothing again. On a page open with the owner's accounts that was 74 MB of 952 MB allocated in 2m32s, the largest flat allocator of all. catalog.ProviderShared is the built list itself, for a reader (catalog.Provider still hands out a copy). available reads it through catalogsOf, which copies only when two catalogs are joined, and sizes the released list before filling it. The shared list is never returned: every way out of available returns Decorate's list, the released copy or the signed-in account's own. The built list is clipped, so an append to it reallocates. Run: go test ./internal/provider ./internal/catalog on mote (ok, provider 135s). Measured on mote's real-account sandbox (acctp, the Usage and Providers pages polled for 2m32s, pageheap.sh), w41 = the parent, w42 = this commit: allocations 993 -> 858 MB, available's cumulative 144.5 -> 52.3 MB, CPU at the settle mark 3.32 -> 3.18 s; footprint 130 MB and live heap ~76.7 MB both unchanged. The parent's full suite at d1e823d5f (same Go tree) was 99 ok, 0 FAIL; this commit's provider and catalog packages ran again, not the full suite. |
||
|
|
ac15036ab4 |
provider: a catalog entry points at its provider instead of copying it
Entry.Provider was a Provider value, 1,328 of an Entry's 1,760 bytes, copied into every model of every provider each time a catalog, an agent's list or a routing group's entries were built. It is now a *Provider: entriesOf and decide's list give every model of one provider the same one (sharedEntry), and a group's entry points at its first member's. It is read only; every place that hands it on as a value (Resolve, CanFast, ownAgent, modelAllowed, …) dereferences it, so what they get is a copy as before. entryFor keeps its signature for the one model ServedEntryOf builds; offEntries' entries now carry their provider too. Measured on mote with the owner's real accounts (acctp sandbox, page open for 2m32s, w40 = before, w41 = this, alternating): - catalogOf's allocations 106 MB -> 67 MB, providerEntries' 88 -> 78 MB - CPU at the page's settle mark 3.42/3.33 s -> 3.18/3.30 s - live heap unchanged (76.3/76.1 -> 76.7/75.9 MB): the lists are rebuilt, not kept, so the copies were churn for the GC, not held Run: go build and go vet ./... and the tests compiled (go test -run ^$) on mote; the full suite at this tree (d1e823d5f) on mica: 99 packages ok, 0 FAIL (agent 317s, gateway 972s, gui 188s, provider 220s, usage 56s). |
||
|
|
66f98d9d65 |
gui: the add sheet's tools show in the title bar once scrolled out of sight
The owner, 11-12, on the Providers page's Add sheet: 向上滑动,然后这些区域 不在可视区域的时候,这些区域应该自动浮现在Header处. Beside the sidebar (side-nav, a window 1024px wide or more), the sheet's search, Custom provider and Import… now show in the title bar's empty right, left of its buttons, once the sheet's head row has scrolled out of sight. They are put there the way Library's, Plugins' and Settings' tools are: position: fixed inside --tools-l/--tools-r/--top-h, which app.js tools() keeps out of the crumb's way (its head query now includes #addSheet .add-tools.afloat). Scrolled back up, they are in their row again. Close stays in the sheet; the screenshot's box didn't cover it. The group is pinned, never copied, so there is one search: the words typed and the focus stay with it both ways. Each change is a 180ms fade in going into the bar and 140ms coming back, cubic-bezier(.23, 1, .32, 1), opacity only, so reduced motion keeps it. Nothing moves in the sheet: the head row keeps its height while its tools are up. Narrow (no sidebar, which covers 420px and the panel): the bar has no free room, so the sheet's whole head (label, tools, Close) is held at the top of the page while the sheet is under it, the way Settings' head is in a narrow window. It has the same blur strip and a hairline once stuck. At 760px and under, the tools take a line of their own under the label. The code is in a new addfloat.js, which renderAdd imports the first time the sheet opens. In app.js it took TestCoreScriptBudget 487 bytes over (1266031 > 1265544); with the move the budget passes and isn't raised. old-webkit's list of scripts loaded on demand names it. Run at 39ac4fafe (on origin/main |