88b4c00ea11c8653cada22e11edf20ab1594de43
1650
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
2fbbd16945 |
gateway, gui: routing history keeps the last two levels of the folder an agent works in, and By session, the stage and the panel name it (#1068, emo172)
Routes now carry Folder: the last two levels of the working directory the agent states (Claude Code's "Primary working directory", Codex's <cwd>, Pi, OpenCode), cut by shortFolder before the route is stored, so no full path reaches the routing history, /api, or the GUI. It is kept in the routing history for as long as the history itself (30 days / 200 MB). A request that states no folder (title, side calls) takes the folder its session (or parent session) last stated; the per-session map is capped at 512 entries. GUI: By session headings read "Agent · folder · title", their tooltip and every request row's tooltip (page and tray panel) name the folder, the stage's agent subtitle lists the last level of each folder when an agent works in more than one, and the panel's agent node tooltip lists them. Run: - TestShortFolder (unix, trailing slash, C:\, D:\, UNC, CJK with spaces) and TestRouteKeepsItsFolderShort (real Handler, fake upstream: session inheritance, a moved Windows path, nothing of the full path in the marshalled routes, saveRoute -> History round trip), TestTurnDone. Broke it by hand: without the session lookup the title request has no folder; with the folder unshortened the full path shows. Both go red. - routing-session-folder.test.cjs: chromium + webkit x en, zh, zh-TW, ja, de x 1100 and 420 px, 20/20. Red on the old routing.js and with the stage's live routes left out. - GUI suites routing-*, panel-routing*, purpose-filter, reasoning-speed, gui-de/ja/zh-tw, click-scroll, number-units: 951/951. - gofmt -l clean; go vet darwin, linux (nogui), windows; builds for all three. go test -tags nogui ./...: all ok except internal/gateway, which hit go test's default 10m timeout at 611s on a loaded machine (#2108); alone with -timeout 30m it passes in 356s. - Real use: nogui build in a sandbox HOME, fake upstream, real Claude Code 2.1.299 (claude -p) run from .../workspace/magpie and .../src/dial: the day's routing jsonl has folder "workspace/magpie" and "src/dial" and no part of the sandbox path above them. Not tried: title/side requests' inheritance end to end with a real agent (claude -p made none), Codex, OpenCode and Pi with real binaries, Windows. |
||
|
|
d9ca84a2f4 |
gateway: built-in TLS, magpie serve/web/daemon install --tls-cert --tls-key, reloaded on renewal (RoderickZH)
magpie serve, magpie web and magpie daemon install take --tls-cert <file> --tls-key <file> (or MAGPIE_TLS_CERT / MAGPIE_TLS_KEY). The gateway and the web UI on its listener then serve HTTPS to other computers. Without them nothing changes. - Half a pair, a file that doesn't parse, or a flag with no value is refused at start with a message naming the missing flag. - The pair is re-read when either file's mtime or size changes (certbot renewal), with no restart. A renewal that doesn't parse keeps the certificate already served and is logged once. - Other computers get HTTPS only. Plain HTTP from them gets net/http's 400 "Client sent an HTTP request to an HTTPS server". - This computer (loopback, or a peer address equal to the local one) may still use plain http on the same port. Its connections are sniffed on their own goroutine (a first byte of 0x16 is TLS) for up to 10s, so a silent client holds nobody else up. gateway.URL() stays http://127.0.0.1:<port>, which agents, MCP servers, ServedBy, the healthcheck and daemon status all use, and no certificate covers loopback. - WSL NAT and containers count as other computers. - ALPN is http/1.1 only (hijacked connections and websockets need it), with TLS 1.2 as the minimum. - Printed links, LAN addresses, publicURL, the serve/web banners and daemon install show https:// for other computers' addresses. - The DNS-rebinding Host checks (foreignPage, rebound, the MCP loopbackHost) don't depend on the scheme and are unchanged. - daemon install carries MAGPIE_TLS_* into the unit or plist. A reinstall or `daemon web on` that names no certificate keeps the installed pair, and --no-tls removes it. - Docs: reference.md gets an HTTPS section that names Caddy as the alternative, gateway-routing.md gets a TLS row, and docker.html (en, zh, ja) gets the env rows. What was run: - New tests: internal/gateway/tls_test.go (others HTTPS-only, this computer both, a silent local client holds no other, renewed certificate served, CheckTLS, addresses, Relisten keeps TLS), internal/cli/tls_cli_test.go and daemon TestInstallCarriesTLS (linux and darwin, paths with space, %, & and "). - Each was broken by hand and went red: no wrap in listen, no reload, a synchronous sniff, a bad renewal dropping the certificate, http in publicURL or the pinned LANURLs, the carried entries removed, and keepTLS as a no-op. - Real use under a sandbox HOME, with a self-signed pair, on 0.0.0.0:3461: - Half a pair, a garbage certificate, a flag with no value, and the env set to half a pair each exit 1 with the message. - curl -k https://127.0.0.1 and https://<LAN IP>/v1/models with a key: 200. Plain http on loopback: 200. - The cert files were swapped for a second pair while it ran. openssl s_client then showed the new CN and serial, and curl --cacert with the new pair got 200. A junk key file then kept the second pair, logged once. - From the Windows box over the LAN: plain http got 400; https with the key got 200, and without it 401. - magpie web --addr 0.0.0.0:3462: https network links. From Windows, http got 400 and https with the key got 303. - gofmt -l clean. go vet passed on darwin, GOOS=linux -tags nogui and GOOS=windows. - go test -tags nogui for ./internal/cli, ./internal/daemon, and the TLS tests of ./internal/gateway and ./internal/gui: all pass at the rebased head. - Two reds in the full suite (`go test -tags nogui ./...`) are the same on origin/main f074996d9; both are filed: - TestGatewayHeldByAContainer failed 2 of 5 there (#2107). - The gateway package runs past go test's default 10m under load: 1208s on main and 1221s here, both passing with -timeout 40m (#2108). |
||
|
|
06c3370b74 |
gui: Fetch models' "{p}: {n} models" counts the models the editor lists, not the vendor's ids (#2069)
liangxyz's Antigravity refetch said "Antigravity: 23 个模型" over 17 chips. The toast counted the ids the vendor listed, while the editor shows a model Antigravity lists once per thinking level (gemini-3.7-flash-high, -low, -medium) as one model with those levels, as Cursor's and Devin's lists are folded too. Two numbers for one list read as models gone. The count is now the models the provider offers after the refetch (Provider.Available, what the editor's chips are drawn from), the ids only when it offers none. TestFetchedCountIsTheEditorsModels saves an Antigravity list of six ids, three models, and fails on the old count (6, want 3). Run (macOS): the test red with fetchedCount returning the ids, green with it; TestProviderTypedKey still counts a relay's two; go test -tags nogui ./internal/gui: one run of the whole package failed in a 208s run whose output I didn't keep, while a fork was running other suites on this machine; three runs after it passed, so its cause is not known. gofmt clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows clean. No GUI change (app.js shows r.count as before), so the GUI suite wasn't run. Not tried against a real Antigravity account. |
||
|
|
9829d2f553 |
gui: a hook's description is shown whole, wrapped, and written in a box that wraps (#2085, emo172)
Library › Hooks cut a hook's description to one line with an ellipsis and
no tooltip, and the editor's Description was a one-line input, so an
80–150 character Chinese description could neither be read nor seen while
written.
- The list wraps the description (at most 200 characters, the user's own
words). The row's text block takes a 240px basis, so the long text no
longer pushes the name under the glyph at narrow widths.
- The editor's Description is a textarea that wraps and grows to fit. It
stays one paragraph (library.SaveHook joins its lines), so Enter still
saves, an IME's Enter still doesn't, as in every other field there.
- Siblings left as they are on purpose: skills, subagents and market rows
hold one line with the whole text in a tooltip, because their lists are
windowed to a fixed row height and their descriptions are authors'
paragraphs, not the user's 200 characters.
Verified:
- library-hooks.test.cjs now gives a hook a 90-character Chinese
description and checks it is not clipped and wraps at 440 and 1100 (1100
in a window of its own: resizing one window across the page's breakpoint
raises a WebKit ResizeObserver-loop error under load), that the name
stays beside its glyph, and that the editor's box is a textarea showing
all of it. On the old code it fails 12/12 ("the description is cut off
at 440"); without the 240px basis, "the name is 38px off its glyph at
440".
- All 484 library*.test.cjs pass in Chromium and WebKit, en/zh/zh-TW/ja/de;
the hooks test 4x concurrently in both engines, 48/48.
- Screenshots at 440 and 1100, both engines, looked at.
Not run: Go checks (no Go changed); not tried in the built app.
|
||
|
|
33da86c71a |
provider: removing a plugin sets its providers' model picks in providers.json aside, and adding it again puts them back (#2057, dawn1095)
A plugin's provider leaves a record in providers.json once the user picks its models: its id and nothing of its own (OnlyPicks). Removing the plugin left those records behind. Nothing listed them, `magpie provider rm` couldn't reach them, and a sync or backup asked for a sign-in to them on every run. RemovePlugin now finds the ids the plugin's providers are stored under (PluginID of each provider plugin.Listed gives for its spec), and moves the records with those ids that hold only picks into providers.json's new pluginLeft, under the plugin's package name. Left alone: - any record with an endpoint or a key (the user's own provider, whatever its id); - a built-in's ids (accountIDs) and "magpie"; - an id another installed plugin serves too; - everything, when the plugins' listing isn't known (no cache and no plugin-providers.json): unknown is not "none is the user's". provider.AddPlugin (CLI, GUI, backup restore) puts the set-aside records back, each one whose id has no record now; one the user has given to a provider since stays aside. plugin.Listed is new: the cached listing, or plugin-providers.json. Run: - plugin_left_test.go, four tests with user-owned records beside the plugin's (a user "zap" with an endpoint next to the plugin's zap-plugin, a hand-made "mine", a built-in's picks, another plugin's and a shared id). Each guarantee broken by hand turned its test red: no set-aside, no OnlyPicks check, no other-plugin exclusion, no unknown-listing guard, take-back over the user's record, no take-back. - go test ./... in a sandbox HOME; gofmt -l; go vet darwin, linux (-tags nogui), windows. Not done: records left by plugins removed before this change stay where they are; turning a plugin off (not removing it) sets nothing aside; `magpie provider rm` still can't name such a leftover. The move flow (installPlugin) still adds through plugin.Add, since its own migration owns those records. Not tried with a real plugin removal in the GUI. |
||
|
|
2a6354f09f |
gui: a quota curve closed again takes its card back to its height (#2059)
mengyianx on the Linux CLI's web settings page: with the remaining-quota trend (剩余额度走势) opened and closed again, the allowance's box stayed as tall as when it was open, blank under the curve. The Usage page packs its cards into columns on 1px grid rows. Each card is stretched to the rows it was given, and the last card in a column is held down to the tallest column. A ResizeObserver on the list and the cards repacks. A curve that grows pushes its card's box, so it repacked. A curve that shrinks leaves the card's box where the packing put it, so the observer never fired and nothing packed again. packUsageNow now also observes each card's children, so a shrinking curve or balance trend repacks too. New test usage-curve-zoom-back.test.cjs opens and closes Codex's allowance curve and DeepSeek's balance curve. It checks that every card and the list come back to their heights, that the clicks don't scroll, and that there are no page errors. It runs in Chromium and WebKit, en, zh, zh-TW, ja and de, at 1100 and 420 (WebKit at 420 wheels to the balance card with reader.cjs's reach). Run: - The new test: 20/20 pass. Against origin/main 8a4cfe0e4's assets (MAGPIE_ZOOM_ASSETS), all 20 fail with "codex: closed again, every card and the list are as tall as before it opened". On the old assets in Chromium en 1100, Codex stays 400 (was 297), DeepSeek 295 (was 192). - The Usage-page GUI files (usage-*, quota-*, balance-*, panel-usage, tray-usage*, allowance*, routing-quota*, claude-usage*, api-key-usage*) in both engines at --test-concurrency=3: 807/808 pass. The one red, webkit de usage-sum-whole at 860px (page 4px wide), serves no quota cards, so this change can't reach it. Alone it passed 3/3. It is the known load flake #1864/#2023; this run was added to #1864. Not tried: the rest of the GUI suite, and the real Linux CLI's web page (the fake API serves the same assets). |
||
|
|
3a7d0314a9 |
usage: a window's Pace as a number on its card, and in the menu bar when asked (fflake33)
fflake33 on Discord asked for the pace as a figure, "+12%" or "−8%"
against an even pace through the window, on the Usage cards and in the
menu bar.
- provider: QuotaWindow.Pace(readAt, now) is the share used (0-100) less
the share of the window gone by, from Bounds (reset less span; a
month's window a calendar month); none for an unlimited window, one
whose span or reset isn't known, or outside it. WithWindowStarts sets
startsAt on copies of the cards for the GUI (the caches' cards are
left alone); /api/usage/quotas and its refresh send it.
- Usage page: "Pace +20%" on the reset line after the wait (quotaPace,
paceLine), its sign turned with the meter in Left mode, amber while
more is used than an even pace would have, what it means in its
tooltip. Past cycles and windows with no known start show none.
- Menu bar: Settings > Menu bar pace (settings.TrayPace, off by default;
hidden on Windows, whose tray shows no text) puts " +12%" beside each
figure ("42% −14%", at most 10 runes, trayRowMax) and "pace −14%" in
the tooltip. KeepOwn keeps it device-local like the other tray
settings; the Settings save keeps it (prefsKeep).
- Strings in en, zh, zh-TW, ja, de. gui-shell.md says it.
Run:
- go test -tags nogui ./internal/provider ./internal/gui ./internal/settings
./internal/usage: ok; ./internal/davsync: ok (now covers TrayPace;
red with TrayPace taken out of KeepOwn). go test ./internal/gui -run
Tray (darwin, with the tray image tests): ok.
- New TestWindowPace, TestWithWindowStarts (input not mutated),
TestTrayUsagePace (off unchanged, used and left, rows, tooltip).
- quota-pace.test.cjs, chromium and webkit: 4 pass; cards in en, zh,
zh-TW, ja, de at 1100 and 420px, used and left, amber, tooltips, no
sideways scroll, a click moves nothing; the Settings row in all five
at both widths, On posts trayPace, a currency save keeps it, no
scroll; hidden with no card and on Windows, shown on Linux. Red with
paceLine not called, with trayPace out of prefsKeep, and with the
Left-mode sign not turned.
- gui-de, gui-ja, gui-zh-tw, i18n-keys: 12 pass; tray-bird 6, quota-holds
2, quota-read-at 4 pass.
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows clean.
Not tried: the real menu bar on a Mac or Linux tray.
|
||
|
|
722abfbb0a |
usage, gui: a window whose whole can't be estimated says "not enough data", and why in its tooltip (#2045)
The Usage page's account cards told a window's whole ("Whole ≈ N tokens
· ≈ $X") only where it could be reckoned honestly, and said nothing
elsewhere, so a reader couldn't tell a window magpie can't reckon from
a fault (#2045 asked for "数据不足" there).
The server now says why on each window of an account's own card that
isn't reckoned (QuotaWindow.HoldsWhy):
- low: under 5% used (HoldsFloor);
- clock: no reset clock, so no known start;
- log: the window began before magpie's request log;
- none: magpie routed nothing the window counts in it;
- credits: a call in it may have been paid from credits or extra usage
(#2010's dry runs).
Windows whose whole is never told (a pool, a family, money aside, an
error card, another magpie's) carry no reason and say nothing, as
before. WithWindowHolds now also fills reasons when no window at all can
be reckoned; the caller's cards are still left unwritten.
The GUI shows a muted "Whole: not enough data" on the reset's line, with
the reason in its tooltip, in all five languages. A reason it doesn't
know says nothing. History cards are unchanged.
Run:
- go test ./internal/usage ./internal/gui: pass. The window-holds tests
check each reason, that reckoned windows carry none, and that the
caller's cards stay unwritten. Not writing HoldsWhy turns 3 tests red.
- quota-holds.test.cjs in Chromium and WebKit, en/zh/zh-TW/ja/de, at
360, 420, 440, 1000 and 1100: the line, its reason, muted, not cut,
inside its card. Removing the GUI branch turns it red. Screenshots at
420 in zh and de looked at.
- i18n-keys, quota-curve, keep-login, quota-name-translated in both
engines: pass.
- gofmt -l clean; go vet darwin, linux (-tags nogui), windows; linux and
windows builds.
Not tried: a real account's card in the running app.
|
||
|
|
f074996d93 |
provider, gateway, gui: a model with none of its levels ticked is sent no reasoning field, on every route and in a routing group (yuexian7)
yuexian7 on Discord: models.dev lists their model as reasoning, and the
vendor answers any reasoning parameter with 422 while the same request
without it works. In a routing group they couldn't set an effort per
model, and the model editor refused to untick the last level ("Keep at
least one level"). The learned refusals (
|
||
|
|
2971e1518f |
gui: the Context window field offers 400K and 512K beside 128K, 200K, 256K and 1M (yuexian7)
yuexian7 on Discord asked for 400K and 512K among the context-length quick picks; until now they had to be typed. contextPicks gains the two, in order. Run: context-picks.test.cjs (new) in chromium and webkit, at 1100 and 420 wide, in en, zh, zh-TW, ja and de: 20/20 pass; on the old app.js all 20 fail. node --check app.js. Related GUI tests (provider-levels-*, model-*, gateway-model-info, context-*, routing-levels, compact-at, name-suffix-*, names-*): 418/418 on a second run; the first run had one failure in model-copy-id (chromium zh, right-click copies a chip's id) that passed 3/3 alone, filed as #2066. |
||
|
|
aa6a0d6b20 |
library: one skill over 200 MB is left out, not the whole repository (#2062)
mikubaka88/CCFA-Skills couldn't be installed at all: "the skills in ... are
too big to install (over 200 MB)". The repository is over the 200 MB
tarball cap, so fetchSkillFiles fetched it file by file, and that refused
the whole repository once the files summed past 200 MB. One skill,
ccf-paper-writer, is 297 MB on its own (exemplar paper PDFs, llava-4d.pdf
alone 46.8 MB); the other 16 are small.
The 200 MB limit per skill stays: a skill is copied into every agent that
gets one as a copy, and treeOf stops comparing at 256 MB, so a 297 MB skill
can't be told current or edited. What changes is that one such skill no
longer blocks the rest:
- fetchSkillFiles sums each skill's files (the deepest skill folder a file
is under) and leaves out a skill over maxFetch; its files are never
asked for. Only when every skill is over it does it fail as before.
- The left-out skills reach ProbeSkills as Probe.Left (path, size), kept
per temp folder and taken once (tookLeftOut).
- The GUI's probe names each under the list ("{name} is too big to
install: 283 MB, over the 200 MB a skill may be"), or in place of "No
skills there" when nothing else is left; zh, zh-TW, ja, de. The TUI says
it in its flash.
- docs/subsystems/library.md says how a big repository is fetched.
Run:
- Real: probe of mikubaka88/CCFA-Skills under a sandbox HOME lists 16
skills and leaves out ccf-paper-writer (296736735 bytes). Not installed
into a real agent.
- gofmt -l internal/: clean. go vet ./internal/gateway ./internal/library
./internal/tui on darwin, GOOS=linux -tags nogui, GOOS=windows (set -o
pipefail): clean.
- go test -count=1 ./internal/library ./internal/tui: ok.
- TestOneSkillTooBigLeavesTheOthers (new): fails with the per-skill
leave-out turned off by hand, passes with it.
TestTooBigRepositoryChecksWhatArrives now makes every skill too big.
- skill-too-big.test.cjs (new), chromium and webkit, en 980 and zh,
zh-TW, ja 440, de 420, plus every-skill-too-big: 14/14; red (0/7 in
chromium) with client.js at origin/main. skill-*.test.cjs 190/190 and
library-*.test.cjs 484/484 in both engines.
|
||
|
|
e855272cf0 |
gui: a refused allow list names the address magpie sees the page from, with Add <addr> (Mathresearcher)
Settings > Share on local network > Allowed addresses refused a list that would shut out the page itself with a fixed sentence and no address (Mathresearcher on Discord). The server already names it (KeepsOut in gateway/allow.go, "that allow list would shut out <addr>, the address this page is open from"); allowSays now carries it into the message in every language, and a one-click "Add <addr>" button saves the list with it added. The address is the connection's own (peerAddr: RemoteAddr, unmapped, zone dropped); X-Forwarded-For and the like are never trusted, and loopback and the machine's own addresses always pass. Behind Docker Desktop or rootless Docker every client shows as Docker's own address (192.168.65.x), the host reaching a container shows as the bridge gateway (172.17.0.1), and a proxy in another container shows as that container. So the button's tooltip says that behind Docker or a reverse proxy this is the proxy's address, and adding it lets in everyone who comes through that proxy. Run: - allow-ips.test.cjs, chromium and webkit: 14 pass. The subtest checks the refusal names 203.0.113.50, the button's text and tooltip fit, a click posts ["172.16.0.0/12","203.0.113.50"], lists the rows, takes the button away and doesn't scroll. With the old app.js put back it fails (TimeoutError; chromium 5 pass, 2 fail). - gui-de, gui-ja, gui-zh-tw, i18n-keys: 12 pass. - gofmt -l (clean), go vet darwin, GOOS=linux -tags nogui, GOOS=windows: clean. go test -tags nogui ./internal/gui -run Allow: ok. Not tried: a real Docker or reverse-proxy setup. |
||
|
|
6fc0e93176 |
gui: the tray panel's Routing rows tell how fast a finished request wrote (#2050)
A finished request that didn't fail now shows its speed after its tokens
and time, "12.4k tokens · 1.5 s · 1667 tok/s", from the same speedOf the
Routing page's rows use, so it is left out where that page leaves it out
(no first token, a burst at the end, a failure). The string "{n} tok/s" is
already translated in every language.
With the speed the totals no longer fit beside where a request went in
the 440px panel: the "served …" mark was cut to "served gpt-…", and when
the totals were let shrink, the speed was cut instead. Where it went and
its totals now share a wrapping line (.pr-line), and the totals go under
it, at the right, when both don't fit. A row whose provider and account
alone are too long now has its totals under them rather than beside.
Not done: a live rate on a request still being answered (part 2). The
trace has no token count until the reply ends, so there is nothing to
show a rate from.
Run:
- panel-routing, panel-routing-providers, routing-reroute-title and
number-units in Chromium and WebKit: 13/13 each.
- panel-routing now checks the speed is on the finished row only and no
row's totals are cut. Dropping the speed line turns it red; dropping
flex-wrap turns it red (the served mark is cut).
- Looked at the panel's screenshot at 440 in both engines.
Not run: other languages than en and zh in this test (the string itself
is translated in all five).
|
||
|
|
a125d5c9ea |
gui tests: group-fold's window is 1700 tall, for the editor's Custom wait that 195a1009b added
|
||
|
|
64487d458e |
gui: copying on KDE Wayland no longer breaks the connection to the compositor and quits magpie (#2039, dannisun0412)
dannisun0412 runs magpie on KDE Plasma 6.6.6 (kwin_wayland, libwayland 1.24) and it quit three times in twelve minutes with "Error 22 (Invalid argument) dispatching to Wayland display" / "Error reading events from display: Invalid argument". The cause is the clipboard read-back probe (clipboard_gtk3.h). It made its own wl_data_device and, when done, called wl_data_device_destroy, which only frees the client side. The compositor still thinks the device is live and keeps sending it a fresh wl_data_offer on every later copy. libwayland drops those events for the dead proxy without reserving their new ids, so the client's id map falls behind the server's; the next server-created object whose id lands past the gap makes wl_map_reserve_new return EINVAL and GDK exits. The probe now binds the data device manager at version 3 at most and releases the device with wl_data_device_release (version 2+), so the compositor stops sending to it. On a version-1 manager it doesn't read back at all (returns -2, which the Go side takes as "copy held"). The probe test (testdata/clipboard_probe.c) gets an "again" mode: copy and read back eight times, then make the compositor hand out four offers at once (the "burst" that needs ids past the leak), then check the process is still alive. Run: - Fedora 44 container with kwin_wayland --virtual (SYS_NICE), gtk3/webkit2gtk-4.1, go 1.26.9: with origin/main's header the probe died with EINVAL 6 of 6 times (primary selection on and off) and TestClipboardReadBack failed 3 of 3 with "Error reading events from display: Invalid argument"; with this change the probe stayed alive 6 of 6 and TestClipboardReadBack passed 3 of 3. GOOS=linux go vet with the gtk3 build in the container was clean. - macOS: gofmt -l clean; go vet darwin, linux nogui, windows nogui; go test -tags nogui ./internal/gui passed. Not tried: a real Plasma desktop or the full app over Selkies. |
||
|
|
2076943915 |
plugin: a plugin declares its own switches, shown in its provider's editor and read by the plugin (#2038, Vocllum)
Vocllum asked that a plugin can offer the user generic on/off options
without magpie knowing what each one is for. A plugin now declares them
on its auth hook, beside checkin:
auth.options: [{ key, label, description?, default?, confirm? }]
and reads the user's values through input.magpie.option(provider, key)
or input.magpie.options(provider). Each call reads the current values,
so a change reaches the plugin without a restart. magpie only keeps the
value and hands it over: nothing is scheduled or run when an option
changes. The check-in switch (settings.pluginCheckins) and the check-in
plugins are unchanged.
- host.js: optionsOf keeps a key matching [a-z0-9_-]{1,40} with a
non-empty label, drops repeats, caps the label at 60 characters and
the description and confirm at 300, takes default only when it is
true, and keeps at most 16. The values come at init and through
setProviderOptions.
- Go: plugin.Option, Provider.Options, OptionOn and SetProviderOptions
(sent only to a host that is running). settings.PluginOptions is kept
by the plugin's provider id, then the key. POST
/api/settings/plugin-option {provider, key, on} checks the key the same
way and hands the values to the host. The generic settings save keeps
them, as it keeps PluginCheckins. /api/providers' plugins[].options
carry each option's resolved `on`.
- GUI: a "Plugin options" field in a plugin provider's editor. Each
option is a segs Off/On beside the plugin's label and description, put
in with textContent. A confirm text is asked through confirmAction
before turning an option on. Changes wait for Save, which posts each
one before the provider. Strings are added for zh, zh-TW, ja and de.
- Docs: provider-plugins.md (a new section), reference.md, gui-shell.md
and the tests README.
Run:
- TestPluginOptions (a real host with testdata/options). Red with the
old host.js (no options listed) and red with setProviderOptions turned
into a no-op (the plugin still reads the old value).
- TestPluginOptionSetting and TestSettingsSaveKeepsWhatItDoesNotSend.
Both red with the generic save's PluginOptions line removed.
- plugin-options.test.cjs: 22/22 in Chromium and WebKit, at 1100 and 420
wide, in en, zh, zh-TW, ja and de. Red on the old app.js (no field).
The screenshots were looked at: long text wraps and the page has no
sideways scroll at 420.
- provider-concurrency, plugin-signin, plugin-checkin, provider-price-rate
and plugin-move-unserved: 68/68.
- go test ./internal/plugin/... ./internal/settings/... ./internal/gui/...
./internal/provider/..., gofmt -l, and go vet on darwin, linux
(-tags nogui) and windows.
Not tried with a real community plugin, since none declares options yet.
The check-in row doesn't take a plugin-declared label or hint; it is
left as it was.
|
||
|
|
7d15df78a2 |
gui tests: signin-proxy brings Custom… into sight before its second click, which the sign-in drawn again put under the editor's bar at 380 in German
The test's second click on "Custom…" failed now and then in German at
380 (also on origin/main
|
||
|
|
b319657301 |
gui: a sign-in whose browser didn't open says why and shows its link, and Windows names rundll32 by its path (#2043)
xiaobaifly7: on Windows, signing in to Cloudflare's MCP server (and any
sign-in) opened no browser, and the window said to finish in the
browser until the sign-in timed out. Wails' Browser.OpenURL starts
rundll32 by its bare name, which Go looks up with PATHEXT's extensions;
a PATHEXT without .EXE (WSL passes one on as ".CPL") finds nothing, and
host.OpenURL dropped the error.
- proc.OpenBrowser starts %SystemRoot%\System32\rundll32.exe by its
path (open / xdg-open / termux-open-url elsewhere) and returns the
launcher's error. host.OpenURL falls back to it when Wails' fails, and
the CLI's account sign-in uses it.
- Windows.OpenURL returns the error. /api/signin, the plugin sign-in and
/api/library/mcp-signin answer it as openError; /api/open fails with
it, so Open again says why.
- The sign-in card shows "magpie couldn't open your browser: {error}.
Open the sign-in link below in a browser yourself." where it said
magpie opened the page, with the link already shown below; the MCP
editor shows the error with the link and a copy button. Translated
(zh, zh-TW, ja, de).
- Open again matched its sign-in by identity, so a poll that put a fresh
copy of the same sign-in in place kept the old error after a
successful retry; it now matches by id.
Run:
- TestBrowserNamesRundll32ByItsPath, TestMCPSignInSaysTheBrowserDidntOpen
and the /api/open and /api/signin tests in signin_open_2043_test.go.
Broken by hand: the bare name back in browserCommand fails the first;
openError returning "" fails the gui tests.
- On the Windows box (amd64, cmd with PATHEXT=.CPL): exec.Command
("rundll32", ...).Start() gave `exec: "rundll32": executable file not
found in %PATH%`; proc.OpenBrowser started it (nil). The proc test
binary's TestBrowserNamesRundll32ByItsPath passed there.
- signin-browser-down.test.cjs (new): the card's text, the link, no
sideways overflow, Open again failing then succeeding, and the MCP
editor's error and link, in Chromium and WebKit at 1100 and 420 in
every language: 20/20. The related sign-in GUI tests: 451/452, the
one a signin-proxy flake also on main (fixed in its own commit).
- gofmt -l clean; go vet darwin, linux -tags nogui, windows; GOOS=linux
and windows builds; go test -tags nogui ./internal/gui/
./internal/proc/ ./internal/cli/.
Not tried: the real Wails app on Windows under PATHEXT=.CPL (the
fallback path is exercised only through proc.OpenBrowser), WSL itself,
the reporter's machine. Not covered: internal/tui/sessions.go and
internal/provider/install.go start `powershell` by its bare name, which
would miss the same way under such a PATHEXT.
|
||
|
|
8da304767a |
gui: Library is a plugin's page, its script, style and words in plugins/library
P2 of docs/subsystems/plugin-runtime.md, the second page after Sessions.
- library.js and library.css move to assets/plugins/library/ (client.js,
library.css). The script registers with the kernel
(magpie.plugin("library")) and adds its page to the "page" slot. Its
hooks: open and relang load, redraw, close (its modal), dirty, discard.
What it set up at load (list scroll and resize, the modal's backdrop
and Escape, beforeunload, the stuck header, a quiet reload on focus)
runs in mount.
- app.js calls those through magpie.call instead of window.loadLibrary,
redrawLibrary, closeLibraryModal, libraryDirty and discardLibrary. It
no longer lists library in its title map, hide loop or OPEN_VIEWS; the
kernel's pages are in them.
- index.html: <main id="view-library"> goes, the kernel makes it.
library.css keeps its place in the cascade.
- The 560 strings only Library says move from i18n.js to
plugins/library/i18n.js (4 languages). i18n.js: 18826 → 16584 lines.
- plugins/library/library.go lists the client files.
- Tests that read i18n.js for a Library string read strings.cjs (i18n.js
and the plugins'): 8 library tests and mcp-editor-cancel,
mcp-oauth-app, mcp-signin-health. font-cascade, win-fonts and
assets_revalidate_test.go name the new paths.
- "Check again" stays in i18n.js: Library said it alone when the words
were split, and
|
||
|
|
5b76aa4da7 |
gui: a mask picture is named in full, so a plugin's stylesheet draws it from the right folder
maskSpan set a logo's picture as `--i: url(icons/x.png)`. A url() in a
custom property is read against the stylesheet whose rule uses the
variable, not the page. app.css sits beside index.html, so that was
right by luck. Moving Library's stylesheet into plugins/library/ (P2)
made `.lib-rtk-logo .mask` ask for plugins/library/icons/rtk.png, and
RTK's logo went blank: every library-rtk-* test went red, reading a
file that isn't there. maskSpan now names the picture against the
page's base (new URL(src, document.baseURI)), for its span and the
shelf's alike.
mono-icon-redraw's guard, that only maskSpan sets a mask's picture,
read assets/*.js only; it now reads the plugins' folders too and knows
maskSpan's `pic`. Broken by hand: a stray setProperty("--i", url(…))
in plugins/library/client.js turns it red, naming the line.
Run: library-rtk-{admin,gain,nohook,path,upgrade}, mono-icon-redraw,
factory-sub, mimo-sub, zed-sub, pi-default-note, usage-ledger-chart,
in Chromium and WebKit, all green (with the Library move on top; the
rtk tests failed without this).
|
||
|
|
1eaf1e890a |
gui: Sessions is a plugin's page, its script, styles and words under assets/plugins/sessions (P2)
The first page of P2 to leave app.js's core. sessions.js and sessions.css
move to assets/plugins/sessions/ (client.js, sessions.css). The page
registers through the kernel as magpie.plugin("sessions"): mount takes its
<main>, which the kernel now makes, open and relang read it again, and
reveal is the Usage page's way in. window.loadSessionsPage and
window.openSessionOnPage are gone. app.js reaches the page only through
magpie.call, and show() takes a page's title from its part. The plugin's
manifest lists i18n.js, sessions.css and client.js.
Words: the kernel's magpie.strings(dict) adds a plugin's words to I18N.
A key that is already there is logged and not taken, since the later one
would silently win. The 65 keys only the Sessions page says (own-keys over
every asset, Go and index.html) move, as written, from i18n.js to
plugins/sessions/i18n.js. tests/strings.cjs reads i18n.js and every
plugin's i18n.js as the page has them. gui-de/ja/zh-tw use it, and
i18n-keys now checks that no key is said twice across files and that a
plugin's words are in every language. TestBuiltinClientsLoaded takes a
.css entry as a <link> in <head>, and a script between kernel.js and
app.js.
Docs: plugin-runtime.md (Words, Pages moved out: Sessions), gui-shell.md,
gateway-sessions.md.
Run:
- go test ./internal/gui/ ./internal/pluginrt/ ./internal/gateway/: ok.
- gofmt clean. go vet darwin, GOOS=linux -tags nogui and GOOS=windows on
gui, pluginrt and plugins: clean.
- GUI, in both chromium and webkit, 40 files, all green:
- the sessions-* and sess-* tests, session-identity, routing-sessions,
account-mask-sessions, usage-session*, gateway-conversations;
- plugin-kernel, the plugin-move* tests, font-cascade, win-fonts;
- i18n-keys, gui-de, gui-ja, gui-zh-tw.
- session-terminal's red under parallel load is the same on origin/main
|
||
|
|
efbacd4e54 |
gui tests: session-terminal clicks Theme only once the Ghostty save has drawn the page again
The Theme click resolved its button before the Ghostty save came back.
When the save then redrew Settings, the click landed on the button from
before, whose handler still holds the page as it was drawn
(sessionTerminal ""). Against the new prefsBase that "" reads as a change,
so the theme save sent the terminal back to System default, and line 119
saw "". It failed 1 to 2 runs in 5 when 5 ran in parallel, on origin/main
|
||
|
|
82f3befd29 |
daemon: magpie daemon install --web serves the browser page from the service, with a link that lasts (HuanCheng Bai)
HuanCheng Bai on Discord runs `magpie daemon` on a Linux server and asked
for the daemon to serve the web page too, or for an option to turn it on.
`magpie web` run beside it is a second process, and he read it as not
seeing the daemon's state.
- `magpie serve --web[=host:port]` serves the gateway and `magpie web`'s
page from one process (stats, StartWeb, Wait). The default page address
is 127.0.0.1:3430. Any other argument is refused, where before it was
ignored.
- `magpie daemon install --web | --lan | --addr host:port | --no-web` and
`magpie daemon web [on|off] [--lan] [--addr host:port]`. The unit's
ExecStart and the plist's ProgramArguments become `serve --web=<addr>`,
and the key goes into the 0600 file's environment as MAGPIE_WEB_KEY. The
key is made once. A reinstall with no flags keeps the page and its key
(read back from the file by daemon.Web), so the link survives restarts
and reinstalls. `web off` drops it. MAGPIE_WEB_KEY in the shell, when
set, is used and checked like magpie web's. The page defaults to
loopback; --lan or a non-loopback --addr prints the network links and
magpie web --lan's warning.
- `magpie daemon status`, install and `daemon web` print the page's link.
- `magpie web` while the service serves a page prints that page's link and
exits. Beside a gateway another magpie serves, it says so and points to
`magpie daemon web on`.
- docs/reference.md (the service section and the Use list), and the
site's start page (en, zh, ja). The READMEs don't cover the daemon.
Run:
- Tests: TestInstallWithWeb (systemd and launchd, plutil lint, read back,
reinstall without the page, the shell's key not carried, no key
refused), TestWebNotInstalled, TestParseDaemon, TestWebOptions,
TestDaemonStatusPrintsPage and TestServeArgs. Each of these went red
with its line reverted by hand: withKey, prevKey in webOptions, and the
status page line.
- Sandbox HOME with a fake launchctl:
- `daemon install --web --lan` wrote a 0600 plist with
`serve --web=0.0.0.0:3430` and the key. plutil said OK, and it printed
the link, the network links and the warning.
- Reinstalling with no flags kept the key. `daemon status` showed the
link.
- `daemon web off` / `daemon web` / `daemon web on` behaved as above,
with a new key after off.
- `daemon web bogus` and `serve --lan` gave the usage errors.
- `serve --web=127.0.0.1:3462` served the gateway (3461) and the page in
one process. The page answered 200 with the key and 401 without, and the
page and /v1/models both showed 3 models. `magpie web --no-open` beside
it printed the service's link and exited 0.
- gofmt -l; go vet (gui), and go vet -tags nogui for darwin, linux and
windows; go test -tags nogui ./... in a sandbox HOME.
Not tried: a real systemd on Linux. The unit text is checked by test only.
|
||
|
|
a39e675d2a |
gui: magpie web beside a busy gateway waits for the port instead of failing to bind it (K.Liu)
K.Liu on Discord: `magpie web` next to the systemd `magpie daemon` logged
"gateway: listen tcp 0.0.0.0:3425: bind: address already in use".
Cause: before listening, serveGatewayLocked asks the gateway's address
whether a magpie serves it (ServedBy, one GET with a 700ms timeout). A
magpie that holds the port but doesn't answer in time (busy on a small
server, or still starting) reads as "nobody", so the page's process
listened itself and the bind failed. With the service answering, no
second gateway was started and the page's state matched.
Now, after ServedBy says no, gateway.Taken() dials the address (500ms).
When something accepts, this magpie doesn't listen; it logs once that the
port is taken and leaves it to the 15s watch, which serves the gateway
once the port is free.
Run:
- Sandbox HOME, settings {"port":3461,"lan":true}: `magpie serve`, then
`kill -STOP` it, then `magpie web --no-open --addr 127.0.0.1:3462`. The
old binary printed the exact bind error. The new one logs "is taken but
doesn't answer as magpie yet" and doesn't bind. After SIGCONT,
/v1/models and the page's /api/state show the same 3 models. With the
serve killed, the page's process took 3461 over in about 16s.
- TestGatewayNotServedBesideASlowOne (a listener whose handler blocks):
it goes red with the Taken check reverted by hand.
- gofmt -l; go vet (gui), and go vet -tags nogui for darwin, linux and
windows, on cli, daemon, gui and gateway; go test -tags nogui ./... in a
sandbox HOME.
|
||
|
|
195a1009b0 |
gui: a routing group's Slow to start takes minutes of your own, beside Wait, 30 s, 1 min and 2 min (Kismet Alan on Discord)
The group editor's "Slow to start" (迟迟不出字) row offered only Wait,
30 s, 1 min and 2 min. Kismet Alan wanted a longer time of their own.
What changed:
- routing.js: the row gets a Custom segment, the same pattern as the
Context row's Custom: picking it shows a small minutes box beside the
segments (5 from Wait, else what was picked), focused to type in.
Decimals are taken (2.5 is 150 s; a comma is read as a point). Anything
else marks the box aria-invalid and the hint says "{v} is not a number
of minutes"; the last good value is kept. A saved time that is none of
the presets opens as Custom with its minutes. firstToken is still sent
in seconds, and the card's "Next after 150 s without a first token"
and the gateway are unchanged (provider.Group.FirstToken takes any
seconds >= 0).
- routing.css: the box and its "min" unit inside the existing ctx-wrap.
- i18n.js: Custom was already there; "e.g. 5", "Minutes", "min" and the
error in zh, zh-TW, ja and de.
- group-first-token.test.cjs: now five languages (en, zh, zh-TW, ja, de)
at 1100 and 420 wide in Chromium and WebKit. It adds the Custom flow:
no box until Custom, 5 to start and focused, "abc" refused with the
hint naming it, 2.5 saved as 150 and shown on the card, reopened as
Custom 2.5, back to 1 min hides the box, and the row stays inside the
editor with no horizontal scroll. At 420 the editor runs past the
window's foot and WebKit doesn't scroll the page's scroller to a
click, so the test wheels each control into view.
What was run:
- NODE_PATH=<playwright@1.62.0> node --test group-first-token.test.cjs:
20 of 20 pass (2 engines x 5 languages x 2 widths).
- Break check: with routing.js at the old code the test fails waiting
for the Custom segment.
|
||
|
|
a5d72a095b |
gateway, gui, cli: a search API's keys take turns, a refused one rests, and each Tavily key shows what it has used (SlouchyQuill)
SlouchyQuill on Discord asked for a Tavily key pool after dsh-tavily-pool: several keys, each key's quota shown, keys rotated. Before this, the comma-separated keys (#1477) always started from the key that last answered, so one key took every search until it was refused, a refused key kept no rest of its own, and nothing showed what a key had left. What changed: - Turns (internal/gateway/search_keys.go). Searches take turns over the keys by default (round robin, a counter per vendor). pick=order (CLI) or In order (Settings) always starts from the first key; the pick is saved in SearchAPI.Pick. - Rests. A refused key rests: 401/403 for 10m ("turned away"), 402 for 1h ("out of credit"), 429 for its Retry-After held to 30s-10m (1m without one). 432/433 count as out of credit from Tavily only; from any other vendor they rest as a rate limit. A resting key is asked after the others, soonest back first, so failover is kept, and it wakes when it answers. Rests are keyed by a hash of the key. - Quota (internal/gateway/search_quota.go). Each Tavily key's quota is read from GET /usage with that key. The fixture is the documented reply from docs.tavily.com. The key's own limit is used when it has one; otherwise its plan's plan_limit/plan_usage, which the account's keys share. A failed read, or a reply missing those fields, says unknown and why, never 0. A read is kept 2m unless asked fresh. A key found used up with no pay-as-you-go credit rests 1h; a later read with credit wakes it. - Keys never appear in full. The vendor's error has the key masked (tvly-…abcd), and errors name "key N (tvly-…abcd)". - GUI. Settings › Models › Web search adds a "Keys of <API>" row under an API with several keys or with Tavily's: In turn / In order, each key masked with what it has used and why it is asked last, and Check again. There is an API for it (POST /api/settings/search-quota), and 13 strings in zh, zh-TW, ja and de. - CLI. `magpie search` lists the pick and each Tavily key's quota, read fresh; `magpie search add … pick=turns|order`. - Docs. gateway-routing.md has a new section "A search API's keys"; both READMEs have a line on web search. What was run: - go test -tags nogui ./internal/gateway ./internal/provider ./internal/cli ./internal/gui: ok. After the last rebase, provider and cli again, and gateway -race -run Search. - New tests: TestReadTavilyUsage, TestSearchKeysTakeTurnsRoundRobin, TestSearchKeyRefusedRests, TestSearchRestFor, TestSearchQuotas and TestSearchKeyNeverInFull. Each guarantee was broken by hand and its tests went red: - turns pinned to the first key: RoundRobin and RefusedRests; - rests ignored: TestSearchAPIKeysTakeTurns, RefusedRests and TestSearchQuotas; - key masking removed: NeverInFull; - a failed read reported as known: TestSearchQuotas. - gofmt -l; go vet -tags nogui for darwin, linux and windows on the four packages. - GUI: search-keys.test.cjs covers en, zh, zh-TW, ja and de × Chromium and WebKit × 1100 and 420px: 20/20. Without the new .search-keys .val wrap rule, de at 420px fails ("Erneut prüfen" went past the window's edge). - search-api, search-first, search-instead, search-mcp, searcher-pick, settings-search, provider-search, gui-de, gui-ja and i18n-keys: 56/56 in each engine. - Full suite in Chromium (concurrency 6, load ~40): 4498/4504. The files that failed (gateway-key-groups, rest-try-now, routing-wb-restricted, text-size, usage-sum-whole) were rerun alone. All pass except usage-sum-whole, which fails now and then on an origin/main worktree too under the same load (#1864, #2023; rest-try-now and routing-wb-restricted are #1905). None of them touch search. - Real Tavily API with two invalid keys: /search returns 401 {"detail":{"error":"Unauthorized: missing or invalid API key."}}, which counts as a refusal. Both keys rest 10m as turned away, the error names them only masked, and both quotas read "unknown · 401". Checked through a test and through the nogui CLI binary in a sandbox HOME. Not tried: a valid key's /usage against the real API. No Tavily key was at hand, so the quota parsing is checked against the documented bytes only. |
||
|
|
f71155591e |
provider: a provider at a vendor's own endpoint is priced from that endpoint's models.dev catalog (#2052, mengyianx)
A custom provider added by its address alone, with no catalog named, was priced only by the model's maker. Qwen3.8-27B, whose maker (Alibaba) sells no such model on any of its seven models.dev catalogs, read "no price is known for it" even at AMD's own endpoint, where models.dev's amd lists it at $0, a price. - catalog: models.dev's provider "api" is read; AtEndpoint names the catalogs at a base URL (trailing slash and case ignored). - provider: EndpointCatalog is the one catalog models.dev lists at one of a key's provider's endpoints (an Anthropic base, kept as its root, also with /v1), used by ListPrice when the provider has no catalog of its own. Never for a subscription's account, never when two catalogs share the address (minimax / minimax-coding-plan), never a plan's catalog (an id with -plan, or membershipCatalogs), whose $0 is the membership's. A user's price and a named catalog still come first; a relay's endpoint matches nothing and its model stays unpriced (no reseller guess). - cli: `magpie model price p/m` with no price gives the two commands that set one (p/m and */m); a price from an endpoint's catalog names it. - gui: the Catalog field's hint says it also sets list prices (en, zh, zh-TW, ja, de). - docs: reference.md's "What a model costs", providers-accounts.md row. What was run: - Reporter's exact case, built binary (go build -tags nogui), sandbox HOME with a copy of this machine's models.dev cache (2026-10-14, same amd entry as the report), providers 001 (relay), 002 and amd at https://developer.amd.com.cn/radeon/api/v1: 001/gpt-5.5 $5/$30, tiers, as before 001/Qwen3.8-27B no price, now with the two commands to set one 002/Qwen3.8-27B $0/$0, "what models.dev's amd lists at its endpoint" amd/Qwen3.8-27B $0/$0 The two suggested commands were run and took effect. - TestEndpointCatalogPrices / TestEndpointCatalogOnlyItsOwn, fixture testdata/endpoint_catalog.json trimmed from the real models.dev cache. Break checks, each FAILs with the case named: ListPrice not using EndpointCatalog -> 002/amd/001 at AMD unpriced, EffectivePrice(002, Qwen3.8-27B) unpriced plan exclusion removed -> "a plan's endpoint: EndpointCatalog() = alibaba-coding-plan", qwen3.5-plus at $0 instead of $0.4/$2.4 single-match rule removed -> "an endpoint two catalogs share: EndpointCatalog() = minimax" Account check removed -> "a subscription's account ... = amd" Anthropic /v1 match removed -> thinkingmachines unmatched - GUI: internal/gui/tests/catalog-hint.test.cjs, chromium and webkit, en zh zh-TW ja de, widths 1100 and 420: 20/20 pass, plus i18n-keys; with the old app.js/i18n.js it fails "one hint names list prices". - go test -tags nogui -timeout 45m ./internal/catalog ./internal/provider ./internal/cli: ok (provider 244s, cli 125s, catalog 3s). gofmt -l clean; go vet (darwin), GOOS=linux go vet -tags nogui and GOOS=windows go vet -tags nogui on those packages: clean. |
||
|
|
c1e354245d |
agent, gui: connecting an agent whose model list holds none of magpie's models says so, in the reader's language (#1989, znuaibot)
znuaibot's case: OpenCode shown only its one picked model, whose provider was switched off. connect() found no field to set, and since the catalog still held models (shown 0, hidden 7) it said only "OpenCode can't be connected to magpie", which sent the user looking at the agent rather than at the model list that emptied it. znuaibot's patch (74160e1f) told the case apart in connect(). Changed on review: the plain English error would have reached the GUI untranslated (NoModelsError beside it is said by code), so the case is a typed AllHiddenError, fail() answers it with code all_hidden, and the GUI says it in en/zh/zh-TW/ja/de, pointing at the agent's Model list → Pick (the names the Agents page uses). Run: TestConnectWithEveryModelTakenOut (agent) reproduces the case with a provider switched off under OpenCode's picked list: on the old connect it FAILs with "OpenCode can't be connected to magpie"; passes now, and connects once the provider is on again. TestAgentConnectAllHidden (gui) checks the code. agent-connect-no-models.test.cjs now runs both codes in Chromium and WebKit, en/zh/ja/de: 16/16 pass, and with app.js's all_hidden line removed the 8 all_hidden cases FAIL. gui-de, gui-ja, gui-zh-tw, i18n-keys: pass. Full internal/agent and internal/gui: see the push record on #1989. |
||
|
|
56fcd1dc27 |
usage: each account picks a recorded allowance cycle beside its curve, meters and legend following it (#2009, NorethSea)
Let each account choose completed cycles beside its allowance curve. The meters, sampling dates, plot and legend follow that cycle. Missing readings stay unknown, and current account actions and whole-window estimates are not presented as historical data. Fixed-deadline refills preserve cycle boundaries alongside natural and early resets. Keep the upstream whole-window estimate for the current view; no separate price endpoint or duplicate estimation is added. Verified on the integrated tree based on origin/main |
||
|
|
b6cf5e3eab |
gui: magpie web keeps its sign-in when another service on the same address fills or clears the host's cookies, and a page opened without it says why and takes the key (#2033, 321sssrt-bit)
A browser keeps cookies per host, not per port. magpie web's sign-in cookie on http://<tailscale-ip>:3430 is the same host's as every other service on that IP's other ports, so one of them could take it away, and a bookmark then answered only "open the link magpie web printed when it started". Reproduced in Docker (linux/arm64, MAGPIE_WEB_KEY fixed, as the reporter runs it) with Chromium and WebKit on the old binary: - docker restart, recreate (an update), browser restart: still signed in (the key, its derivation and the 400-day cookie are fine); - another port on the same host setting ~400 cookies: Chromium evicts the sign-in (401), WebKit keeps it; - another port answering Clear-Site-Data: "cookies" (a sign-out often does): 401 in both; - the page opened by another name for the host (localhost vs IP): 401. Changed: - the sign-in cookie is sent with Priority=High, so Chrome evicts it last when the host's cookies overflow (with it, the flood case stays signed in); - every magpie_web_<port> cookie the browser sends is tried, so a stale one sent first no longer hides the right one; - an HTML page opened without the sign-in gets a page that says which case it is (no cookie sent for this address, or a cookie holding another key) and a field to paste MAGPIE_WEB_KEY into; POST /_magpie/sign-in sets the cookie and goes back to the page asked for (local paths only: no scheme, host, //, /\ or the sign-in itself). The key is never in the page. API calls get a plain 401 that now says the reason too, and the turn-away is logged with it. - docs/reference.md's Docker web section says how long a sign-in lasts and what can take it away. Run: - TestWebGuardBookmark (link cookie has Priority=High; stale cookie first still passes; both reasons; API 401; wrong key 401 with no cookie; right key 303 to /?view=usage with a 400-day cookie; external, //, /\, javascript:, empty, sign-in-path and CRLF back values all go to /). Broken by hand: the old guard fails it (link without Priority), dropping Priority alone fails it, reading only the first cookie fails it (stale cookie: 401). - The Docker matrix above again on the new binary: the flood keeps the sign-in in Chromium; Clear-Site-Data and the other name get the form, and the form signs in (wrong key turned away, right key back to /?view=usage, 200) in Chromium and WebKit; the log says "turned away ... no cookie sent". - go test -tags nogui ./internal/gui (ok, 173s), gofmt -l, go vet darwin, GOOS=linux -tags nogui, GOOS=windows. Not tried: the reporter's own browser and Tailscale address; which service on their host takes the cookie is not known. |
||
|
|
bf25842714 |
gateway: a provider's own cap on how long a key that keeps failing rests (#2008, Gaudi-XIX)
A key that keeps failing doubles its rest from a minute up to 10 minutes, and one rate limited again as soon as its rest is over up to 30; both caps were fixed, so a free key down for hours was asked again every 10 or 30 minutes all the while. `magpie provider rest-cap <id> 4h` (Provider.RestCap, minutes, at most MaxQuotaRest, 8 days) sets where both ladders stop for that provider's keys and accounts (RestCapOr in restAfterMarked's default branch and in rateRest); `default` gives back the gateway's own. A time the vendor names still stands over it. Unset, nothing differs. It is kept by the editor's save, the account copy and normalize. Run: go test -tags nogui ./internal/provider ./internal/gateway ./internal/cli ./internal/gui (temp HOME). Broken by hand: both ladders back on the fixed caps fail TestOwnRestCap (rate-long #6: 30m, want 32m); the GUI keep removed fails TestSaveKeepsQuotaResetAt. Not tried against a real vendor's outage. |
||
|
|
064cffdbfd |
gateway: a key out of a daily allowance rests until the time of day it comes back (#2008, Gaudi-XIX)
A free tier's "You've reached today's free-model token quota" says nothing of when it is back, so it rested 15 minutes (or the provider's own quota-rest), and was asked again all day. A vendor Retry-After over an hour was cut to the hour, and that hour then stood over the user's own longer rest. - Provider.QuotaResetAt: "08:00" on this computer's clock, or "00:00+08:00" on the vendor's. `magpie provider quota-rest <id> until 08:00` sets it; a number of minutes set after it replaces it, and default clears both. normalize drops one that isn't a time of day. It is kept by the editor's save and the account copy. - restAfterMarked's quota branch rests until its next occurrence (OwnQuotaRest). A time the vendor names, or a window's end, still stands over it; a Retry-After stands unless it was cut to longestWait while the user's own rest is longer. - Defaults are unchanged: nothing set, nothing differs. Run: go test -tags nogui ./internal/provider ./internal/gateway ./internal/cli ./internal/gui (temp HOME). Broken by hand, each fails: OwnQuotaRest replaced by QuotaRestFor (TestQuotaRestsUntilTheTimeOfDaySet, 3 asserts), the Retry-After guard removed (the 7200 case), the GUI keep removed (TestSaveKeepsQuotaResetAt), default not clearing it (TestQuotaRestUntil). Not tried against a real free-tier vendor. |
||
|
|
4c746ab390 |
gui: Azure OpenAI says its models are the deployments magpie lists with the key (#1995, parkavenue9639)
Adding Azure OpenAI asked only for the endpoint and key. Nothing said that, once it is saved, magpie asks the resource for its deployments with that key (Provider.azureModels), so people took the page for one where model ids must be typed. A saved one whose list hadn't come back yet said "The vendor's list is empty", the same as one asked and empty. - The endpoint hint (presets.go) now says magpie asks the resource for its deployments with this key once added, and the deployments' names are the model ids. - The add page has a Models row for Azure: nothing to type; a deployment's name is typed as a model id only if the list can't be fetched. - A saved Azure provider with an empty list says it is asking the resource with this key while the background fetch runs (providers.fetching, not yet fetched, no list error), and after it that no deployments came back, with Fetch again or a deployment's name. Every other provider's empty text is unchanged. - New strings in zh, zh-TW, ja and de. azureModels itself is unchanged. Run: azure-endpoint.test.cjs (24 pass, Chromium and WebKit, en and zh), extended with the add page's Models row and four empty-list cases (asking, asked and none, asked and failed, OpenRouter unchanged). With the old app.js put back it fails 10 of 12 on Chromium (no .azure-models row, the generic empty text). With the old i18n.js the zh cases fail (6 of 12). gui-de, gui-ja, gui-zh-tw, i18n-keys, provider-fetch-again, provider-picks-stay, add-sheet: 34 pass in each engine. go test -tags nogui ./internal/provider ./internal/gui ok under a sandbox HOME; gofmt -l clean; GOOS=linux and GOOS=windows go vet -tags nogui on both packages clean. Not tried against a real Azure resource (no account): only the text changed, not the fetch. |
||
|
|
80211e7075 |
provider: a balance field sums, maxes or counts a list's items, and one amount it can't read is "—" (#1993, RicardoWYP)
A relay's /api/subscription/self tells usage per subscription, a list.
A balance path could only name one index (subscriptions.0), so several
active subscriptions read as the first, ".0 + .1" failed whole when only
one existed, and a weekly cap of 0 ("divides by 0") hid every amount of
the field.
Now a path goes through a list's items with "*" (a.*.used), or those
that match with "[key=value]" / "[key!=value]" (a[status=active].used,
also on an object: a.*.subscription[status=active].used). Such a path is
several values, made one by sum(), max(), min() or count(); arithmetic
between two of them goes item by item, so max(a.*.used / a.*.cap) is the
fullest window. Several values left outside a function are an error
naming the functions, not a guessed sum. Within a list an item without
the path, or divided by 0, is left out; max/min of nothing is an error.
In a field of several ";" amounts, one that can't be read shows "—"
(BalancePart.Error says why, as the card's hover on the Usage page and
in the panel) and the others still show; the read fails only when none
can be read. A single amount alone still fails as before.
The GUI hint (zh, zh-TW, ja, de) and `magpie provider` help say the new
syntax.
Run:
- TestBalancePathLists, with the reporter's literal JSON: against the
old balance.go it fails ("nothing at \"sum\" in the reply", and the
"—" cases error); passes now. TestReadBalancePath's one case that
expected a whole-field failure with one bad amount now expects it
only when every amount fails.
- go test -tags nogui ./internal/provider ./internal/cli ./internal/gui
under a temp HOME: ok.
- balance-parts, gui-de, gui-ja, gui-zh-tw, i18n-keys in Chromium and
WebKit: 14 pass. With the title lines removed, balance-parts fails on
the missing hover text.
- gofmt -l clean; GOOS=linux and GOOS=windows go vet -tags nogui on
provider and cli.
Not tried against the reporter's real relay.
|
||
|
|
1aadd2167c |
gui: a proxy's own error page is said by its title, not as raw HTML (#2032, precisionz)
When an answer isn't JSON, api() showed its first 200 characters. For a proxy's or tunnel's own HTML page that was markup, e.g. Cloudflare's 524 page as "<!DOCTYPE html> <!--[if lt IE 7]> <html class=…" in precisionz's screenshot. An HTML answer (by Content-Type, or a body that starts as a page) is now said as "A proxy in front of magpie answered, not magpie (<title>)". For 504 and 524 it says that the proxy stopped waiting, magpie may still be finishing, and to check again in a minute. The status pill shows one line, so the words that matter come first. Plain-text errors are shown as before. Strings in zh, zh-TW, ja and de. Verified: - internal/gui/tests/plugin-proxy-page.test.cjs (new). It installs from the Discover field at 420px, with plugins/add answering Cloudflare's 524 page (its head as in the screenshot, the rest from Cloudflare's template, not captured live) and a 502 with no Content-Type, in en, zh, ja and de, plus a plain-text 500. Chromium and WebKit: 12 pass. With api()'s old line put back, every language fails on the raw markup. - gui-ja, gui-de, gui-zh-tw, i18n-keys and every plugin-*.test.cjs, both engines: 396 pass, 0 fail. |
||
|
|
c55395df9e |
gui: a plugin install goes on when the proxy in front of magpie web gives up (#2032, precisionz)
precisionz installed Zed from magpie web on a phone; the page spun for a
while and then showed Cloudflare's own error page ("<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie…"). A tunnel or proxy in front of
magpie web stops waiting after its own limit (Cloudflare: 100 seconds,
then 524), closes the connection, and /api/plugins/{op} ran bun under the
request's context, so the install was cancelled halfway.
/api/plugins/{op} now runs under context.WithoutCancel(r.Context()) with
the same 5-minute cap, as moveContext already does for a move. add,
remove, update and upgrade go through test seams (addPlugin, ...).
Verified:
- TestPluginOpsOutliveRequest (new) cancels each request before serving
it. With r.Context() put back it fails: "got [add: stopped with the
page remove: stopped with the page update: stopped with the page
upgrade: stopped with the page]". With the fix it passes.
- HOME=<temp> go test -tags nogui ./internal/gui/: ok (107s).
- gofmt -l clean; GOOS=linux and GOOS=windows go vet -tags nogui
./internal/gui/: clean.
Not tried: a real Cloudflare tunnel in front of magpie web.
|
||
|
|
17d4283a5a |
library, gui: a hook has a description in any language, shown under its name (#2011, emo172)
A hook's name is letters, digits, - and _ (checkName), so a Chinese user had to translate "auto-format-queue" back in their head; 编辑后格式化 was refused. Hook now has an optional Description: one line (whitespace and line breaks folded into single spaces) of at most 200 characters, kept in library.json only and never written into an agent's hooks file. The Hooks tab shows it under the name; the editor has a Description field (maxlength 200) under Name. The library's text fields no longer save or close on an Enter or Escape that only ends an input method's composition (isComposing / keyCode 229), which a Chinese description would hit. Strings in zh, zh-TW, ja and de; docs/subsystems/library.md says it. The reporter's other option, non-ASCII names, wasn't taken: the description says more than a name can, and names stay one rule across servers, skills and hooks. Run: TestHookDescription (kept through a save, an agents change and a rename, read by the page, no agent file has it, 201 characters refused, 200 kept) fails with the folding and the length check removed. library-hooks.test.cjs (a description under the name, none for a hook without, the field's placeholder and hint, an IME Enter posts nothing, Save posts the description) fails on the old library.js and with the IME guard removed. library-*, gui-de, gui-ja, gui-zh-tw, i18n-keys and click-scroll pass in Chromium and WebKit (263/263 each). go test -tags nogui ./internal/library ./internal/gui under a temp HOME, gofmt -l, GOOS=linux and GOOS=windows go vet -tags nogui ./internal/library pass. |
||
|
|
269fc93e8e |
gui tests: settings-general reads the language button's place once the page's animations end
The test compares the language button's place before and after a language
pick. The context has no reducedMotion, so the Settings page's entrance
animation could still be running when `before` was read. Under load, the
reads came out like 175.07 or 175.98 against a resting 175: 20 such reads
in 18 runs, 6 at a time. One run went red on ja at 440px, with before at
200.5 and after at 199.19 while the view had scrolled 24. It was red alone
on origin/main
|
||
|
|
befb563e3d |
gui tests: copilot-signed-out-account measures the account's row once it is no longer drawn again
What comes in after the Copilot editor opens draws its accounts again.
The test read the row's, the reason's and the buttons' boxes across that
redraw, and got null ("Cannot read properties of null (reading 'x')") or
a row no longer attached. It was red alone on
|
||
|
|
3f4cec2496 |
gui tests: group-member-info wheels a member's switch and Remove into view before it clicks them
The group editor opens with its first member under the window's foot,
which took the click on .rt-mon. Playwright's scroll before the click is
put back (#1554). This flaked on
|
||
|
|
2f68ede77e |
gui tests: session-terminal wheels the row into view instead of opening a taller window
Settings rows were added above Session terminal again, so even in a
1000px window the row sat under the window's foot. Playwright's scroll
before each click is put back (#1554), and the click waited on the foot
until it timed out: red on
|
||
|
|
bb70284082 |
gui tests: plugin-list-error looks for the "vendor list · <when>" hint, not every "供应商列表"
|
||
|
|
ba07128884 |
gui tests: nav-sub-unroll and plugin-check-github-limit find Installed by name, after P0's Built-in tab
|
||
|
|
8dcb90873d |
gui tests: menu-scroll waits for the menu's opening to finish before it clicks its scrollbar
A click on the scrollbar's track while the menu was still opening landed
nowhere now and then, in both engines. It was red in 5 of 8 runs on
|
||
|
|
f7a3693f78 |
gui tests: library-mcp-tool-switch has every switch below the stuck head before it clicks
Clicking the pill sometimes scrolled the page in WebKit (to 242, 422 or
440), which left read_text_file under the stuck .lib-head, and the click
landed on the head. It was red in 5 of the 10 WebKit cases in a full
run of the suite. The library code it clicks is unchanged since
|
||
|
|
bf6393f9bd |
gui tests: allow-ips wheels Remove into view before it clicks it
In Chinese the 10.0.0.0/8 row's Remove sat at 521–544, with the view's
foot at 532. Playwright's scroll before the click is put back (a scroll
that isn't the reader's, #1554), so the window's foot (#status) took the
click. This was red every run on
|
||
|
|
4325e9970d |
gui tests: gateway-port lets each wheel step come to rest before it looks again
On a busy machine, wheel events still queued scrolled on past the port
row, so the field was above the view when it was typed in ("typing moved
the page 269 !== 343"). This reproduced reliably at 8 runs at once on
|
||
|
|
50dd39104c |
gui: 100% picked at the foot of Settings at 150% ends at the foot, not 6px up (#911 again, zh)
Zoomed out, the window's header gets shorter and the view taller, while no part inside it changes size. relaid (#911) watched only the view's parts, so nothing put the reader back. The view stayed clamped to the height it passed through, short of its foot: text-size.test.cjs's "zh: 100% picked at the foot of the page leaves no blank under it" was red on main in Chromium ("scrolled from 160 to 109 (max 115)"; seen on |
||
|
|
6bab47729a |
gui tests: gateway-caller-keys wheels up to Settings' tabs before Network, which the header covered in WebKit
Back on Settings after the Gateway page, the page comes back where the test had wheeled it (48px), so the tab strip sits at y=10 under the header. Playwright scrolls a covered element into view before a click, but a scroll that isn't the reader's is put back by design (#1554), and WebKit's click waited on the covered tab until it timed out: red on main in both languages (seen on |
||
|
|
e7e2d522f0 |
gui: on a phone a routed request's account keeps a few letters, not a sliver
|