5f5307ab6dfa6cf2878c977bf40bf8fbc4e91fae
7924
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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). |
||
|
|
0fa15db1ca |
site: an Azure OpenAI page in en, zh and ja
/docs/azure says how magpie's azure preset serves the user's own Azure
resource: the endpoint and key from the portal (the editor's Endpoint,
or provider add azure <key> url=…), every address form AzureBase takes
moved onto the v1 API under /openai/v1 with no api-version, the key in
api-key and never a Bearer, deployments' names as the model ids and
what to type when no list comes back, an API Management gateway's URLs
kept, headers with ${sessionId}, imports made the azure preset,
content_filter read as a policy refusal (#248), Codex's bare reasoning
items left out unless store is true (#1008), and the Decisions API at
/openai/v1/decisions. Every claim is from internal/provider/azure.go
and presets.go, internal/gateway/fallback.go (policyRefusal),
internal/cli/providers_cli.go, docs/subsystems/gateway-routing.md and
providers-accounts.md, with the labels' zh and ja from i18n.js. Linked
from each language's openai page; in the sitemap, llms.txt and
llms-full.txt.
Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
116 pass, 0 fail.
Not tried: a real Azure resource for this page; it names only what
magpie's source and docs say.
|
||
|
|
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 |
||
|
|
046a131304 |
gui: an agent's Long conversations is one row, and its context window is picked
The owner (11-12): an agent's sheet showed Long conversations twice, every
agent's row above the agent's own, which read as the same setting twice.
Now the sheet shows one row, the agent's own (.own-compact hides
#fullContextRow there). It shows the agent's own value, else every agent's,
and a change posts settings/agent-compact {agent, own: true, full, at}, so
it is that agent's alone. Settings keeps every agent's row for when no agent
holds one. The Context card's note says "Long conversations in {agent}" when
the agent holds its own value (context.js), in en/zh/zh-TW/ja/de.
The agent's context window (agentwindow.js) is picked, never typed as a
syntax: one size for all its models from the app's menu (Each model's own,
128K to 1M, Other size… typed as 300k), and "Set a model apart" adds a
model from the agent's model picker with its own size, a line each, with a
remove button.
Tests rewritten to the one row, keeping what each guarded:
- compact-one-value: Tuned for you and Long conversations are one window,
now through the agent's own value and its post.
- codex-compact-held: Codex's held values are under the agent's row.
- agent-prefs: what an agent's opened row and its panel sheet show
(#fullContextRow hidden, .row.agent-compact visible).
- compact-at: a typed size posts settings/agent-compact for Claude Code,
and never settings/full-context.
- codex-memories-settings "no Codex, no memories row": waits on the
merged row, lists the visible rows in its message.
- agent-compact, agent-window: the new row and the picker.
Run on mote (macOS, Playwright 1.62.0, chromium + webkit, every language
each file covers, narrow and wide), at
|
||
|
|
be8e352a20 |
editor: Proxy takes no room unless Custom is picked
The owner (11-12, "这些空白看起来好难受"): the Custom address and its login
were visibility:hidden while not picked, so each account kept an empty
strip (43px) between its proxy segs and the next account's name. They are
display:none now, so the gaps are even. proxy-gaps measures the segs'
bottom to the next element's top at 900 and 420 in every language;
account-proxy's no-move check now covers the lines above the pick.
Run (mica, mica-run, both engines, en de ja zh zh-TW where a file takes
languages; mote was over 18 load every check):
- The four changes together: account-weight, account-proxy, routing-js
26/26; routing-advanced, proxy-gaps, login-export, routing-save,
key-weight green; account-arrange red as on main (#6010).
- About 40 files around the editor (prefs, check-in, warm-up, proxy,
routing, export): 698/730. The same reds on origin/main
|
||
|
|
c21683cbf2 |
editor: Export accounts is the last account row, with an export glyph
The owner (11-12): Export accounts to a file goes last of the four account
rows, after Add an account by setup-token, and has an arrow out of a tray
instead of the plus: it adds nothing. login-export checks both.
Run (mica, mica-run, both engines, en de ja zh zh-TW where a file takes
languages; mote was over 18 load every check):
- The four changes together: account-weight, account-proxy, routing-js
26/26; routing-advanced, proxy-gaps, login-export, routing-save,
key-weight green; account-arrange red as on main (#6010).
- About 40 files around the editor (prefs, check-in, warm-up, proxy,
routing, export): 698/730. The same reds on origin/main
|
||
|
|
8f7ddb9e06 |
editor: Routing, Rate limited and Stays fold under Advanced
The owner (11-12): these are changed by few, so they sit at the top of the
editor's Advanced fold, collapsed by default. The fold opens on its own
when one isn't its default (routing, affinity or sink set), unless the
user already opened or closed it for this provider. Tests that pick a
routing seg open Advanced first; routing-advanced checks where the three
sit and when the fold opens, for a subscription and a relay.
Run (mica, mica-run, both engines, en de ja zh zh-TW where a file takes
languages; mote was over 18 load every check):
- The four changes together: account-weight, account-proxy, routing-js
26/26; routing-advanced, proxy-gaps, login-export, routing-save,
key-weight green; account-arrange red as on main (#6010).
- About 40 files around the editor (prefs, check-in, warm-up, proxy,
routing, export): 698/730. The same reds on origin/main
|
||
|
|
62044305e3 |
editor: a check-in or warm-up row holds its hidden line, so the dialog grows no second scrollbar
A provider's check-in and warm-up rows keep a .sub line out of sight,
position:absolute under hover. Their .who is display:contents and has no
box, so the line was held against the .dialog: with Advanced open the
dialog grew a scroll of its own (e.g. 1117 over 810) beside the editor's,
and in WebKit every row was 8px narrower (de 560 "Gewicht 3 · 75%" ran
2px past its row). Happens on main whenever Advanced is opened. The row
is now the line's containing block. account-weight opens Advanced and
checks the dialog doesn't scroll.
Run (mica, mica-run, both engines, en de ja zh zh-TW where a file takes
languages; mote was over 18 load every check):
- The four changes together: account-weight, account-proxy, routing-js
26/26; routing-advanced, proxy-gaps, login-export, routing-save,
key-weight green; account-arrange red as on main (#6010).
- About 40 files around the editor (prefs, check-in, warm-up, proxy,
routing, export): 698/730. The same reds on origin/main
|
||
|
|
2d2333cfa1 |
site: an Amazon Bedrock page in en, zh and ja
/docs/bedrock says how magpie's bedrock and bedrock-mantle presets serve Claude, OpenAI's GPT models and other makers' models with one Bedrock API key and no SigV4: adding it, region= (CLI and the editor's Region), the runtime's given list (global. profiles for Claude and GPT, in-region ids for the rest, geography profiles typed in), the API picked per model, Mantle's own model list, in-region ids and two OpenAI prefixes, Claude Code's CLAUDE_CODE_USE_BEDROCK taken out and put back, and the anthropic-beta 400 asked again without the betas. Every claim is from internal/provider/presets.go and provider.go, internal/cli/providers_cli.go (applyPairs' region=), docs/subsystems/providers-accounts.md, gateway-routing.md and agent-wiring.md, with the label's zh and ja from i18n.js. Linked from each language's anthropic page; in the sitemap, llms.txt and llms-full.txt. Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt; node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run): 116 pass, 0 fail. Not tried: a real Bedrock key for this page; it names only what magpie's source and docs say. |
||
|
|
909cd5c758 |
gateway tests: TestSearchQueueKeepsCodexAlive's hard cap starts at the headers
macOS CI at |
||
|
|
f9bc297a5e |
gui tests: TestPluginPageReadsWhatItDeclared's limiter check passes on every -count round
The check called pageSetAllowed with the fixed key "x", and its last call
stored "now + 2s" in the package's limiter. The next -count round's first
call, under a second later than that, was refused, so the test was red on
every round after the first ("pageSetAllowed"). The check now uses a key
of its own run.
Run on the Linux box (wsl-run, magpie-desktop; mote and mica were at load
58 and 72), at origin/main
|
||
|
|
3d4c8edcea |
gui: Open the Codex app is in Codex's row menu, not a button on its row
|
||
|
|
dbaf9d68cc |
edit: TOMLTables' list is kept with the file's other answers
The Codex agent's drift lists its config's tables on every look
(TOMLTables), and the list came from the whole parse. Over a Codex
config.toml with ~11k projects, the drift polls of an open page kept that
parse (3 to 5 MB) alive and it was never let go. GetTOMLTop and
GetTOMLTable answers were already kept beside the parse. The table list
is now kept there too, copied out of the file's text, so the idle drop
can let the parse go while a page is open.
Run (mote, at
|
||
|
|
1281046a02 |
gui: the Library's Variables tab is called Environment variables
What it holds are environment variables an agent starts with, and "Variables" alone read as something else (the owner: 应该叫环境变量). The tab, its empty line, its add buttons and the new item's sheet say environment variable in en, zh, zh-TW, ja and de (环境变量 / 環境變數 / 環境変数 / Umgebungsvariablen). "Environment variables" moves into the core i18n.js: otel's page uses the same words, and i18n-keys keeps a plugin's words its own. Run (mote, at origin/main |
||
|
|
32d6be0d05 |
gui: Memory has a brain of its own, in the sidebar and on its requests
The owner (11-12): Memory should have its own icon, a brain. The Library's Memory tab had a bookmark, and Memory's own requests (the conversations it reads into memories, made as memdistill.Agent "memory") were drawn in Routing's graph, Usage and Sessions with the generic cube under their raw id, since "memory" was no client. - icons/memory.svg: a brain, 16-grid, stroke 1.4 with round caps and joins, as the sidebar's marks are; drawn as a one-tone mask. - navicons.js: the Library's Memory tab draws the same path. - agent.others: a client "memory", named Memory, with that icon, so /api/state's clients and agent.Looks (Usage, Sessions) name and draw it. It has no User-Agent: its requests are known by their token. - TestEveryClientHasNameAndIcon: memdistill.Agent is among the ids the gateway records, so it must be a client with a real icon. - tests/memory-icon.test.cjs: the sidebar's Memory tab draws the path icons/memory.svg has (and no other tab does), and a request from "memory" in Routing is drawn with the memory mask, not the cube. Chromium and WebKit, en/zh/zh-TW/ja/de, 1100 and 420px (no sidebar at 420px, so there the request only). Run on the tree rebased onto |
||
|
|
ff8b437117 |
gui tests: library-loading's tab lists include Claude plugins (#6204)
|
||
|
|
0e181b6f88 |
gui: the saved-proxy form's fields are the app's own, and no field falls back to the browser's
The owner, 11-12, on Settings › Network › Proxies › Add (Name, http://127.0.0.1:7890, Username (optional), Password (optional)): "输入框 太简陋了。根本就不是我们整个产品的输入框组件。" proxyFormRow gave its four fields only the class proxy-credential, which sizes them in .proxy-form and styles them nowhere, so they drew as the browser's white inset boxes on either theme. They are input.words now, the same field as the gateway address and the share password on that page. The class: app.css gets a :where() base rule (zero specificity) for every text input and textarea: 1px var(--line) border, 7px radius, var(--card) background. Any rule that names a field still wins, so a field only takes it where it had the browser's look before. input-look.test.cjs opens every Settings part (Network with the saved-proxy form open and each Custom proxy pressed), a custom provider's editor and a signed-in Codex editor (every fold open, each Custom proxy pressed), and a routing group's editor (every fold open). No visible text field may have an inset/outset border, or a white background on the dark theme, and an input no rule names, put into the group editor, must not be inset. Chromium and WebKit, en zh zh-TW ja de, 1100 and 420px, light and dark. Run on mote (mote-run), at |
||
|
|
af7edcc02a |
gui: the Library's project section is titled by what it holds
The owner (11-12): the MCP tab's 项目中 ("In projects") read oddly over
the servers a project gets. The heading now says what the section is:
"Project servers" on the MCP tab and "Project skills" on the Skills tab,
which shares the section (项目服务器 / 项目技能, 專案伺服器 / 專案技能,
プロジェクトのサーバー / プロジェクトのスキル, Projektserver /
Projekt-Skills).
Run on mica, at this tree: project-servers, project-skills-groups,
project-scope, library-mcp-agentless, library-all, i18n-keys and
i18n-en-no-cjk, chromium and webkit: all ok (6, 12, 6, 22, 26, 4, 4).
project-servers checks the heading in en and zh, project-skills-groups
in every language. Broken by hand (t("In projects") back): both go red,
6 of 6 and 12 of 12.
Not tried: the real app; the change is the heading's words.
|
||
|
|
1729e1193a |
site: a Google Vertex AI page in en, zh and ja
/docs/vertex says how magpie's google-vertex preset serves Gemini, partner models (DeepSeek, GLM, gpt-oss) and Claude from the user's own Google Cloud project with no API key: turning on aiplatform.googleapis.com, gcloud application-default login or a key file, project=, location=, credentials= and impersonate= (with the GUI fields' labels), the models each location lists and typing in others, Model Garden and testing a partner or Claude model on its own, Claude on Messages API as with CLAUDE_CODE_USE_VERTEX, the Priority/Flex PayGo headers, and the errors reference.md lists. Every claim is from docs/reference.md (Google Vertex AI) and the CLI usage, with the labels' zh and ja from i18n.js. Linked from each language's gemini page; in the sitemap, llms.txt and llms-full.txt. Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt; node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run): 116 pass, 0 fail. Not tried: a real Vertex AI project for this page; it names only what magpie's docs and source say. |
||
|
|
5c00da3b25 |
gui: a group's note says it is optional
The owner (11-12): the note field under a group's name read as one more thing to fill in. Its placeholder now starts with "Optional", in every language: 可选,例如:给工作 Key 用 and the like. Run on mica, at this tree: group-note, group-keys, group-redact and i18n-keys in chromium and webkit, every language, 1100 and 420px: 86 of 86 ok. Broken by hand (the old placeholder back): group-note goes red. Not tried: nothing beyond the GUI tests; the change is the placeholder's words. |
||
|
|
109559913a |
gui: a group's gateway keys and masking sit under Advanced
The owner (11-12): few people bind a group to gateway keys or change how it is masked, so the group form showed two rows most never touch. Both rows now sit in the group's Advanced fold with the rest of what is set rarely, and the fold opens by itself when either is set, so a bound or masked group still shows it. Run on mica, at this tree: group-keys, group-redact, group-note and i18n-keys in chromium and webkit, en/zh/zh-TW/ja/de, 1100 and 420px: 86 of 86 ok. Broken by hand (the two rows back at the form's top level): the keys, redact and note tests fail, 50 of 82 red. group-redact now reaches its chip with reader.cjs reach(): Playwright's scrollIntoViewIfNeeded is put back by the app's scroll hold at 420px, which made it click the wrong place there. It also checks the click does not move the page. Not tried: the real app with real gateway keys. |
||
|
|
fa7e466acd |
gui: Settings' gateway row is titled a port when a port is what it takes
The owner (11-12): the row over a field that takes 3425 read 网关地址 (Gateway address). Only the port is typed there; it is titled Gateway port (网关端口, 閘道連接埠, ゲートウェイのポート, Port des Zugangspunkts), and the field's aria-label with it. With MAGPIE_ADDR set the field shows the whole host:port, off, and the row keeps Gateway address, as Chicring asked before. Run (mote, both engines): gateway-port, i18n-keys, i18n-en-no-cjk, 14 of 14 ok. Broken by hand: settings.js put back as on origin/main, gateway-port red in both engines (expected 'Gateway port'). Not tried: the real app. |
||
|
|
648cd3fdbb |
gateway: the management API leaves other keys that manage magpie alone
|
||
|
|
2bcbae35ef |
gui: Partners' heading in the Add sheet ends in "Become a sponsor"
The owner asked for an elegant sponsor button at the right of the Add sheet's Partners heading (在右边加上一个优雅精致的我要赞助的按钮). It is a quiet pill with an accent heart outline: 我要赞助 / 我要贊助 / スポンサーになる / Sponsor werden. Hover changes colour and border with `ease`, gated to a fine pointer, and :active scales to .97. A click opens the same mail usemagpie.ai's "Become a sponsor" writes (mailto:yetoneful@gmail.com?subject=Sponsoring%20magpie). /api/open lets through that one exact link (sponsorMail), not mailto: at large. Web mode sets location to it. The heading and the button share a .kind-row. The heading keeps its own box, so the Partners shine still wraps only the words. The shine test now finds the tiles after that row. Run on mica (mote was at load 33-57): - node --test add-sponsor-me, add-partners-shine, add-sheet: Chromium and WebKit, en/zh/ja/de at 900 and 440px. The new file and the shine file are green. - add-sheet chromium is red 1 of 3 with "Cannot read properties of null (reading 'serverPin')". It is red 1 of 3 on untouched origin/main |
||
|
|
1f9d2c36c6 |
edit: the YAML looks keep a slim tree, not yaml.v3's nodes
GetYAML, GetYAMLMap and GetYAMLList read the file through filememo, which kept yaml.v3's whole node tree for as long as magpie runs: ~160 bytes a node behind a pointer, with a tag, styles, comments and places that no look reads. For dsh's 68 KB settings.yaml, read by RenameLegacy at start and by dshGet on every poll, plus Hermes' config.yaml, that tree was the largest thing left in an idle tray's heap. The looks now keep a yamlLook instead: a node's kind, a scalar's value, and the nodes under it held inline. GetYAMLText still marshals yaml.v3's tree, so it keeps one under its own memo kind; only MiniMax's file is read that way. Run (pushed head's tree, on mica and mote): - go vet ./internal/edit ./internal/agent; go test ./internal/edit ok; go test ./internal/agent ok (190s, mica). - TestYAMLLooksReadAsTheNodeTree holds every key path of a file with anchors, aliases, merge keys, flow and block lists, complex keys and comments to what lookupYAML on yaml.v3's tree reads. Broken by hand (a mapping key copied as its tag, not its value), it goes red. - Idle tray, real account sandbox with the owner's 25,379 probe lines, at 150 s, three alternating runs: live heap 9.21 MB (w38, v0.1.3941) vs 8.39 and 8.41 MB (this); footprint 77 vs 75 and 74 MB. edit.parseYAMLRoot is gone from the inuse top. Not tried: Windows or Linux (no OS-specific code here). |
||
|
|
f0571d7da5 |
site: a usage page in en, zh and ja
/docs/usage says what magpie records of each request and where to read
it: the Usage and Requests pages, magpie usage (today, 7d, 30d, all,
--last, --days, --csv, --account), the Sessions page and magpie sessions
(--days, --model, --folder, --json, and session reading allowed per
agent, none until then), where a price comes from (the user's own, the
provider's catalogue, models.dev) and magpie model price for a relay's
real one (four numbers, a fifth for a 1-hour cache write), calls with no
price ("{n} unpriced", never counted as free), magpie statusline for
Claude Code, and GET /v1/magpie/usage and /usage/requests with a held
key's cut. Every claim is from the CLI usage in internal/cli/main.go,
docs/reference.md (What a model costs, the status line),
docs/subsystems/gateway-sessions.md and app.js, with the labels' zh and
ja from i18n.js. Linked from each language's quota page; in the
sitemap, llms.txt and llms-full.txt.
Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt;
node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run):
116 pass, 0 fail.
Not tried: magpie usage or magpie sessions against real data for this
page; it names only what magpie's source and docs say.
|
||
|
|
9c33839dee |
site: an images page in en, zh and ja
/docs/images says how a model that can't see images gets screenshots anyway (the Image recognition model describes each image once, cached, up to 4 at a time, in every turn and tool result; Automatic, a picked model, Off), the /mcp/magpie/vision server's analyze_image (URL, data URL or a local path up to 20 MB; a gateway key from another computer), the Magpie Image tool (generate_image, generate_video, generation_result; generated-images and generated-videos, never written over; a call answers within 20 s with an id), /v1/images/generations and edits, and Image generation timeout (1 to 60 min, 5 by default). Every claim is from internal/gateway/vision.go, vision_mcp.go, internal/imagemcp/imagemcp.go, docs/subsystems/gateway-routing.md and renderImages in app.js, with the labels' zh and ja from i18n.js. Linked from each language's web search page; in the sitemap, llms.txt and llms-full.txt. Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt; node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run): 116 pass, 0 fail. Not tried: describing or drawing a real image for this page; it names only what magpie's source says. |
||
|
|
d85ee9e53f |
usage: the probes are kept in packed blocks, as the gateway rows are
The request log's probes (magpie's own tests, model lists, MCP tool calls
and searches) were a slice of whole Records, 952 B each, and every read
that continued the log appended to a copy of it. The owner's real log has
25,379 of them (25,223 MCP tool calls): ~24 MB of live heap in every
running app, the tray's included, for rows only the Requests page lists.
Now they are rowChunk blocks of logBlockRows, frozen (packed) when full,
the last one reopened as a copy for the next append (probeRows), the way
readLogSnapshot keeps gateway rows. probeChunk and log-v1.bin read them
back through chunkRows; a block whose Latest is before since is skipped
whole. log-v1.bin's format is unchanged.
Tests: TestProbeBlocksContinued (3 blocks + an appended block: the earlier
snapshot reads as before, the continued read equals a fresh parse, since
cuts at the right row). Broken by hand: dropping the continued snapshot's
probe blocks turns it red. TestStartReadsKeptLogBlocks covers the disk
round trip with probes.
Run at this head on mica: go vet ./internal/usage; go test ./internal/usage
./internal/gateway/... ./internal/gui, all ok (gateway 869s).
Real app on mote (sandbox HOME from the real-account sandbox, plus the
25,379 probe lines of the owner's real log), tray idle at 150s, cold:
before (w36, v0.1.3938's code): footprint 105 MB, live heap 48.4 MB,
readLogSnapshot 26.5 MB of it
after (w37): footprint 70 MB, live heap 16.0 MB, readLogSnapshot out
of the top; warm start (log-v1.bin read back): live heap 15.6 MB
Requests page, web mode, same HOME: requests.csv byte for byte the same
on both builds; /api/usage/requests' 100 rows the same apart from the 4
probe rows the first run itself wrote (token refreshes through the dead
proxy).
Not tried: Windows and Linux (no OS-specific code here).
|
||
|
|
f8a00a3bee |
site: a quota page in en, zh and ja
/docs/quota says how to see what is left of every subscription, plan and key: magpie quota and --json (lastServedAt, last), refresh (a Claude account read by running /usage), GET /v1/magpie/quotas and its history endpoint, reachable from another machine only while shared on the local network, the magpie-quota skill, alert by percent and --balance, quota wait with its exit codes and the until-loop for a stopped Codex job, history kept 45 days, and a Codex account's reset, auto-reset and credits. Every claim is from quotaUsage in internal/cli/quota_cli.go and docs/subsystems/library.md, with the Usage and Library labels' zh and ja from i18n.js. Linked from each language's routing groups page; in the sitemap, llms.txt and llms-full.txt. Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt; node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run): 116 pass, 0 fail. Not tried: running magpie quota against real accounts for this page; it names only what magpie's source says. |
||
|
|
9eda623406 |
docs: lessons: a script Settings loads runs in the panel too (#6139)
|
||
|
|
41e330bdf8 |
gui: an agent's settings sheet opens from the panel again (#6139)
|
||
|
|
5f1a642b42 |
docs: a commit's tree is origin/main plus its own change, in the code standards
Seen a third day: |
||
|
|
19fd0dfb87 |
catalog: mmddSnapshot compiles on first use
|
||
|
|
b552740c4b |
cli: name POST /api/settings/codex-client and codex-open as not yet a command
|
||
|
|
926b1e7dfb |
provider, gui: put back what 8c7328f3a took out of main by mistake (35aaaa4b9, 2fa79aef3, 797a23cad)
|
||
|
|
f1f512c1ec |
library: a repository's heading folds an agent's profiles into one chip, and a row's profiles chip lines up with the hand (Yanzhongixuy on X)
0.1.3926, several Hermes profiles: the Skills page's source headings (anthropics/skills ...) drew one icon per profile, a long strip, and the one chip |
||
|
|
625f3db114 |
site: a routing groups page in en, zh and ja
/docs/routing-groups covers both levels of magpie's routing: several accounts or keys on one provider (the editor's Routing and Stays, shown once a second one is on, and what one rate limited with quota left does: Keeps its place or Goes to the back), and routing groups across providers (auto-found groups, members, nested groups, patterns, By weight and Manual, rules, reasoning per member or by a classifier). Each routing and Stays choice is worded from app.js's ROUTINGS and STAYS and routing/client.js's options, with their zh and ja from i18n.js and plugins/routing/i18n.js; the CLI lines and templates are from groupUsage in internal/cli/groups_cli.go. Linked from each language's subscriptions page; in the sitemap, llms.txt and llms-full.txt. Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt; node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run): 116 pass, 0 fail. Not tried: making a group or rotating real accounts for this page; it names only what magpie's source says. |
||
|
|
8c7328f3a6 |
remote quotas: a Remote set to Select none still tells its cards (@LOYSoLuI4PG4WlN on X)
On 0.1.3929 a Remote magpie added for the Usage page's quotas showed none of the remote's subscriptions any more. |
||
|
|
797a23cade |
gui: the tray holds its page words in one language, not all four
The tray's tooltip names a usage window as its card does, with the page's own translations from assets/i18n.js. pageWords parsed all four language blocks (zh, zh-TW, ja, de, ~20k entries) once and kept them for the life of the process: 6.5 MB of an idle tray magpie's heap, for the few dozen words one language needs. It now parses only the block of the language asked for and keeps that one; a change of language reads the file again. Run (real account sandbox on mote, `tray`, no page, 150 s): - w35 (before): footprint 71 MB, live heap 16.7 MB; pageWord 6.5 MB cum. - w36 (this): footprint 67 MB, live heap 12.4 MB; pageWord 0.5 MB cum. On mica: go vet ./internal/gui; go test -run 'PageWords|TrayTip|Tray' ./internal/gui ok, with a new TestParsePageWordsInOneLanguage (one block read; ja then zh each give their own word). gofmt clean. Not run: the full suite. |
||
|
|
2fa79aef35 |
provider: a save of the bytes the file already holds changes nothing (#6289) (KdhsiiKshshhs on X)
writeLogins and writePrivate rewrote logins.json with identical bytes, which moved its mtime and called filememo.Forget, so every read after parsed the 230 KB file again (anton1615 measured 182 reads in 15 s, CPU 3.3x after each write). Now a file that holds exactly these bytes, at the mode the write would give it, is left alone: no lastgood generation, no rename, no Forget. A stat or read that fails is "not equal" and writes as before. Real changes keep steady.WriteFile's temp-and-rename. The same check is in writePrivate, writePrivateQuiet and (writeChanged) the sibling writers of codex-autoreset, codex resets-used and Kiro's token file. Nothing else bumped the mtime in the reporter's path: the other writers of logins.json (rememberLogins, Claude/Codex sign-in syncs) all go through writeLogins. Changed() still runs on a told save, so a list built before it is not reused (TestLoginsListedOnceARequest unchanged). Run on mote: TestUnchangedLoginsSaveKeepsFileAndParse and TestWritePrivateSameBytesLeavesFile, -count=20 green; both red with fileHolds forced to return false (mtime moved). gofmt clean; go vet on darwin, linux nogui, windows nogui; go test -tags nogui ./internal/provider ./internal/filememo ./internal/lastgood (result below in the push notes). Not tried: the reporter's 130-account gateway; the full suite before the tag. |
||
|
|
35aaaa4b94 |
codex: a setting for which client the requests to ChatGPT say they come from, CLI or Codex Desktop (ouhthuo on X)
ouhthuo wants the originator "Codex Desktop", with which, they say, a high-effort gpt-6.1-sol request is routed to a newer model. magpie sent codex_cli_rs on every request, and codexSign even overwrote a real Desktop's own originator. Settings > Codex > "Codex client" (CLI, the default, or Codex Desktop; the settings key codexClient is "" or "desktop", POST /api/settings/codex-client, no free text). codexClientHeaders is the one place that sets originator and User-Agent, so the model requests, the /wham usage and reset calls, the token refresh, the device and code sign-in exchanges and "test as" all follow it. Desktop sends originator "Codex Desktop" and the UA shape codex-rs builds for it: Codex Desktop/<codex version> (<os>; <arch>) unknown (Codex Desktop; <app build>). Source: codex-rs login/src/auth/default_client.rs and a captured Desktop UA. The default is unchanged; base_instructions and the identity prompt are untouched. The OAuth authorize URL keeps codex_cli_rs. The row sits in the Codex agent preferences, 5 languages. The two Codex menu buttons share one helper (codexMenuPick) so app.js stays inside its budget without raising it. Run (mote): TestCodexClientSetting (red with codexClientHeaders ignoring the setting), settings, settingsapi, gui and provider Codex tests ok; gofmt clean; go vet darwin, windows and linux nogui clean; GUI codex-client, codex-service-tier, codex-open-button, i18n-keys, i18n-en-no-cjk, settings-general, click-scroll in chromium and webkit ok. Real Codex account in a sandbox HOME: gpt-6.1-sol and gpt-6-sol at high effort answer under both identities with identical usage; the reply's model field only echoes the requested name, so whether the served model differs can't be told from here. Red and not mine, already filed: settings-search (#6133, #5982) and agent-prefs "Settings line" (#6139) fail on origin/main, TestMoveToPlugin #5524. Not tried: the real Desktop app (not installed here); the app build number in the UA is the newest seen in local logs and can go stale. |
||
|
|
b4821050a8 |
lessons: a commit's stat names only the files its change touched (76ceff87c)
|
||
|
|
0f0f391e67 |
site: a web search page in en, zh and ja
/docs/web-search says how magpie gives web search to models that can't search (DeepSeek, GLM, Qwen) when Claude Code's WebSearch or Codex's web_search reaches them: Settings › Models › Web search, Search first with, a provider that searches for other models (one magpie picks gives way to the next, up to three; one you pick to If it fails, then the Search APIs only when it can't serve at all), the providers that search for their own models first, provider search turned off, the Search APIs and magpie search's CLI (keys in turn, pick=order, url=, count, mix), Models that search by themselves, and the MCP server at /mcp/magpie/web-search with web_search and web_fetch. Facts from internal/cli/search_cli.go, docs/subsystems/gateway-routing.md and gui-shell.md, with the GUI's labels and their zh and ja from app.js and i18n.js. Linked from each language's DeepSeek page; in the sitemap, llms.txt and llms-full.txt. Run: the three pages' JSON-LD parsed with node; llms-full.mjs rebuilt; node --test site/*.test.mjs on the WSL box (magpie-desktop, wsl-run): 116 pass, 0 fail. Not tried: a search through a real searcher or Search API for this page; it names only what magpie's source and docs say. |
||
|
|
227171f69b |
tests: the tallies fixtures key a seat with a plan as the gateway does (RayYanOnline on X)
routing-acts-calm and routing-acts-idle wrote the day's tallies under the two-part key; tallyKey adds the plan since 2240e5b34 (
|
||
|
|
1488762dae |
settings: MCP server addresses get the This computer / Local network switch (xzhih on X)
Settings > Models showed Image recognition's, Image generation's and Web search's MCP server at 127.0.0.1 even on a magpie shared on the network. While sharing is on, each address row now has a switch beside it, This computer and the far address named as the gateway names it (addrWho: Local network, Public address, On the internet). The far address is the one the sidebar uses (sideLAN), so MAGPIE_PUBLIC_URL, container and LazyCat rules carry over; nothing is copied. The pick is kept (magpie.mcpWhere); an app starts at This computer as before, a page other machines opened (magpie web) at the far address. Sharing off: no switch, as before. The Library hub and the plugin tools line follow the pick through mcpAddress (no switch of their own). The two image rows moved from app.js into plugins/gateway/settings.js with the switch; app.js ends smaller, and the core budget is met. Run on mote at this tree: mcp-address-lan.test.cjs (new, 22 tests: chromium and webkit, en zh zh-TW ja de, 1100 and 420px) 22 pass; with mcpAddress's hook removed 11 of 11 chromium tests fail. vision-mcp, image-mcp, search-mcp, public-url-default and 98 tests in all pass; the lan/mcp/ gateway/settings/search/vision/image GUI subset (122 files, 2181 tests): 2114 pass, 67 fail; the six failing files I reran (side-effort, settings-hints, settings-search, lan-join, images-codex-one, settings-lines-wrap) fail the same 35 tests on a clean origin/main copy, so they are not from this change; filed separately. The other failing files' names were lost to a tail (not reread). go test ./internal/gui (core budget included) ok; go vet darwin, linux nogui, windows ok; gofmt clean. Not run at the rebased head: the Go suite beyond internal/gui; the whole GUI suite and go test ./... (mote and mica both held a GUI suite; queued after the tag). Not tried: a real LAN server. Library hub address and the plugin tools line show the picked address but have no switch of their own; they read it when drawn. |
||
|
|
8097860ab1 |
gui: put back what 76ceff87c took out of main by mistake
|
||
|
|
1ca2c62c49 |
catalog: a relay's deepseek-v4.1-flash is priced at DeepSeek's, whose entry names it by a dated canonical id (Winnie7572 on X, #4811, #5622)
models.dev lists DeepSeek's V4.1 Flash only as deepseek-flash with canonical_model_id deepseek/deepseek-v4.1-flash-1017. The canonical fallback (#1520) matched the undated id alone, so every relay serving deepseek-v4.1-flash (Open Design, WorkBuddy, Tencent Cloud) had no price and no estimated cost. priceIndex now also keys a maker's own canonical entries with a trailing snapshot date (-MMDD, -YYYYMMDD, -YYYY-MM-DD) taken off, tried after the exact and dashed keys, so a price a vendor lists by the id as given still wins. Only the provider that is the canonical's maker counts, as before, so no other vendor's model is priced. Open Design's other models were checked with the plugin's real ids (packages/opendesign models.mjs) against models.dev: every one but deepseek-v4.1-flash and deepseek-v4.1-flash-eco was already priced. -eco is the plugin's own id, not a snapshot, and stays unpriced (filed). Run (mote, at this tree): go test -count=1 for internal/provider, catalog, usage, gui all ok; go vet darwin, windows, linux nogui ok. New TestRelayDeepSeekSnapshotCanonicalPriced (models.dev entries in testdata/models_dev_opendesign.json) is red with the snapshot key disabled by hand. TestCommandCodePlanPrice's relay case asserted the gap ("a relay took Command Code's list price" for an unpriced model); it now asserts DeepSeek's price, which Command Code's plan still beats with its own catalog. Not tried: a live Open Design account. |