ac4af582301a4e8a29245dbba767eba31334ddf9
337
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
b62117287b |
gui: a moved plugin's first question offers its other ways, the API key among them
mahiro233 on Discord (v0.1.3372, Kiro plugin 0.1.34): Kiro's account sheet asked "Choose a sign-in method" with three choices and Cancel, and offered no API key. The plugin has one (its third way, "Kiro API key (ksk_…)"), but a moved subscription opens its plugin's first way at once (#777), and when that way asks a question first, as Kiro's does since plugin 0.1.21, the question had no way to the others: "Other ways to sign in…" and "Use an API key instead" are on the waiting box only, which the question comes before. Kiro CLI's or IDE's sign-in was out of reach too. The first question of a moved subscription's way, when the plugin has other ways, now has "Other ways to sign in…" (already in every language), which shows the way picker, as the waiting box's does. A later question (Kiro's Start URL) doesn't: the user chose that way already. Test: plugin-ask-ways.test.cjs, en and zh, Chromium and WebKit: the question's choices and hint, the link, the picker with the key way, the key field titled by its label, nothing signed in before a key, no link on the Start URL question, and the plugin's words in Chinese where it gives them. Run on mote at the pushed head, Chromium and WebKit: plugin-ask-ways, plugin-other-ways, -moved-signin, -key-hint, -password-prompt, -signin, -keyless-signin, signin-paste-plugin, deprecated-subscriptions, i18n-keys and i18n-en-no-cjk, 49 of 50 each; the one red is i18n-keys' "a plugin's words are its own", the same 3 words on origin/main |
||
|
|
c630d9a29c |
gateway: the key page's Claude Code setup keeps each tier on its own family
The /me page's Claude Code tab wrote the picked model into
ANTHROPIC_MODEL and into ANTHROPIC_DEFAULT_OPUS_MODEL, _SONNET_ and
_HAIKU_ alike, so picking Opus sent every Haiku background call to Opus
too (and picking a GPT model made "haiku" a GPT model).
The pick now sets only ANTHROPIC_MODEL. /v1/magpie/me returns `tiers`,
built by keyPageTiers from the models this key may use: for opus,
sonnet and haiku, the newest model of that family (claudeTier and
claudeVersionOf; routing groups and fable are skipped). A tier the key
has no model for is left out of the snippet, so Claude Code keeps its
own default for it.
Siblings: the agent writer (internal/agent/claude.go) has its own tier
design (tiers follow the main model, haiku to the provider's Haiku, the
user's own tiers kept) and writes the user's real config; it is a
different situation and is left as is. OpenMausBot's snippet writes
only ANTHROPIC_MODEL.
Run (mote, via suite.lock):
- go test -count=1 -run KeyPage ./internal/gateway/: ok
- GUI key-page.test.cjs: chromium 13/13, webkit 13/13
- gofmt -l: clean; go vet ./..., GOOS=linux go vet -tags nogui ./...,
GOOS=windows go vet ./..., and go build for darwin, linux (nogui) and
windows: ok
Broken by hand:
- old keypage.html: the new GUI test is red in both engines
(ANTHROPIC_DEFAULT_HAIKU_MODEL 'claude/claude-opus-5', want
'claude/claude-haiku-4-5')
- keyInfo without keyPageTiers: TestKeyPageTiersAreTheirFamilys red
("tiers map[]")
Full suite (go test -tags nogui -timeout 45m ./...): queued behind
other sessions on suite.lock at push time; its result goes on the
follow-up, with an issue for any red.
Not tried: a real Claude Code against the page's snippet, and the
gateway binary in a sandbox HOME.
Reported-by: strinah (Discord)
|
||
|
|
8544d5fdb5 |
settings: Download source says usemagpie.ai first, GitHub when it fails
Since v0.1.3345 an update's files come from usemagpie.ai (R2) and go to
github.com only when that fails; a mirror stands in for github.com only.
Settings › About › Download source still showed "GitHub", said updates
come from GitHub, and its button "Use GitHub" (zh 恢复官方) read as
switching back to GitHub. Now it shows usemagpie.ai, says GitHub (or the
mirror) is the fallback, and the button is Remove mirror (不用镜像), in
en, zh, zh-TW, ja and de. `magpie update mirror` says the same.
Run on mote (update-mirror, i18n-en-no-cjk, i18n-keys and cli vet again at the rebased head: ok but #5332):
- update-mirror, i18n-keys, i18n-en-no-cjk and every GUI file that opens
About (19 files), chromium + webkit: update-mirror and i18n-en-no-cjk ok.
The reds, rerun one file at a time:
- i18n-keys "a plugin's words are its own" and segs-press-redraw
"clicks its new self once": red the same at origin/main
|
||
|
|
f418edffc3 |
sessions: a session's details show how full its context was, request by request
liang_yongxiang on Discord: Routing tells how full one request's context window was; does Sessions have the same, each turn's share? A session's details on the Sessions page (and in Usage's Sessions list, which draws the same details) get a Context line when the gateway sent calls of it (s.via): the Context tab's spark of its prompts, request by request against its window, and the fullest one's share beside it, toned as the tab tones it. A point's tip says "Request 2: 80K of 200K (40%)" (the tab's spark says it too now, where the window is known); a point clicked opens that request in Routing with its card. A session the gateway never saw asks nothing; one it kept no prompt of shows no line. The data is the routing history the Context tab already reads. A new GET /api/context/session?agent=&id=&from=&to= reads only the days from the session's first to its last (30 at most), through the tab's per-day cache (daysRecsLocked, split out of contextRecsLocked, so the tab's cached days are not evicted), and keeps that one session (contextOfRecsFor), with up to 1000 of its requests. The tab keeps the latest 80 sessions and would leave an older one out. Subagent and side calls are left out as the tab leaves them out; the same id under another agent is that agent's. The line's code is in plugins/usage/page.js (sessCtxLine). context.js only exports spark and health, and pays for its tip by cutting comments, so the core's scripts are 10 bytes under main's, no budget raise. Run at this head (rebased on |
||
|
|
7a6211d047 |
providers: a model's own headers, in Model settings
axelburks on Discord: a vendor routes one model by a header of its own. A key's provider (built-in or custom) can give each model headers (settings.ModelHeaders["pid/model"]). They go on that provider's requests for that model alone, after the provider's headers and after auth: a name both have is sent once, as the model's, so a user's value is never overridden by the provider's or magpie's key header. The gateway names the model (provider.WithModel) on every route that asks one: chat on each API, translated and streamed, count_tokens, System One's decision, embeddings, images, videos and the model test. A fallback provider serving the same model id gets its own headers only. Accounts and plugins carry their sign-in's headers and take none. The editor's "Name, price and reasoning level" panel is now "Model settings" (every language), with + Add header per model, staged and made with the Save; Restore default takes them away. The rows being typed are kept out of the draft's compare, so an untouched editor still closes without asking. Broken by hand: dropping WithModel from gateway.go turns TestModelHeadersReachTheirModelOnEveryRoute red; dropping the provider id check in modelOf turns TestModelHeadersStayWithTheirProvider red. Run, on this stack over origin/main |
||
|
|
9451ad59f1 |
gateway: MAGPIE_PUBLIC_URL at a private address is the local network's, the Docker bridge's other containers', alike in Connect's menu
jiezhengj (Discord) runs magpie in Docker on a NAS, MAGPIE_PUBLIC_URL at the NAS's own 192.168.31.218. The web UI's Gateway list called that address "Public address" (公网地址), which reads as the internet's, and Connect's Base URL menu offered 本机 / 公网地址 / 局域网, where 局域网 was really the Docker bridge's 172.17.0.1 that other containers on the host use, while the list above it named that one "Other containers on this host". The classification itself was right (gateway.PublicIP never takes RFC 1918, CGNAT or ULA for the internet); the labels weren't: any MAGPIE_PUBLIC_URL was "Public address", and Connect's menu had its own three-way rule that knew nothing of the bridge or of internet addresses. - gateway.URLKind(u): "internet" (PublicIP), "local" (any other IP literal) or "" (a name, not looked up). /api/settings and /api/providers' gateway carry it as publicKind beside publicURL. - settings.js addrWho(g, u, others) is the one rule: this computer; the bridge address as other containers'; an internet address as such; MAGPIE_PUBLIC_URL by its kind (private: Local network; a name: Public address); anything else Local network. The Gateway list (each label said once for the lines it heads; local, then other containers, then internet), Connect's Base URL menu and About's MAGPIE_PUBLIC_URL row all use it. - "Public address" now only names a MAGPIE_PUBLIC_URL that is a host name; zh 公网地址 → 对外地址, zh-TW 公開位址 → 對外位址 (ja/de already neutral enough: 公開アドレス, Öffentliche Adresse). No new strings. Run, on mote (sandbox HOME, Go 1.26.8): - go test -run 'URLKind|PublicURL|LAN|Container|DefaultGateway|HostNetwork' ./internal/gateway ./internal/gui: ok, at |
||
|
|
80ae904c23 |
routing: routing groups get a page of their own, beside Routing
The owner asked for the groups to leave the Routing page (11-06): under the live stage and every request they were a long scroll down, and New group with them. The design was reviewed before this was built. - New page, Routing groups (#view-groups), drawn by the routing plugin's same script (routingPage), so the editor, its dirty/discard and every group action are unchanged. Toolbar: filter, "N groups · M on", Templates, Import, Select, and New group as the filled button. The list is right under it, and a Settings section under the list holds Found groups (with Exclude providers…) and Names in agents' lists. - No Export button: each group already has its own Copy to share. - Routing keeps the live stage and the requests. A request's group opens the groups page at its row. - The sidebar has a Routing groups tab right after Routing (from 1024 points). The header's row has no room for one: at 860px the extra tab pushed the logo out (brand.test). There the tab is hidden, Routing's tab is lit for both pages (markNav), and Routing's head has a "Routing groups ›" button, hidden beside the sidebar. - Every way in now goes to the groups page: the guide's Open routing groups, the panel's and the provider editor's Make a routing group (window/main?view=groups&newgroup=…). mainView still takes view=routing&newgroup from an older panel. - Words: "Routing groups", "Open routing groups", "Once saved, make a group of them in Routing groups.", and the editor's names note now says the setting is under the list, in zh, zh-TW, ja and de. "Open Routing" stays for the Agents page's button. - Docs: providers-accounts, gateway-routing, plugin-runtime, gui-shell and reference say "Routing groups page" where they mean the groups. - Core budget: the core's scripts are 1,533,774 of 1,533,802, paid for by three show()/setGatewayMode comments cut in app.js. No raise. Tests: routing-groups-page.test.cjs (new) covers the page in Chromium and WebKit, en/zh/zh-TW/ja/de, at 1280, 640 (window) and 420 (web): no groups on Routing, the tab or the head's button by width, the lit tab, toolbar order, New group primary and in sight, list then Settings, no sideways scroll, no native select, no left-border accent; a request's group to its row; quotas redrawn with an open editor left alone. The trace tests (routing-compact, -pause-folder, -rule-models, -folder) open Routing, then show the groups; routing-editor-foot and name-suffix-where-named scroll by wheel, as the scroll guard lets a reader; builtins expects the groups tab beside the sidebar only. Removed: routing-groups-jump (the head's "Routing groups ↓" that scrolled down to them, gone with them), routing-pointer-pin and routing-steady (the groups kept in place under requests streaming in above them: no request is above them now). Their guarantee that what redraws leaves an open editor and its typing alone is routing-groups-page's quotas case; Routing's own lists keep their keepInView. The groups page's jump: a request's group, or a pool's "Several keys" chip, opened the groups page and scrolled the row to the centre, and the next frame show()'s backAfterLoad put the page back where the reader last left it, then brought the focused segment in by "nearest": in WebKit the pool sat half under the window's foot (routing-mode-goes, 9 of its 10 WebKit cases). goRouting now jumps at once on a page it opens and marks it arrived(). The wheel in routing-many-keys turns over the keys: at the page's foot, now shorter, the mouse rested over the requests list (.rt-reqs, overscroll-behavior: contain), which took every wheel up, and the test stopped with 2 keys in sight. That is #4082's cause. routing-days-fit's fixture has 12 requests, a day that fills the window, since the day bar held needs room under it. Run on mote (macOS 27, load 25 to 65), Playwright 1.62.0: - Go: go vet, gofmt -l and go test ./... at the rebased head ( |
||
|
|
0f07fbd0c6 |
agents: a first Details opening reads its settings before it slides (#5360)
The first time an agent's Details opened, sheet() measured the row before /api/settings (and, for a full-context row, agentcompact.js) had arrived, slid to that half height, then jumped to the full one when they landed. The click now loads what the row needs first (the button shows Loading…), and only then measures once and slides. A later click supersedes a load still in flight. agentcompact.js finds #fullContextSegs on the list it is given, so it fills a row before it is in the page. This is chiperman's patch (8886a860a) without its core budget raise: Agents-page comments in app.js were cut instead (app.js 1,311,357 -> 1,311,024; core 1,533,459 of 1,533,802). agent-expand-steady's slide check looked for the height animation only in the click's own task. A first opening now waits for the settings read, so it looks in every frame; it still fails when no frame is animated. Run (mote, at base |
||
|
|
8b70b7d976 |
usage: a request's bytes up and down, and what DeepSeek's image files saved, in Requests
Suggested by @faithleysath (matrix0487 on Discord): the usage ledger now keeps what each request received back (down_bytes) beside what it sent up (up_bytes, #4456), and what DeepSeek's image files (#5407) kept out of the upload (image_files_saved). Shown in Usage → Requests: - a row's details: "Sent upstream", "Received" and "Saved by image files", each only when it is above 0. A row from before has none of them, not 0; - under the Requests card, the period's "↑ up · ↓ down", with "{n} saved by image files" when there is a saving. Its title gives the exact bytes. A period with no counted bytes shows no line. What is counted: - Down bytes are counted as the reply body is read, after Go's transport has undone gzip, so a gzipped reply counts its plain size, not wire bytes. A plugin's row counts the local hop to the plugin host. A 101 body is not wrapped. Every try counts, so a refused try plus the answering one add up (TestLedgerKeepsDownBytes). - Image files saved, per try: the body before the swap minus the body sent, minus the upload bytes this request itself paid (len(b64)/4*3). It can be negative on the turn that uploads; the GUI shows only a saving above 0. Gaps: an upload that finishes after the wait timeout or ctx-done is not subtracted (as with up_bytes); a joined upload flight is paid by the request that started it; multipart overhead is approximate. - packedRow grows by three int32 (152 bytes, still within the test's bound), clamped to the int32 range. Totals sum all three. - settledCountVersion goes 1 → 2, because Totals now count bytes. The settled page, heat and effort caches recount once, on the first start after the update. The heat key hash includes the new fields. Run on mote at |
||
|
|
4164edce60 |
gui: a one-tone dark or light logo is drawn in the text colour, so Open Design's shows in dark mode (chen2652)
chen2652 (Discord #help) reported that Open Design's icon is almost invisible in dark mode, with no browser dark-mode extension on. The icon is the plugin's own picture, open-design.ai/favicon.svg: a single fill, #26251E, drawn as an <img> on the dark card (#232327). Now icon() judges each picture once, after the picture's own load, so lazy loading is kept (#909). The result is cached per src. If every opaque pixel of a picture is one tone (the range of each channel is at most 24), and that tone is near-black (every channel at most 72) or near-white (every channel at least 224), the picture is replaced by maskSpan, the way a mono logo is drawn: a mask in the text colour. This holds on any ground, Omarchy's themes included. It covers user pictures (file:), plugin pictures, and bundled -color and PNG icons. Audit: every bundled picture icon, plus the plugin registry's pictures, was measured in CIELAB against #232327 and #fff. Two were invisible in dark mode: Open Design's plugin picture and bundled voyage-color.svg (#012E33, in the provider icon picker). Both are now masks. Multi-tone and tiled logos stay as they are (pipellm, zcode, mothx, deepinfra and others: low contrast in places but readable). Mono icons were masks already. Test: icon-one-tone.test.cjs, with the real favicon bytes in fixtures/. - It draws every picture logo on the dark and the light card and measures, on a screenshot, how much of each stands apart from the ground. - It opens Open Design's Installed row on the Plugins page and checks that it is a mask in the icon's text colour and visible in both themes: 5 languages, 980px and 420px, Chromium and WebKit. icon-url and icon-url-saved served a plain black square as the fetched picture. That square is one tone, so it is now a mask. Their fixture is now a coloured tile, like the letter icons the server makes (favicon.go). Run (on mote unless named): - icon-one-tone: 48/48. The 14 icon/theme GUI files (icon-tile, plugin-own-icon, mono-icon-redraw, plugin-registry-icon, models-add-and-icons, market-icon-corners, request-provider-icon, routing-client-icons, routing-log-icons, tray-logos, api-key-theme, icon-url, icon-url-saved, icon-one-tone): green in both engines. - go test ./internal/gui -run 'Budget|I18n|Asset', gofmt -l, GOOS=linux go vet -tags nogui and GOOS=windows go vet of ./internal/gui: all clean, and no size budget was raised. - A whole GUI suite on Linux (WSL) was cut off when the SSH connection to xiaomi-gpu dropped, after about 9,160 passes and 277 reds: - 40 of the reds were icon-url and icon-url-saved (fixed above). - The rest were in 75 other files. Those 75 files were run on mote with this change and at origin/main |
||
|
|
79477604a5 |
providers: a plugin option that says placement "top" sits under the accounts, above Routing (#5269)
mycf_711 (#5269): WorkBuddy Pro's plugin-level "panel" switch was drawn in Plugin options, under the whole model list, so it took a scroll every time. An option in auth.options may now say `placement: "top"`: the provider's editor draws those in a Plugin options block right under the accounts, above Routing, and the rest under the models as before. The note that the plugin reads them goes with the first block. host.js keeps placement only when it is "top" (anything else is left out, so the option goes under the models), and plugin.Option carries it to /api/providers. A plugin that says no placement is drawn exactly as before, and an older magpie ignores the field. Documented in docs/subsystems/provider-plugins.md and docs/reference.md. Run (mote, through mote-run): - new internal/gui/tests/plugin-option-placement.test.cjs: chromium 31/31, webkit 31/31 (1100 and 420 wide, en/zh/zh-TW/ja/de; mixed, top only, none or an unknown placement; the top switch posted on Save). - plugin-options.test.cjs 11/11 and plugin-option-words.test.cjs 21/21, i18n-keys 4/4, each in chromium and webkit. - go test ./internal/plugin ok (TestPluginOptions checks "top" kept and "sidebar" left out); go test -run Budget|Script|Asset ./internal/gui ok. - gofmt -l internal/plugin empty; go vet ./internal/plugin ./internal/gui ./internal/cli, GOOS=linux -tags nogui and GOOS=windows vet of internal/plugin ok. Broken by hand: - app.js put back to its parent: the placement test fails "mixed" and "top" in both engines (blocks under the models), "none" still passes. - host.js's placement line removed: TestPluginOptions fails "second = {... Placement:}". Not tried: a real WorkBuddy Pro plugin (Gitee, private) with the field; the full go test ./... and the whole GUI suite run after the next commit. |
||
|
|
083821dc96 |
plugins: a search entry can use the plugin's own sign-in, with its own rests
Asked for by axelburks on Discord. A plugin's search hook entry can name
a provider its own auth hook signs in to, `auth: "<provider id>"`. It then
takes no key. The host picks an account, renews it under `fresh` (the wait
counts within the search's time), runs the hook in `inScope`, and gives it
`ctx.getAuth()`, which returns that account's sign-in. A token the hook saves
with client.auth.set goes to the same account.
The gateway (askSearchSignedIn) asks one account at a time. It takes the
accounts that are on, in the order the provider's model requests take them
(accountsOn, now shared with fallback.go), and puts an account resting from
a search refusal last. A refusal rests only that account's search
(restSearchKey "account <key>"), never its models' rest (restingUntil). Every
attempt gets its own request-log row. An entry without `auth`, or naming a
provider the plugin doesn't sign in to, is a keyed entry as before, with no
getAuth. In Settings → Search, a bound entry shows "Signs in with {name}" in
place of the key field, and the row says whether it is signed in and how
many accounts are on (every language).
Docs: reference.md (with an example), plugin-runtime, plugin-tools and
provider-plugins.
Run on mote at
|
||
|
|
c0dd5838c2 |
library: the write-failure card can be hidden until a new failure (#3745)
Zachary-wW (#3745): the Library's "Some of the Library couldn't be written" card had Try again and nothing else. Their Grok Build has an AGENTS.md magpie can't stat, and every change writes every agent again, so the card stood over the page through every edit on the Instructions tab, with no way to put it away. The card has a × beside Try again now, named "Hide until something new can't be written". It hides the write failures the card lists, on every tab, and sends nothing. The page keeps what was hidden by agent and item ("grok" and "instructions"). After every answer, a read or a change, it lets go of a hidden failure that no longer stands, and a failure not hidden brings the card back with all it lists; so does a hidden one whose item was written in between and fails again. So the card stays hidden while the reporter keeps editing, though each change fails on Grok Build's file again, and a new write error shows it again. The key is not the error's text: a write goes through a temp file named anew at each try (edit.WriteAtomic), so a folder that can't be written fails with a new text at every sync, and the card would never stay hidden. Meanwhile each change's toast still names what failed, as before, and a skill that couldn't be given keeps the dot on its agent's chip. The list magpie keeps (lastProblems) is not touched. The × is named by its title, as the Library's other × buttons are. An agent's own skills in the library's way are the agent's to settle, not failures: they stay, under their own title, with no ×. The view keeps its scroll as the card goes, as render() keeps it for Try again; Chromium's scroll anchoring moved it. From the keyboard the focus goes to the card's next button, or to the tab open. On a phone the × is 44px wide and as tall as Try again. The card's title keeps its words whole: with less than 10em beside it, Try again and the × go to a line of their own (beside them, a German title at 320px broke "Bibliothek" and "geschrieben" inside). library-problems-hide.test.cjs is new. Its API answers as internal/gui/library.go does: a change's problems are its full sync's, an Instructions change keeps the rest and puts its own in, and a read gets the list with no result. Its error texts are the ones magpie's own sync gave in a sandbox HOME, through Handler in a scratch Go test (not kept): Grok Build's AGENTS.md a link into a folder magpie can't search, its folder read-only, and its skills folder read-only. Not covered: what was hidden lasts as long as the page, so a reload shows the card again. The × hides, it doesn't fold: while the card is hidden, its error texts and Try again are out of reach, though any change writes every agent again. An agent's instructions, and its whole MCP file, have no mark of their own as a skill's chip has, so with the card hidden only a change's toast names their failure (#3987). What was run (tree f98a4b99, on origin/main |
||
|
|
d10f377657 |
providers: Names & levels is Names, prices & levels, where a model's own price at one provider is set (ferock4669)
ferock4669 asked on Discord whether magpie has a screen to price each model, since one model can cost differently on each provider. It has: each row in a provider's per-model list has a price box (input, output, cache read, cache write, 1h cache write, long-context tier, $ / 1M tokens), saved in settings' ModelPrices under pid/model. It wins over the list price in Usage (usage.Pricer through provider.BasePriceIn) and in a key's spend cap (usage.KeySpent through NewCoster). Nothing has to be built; the button opening it said only "Names & levels", so nobody finds a price there. What changed: - The button, its panel's heading and fold, and every note that sends the user there say "Names, prices & levels" (zh 名称、价格与推理档位, zh-TW 名稱、價格與推理檔位, ja 名前・価格・推論レベル, de "Namen, Preise & Stufen"); the gateway's vision and compaction notes, the provider package's text, the subsystem pages and the site's start docs (en, zh, ja) follow. - The button's tooltip says it sets what each model costs at this provider; Usage's "estimated" tooltip says where a provider's own price is set and that it counts over the list price. Both in en, zh, zh-TW, ja and de. - Not changed: the Codex model description text in internal/codexcat (it goes to Codex, so a vendor sees it) and core_budget_test's history comment. - app.js: a comment above the price box is shortened so the core script stays under its budget, not raised (app.js 116 bytes under origin/main). Run at the pushed head (rebased on origin/main |
||
|
|
276c806db2 |
plugins: a plugin's own requests are counted; a provider plugin's options get the editor (plugins#592)
zelong77 asked for two things once Devin 0.1.30's cache keep-alive
worked: its pings were invisible in magpie, and the interval and ping
count could only be edited in plugins.json. The owner decided pings are
shown as counted usage and the two numbers are edited in the GUI.
- host.js gives plugins input.magpie.usage(provider, call) and
input.magpie.account(provider). usage validates the call (kind
[a-z0-9_-]{1,40}, a model id, whole-number tokens from 0, status at
most 999, error clipped to 500) and sends an unasked "usage" event;
host.go hands it to plugin.OnUsage in the background.
- internal/usage/plugin_calls.go writes each one as a row of agent
magpie on the plugin's provider (provider.PluginID) and account
(provider.PluginAccountUser), with its kind. It is counted, priced
and in every total, not a probe. Kind cache_keepalive is in the
purpose catalog as "Cache keep-alive" (five languages), so the
request log names and filters it. The ping itself still goes straight
to Devin, never through the gateway, which would break the cache.
- /api/plugins reads every plugin's package options example, not only a
middleware's or request hook's, and the Installed row offers the same
Options JSON editor for a provider or agent plugin that suggests or
has options (not while it is off). Clear's confirm no longer calls
them a middleware's options.
- The Devin mover's min is 0.1.31, which reports each ping and gives
its two settings' defaults (285 s, 6) to the editor. npm has 0.1.31
(published 10:03Z); the plugins publish run is red only for
think-tags' known E404 (plugins#180).
- docs: provider-plugins.md (the API, the options editor),
gateway-sessions.md (the counted row beside probes).
Run at this tree (rebased on origin/main
|
||
|
|
e84870f173 |
plugins: an option's words in the window's language, and a filtered model list says so (plugins#590)
anewuser6937 (Discord, plugins#590) saw one model in WorkBuddy's editor
and took the plugin for broken. They had turned on "Free models only"
themselves, but its label and description read in English in the Chinese
window, and nothing by the models said the list was filtered.
A plugin option (auth.options, magpie's own field; OpenCode's AuthHook is
provider/loader/methods and never reads it) may now give `labels`,
`descriptions` and `confirms`, each keyed by the window's language
("zh", "zh-TW", "ja", "de"), beside the plain strings, as a page's
`titles` do. The host keeps only non-empty strings under language names
of 16 or less, 16 languages at most, each capped as the plain one is
(60/300/300). The editor shows the exact language, then its first part
(zh-TW reads zh), else the plain words, in the row, the hint, and the
confirm dialog and its title. `filtersModels: true` says the plugin's
model list leaves models out while the switch is on; while one is on, as
saved, the Models field says under the chips "Only some models are
listed: the plugin option “…” is on." (zh 只列出部分模型:插件选项「…」已开启。,
zh-TW, ja, de too). An older plugin shows what it showed before, and an
older magpie shows a new plugin's plain words with no note.
WorkBuddy 0.2.10 gives "Free models only" in all four languages with
filtersModels (magpie-community/plugins aec58ae, on npm: `npm view
@magpie-community/opencode-workbuddy-auth@0.2.10 --prefer-online` on mote
says 0.2.10, latest), and the mover's min is raised to it so every moved
user gets it. The CLI's `magpie plugin options` stays English, as the CLI is.
The core scripts would have gone 608 bytes over their budget; three of the
provider editor's comments in app.js are cut down instead, no raise
(1,532,865 of 1,533,105).
Run, on mote (mote-run), at this tree:
- node --test plugin-option-words.test.cjs (new): Chromium and WebKit,
1100 and 420 wide, en/zh/zh-TW/ja/de, switch on and off: each
language's label and description, zh-TW falling back to zh and ja/de to
the plain words for a zh-only option, the note exactly once under the
chips in a .hint inside the editor with no sideways scroll, none while
off, the confirm in the language. With app.js put back: 19 of 21 red
in Chromium (only "en off" passes, both widths).
- With plugin-options.test.cjs and i18n-keys.test.cjs, both engines:
68 pass, 0 fail.
- go test ./internal/plugin ./internal/provider ./internal/cli: ok.
TestPluginOptions with host.js put back: red (empty maps, FiltersModels
false). The real WorkBuddy 0.2.10 index.mjs loaded into this host
(a temporary test, not kept): plugin.Providers lists free_only for
workbuddy and workbuddy-ai with all four languages and filtersModels true.
- go test ./internal/gui: TestCoreScriptBudget ok after the cut. Red,
and red the same at origin/main
|
||
|
|
a6217e83d3 |
plugins: a plugin npm said nothing of offers Install, not Coming soon (zhudabao8433 on Discord)
zhudabao8433 on Discord (#general, 11-01): PowerContext (@magpie-community/gateway-powercontext) could be installed yesterday and today reads 即将上线 again. Cause: PowerContext was never pulled. It is in registry.json since plugins 1e4c8a2 (10-29) and on the dist branch (0.2.0, every dist commit since), and not on npm (E404), so magpie learns its version from the dist branch's ~1.7MB index.json. Coming soon is drawn whenever a listing has an npm answer with no version, and three paths gave one without anything confirming the package is missing: - builds before v0.1.2413 kept a dist read cut off at npmEach (6s) as "not on npm" in plugin-npm.json (ferock, |
||
|
|
a9154b170a |
gui: the open provider editor holds still as allowances come in (#3492)
congee949 (#3492, Playwright on v0.1.1403's assets, a fixture of five accounts and 16 models): with a subscription's editor open, the whole dialog, its head and buttons too, went to opacity .5 and 2px down and came back as its accounts' allowances came in, for an empty answer ({}) as well. The editor reads them (loginUsageOf) as it is drawn, and the read's end draws it again (renderProviders). openModal took every redraw of an open dialog for new content and played the soft refresh it gives one (.dialog.swap: content-in, 220ms from opacity .5 and translateY(2px)). That redraw is now a quiet one: loginUsageOf's finally calls renderProviders(true), renderProviders hands it to openModal, and openModal adds no swap for it. The rest of the redraw is as before: the body keeps its scroll, the focus stays on its control and the dialog keeps its place (holdModal). Every other call of renderProviders and openModal passes nothing and does as before. The issue's other way, filling in only the allowances, would take a second way of drawing an account's meters and its at-its-cap note beside the editor's own; this keeps the one. app.js is 33 bytes bigger (1,309,476 of its 1,310,460; the core's scripts 1,525,572 of 1,526,556), no budget raised. On origin/main |
||
|
|
a7b47d57ec |
accounts: removing the account Claude Code is signed in to switches it to another first (#4532)
StringKe (#4532): removing the signed-in Claude account was refused with SignedInError, while Codex's switched away first. ForgetLogin now does the same for Claude Code: nextOnForget picks another account (on first, then one whose sign-in holds), SwitchLogin signs Claude Code in to it, and only then is this one forgotten. If that switch fails, nothing is removed and the error says why. nextOnForget leaves out accounts Claude Code or Codex can't be signed in to (switchable: not a setup-token account, not a Codex account held in another folder). Claude Code is never signed out: when the account is the only one it can be signed in to, it is kept, with SignedInError{Only} (GUI code signed_in_only), which says to add another account first or sign out in Claude Code. The GUI gives the signed-in Claude row a Remove when another account it can use exists, and no Remove or Sign out otherwise. Claude Code's own credential is never deleted; forgetClaudeDir removes only the forgotten account's own folder and its folder's Keychain item, and claudeHolders' check of other records holding the same token is unchanged. Tests: TestForgetLiveClaudeSwitchesFirst, TestForgetOnlyClaudeIsKept (replacing TestClaudeInUseStillRefused, which held the old refusal); codex-signout.test.cjs gets three Claude cases (Remove with another; only + setup-token: no Remove, reason in zh/zh-TW/ja/de; the signed_in_only refusal in en/zh). Run (mote, sandbox HOME through the test helpers): - go test ./internal/provider ./internal/cli, vet and gofmt at the stack head: in the next commit's body (one tree, same run). - Broken by hand, each red: Claude not switched first (TestForgetLiveClaudeSwitchesFirst), Only left false, a setup-token account counted as another, nextOnForget unfiltered (TestForgetOnlyClaudeIsKept). - GUI on Linux (WSL magpie-desktop), Chromium and WebKit: codex-signout, own-signin-remove, saved-signedout-remove, login-import, claude-signin, account-alias and i18n-keys all pass but i18n-keys' "a plugin's words are its own", red on main (#4524). On mote, codex-signout passed in Chromium; its WebKit launches were killed with mote at load ~25 under other sessions' suites (#4125), so WebKit's record is Linux's. CLI in a sandbox HOME (WSL, file credentials): forget of the signed-in account by its name switched Claude Code to the other (.claude.json then says max@x.com); forget of the only one was refused with the message above and left it signed in. Not tried: a real Claude Code switch on removal with real accounts, or in the CLI against a live ~/.claude (sandbox only). |
||
|
|
847f0c4703 |
gui: Masking alert lives on the Masking page
nb5p on Discord (#feedback): "这个脱敏提醒被放到额度设置里了,害得我找半天没找到". The Masking alert row sat in Settings › Usage. It now closes Insights › Masking, after the list of requests, in the page's own `.list.prefs` rows (same Off/On segs, same ids #maskAlertRow/#maskAlertSegs, same i18n keys and the same maskAlert setting). Nothing is left in Usage. The page draws it from page.js after loadSettings, hides it while one request is open, and gateway mode leaves it out as Settings did. Placed after the list so the requests still start in the first screen (masking-records at 640px) and the demo keeps its place between the card and the list. Run at base |
||
|
|
bdc1617bed |
routing: Accounts and keys count the whole day, not the last kept requests (#3351)
1234fsdc: the live Routing page's Accounts and keys said tried and answered over the requests the page still keeps in memory, so on a busy day the counts were a sliver of what Usage showed for the same accounts and went down as old requests fell off. /api/trace/history (the read the live page already makes every 15s) now carries `tallies`: per account or key, today's tries, answers, fails by reason, models answered, the last answer and the latest rest, read from routing/<today>.jsonl. The page seeds the list with them and still takes the latest rest and readings from the requests it keeps; a day looked at, or a purpose picked, counts its own list as before. The note says "over today's requests" then. Ported from ggbdpq's patch on the issue. Changed from the patch: - The patch parsed the whole day's file under history.mu on every look. A busy day's file is hundreds of MB (#3383) and saveRoute takes the same lock, so every 15s poll would stall the routes being written. DayTallies now folds in only the whole lines added since the last look (it keeps the offset, as History does); a line still being written waits for its end. It starts again when the day changes, the file shrank or was compressed, or the folder moved (another HOME). - What it returns is a copy: the patch handed out the live tallies, and the JSON writer read a Fails map the next fold wrote. - The latest name and rest go by the try's time, so no sort per look. - docs/subsystems/gui-shell.md says how the counts are made and that a request done since the last look is counted at the next one. Run on mote at this change on |
||
|
|
62c8d21ee5 |
gui tests: account-arrange acts once the allowances are drawn (#4468)
account-arrange's "account dragging uses the routing order in every mode"
was red alone in WebKit at
|
||
|
|
ce8b67de37 |
gui tests: a page's first load gets a minute, not a click's 5s (#4470)
claude-switch-only set page.setDefaultTimeout(5000) and then called page.goto with no timeout of its own, so Playwright held the first load of app.js, i18n.js and the plugins to the 5s bar meant for clicks. On a busy box (a whole-suite run at load 130-160) that load took longer and goto timed out. The same pattern is in 988 GUI test files (1174 pages): every one of them now also sets setDefaultNavigationTimeout(60000) on the same page, right after its default, so goto, reload and waitForURL wait on the load itself with room, while clicks and waits keep their short bar. group-from-model-add's own 20s navigation bar is raised to the same minute. claude-switch-only also gives its first provider row (drawn from the page's first reads) a minute before clicking it. nav-timeout.test.cjs (no browser) reads every GUI test file and names each page given a default under a minute without a navigation timeout of at least a minute, so a new file can't bring the pattern back. What was run (WSL magpie-desktop, Playwright 1.62.0, load 70-260 from other sessions): - node --check on every file in internal/gui/tests: all parse. - nav-timeout.test.cjs against origin/main's test files: red (names the 1174 pages); against this tree: its only reds were my own probe copies of the old files, since removed. - By hand: claude-switch-only with app.js served 7s late (a busy box's first load), --test-name-pattern "1100 en": origin/main's file 4 of 4 red with "page.goto: Timeout 5000ms exceeded"; this file 4 of 4 green. - claude-switch-only.test.cjs, both engines, en/zh/ja/de, 1100 and 420: 32 of 32. group-from-model-add, usage-access-key-card and i18n-keys: green. agent-plugin-agents: Chromium green; WebKit's de 420 subtest red on a 5s waitForFunction at line 115 (a wait after load, not the navigation), at load ~230. Not tried: the whole GUI suite (about 1000 files; the change is one mechanical line per page), Windows or mote (mote's browsers, #4125). |
||
|
|
a45a0f1c5d |
signin: Settings can keep sign-in pages out of the default browser (max2020)
max2020 on Discord signs in from a separate, fingerprint browser so the vendor never sees their default one. Every waiting sign-in already shows its link with Copy link (since |
||
|
|
c84c3e1c03 |
gateway: a key's holder sees its own usage and setup at /me
zytszone on X runs one magpie's gateway for a whole department, whose people can't be given the admin's app. Each now opens the gateway's /me at the address they reach it at, types the gateway key they were given, and sees that key's own name, limits and what is spent of them, its usage over today, 7 and 30 days with its most used models, the models it may use, and copy-ready setup for Claude Code (settings.json env), Codex (config.toml provider, /v1, responses), any OpenAI-compatible client and a curl test. The base URL is the address the page was opened at, never 127.0.0.1; the key is a placeholder until "Put my key in the setup" is ticked. Strings in en, zh, zh-TW, ja and de. - GET /me (keypage.html, embedded) is the same bytes for everyone and holds no data, so lanGuard serves exactly GET/HEAD /me (no escaped path) to another machine without a key, after the allow list, the rebinding check and the not-shared 403, which still apply. Its CSP loads nothing from elsewhere, posts no form and forbids framing. - GET /v1/magpie/me (keyInfo) answers access.Caller's own key only. No key, a wrong one, one turned off and magpie's own token are 401 alike; ?key= is refused 400 so a key never sits in an address or a log. It names no account, other key, provider or secret; its models are /v1/models' for that key (keyAllowed), none for a read-only key. The page sends the key as Authorization to its own origin with credentials omitted and keeps it in sessionStorage only. - Both are in readOnlyRoutes, /me in clientPrefixes (magpie web's page port), and Gateway -> Gateway keys shows the page's address (MAGPIE_PUBLIC_URL, else the LAN address offered) with a Copy, while shared and with a key. Docs: gateway-routing.md, reference.md. Run: - mote: go build -tags nogui ./...; go vet -tags nogui gateway+gui; GOOS=linux and GOOS=windows go vet -tags nogui ./internal/gateway; go test -tags nogui -count=1 ./internal/gateway ./internal/gui: ok (gateway 732s). gofmt -l clean. Rebased onto |
||
|
|
ef9cd2fd6c |
gui: the tray panel's More in Plugins opens the window on Discover (#3579)
yetone (#3579): in the tray panel, the add sheet's More in Plugins, and its search's "look for a plugin", asked the window for Plugins with no more than the view's name (window/main?view=plugins). The window opened on the tab of Plugins kept from before, Installed or Built-in, with nothing looked for. |
||
|
|
44d6979930 |
gui: a page scrolls rather than squeeze its heads, so opening the Gateway page's models moves nothing over them
The owner, 10-29: 展开模型的时候,这块部分会整体向上移动几个像素. A view is a flex column (since |
||
|
|
5637cca141 |
settings: a notification when masking swaps a value for the first time (Must2333 on X)
Must2333 on X: "我还希望能即时的知道发生了替换,但不是通过随时监控网关的方式".
They want to know when magpie masks something without watching the
gateway or the 脱敏 page.
Settings › Usage has a new row, "Masking alert" (zh 脱敏提醒), after the
task done alert. Off/On, off by default. When on, a value masked for the
first time gives a system notification through the same notifier as the
other alerts. It says only how many new values, each kind and its count,
and the agents that sent them (two named, "+N" for more). It never says
the value, any piece of it, or the Head hint the 脱敏 page keeps. A click
opens the 脱敏 page on the latest record (clickView, "masking&key=<key>").
Why off by default: every other notification in this group is off until
turned on; turning one on asks macOS for notification permission; for
most users a notice each time masking works is noise, since masking's
expected behaviour is quiet protection. It is one row, in the group that
already holds the alerts, hidden while masking is switched off
(data-feature="redact") and in gateway mode.
Staying quiet:
- First time only: maskrec.Fresh says which values a record has that no
record before it had. A conversation sends its whole history each turn,
so a value is masked again every turn after its first. The index is by
placeholder (HMAC-stable across restarts), filled from memory and from
the days kept on disk, so a restart doesn't make a history new again.
The days are read off the lock, since Hold takes it on the request's
way. Values sent as written (Action "warn") are left out.
- A burst is one notification: records gather for 3s (maskGather).
- At most one every minute (maskGap); what comes in between is said
together after it. At most 5000 records wait.
- With the setting off, nothing is kept.
The gateway tells the app through gateway.OnMasked, after maskrec.Hold,
with Snips and Back taken out; nil under `magpie serve`.
Strings: en, zh, zh-TW, ja, de, in i18n.js (the row) and in
mask_alert.go (the notification's title and kind names, the 脱敏 page's
own words for the kinds). docs/subsystems/gateway-routing.md has the
bullet. The core script budget isn't raised: main's 10-29 budget leaves
room for the row's 287 bytes.
Tests, each broken by hand and seen red:
- TestMaskAlertFirstTimeOnly: masks through redact.Mask as the gateway
does; the history masked again says nothing, a new email in turn 4 is
said alone. Red when flush counts r.Values instead of the fresh ones.
- TestMaskAlertNeverSaysTheValue: no 4-character piece of the key, email
or phone, and no Head, in any of the 5 languages. Red with the Head
added to the kind's name.
- TestMaskAlertCoalesces: a burst of 5 from 3 agents is one wait of
maskGather and one notification ("+1"); two more 10s later wait
maskGap-10s and are said as one; off keeps nothing. Red without the
waiting check (5 waits) and without the maskGap wait ("waits 3s want
50s").
- TestFreshOnlyTheFirstTime, TestFreshHeldWhileReading (maskrec). Red
with loadFirst skipping the disk read (the history new after a
restart), and with the index broken (both).
- TestDismissedAlertOpensNothing covers the mask notice's click.
- mask-alert.test.cjs: every language at 900 and 380px, both engines:
the row after the task done alert, Off at first, On saves maskAlert,
another save keeps it, Off saves false, no click moves the page, no
left border, gone with masking switched off. Red with maskAlert taken
out of prefsKeep, and with data-feature taken off the row.
Run:
- This change on main
|
||
|
|
11cbf4de1d |
usage: Sessions' agent filter is a menu, as the model and folder ones beside it
The owner (10-28, screenshot of Usage › Sessions with 13 agents in a strip across the page): "这应该是个 Combo Box". The agent filter was a segmented strip, one segment per agent in range, that scrolled sideways in itself once it ran past the window (#929). It is now the same sessPick button as 全部模型 and 全部文件夹, with the same searchable menu: "All agents", then every agent with sessions or usage in the range, the most used first, each with its tokens under the other two filters. One agent in range still leaves it hidden; the pick still resets to All when its agent leaves the range. The request ledger's agent filter was already this menu. #sessAgent left the CSS rules for scrolling strips; the strip's own test (sess-agent-strip, #929's sideways scroll) is gone with the strip, and usage-sessions-agents-fit now checks the menu: no sideways scroll at 860 and 560 wide, the three filters on one line inside the window, the menu's order, search, a pick shown on the button and kept when the page is drawn again, All clearing it, one agent hidden. sessions-empty-range and sessions-overview-once pick their agent from the menu. Run on mote (node 22, Playwright 1.62.0): - usage-sessions-agents-fit, sessions-empty-range, sessions-overview-once: 24 of 24, Chromium and WebKit, every language they cover. - usage-sessions-agents-fit against origin/main's page.js, client.js and app.css: red in all four (BUTTON.sess-pick expected, a div of segments). - go test -tags nogui -run Budget ./internal/gui: ok. - 122 other GUI files that touch Usage, sess-pick or i18n, concurrency 3, beside another session's full GUI suite (load 36-75): 1944 pass, 24 fail in gateway-caller-keys, gateway-key-cycle, i18n-keys, mcp-oauth-app, usage-ledger and web-page. Rerun alone at concurrency 1 on this tree and on origin/main ( |
||
|
|
761e0e0105 |
gui: a Settings option pressed through two redraws clicks its newest self (#3922)
Browser access draws twice per renderSettings: once at once, and once more when its /api/web-page answer comes. When that answer landed between the release and the click segs' pointerup sets off, the option the release found was gone by the click and nothing was sent, which segs-press-redraw's sweep saw on Network's web-page list. The click now goes to the control's newest self (same segsWho, same option), found again whether or not a draw came since; dragged off or gone still picks nothing. From Coffemon's patch on #3922 (JoeyWu-tech, fix/3922-segs-newest, c1b5575af and e8c831736): the test's new redrawn-twice case, reveal() waiting for each wheel's scroll to land, and the README entry, taken as is. The app.js change is his, shorter: his kept b when still there and looked up the newest self otherwise (+298 bytes); the lookup finds b itself when b is still there, so it is used alone (+129 bytes). Main's core had 18 bytes of room left when this landed; TestCoreScriptBudget is green and no budget is raised. What was run (mote, Playwright 1.62.0, Chromium and WebKit, en, zh, ja, de, 900 and 440px): - The new test on main's app.js: 22 of 42 red, both engines. - With this change: 42 of 42. - Broken by hand (the newest self's option taken as [0], not p.i): Chromium 17 red. - go test -run TestCoreScriptBudget ./internal/gui: ok. Not tried: the real app's webview, or a loaded Mac. Co-authored-by: JoeyWu-tech <joey110551567@gmail.com> |
||
|
|
1d7ca4c6b7 |
gui: every scroller in every stylesheet is held to keep the wheel; Safari 15 too
碳碳双键 (ysm119, Discord): a list scrolled to its top or foot by the wheel went on to scroll the page, "in many places". |
||
|
|
6bec526f7a |
gui: a key's rename saves once on Enter and never on Escape (#3944)
A provider's key name was edited in an input whose Escape drew the
editor again and whose blur saved. Chromium blurs the input as that
redraw takes it out, so Escape after typing saved the typed name, and
Enter, or Enter twice before the save answered, sent keys/rename twice.
The account rename already guarded this with a once flag. Both now go
through one helper, renameIn: Enter saves a changed name, Escape keeps
it, and whichever comes first ends it, so the blur that follows does
nothing. Taking the two copies into one makes app.js 93 bytes smaller;
no budget is raised.
From Coffemon's patch on #3944 (JoeyWu-tech, joey/fix/3944): the test
key-rename-once.test.cjs and its README entry taken as is. The app.js
change differs: the patch copied the account rename's guard into the
key rename; this shares it instead, to keep core script inside its
budget.
What was run (mote, Playwright 1.62.0, Chromium and WebKit, en and zh):
- origin/main
|
||
|
|
03a8d981ea |
gui tests: quota-refresh-order runs again, with seven more orders (#3679)
|
||
|
|
d74ef5e04c |
gui: an inner list wheeled to its end keeps the wheel; the page stays put
碳碳双键 (ysm119, Discord): wheeling the Usage page's request list to its top or bottom carried on into the whole page, and "this happens in many places". It is the class: every box that scrolls inside a scrolling page. app.js marks such a box `.holds` while it overflows vertically, on pointerover and on each wheel (the box under the pointer and its ancestors up to the .view), and app.css gives `:where(.holds)` overscroll-behavior-y: contain, which keeps the Mac's bounce on the box. Not one CSS rule for every overflow:auto box: in Chromium `contain` holds the wheel even in a box that doesn't overflow, or is overflow:hidden, or only scrolls sideways, so short lists and the heatmap's and ledger's sideways scrollers would have stopped the page. The .view itself is never marked. :where() weighs nothing, so .mchips in a short window (@media max-height 640px, #833) still passes the wheel on. The new test, inner-scroll-contain.test.cjs, wheels the Routing page's requests list past each end (en and zh, 900x560 and 1300x600, under "By session" / 未提供会话标识), and ten kinds of inner box, and asserts the page's scrollTop didn't move. A short list, heat-scroll, led-wrap and snip must still pass the wheel to the page. routing-scroll-end now wheels over the page's gutter: at its view centre the pointer sat on the requests' list, which now keeps the wheel at its end (600 of 1066). Run (mote, Playwright 1.62, Chromium and WebKit): - inner-scroll-contain 40/40. - 17 files: inner-scroll-contain, click-scroll, routing-scroll-end, routing-sessions, view-wheel-after-click/-after-redraw/-unheard, heatmap-scrollbar, ledger-hscroll, ledger-hscroll-foot, context-scroll-end, menu-scroll, provider-levels-scroll, panel-usage, panel-routing, qoder-cn-tile, agent-disconnect: 268/287. Reds were routing-scroll-end (this change, fixed above) and panel-usage webkit zh (#3311, commented). Rerun of routing-scroll-end, panel-usage and inner-scroll-contain: 66/66. - go test -tags nogui ./internal/gui ok (TestCoreScriptBudget passes at the rebased head: core under 1,526,556, app.js under 1,310,460; no budget raised). Broken by hand: the old app.js and app.css: the requests list and every held box red in both engines (mchips aside, it had contain already). Only the CSS rule removed: red, "the page didn't move" x8 plus each held box x2. Only the overflow check removed: a short rt-reqs red (Chromium), led-wrap and snip red in both engines. Not run: full GUI suite (mote was busy with another session's suite). Not tried: WebKitGTK on Linux, WebView2 on Windows, a real Mac's trackpad rubber band and momentum in the app, older macOS WKWebView, touch; zh-TW/ja/de (no strings changed). |
||
|
|
824100f30f |
gui: keep Windows modal backdrops responsive without blur
Disable full-window modal backdrop filtering in Windows desktop windows and tray panels, retaining the dimming veil. Browser pages and other platforms keep their existing blur through the existing win/web markers. Document the platform behavior in the GUI shell reference. On an affected 0.1.1805 installation with WebView2 155.0.4283.62 and Intel UHD D3D11, disabling the filter made provider tests visibly responsive. The reporter confirmed the improvement. Scripted scrolling measured roughly 67 to 165 rAF callbacks/s, not presented FPS. Verification: modal-backdrop.test.cjs fails on the original CSS in both Windows desktop Chromium cases (blur instead of none), with the other 10 cases passing. After the fix, 45 targeted tests pass across Chromium and WebKit: modal-backdrop, dialog-backdrop-drag, segment-press-dialog, gui-zh-tw, gui-ja and gui-de. node --check and git diff --check pass. The full GUI suite, Go vet/build/test matrix and native macOS/Linux tests were not run. |
||
|
|
c3b0484a96 |
usage: keys of one account show its balance once (mimi)
mimi on Discord (#feedback): "同一个网站,添加多个key时,余额会重复展示" -
a site's keys 1-A031-Pro, 2-S009-Plus and 3-S010-Team-2 each showed the
account's $8.39 and its own curve.
KeyBalances still reads, keeps and charts every key on its own. What
changed is what the Usage page draws:
- balanceRead says whether the reading is the account's (balanceAccountWide),
going by the source, not the vendor's name:
- account-wide: a balance token (new-api /api/user/self, sub2api
/api/v1/user/profile, AiHubMix), a known host's account query
(DeepSeek, Moonshot, OpenRouter credits, SiliconFlow, StepFun, ...),
and sub2api /v1/usage when its mode is "unrestricted" (wallet or the
group's subscription, per sub2api's gateway_handler.go Usage);
- per key: AiHubMix's /dashboard/billing/remain, new-api's
/api/usage/token, sub2api in quota_limited mode, any other Balance
URL the user named.
- Two such keys of one provider with the same amount are one account only
when their balances moved together: the same latest change (from and
to), first read within balanceHistGap. Two accounts with the same
amount stay apart until one is spent from; keys whose amounts differ
are never one. SharedBalance (the first key's name) says so in
/api/usage/quotas, magpie quota --json and /v1/magpie/quotas.
- Refreshing a shared card reads every key it stands for (sharesAskedCard),
so it stays one card. The history is read outside the cache's lock.
- The Usage page draws them as one row, one balance, one curve, with
"+2 keys" beside the key and the keys on hover; the head's sum counts
the account once. The code is in plugins/usage/page.js, so app.js is 9
bytes smaller than before; no budget raised.
Run (mote-run, at the pre-rebase base
|
||
|
|
833f51adcf |
gui: a browser tab has the font rows too, with its own choice
Norcleeh on Discord: magpie opened in a browser had no font setting in Settings > General, while the app does. The rows were hidden on purpose: /api/fonts answered 404 to a browser page and boot sent it no choice, since the list is the fonts of the computer magpie runs on and the tab can be on another one. Now a browser tab (magpie web, or the app's page in a browser) has both rows wherever magpie can read its fonts (boot's fonts; a nogui build can't, and keeps them hidden). Its list is /api/fonts less the families this browser doesn't draw (fonts.js here(): text in the family measures apart from monospace's or serif's on a canvas), so another computer's fonts and Safari's user-installed ones aren't offered. The choice is the browser's own, in localStorage (magpie.fonts), applied by fonts.js before the first paint; it neither changes nor takes the app's settings.UIFont/CodeFont, and a settings save from a browser still keeps the app's. Run on mote at this tree (on |
||
|
|
e056779a67 |
gui: the app serves its page to a browser, behind its key (Settings › Browser access)
jiakun_zhao on X ran `magpie web` in a terminal beside the desktop app, to manage it through a Cloudflare tunnel. Settings › Network and sharing › Browser access now has the app serve the same page itself: Off, This computer (127.0.0.1, for a tunnel or SSH forward) or Local network. Access is magpie web's, unchanged: the key in the link is traded for the cookie (webGuard), the allow list holds, and the gateway's client routes on the page's port need a gateway key (onePort). A rebound Host and Origin: null get no cookie. There is no way to serve it without the key. The key and choice live in web-page.json (0600) beside settings.json, so a sync never carries them. GET/POST /api/web-page are the app windows' alone: a browser on the page can't read the key or turn the page off. A busy port (magpie web, the magpie before an update) is tried every 4s; `magpie web` on the same port opens the app's link instead. Run at d43b7c40d (this change on |
||
|
|
aa766289bf |
gui: a routing group switched on no longer folds away the one provider's models
shiqi_40904 on Discord (#general, 10-27): with Codex as the provider,
switching a routing group of their own on made models go missing from an
agent's model list, and switching it off brought them back.
The cause is in the agent model list dialog. A section with more than 8
models starts folded when the list has more than one section, so that
several providers can be told apart. The Routing groups section counted as
one. With only Codex serving there is one section and Codex's 10 models
show. Switch a group on and there are two sections, so Codex's 10 start
folded under a "Codex 10 / 10" header with no rows. Nothing was missing on
the server side: /api/state's options and counts for every agent only
gained the group (27 -> 28 in the sandbox).
Now only provider sections count toward folding. With two or more
providers the long ones still start folded, as before
(agent-models.test.cjs is unchanged and passes).
Run (worktree at origin/main
|
||
|
|
78a0dbdd29 |
gui: a download the network broke off says so, not the signed address
AIMetaPhD on X: Settings › About read "0.1.1618 下载失败 · https://github.com/
…/magpie-windows-amd64.exe: Get \"https://release-assets.githubusercontent.com/
…?sig=…&jwt=…\": EOF". The text was hundreds of characters of signature and
token, and it said nothing about what to do.
/api/update now carries network: true when update.Network(err) is true
(the previous commit's NetError, after its own tries). The Version row
then says "{v}'s download broke off, a network problem. Click Check to
try again, or download it from the release page", translated into zh,
zh-TW, ja and de. The raw error stays in the tooltip. The release page
button the row already had stays. A mirror's failure keeps its own text
(#893). begin() clears the flag along with the mirror.
Run: GUI tests (Playwright 1.62.0, Chromium and WebKit):
update-*.test.cjs (16 files, the new update-network among them) and
i18n-keys, 266 of 266 pass. go test ./internal/gui (ok, 224s); go
test ./internal/update ./internal/cli (ok, previous commit); gofmt -l
clean; go vet; GOOS=windows go vet; GOOS=linux go vet -tags nogui
(./internal/gui ./internal/update).
After rebasing both commits onto origin/main
|
||
|
|
ef0a03e137 |
otel: Langfuse is set up from its host and the project's two keys
A user on X asked for Langfuse built in. magpie could already export to Langfuse over OTLP, but Settings › Observability had the user type the endpoint .../api/public/otel and a percent-encoded Authorization=Basic%20<base64(pk:sk)> header by hand. Settings › Observability now has a Collector row: OTLP or Langfuse. With Langfuse, the user picks the host (Cloud EU, Cloud US, or Self-hosted with an address, which also covers Langfuse's JP and HIPAA regions) and fills in the public and secret keys. Once both keys are there, magpie saves: - the endpoint <host>/api/public/otel; - Authorization: Basic base64(pk:sk), in otel.headers as before, so the secret is stored where it was and a backup without keys leaves it out; - on a first setup, also x-langfuse-ingestion-version: 4, metrics off and export on. langfuse.com/docs/opentelemetry/get-started (read 10-26) gives the same header for every region and for self-hosted, and says that without it OTLP data can arrive up to 10 minutes late. A Langfuse endpoint set up by hand opens in this view with its keys decoded into the fields. Opening it saves nothing. Changing a key or the host keeps the user's other headers, their metrics and export choices, and an ingestion header they set or left out. Switching from another collector leaves that collector's headers behind and does not send them to Langfuse. The Observability page moved from app.js into the otel plugin (assets/plugins/otel/page.js, with i18n.js for its words, in Client), because app.js had 13 bytes of budget left. The app.js and core budgets are lowered to what is left (1,321,319 and 1,537,645; app.js is 1,321,313 after rebasing on |
||
|
|
894ec96036 |
plugins: "More in Plugins" opens Discover, not the tab visited last (outloudvi on Discord)
On Providers, 「插件里还有更多」 / "More in Plugins" opened whichever
Plugins tab was visited last (Built-in, Installed). pluginQuery("")
returned early when the query was already empty, before it set the
tab to Discover. The early return is gone, so an empty query also
switches to Discover; a non-empty one already did.
plugins-more-discover.test.cjs visits Built-in, then Installed, in en
and zh, goes back to Providers and clicks the add sheet's More in
Plugins tile, expecting Discover with its cards and no Built-in list;
then the "look for a plugin" link with a search, expecting Discover
with that search.
Run:
- plugins-more-discover.test.cjs, chromium and webkit: 3 of 3 green.
- 61 GUI files the change can reach (plugin-*, plugins-*, builtins,
deprecat*, add-sheet*, provider-search*, i18n-keys, nav-sub-unroll,
mobile-web, market-have, sidebar-tab-top), both engines: 412 pass,
1 fail each: builtins.test.cjs's sidebar list lacks the masking
tab, red the same with the old plugins.js (#3498).
- go test ./internal/gui/ -count=1 (budgets included): ok but
TestMainWindowCorners/macOS_15_SDK killed at load ~200 (#1936,
#2645); alone it passes.
- At the rebased head (
|
||
|
|
c9c28aa586 |
gui: a gateway key list that can't be read keeps saying so in its card, and one read before stays
Found beside HarriesChen's report: when /api/caller-keys failed,
loadGatewayKeys put the error straight into #gatewayKeys, and the page's
next redraw (renderGatewayKeys from renderGatewayView, the providers'
poll) wiped it, since it returns early while no list was read. A failed
re-read also replaced a list already shown with the error.
gatewayKeysErr now holds why a never-read list failed, and
renderGatewayKeys says it in the list's card (styled like the empty line
by the previous commit). A list read before stays, and the error goes to
the status line. A read that works clears it.
Run:
- gateway-keys-empty.test.cjs: the unreadable case (past a
renderGatewayView redraw) and the read-before case, both engines: green;
with keys.js from main both red (".none" never visible; the 3 keys gone).
All 22+2 of the file green with the change.
- The whole GUI suite was still running at push time (see the previous
commit); not in this record.
Not tried: a real failing gateway (only the fixture's 500).
|
||
|
|
5046e4fc84 |
gui: no gateway key yet is said muted and inset in its card, as Recent calls says none (HarriesChen on Discord)
HarriesChen (#feedback, 10-25), magpie web on an iPhone: under Gateway keys, "No gateway keys yet" was drawn in the body's own text (14px, the foreground colour) flush against the edges of its white card. The `.none` line inside `#gatewayKeys > .accts` had no rule: `.accts` gives its rows padding through `.acc`, and the empty line isn't one. `#gatewayKeys .none` now takes the look of the same page's Recent calls empty line: muted colour, 11.5px, line-height 1.45, inset 13px 14px in the card. The page's other empty lines (Recent calls, Models' "No models match") already had rules and are unchanged. Run: - Reproduced at 390x844, magpie web (bootPrefs web), Chromium and WebKit, light and dark: before, colour rgb(28,28,33) / rgb(237,237,241), 14px, padding 0; after, rgb(133,133,141) / rgb(139,139,148), 11.5px, 13px 14px, equal to #activity .none in each. Screenshots looked at. - New gateway-keys-empty.test.cjs (390px, web, both engines, en, zh, zh-TW, ja, de, light and dark): 20/20 green; with app.css from main 20/20 red (colour, size, inset). fixtures/caller-keys.cjs takes options.keys. - go test -tags nogui ./internal/gui -run 'Budget|Asset|I18n|CSS': ok (no budget raised). - The whole GUI suite (node --test --test-concurrency=2 tests/*.test.cjs, both engines) was started at 687c3645f's tree and was still running when this was pushed (owner: ship at once). Its result is not in this record. Not tried: a real iPhone Safari; the Go suite (only CSS and GUI tests change). |
||
|
|
b437e4adb4 |
settings: a proxy's username and password have fields of their own for every proxy, HTTP too (微雨南山 on Discord)
Settings > Proxy > Custom now shows Username and Password fields beside the
address for every proxy kind. Before, only a SOCKS5 address had them (the
password is masked). An HTTP or HTTPS proxy's login had to go inside the URL,
so a password holding @ : / % # or a space broke it. Each field is
percent-encoded (encodeURIComponent) when the address is saved.
The setting's format is unchanged: still one URL with the login as its
userinfo. A proxy saved before with user:pass@ loads into the fields. It is
split the way Go's url.Parse splits it (last @, then first :), so
"https://al%20ice:se@cr%23et@proxy.example:8443" shows "al ice" and
"se@cr#et". It is not split through WHATWG URL, which would add a "/" or drop
a default port. A part left as it was loaded keeps its own escapes, so
non-UTF-8 bytes survive. A login pasted into the address moves into the
fields. Describe, Redact and the status line already hid the userinfo
(#1886), and a new test checks that again.
Credit: 微雨南山 on Discord (#feedback), who asked for macOS-style
address / username / password fields after a special character in the
password broke the URL.
Tests:
- internal/netproxy/login_test.go: the login "me@corp:x" / "p@ss:w/rd% #1 x",
saved as the page encodes it, reads back as typed. It signs in to a fake HTTP
proxy (Basic Proxy-Authorization), and to a fake SOCKS5 proxy through both Go's
transport and the plugin bridge's socksHandshake. It also reaches a CLI's
HTTPS_PROXY. One character off is refused (407 / SOCKS fails), and Describe and
Redact show no part of it. TestBunProxyLoginWithReservedCharacters signs in with
the real bun 1.4.2's fetch({proxy}). These pass on the old Go code too: the Go
side needed no change.
- internal/gui/tests/settings-proxy-auth.test.cjs, Chromium and WebKit, en zh
zh-TW ja de, at 560 and 375px: an HTTP proxy has the fields, the login
round-trips encoded and comes back decoded, the password is type=password, and
the status hides it. A login saved in the address loads into the fields, and
Enter on it saves nothing. On the old app.js both tests fail in every language
checked ("an HTTP proxy has a username field / false !== true"; the address
still showed 'https://al%20ice:se@cr%23et@proxy.example:8443').
Run:
- gofmt -l: empty.
- go vet (darwin), GOOS=linux go vet -tags nogui, GOOS=windows go vet: clean.
- Full Go suite at c7ad43426 through the suite lock (-tags nogui -timeout 45m):
68 ok, one red, internal/gui TestCoreScriptBudget. The first app.js was
1338904 bytes over 1338084. The helpers and comments were tightened (not the
budget raised): app.js is 172 bytes under its parent. Then internal/gui,
internal/netproxy and internal/settings: ok at the final tree. After the
rebase onto
|
||
|
|
ecd9835005 |
agent: Claude Code's subagent effort writes nothing without a subagent model (KorenKrita)
KorenKrita on Discord (cause confirmed by them): with Claude Code's
subagent model unset ("Claude Code picks") and a subagent effort set,
claude.go wrote spell(tierWith(main model, effort)) into
env.CLAUDE_CODE_SUBAGENT_MODEL. That pinned every subagent to the main
model, so Claude Code's own pick (the Agent call's model, the subagent's
frontmatter) never ran.
Agent wiring (internal/agent/claude.go):
- With no subagent model, magpie writes no effort, and
CLAUDE_CODE_SUBAGENT_MODEL stays unset.
- The saved effort is kept, not deleted (the user set it). It lives in
the stash under claude.subagent_effort, and the subagent effort's Get
reads "" while there is no model. A model picked later takes it
("v/glm:high").
- A value an older magpie wrote that way (the main model at an effort,
not own, while routed: subagentFollowing) is moved into the stash and
taken out of the env by writeTiers and by Sync on start.
- subagentOwn no longer counts that value as the user's own model.
- Doc: docs/subsystems/agent-wiring.md, the Claude Code "subagents" entry.
GUI (window, opened Claude Code row):
- The subagent effort moves from its square under the session defaults
to the right of the Subagents row. It uses the tier rows' markup and
code (effortBtn in connectPanel, ag-eff), so it lines up with
Opus/Sonnet/Haiku's effort.
- While the subagent model is unset it shows Default, is disabled, and
its title says "Set a subagent model first". The new string is in zh,
zh-TW, ja and de.
- The old square is removed from the opened row. No other layout changes.
- The tray panel's own square is left alone: #3308.
Tests:
- New internal/agent/claude_subagent_effort_test.go
(TestClaudeSubagentEffortNeedsAModel). On the old code it is red:
an effort with no subagent model wrote
CLAUDE_CODE_SUBAGENT_MODEL="v/glm:high"
With the Sync branch broken by hand it is red at "Sync left an older
magpie's CLAUDE_CODE_SUBAGENT_MODEL="v/flash:high"". It also checks
that a set model plus effort still writes "v/glm:low".
- claude_tiereffort_test.go now expects no env for an effort with no
model.
- New internal/gui/tests/claude-subagent-effort-row.test.cjs (16 cases):
chromium/webkit x en/zh x 1100/560px x with/without a subagent model.
It checks:
- the control sits in the Subagents row at the tier efforts' x and
height;
- with no model it is disabled at Default and opens no slider;
- with a model it posts subagent_effort, with no scroll;
- the old square is gone.
It is red against the old app.js ("the old square is still there").
- tier-effort.test.cjs is updated for the moved control.
Run at this tree (parent
|
||
|
|
c627652e9a |
settings: lightweight mode is off for a user who never chose
The owner, 10-21: "要默认关闭「轻量模式」,不然太卡了". With it on, the window is made again and its page loaded again on every opening, which is slow. |
||
|
|
28bec1507c |
settings: lightweight mode is on for a user who never chose it, and off for one who turned it off
The owner: 改成默认开,只对没设过的用户. A webview kept for good holds what
its page drew while hidden, which grew ~20 MB a minute on Windows under
steady requests (#2515); lightweight mode lets it go.
- settings.Lightweight is a *bool: nil (never chosen) is on, false is
off, true is on. LightweightOn() says which; gui/lightweight.go reads
it. KeepOwn still keeps this computer's value on a sync or a restore.
- app.js shows On unless lightweight is false, and the prefs save sends
s.lightweight as it is: unchosen stays out of the JSON, so saving
another setting doesn't choose it.
Caveat: until now Off was a bool with omitempty, so it was never stored.
A user who chose Off before this can't be told from one who never chose,
and gets On. Only choices made from this release on are kept.
Tests:
- settings TestLightweightKeptAndOwn: on when unset, Off saved reads back
off, another save keeps it off, KeepOwn keeps this computer's Off over
the other's On, and an empty one stays unset. Broken by hand
(`!= nil && *`) it fails "off for a user who never chose".
- lightweight.test.cjs: On shown for a user who never chose; another
setting's save posts no lightweight; Off posts false and shows Off;
another save keeps false; On posts true; nothing scrolls. Its viewport
is 1200 tall: rows added above had put Off under the window's foot
(y≈1008 of 1000), where the mouse click did nothing.
- segs-glide and segs-press-redraw start from a user who turned it off,
so On is still a pick away; README's lightweight line says the new
default.
Run at this commit's parent (the #2683 test fix on origin/main
|
||
|
|
7916045591 |
library: RTK's tag for Grok Build and Grok App gives their own reason and rtk-ai/rtk#2136, not DeepSeek Harness's (新v学员 on Discord)
Every agent RTK has no hook for got dsh's tooltip on the RTK tab: "{agent}'s
hooks can only allow or deny a command, not change it" with
rtk-ai/rtk#3847 ("FR: Support DSH"). For Grok Build that is wrong twice:
the issue is dsh's, and Grok's PreToolUse hooks can rewrite a command
(updatedInput, shown on rtk-ai/rtk#1890). What holds is that rtk init has
no Grok agent (src/hooks/init in rtk v1.0.1 has none), and
rtk-ai/rtk#2136 is the open request for Grok Build (#4513 was closed as
its duplicate). Each link was checked with gh issue view; the others in
rtk.go (#3847, #3934, #4311, #3898, #4187, #3404) are right.
rtkNoHookWhy in plugins/library/client.js gives each agent its own reason:
dsh keeps its text and #3847, Grok Build and Grok App cite #2136 (Grok App
runs Grok Build), and an agent with no entry gets a reason with no link.
New strings in zh, zh-TW, ja and de. rtk.go's grok and grok-app reasons,
which the CLI shows, cite #2136 too.
TestRTKNoHookIssuesAreEachAgents fails when an rtkNoHook agent has no page
reason (or the reverse), when the page and rtk.go cite different issues,
when two agents cite the same issues without a reason in sharedRTKIssues,
or when the fallback carries a link. library-rtk-nohook.test.cjs checks
Grok Build's tag says #2136 and never #3847, DeepSeek or "hook".
Run in a worktree rebased on origin/main
|
||
|
|
9b04c4e20f |
plugin: async gateway request hooks, run in Bun before routing and after the reply (#2118)
A package's magpie.hooks entry (or a *.hooks.{js,mjs,ts,mts} file) exports
`async onRequest(body, ctx)` and an optional `onResponse(reply, ctx)`. They
run in the Bun plugin host, so a hook can await I/O, for example a context
service like PowerContext, which the sync moejs middleware can't. The
gateway still makes one model request per client request. A hook adds
context to the body; it doesn't register tools or run a loop, so magpie
doesn't become an agent runtime.
Ported from Tsukikage7/magpie#1. Changes from the fork:
- The entry name is magpie.hooks / *.hooks.*. The fork's magpie.gateway /
*.gateway.mjs is already the middleware's alias, so a hook importing
node:fs was also loaded as moejs middleware and failed there.
TestGatewayHookNamesApartFromMiddleware fails if the two sets overlap.
- onRequest is rolled back, and counts as failed with no onResponse, when
it throws, times out, returns non-JSON, or changes tools, tool_choice,
function_call, functions, toolConfig, model or stream.
- onResponse gets the client-facing reply, merged through the gateway's own
stream decoder, collector and renderer (no second merger).
- Codex's native passthrough (/backend-api/codex) runs the hooks too,
without the sync middleware.
- The run ends with the request handler, not the client connection. Codex
hangs up on response.completed, and the reply it got is still captured
as a success. TestGatewayHookSeesReplyAfterClientHangsUp is red on the
old `r.Context().Err()` check and green with -count=3.
- ctx.origin is host-derived (local / gateway-key / remote). Headers, keys
and peer addresses never reach the hook.
- Plugins page: a hook package shows a "Request hook" chip, a diagnostics
line (outcome code, calls, avg ms, bytes, failures; no content), and
Options. Strings are in en, zh, zh-TW, ja and de.
Docs: docs/subsystems/gateway-request-hooks.md (new), provider-plugins.md,
gateway-middleware.md, and site docs plugins.html in en, zh and ja.
Real use, sandbox HOME on 127.0.0.1:3486 with the owner's real Codex Pro
sign-in. The probe hook adds a codename note and logs both callbacks:
- /v1/responses, /v1/messages, Gemini generateContent: stream and
non-stream. onRequest's note reached the model (the answer had the
codename), and onResponse got success=true and the whole reply.
- /v1/chat/completions: with the probe also changing `model`, the change
was rolled back (the reply came from the asked model) and no onResponse
ran. Without that change, earlier: stream and non-stream success.
- The real Codex CLI 0.162.1 `codex exec` through openai_base_url ->
/backend-api/codex: the hook saw origin=local, agent=codex and the
query; the answer had the codename; onResponse success=true (before the
hang-up fix it never ran: the context was already cancelled).
- `magpie plugin list` shows only "async gateway hook onRequest" for the
hook package, no failed middleware.
Tests (base origin/main
|