db87e014f2c53cdcf4c4e10c2d3cd41393ba3cb6
191
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
9019ca88d6 |
gui: Scroll to top and Scroll to bottom move when the page under them changes, not only on a scroll (Jiabubu)
Jiabubu on Discord: with the capsule in sight, a click that opened a
Routing group left it over the editor's member rows (Remove beside Up
and Down) and its held Cancel and Add, and it moved off them only once
the page was scrolled.
scrollends.js placed the capsule on a scroll, a resize, focus or the
pointer leaving it, and a hidden attribute set anywhere. Opening a group
in place sets none, unless something else on the page happened to be
hidden again in the same draw (an empty pool list is, on every draw,
which is why the earlier tests saw it move). It now also watches the
open page and each of its own children with a ResizeObserver, and the
page's child list, so any change of size under it (a group opened or
closed, rows added or taken out) places it again on the next frame: it
rises above a held foot, steps aside at the page's foot, or comes back.
One file serves every page with the capsule (Agents, Providers, Routing,
Library, Settings, plugin pages), so they all take it. No core script
changed; scrollends.js loads lazily and has no budget.
view-ends-relayout.test.cjs: with no scroll after the change, the capsule
must be where the reader's next scroll puts it, and over nothing of the
editor's:
- Routing, 16 groups of the reporter's rows ("低-ultra", 922K), a pool in
the list: a screen down, a click on the card lowest in sight opens its
editor; then Cancel closes it.
- Agents, 40 rows: a little above the foot, a block at the list's end
taken out so the foot comes up under the capsule.
Desktop 1100, 700, 560; browser page 1100, 440, 360; Chromium and WebKit,
en/zh/zh-TW/ja/de.
Run on mote (mote-run) at this tree:
- view-ends-relayout, both engines, every language: 10 of 10 ok.
- On
|
||
|
|
0872bc2a0e |
context: a request's text and reply from the request archive (wangbinyq)
wangbinyq on Discord: with the request archive on, clicking a block of
the context window card still said "只保留最近 10 个请求的原文", since the
card read only the last 10 bodies magpie keeps in memory.
What changed:
- /api/context/text tries memory first, then the request archive's copy
when the route names one (Route.Archive, the route found in the trace
or in the history file of the card's ?day=, HistoryRoute looks a day
either side). gateway.ArchivedPromptText parses it as PromptText does
and masks it through maskedCopy, as the body in memory is; it is
marked from "archive" and the card says so.
- New /api/context/reply: the reply to the request, from the Recent
calls (Server.ReplyBody) or the archive's Response. gateway.ReplyPieces
reads it into thinking/assistant/call pieces (conversationOutput, split
out of conversationTurn) after redact.ScrubJSON, and masks every piece
through maskedCopy. The card's text view has a Reply button beside
Close that shows it and goes back to the part.
- What is shown is what the archive stores, masked as the memory copy
would be, nothing more. A body or reply that can't be masked shows
nothing (404 "unread"); one the archive cut short isn't parsed ("cut");
one it names and doesn't have says so ("missing"), and one with no
archive copy keeps the old "only the last 10" line ("off"). A failed
bucket read is an error, not "gone".
- The archive read is capped at archiveReadMost and the last copy read is
kept 5 minutes, so the items opened one by one read it once.
- ctxtext.js takes the route (id and time) instead of the id; context.js
passes it (its one-line change paid for by a comment cut, core budget
not raised). New strings in zh, zh-TW, ja and de.
- docs/subsystems/gateway-routing.md (Prompt) and gui-shell.md.
Run on
|
||
|
|
84da86ebd5 |
gui: Hide accounts is one switch for every page, window and the panel (paultian)
paultian on Discord (#feedback): Routing, Usage and Providers each kept their own "Hide accounts" state, so turning it on in one page left the others showing emails. Now window.hideAccounts is one switch, one localStorage value (magpie.maskEmails), behind #rtMask, #usageMask and #pvMask alike. Flipping it in any page applies to every page at once, and a storage event carries it to other windows and the tray panel. The old magpie.maskProviders value is folded in on first load (hidden if either value was on) and then removed, so nobody who hid accounts on one page sees them shown after updating. The tooltip and the Settings line now say "on every page" instead of "on this page", in every language. Tests: provider-mask.test.cjs checks that one switch hides accounts on every page and in a second window, that the state survives a reload, and that an old maskProviders=1 comes through as hidden. account-mask's expected tooltip text is updated. Run on mote (GUI files at base 05aba5ca4; the Go asset/budget tests again at this head after rebasing on |
||
|
|
b295d11965 |
serve, update: one magpie works the gateway; the service waits, the copy an update left stops (#4938)
ox01024's #4938, Bug 2. Two magpies did the gateway's work at once on a Mac: - launchd's com.yetone.magpie.serve ran `magpie serve` beside the app. It ran startUp (plugin Settle/Refresh, FoldCopies, Hold, the agent moves), the plugin host and every account's model fetch, then failed to bind, exited 1 and was started again 5s later: 6,035 times in two days, a 279MB serve.log, and logins.json.lock held against the app's requests until they went 504. - The copy an update left (.magpie-update/old) handed the socket over, hid, and lived on ~3h, its loops writing beside the new one. What changed: - cli: `magpie serve` (no --web) checks codexrelay.Leave, gateway.ServedBy and gateway.Taken before startUp, as the app's serveGatewayLocked does. While the port is held it prints one line and looks again every 15s, doing nothing else. Once the port is free it serves (serve_wait.go). It waits rather than exiting 0: under KeepAlive SuccessfulExit:false a clean exit would leave no service after the app quits. - gui: after a handover the old magpie's loops end with backendCtx: - library.KeepLinked (now takes a ctx), - provider.WatchQuotas, - the menu bar usage loop, - the updater's check/auto-restart loop. lighten lets its hidden webviews go as lightweight mode does, so their polls stop. quitBy exits it at handedOffDrain + 3m whatever holds its quit up (gateway.HandedOffDrain getter; exitNow stubbable). - docs/subsystems/gui-shell.md says both. Run at the pushed head on mote (mote-run): - gofmt -l internal/: nothing. go vet ./internal/{cli,gui,library,gateway}; GOOS=linux go vet -tags nogui and GOOS=windows go vet of the same: ok. - go test -count=1 -timeout 45m ./internal/cli ./internal/library ./internal/gui ./internal/gateway at |
||
|
|
eb779ce92a |
gui: the tray icon's tooltip is in magpie's language (yi_time)
yi_time in #feedback: magpie set to Chinese on Windows, and the tray
icon's hover tooltip said "Today: 121K tokens (2.9K in · 180 out ·
118K cached)" and "3 requests" in English. The tray menu already
followed magpie's language (trayLang, #301); the tooltip's words were
hard-coded English in trayusage.go.
Now every tooltip is in trayLang(settings.Lang, systemLang), on
Windows, macOS and Linux alike. That covers trayIdleTip, magpie's
totals (trayTotalCard), and each subscription card (trayCardText: its
use or what is left, the pace, when it resets, until's d/h/m, "as of
…"). The words are in trayWords beside the menu's, for zh, zh-TW, ja
and de; English stays the key and the fallback. A window's name and an
error are still the card's own. A change of language in Settings now
also refreshes the tooltip (onTrayUsage); before, only the menu was
relabelled. The test-only trayUsageText and trayUsageView stay in
English, so the existing tests keep their strings.
Test: TestTrayTooltipFollowsMagpiesLanguage.
- yi_time's own numbers in zh: "magpie\n今天:121K token(输入 2.9K ·
输出 180 · 缓存 118K)\n3 个请求".
- The same numbers in en are unchanged.
- Covers the total card and a card's used, left, reset and as-of.
- For zh, zh-TW, ja and de, no English word in the idle, totals, card
(with pace) or combined tooltips.
Run at this head (rebased on
|
||
|
|
5ec2375688 |
gateway: a call's HTTP headers both ways, masked, folded under its bodies
usrname1833 on Discord asked to see the raw request and response HTTP headers (查看原始请求和原始响应的http头), to debug as with a capture. magpie kept the client's request headers and its own response headers only in the request archive, and nothing of what went upstream. Now a call keeps its headers both ways (internal/gateway/wire_headers.go): - the client's, as they reached magpie: headerLogged in Handler() clones them for every request that isn't a GET, HEAD or OPTIONS; - each request magpie sent upstream for the call: method, address, headers, and the answer's status, protocol, headers and time, or the error. rpmTransport (under s.client) records it as it is sent; provider.SendsThroughPlugin records a plugin account's hand-off, shown as handed to the plugin, since the plugin's own request to its vendor is made in Bun and magpie doesn't see it (the view says so). The first 8 tries are kept, the rest counted. Recording copies each header map; nothing is masked or sorted as a request goes. Secrets are taken out when the headers are read (Call.Headers): by what each header is (new redact.SecretHeader, now behind redact.ScrubHeader: Authorization, cookies, x-api-key, api-key, any *-Key, *-Token, *-Secret, *-Auth, *-Signature, but Idempotency-Key and a count of tokens such as anthropic-ratelimit-tokens-remaining), any Bearer or Basic value, and redact.Scrub on the rest; an address loses its password, a secret-named query value (?key=) and its fragment. They live with the call in the 40-call ring; /api/gateway/call gives them as "headers". The request archive keeps the upstream ones as "upstream" beside the request's and response's headers, masked the same way. No body is stored that wasn't before. GUI: under a recent call's bodies on Gateway and a request's on Routing, "HTTP headers" folds open the client's headers, then each upstream request beside its answer (wireHeadersView, plugins/usage/page.js); the archive's copy shows its upstream requests too. Strings in all four languages. docs/subsystems/gui-shell.md describes it. Also changed by SecretHeader: the request archive no longer masks a rate-limit count header (…-tokens-remaining), which the old name rule took for a token. (provider.SecretHeader, which backups use, is another function and unchanged.) Tests: TestRecentCallHeadersBothWays (a fake vendor; the client's key and cookie, magpie's upstream key and the vendor's Set-Cookie all masked; status, protocol and response headers kept), TestRecentCallHeadersEachTry (a 429 then the next key, both kept in order), TestPluginHandOffHeaders, TestScrubURL, TestSecretHeaderRealNames (real header names both ways), TestArchiveOnThisComputer and TestRecentCallBodiesOnDemand extended, call-headers.test.cjs (Gateway, Routing and the archive's copy; chromium and webkit; en at 1100px, zh, zh-TW, ja, de at 380px and Routing at 440; nothing out of the box, no left-border accent). Run (on mote, macOS 27.2, through mote-run, unless named): - Full suite at ebd22b1b4 (the same change on |
||
|
|
d5dc8eeccc |
gui: Scroll to top and Scroll to bottom on a long page (emo172)
#1090 (emo172) asked for back-to-top and back-to-bottom buttons on the main pages. Once a page is scrolled more than one window down, a small capsule with two buttons, Scroll to top and Scroll to bottom, fades in. It sits in the page's right margin when a wide window leaves one, and otherwise over the page's corner, above Providers' sticky Add buttons. It stays hidden near the top of the page, while a dialog is open, and (over the corner) at the page's foot, where the last row can't scroll out from under it, unless it has the pointer or keyboard focus. The page's own height never changes for it, because app.js's scroll guard measures that height. A press goes through scrollOnPurpose, so the window's scroll guard takes it as the reader's own scroll. It scrolls smoothly, or at once under reduced motion, and the button at the end it already reached is aria-disabled. Both buttons are real buttons, reachable by Tab, with a label and tooltip in en, zh, zh-TW, ja and de. They are drawn from the window's tokens in both themes, with no gradient and no coloured edge. scrollends.js is imported on the window's first scroll, so the core scripts carry one line in app.js, paid for by two comments cut from the scroll guard's. No budget was raised. old-webkit lists scrollends.js among the lazy scripts. docs/subsystems/gui-shell.md says where the capsule sits and when it shows. Run on mote at this head (on |
||
|
|
18c69aa467 |
gui: Windows reads the screens with one callback, not one per display change (1111_13879)
1111_13879 on Discord: on Windows the app died after a few hours with
"fatal error: too many callback functions", taking the gateway with it
(clients got connection refused). Five dumps all ended in
w32.GetAllScreens -> syscall.NewCallback -> runtime.compileCallback,
from Wails' WM_DISPLAYCHANGE handling.
Wails (v3.0.0-beta.24 here; v3.1.0 and v3.2.0-nightly.20261101 are the
same) reads the screens again on every WM_DISPLAYCHANGE, and on
WM_SETTINGCHANGE for SPI_SETWORKAREA, through w32.GetAllScreens, which
passes a fresh closure to syscall.NewCallback each call. Go never frees
a callback and throws past about 2000, unrecoverably.
magpie now sets WndProcInterceptor (screensWndProc): on Wails' hidden
main-thread window ("__wails_hidden_mainthread") it takes those two
messages before Wails does, enumerates the monitors with one callback
made once at package level (allScreens), builds the screens exactly as
Wails' processAndCacheScreens does (wailsScreen) and hands them to
Screen.LayoutScreens, then answers as Wails would (DefWindowProc for
WM_DISPLAYCHANGE, 0 for WM_SETTINGCHANGE). Other windows and messages go
on to Wails. Wails' one read at start-up is the only per-call callback
left. No go.mod change: no newer Wails fixes it, and magpie has no fork.
Other per-call NewCallbacks in Wails' Windows code: w32.EnumChildWindows
and w32.SetWindowsHookEx, neither called by Wails or magpie. WndProc
classes are registered once; the WebView2 COM vtables are package-level.
magpie's own (internal/agent apprestart) is already made once.
Run at this tree (base e156fdd03; origin/main since adds only
|
||
|
|
ed978e560f |
gui: the Quit question's Don't ask again, and Settings › General › Ask before quitting (zhujiu on Discord)
zhujiu (Discord #feedback) asked for a 不再提示 on the question a tray Quit asks while agents go through magpie ( |
||
|
|
70b96126ef |
gui: a provider's editor grows with a large window (5046312 on Discord)
5046312 on Discord: in a large, wide window the provider editor (Codex's, with its accounts, meters, cap pill, switches and many option rows) stayed a 600px box in the middle, cramped, and asked for a better layout or a resizable sheet. drawEditor's editor now carries `roomy`, and openModal copies it onto #modal's dialog as it already did `wide`. `.modal .dialog.roomy` is min(max(600px, 56vw), 880px, 100%): 600 up to a 1071px window, then 56% of it, at most 880, as a Mac sheet takes the room its content needs. Its height already follows the content up to the window, so no new height rule. A question that takes the editor's place in the same dialog (Sign out's forget-ask, Disconnect, ...) drops the class and stays 600. No drag handle. The rows themselves are unchanged. Every provider editor (subscriptions, keys, new providers, presets) goes through drawEditor. The core-script budget is not raised (7 bytes under). Sizes (chromium, en; width x height of the dialog): window before after 2560x1440 600 x 1228 880 x 1038.5 1440x900 600 x 810 806.4 x 810 1100x800 600 616 1024x768 600 600 560x420 512 512 390 web 374 374 Run at the pushed tree (this commit on 019b308f1; the whole-suite runs below at earlier bases, editor-roomy, i18n-keys and the budget tests again at |
||
|
|
f9595e7684 |
gateway: System One requests are kept in the request archive, and Routing says when the archive is on (wangb on Discord)
wangb on Discord: 「请求存档开启, 但是 systemone 的请求没有记录下来」. The Routing page then said "magpie 只保留最近 40 个请求的请求体和响应体… 要保留 每个请求的,请在「用量 › 请求」顶部打开「请求存档」", as if the archive were off. Why: only serve() made an archive wire (archiving). The two System One paths never reached it: - /v1/systemone, which an app sends (serveDecideTries, also used for a decision group), opened a Route but recorded no Call. It was in neither Recent calls nor the archive, so the Routing page could never open its bodies. - the question a routing group's Jev classifier asks for a turn (askJev / jevLevelled -> systemOne -> postDecide) only appended a usage row. What changed: - serveDecideTries captures its reply, makes the wire as serve does, names it on the Route from the start (Route.Archive), and records a Call (Route, status, error, fallbacks, usage, bodies) when it ends. So the call is in Recent calls and, with the archive on, in the archive. Its usage row carries Archive. - systemOne keeps the call magpie made itself through a new archiveOwn. It keeps the request as it went (method, path, the headers magpie signed it with, the body in the provider's shape) and the answer, with secrets scrubbed as for any call. Its "routing" usage row names the archive entry. postDecide became postDecideSent, which also returns the request it sent. archive's queueing moved into queueArchive, which both share. archiveID makes the name. - Routing's "Request and response" for a request in neither the ring nor the archive: with the archive on (gateway.archive.on in /api/providers) it says the archive is on and this request isn't in it (made while it was off, or not saved). It no longer says to turn the archive on. New string in zh, zh-TW, ja and de. - docs/subsystems/gui-shell.md says which calls are archived and which still aren't. Still not archived (unchanged): Codex's own backend (codexUpstreamOn), draw, embeddings and video side routes, and replies magpie writes itself (answeredHere). Masking makes no outgoing call. Chat classifiers and Codex titles to a model already go through serve and are archived. Run on mote at base |
||
|
|
1a864f156e |
usage: a hidden card a menu bar cell showed offers Show in Overview, not Hide again
Found while fixing yuu003348's report ( |
||
|
|
dee1afa400 |
usage: what is hidden from the Overview can be found again (yuu003348 on Discord)
yuu003348 on Discord: "观测/用量/概览 从概览中隐藏 后 无法取消隐藏". The way
back was there: a "{n} hidden" line under the cards (#quotaHid), each row with
Unhide, Show all from two. But it was drawn in --faint (#b9b9c2 on #f4f4f6,
1.77:1, 11.5px), so it couldn't be found; the Agents list's line (ikunbots on
X) is the same class.
- app.css: .us-hid .us-hidline is --muted (3:1 or more in light; ~5:1 in
dark by the tokens), for both lines.
- plugins/usage/page.js: while any are hidden, a card's menu and an Agents
row's menu end with "Show {n} Hidden". It opens the line under its list,
puts the keyboard on it and brings it into sight on the menu's click
(openHidden, scrollOnPurpose). hiddenQuotas() is the one count both the
line and the menu read.
- i18n: "Show {n} Hidden" in zh, zh-TW, ja, de.
- docs/subsystems/gui-shell.md says both.
- usage-cards-hide / usage-agents-hide now expect the new item when
something is hidden already.
Run (mote, node --test):
- usage-hidden-way-back.test.cjs (new): chromium and webkit, en/zh/zh-TW/ja/
de, 1200, 560 and 390 (touch long-press): 2 of 2 ok (32 cases).
- 130 Usage/menu/tray GUI files: the only reds the change made were
usage-cards-hide and usage-agents-hide's exact menu lists, now updated.
Every other red there is red at origin/main
|
||
|
|
e44ad72cfd |
gui: a failed status dot is an x, not a red dot alone
coolmantou on Discord (#feedback), who is red-green colour-weak, could barely tell the green status dot from the red one. Under a deuteranopia or protanopia simulation the two are one olive colour, in light and dark. Making the green lighter would not help a greyscale or protan reader, so the failed state now says it by shape (Apple HIG: never colour alone). What changed - app.css: a --x-mark token (an SVG x, used as a mask). Each failed dot keeps its red and its 6-7px box, is drawn through the mask and scaled 1.5 so it reads as heavy as the round dot. Layout is unchanged. Dots: Test models (.tdot.bad), an agent's status (.ag-st.bad .ag-dot), the check-in (.ci-dot.bad), the request ledger (.led tr.bad .st .dot). - routing.css: a try or probe (.rt-req/.rt-probe.bad .to i), a step (.rt-steps li.bad::before), the preview (.ps-dst.bad > i). - library.css: a server that failed (.lib-health.err::before). A ring was not used because "not checked" is already a ring there (#2308). - Not changed: green-only dots with no red pair (gateway, keys, tiles, live), chart markers, routing's animated packets, redact's categorical facet dots. The tray has no status dots of its own. - docs/subsystems/gui-shell.md says it beside "State is shown with a dot". Tests - status-dot-shape.test.cjs (new): for all 9 pairs with the real stylesheets, in chromium and webkit, light and dark, 980 and 420 wide: the good dot has no mask, the failed one has the x mask and the good one's box, and its pixels have ink on the arms and centre and none above the centre. - library-mcp-health.test.cjs: its "a dot, not a stripe" check now expects the x for a failed server and a round dot for the rest. Run at the pushed head (mote, via mote-run) - status-dot-shape + library-mcp-health: 16 pass, 0 fail (chromium and webkit). - go test -run 'Asset|CSS|Budget|Compress|Revalidate' ./internal/gui: ok. - At |
||
|
|
89ffc58f5b |
gui: a card's Refresh says the read's failure, and Claude Code's first-run screens say what to do (#4817, uiuing)
From uiuing's branch (1eeb8928b, 66818dbf6), adapted. A usage card's
Refresh showed nothing when the read came back as a card with an
error: only a thrown request reached status. quotaRefresh now says the
refreshed card's error through quotaError, for a single account and
for a provider whose cards were replaced (the one kept in quotas).
quotaError reads the helper's new "stays on its first-run screens" and
an older magpie's "shows its first-run notes" as "Finish Claude Code's
first-run setup, then refresh", in en, zh, zh-TW, ja and de. Comments in
quotaError and quotaRefresh were cut so the core scripts stay in their
budget (1,533,732 of 1,533,802; main was at 1,533,780), with no raise.
Run at the pushed head, on mote: node --test of claude-quota-onboarding,
quota-refresh-order, usage-card-refresh, usage-refresh,
usage-refresh-flight, account-refresh, editor-quota-quiet,
usage-no-reading, usage-remote-cards, tray-usages, glm-quota-error,
claude-usage-asked, allowance-open-read, api-key-usage,
key-balance-card, copilot-signed-out-account, signin-again, plugin-git
and i18n-keys (chromium and webkit, every language each file runs, 440px
where it sets it): 287 of 287.
go test -run 'Budget|I18n|Lang' ./internal/gui ok.
go test -run "Claude|TUI" ./internal/gateway ok. The full
./internal/gateway (-timeout 45m, before the rebase onto
|
||
|
|
16ce5ed232 |
usage: an account whose longer window is used up adds no headroom to the all-accounts sum (#4791)
hayden4608 (Discord) and handong66 (#4791) have four Codex accounts. Three show 5 hours 100% left with 7 days 0% left, and one shows 5 hours 0% left with 7 days 22% left. The All accounts strip read "5 hours 75% left", but none of those three can spend its 5 hours until its week starts again. The right figure is 0%. mergeQuotas (quotaall.js) is the one place that sums windows across accounts. It feeds the Usage page's strip, the tray panel's strip and the Routing groups' line. The native menu-bar tray, the TUI, the CLI and /v1/magpie/quotas show one account at a time and are unchanged. The GUI's JSON doesn't carry Aside, Model or the matches, so the call is made in Go. provider.WithHeldWindows marks a window heldBy another window of the same account when that other window: - stops the account for every model, by routing's rule: not aside, no model, no matches, used >= 100, reset not passed, and not Codex credits that go on; and - starts again after this one (by reset times, else by span). So 7 days used up holds 5 hours, but 5 hours used up doesn't hold a week with 22% left. /api/usage/quotas and its refresh apply it. mergeQuotas counts a held share window as 100 used and a held counted one as its limit, and the strip's tooltip says how many were counted that way (en/zh/zh-TW/ja/de). The account cards still show the vendor's own figure. Run on mote (macOS) at this head's parent tree: - go vet for darwin, linux (nogui) and windows: ok; gofmt -l: none. - go test -count=1 ./internal/provider ./internal/gui, before the quota_span leftOut line and an i18n comment fix. The provider package's only red was TestQuotaSpanCarriesEveryWindowField, which wanted heldBy named, and it is now named. internal/gui's only red was TestMainWindowCorners/macOS_26_SDK, which is #3949. - GUI, chromium and webkit, every language, 440px and 360px: quota-*, usage-* (all-accounts, merge, accounts, fold, refresh and more), panel-usage/quota/switch-accounts/balance-order, routing-quota-left, routing-group, tray-usage, i18n-keys, gui-de/ja/zh-tw, old-webkit: 704 of 707. The reds were i18n-keys (a quoted "All accounts" in window_held.go's comment, fixed here) and usage-fold's "17 subscriptions and 29 accounts" in both engines, which is #4790 and is red at origin/main too (see below). At the pushed head, rebased on |
||
|
|
da275848b6 |
tray: Windows shows a card's number in its icon (Benjaminliang_1 on X)
Windows' notification area shows no text beside an icon, so with a card in the tray the icon itself is now the first card's figure: the first row of the first card whose first row is a percentage, used or left as Allowance display has it, its digits alone (trayIconFigure). It is drawn in Segoe UI Semibold (Go's bold if the font can't be read) at SM_CXSMICON, white on a dark taskbar, near black on a light one, as tall as fits, centred by its ink, three digits narrowed into the square (trayNumberIcon). It is drawn again when the figure, the icon size or the taskbar theme changes (SystemThemeChanged wakes the loop); the tooltip still lists every card. A balance or magpie's totals are skipped; with no such card, or no cards at all, the icon is the bird as before. Settings > Usage > Tray icon number (settings.TrayNoNumber, Windows only, on by default, kept per computer) keeps the bird when off; Menu bar windows is now shown on Windows too, since it picks the row the number comes from. The number row sits after Menu bar cost, so the bird > pace > cost order the other tests pin holds. Linux and the Mac are unchanged. New words in zh, zh-TW, ja and de. app.js stays in the core budget with one comment shortened, no raise. Run at this commit on origin/main |
||
|
|
8826a15ea4 |
gui: a Quit while agents go through magpie asks first, naming them (Aisiverto on X)
Aisiverto on X (Windows, v0.1.2519) wired Codex to magpie and quit magpie. Codex then retried "unexpected status 502 Bad Gateway ... url: http://127.0.0.1:3425/backend-api/codex/responses" five times and gave up, and it took a long search to find magpie's openai_base_url in config.toml. A Quit the user chooses (the tray's Quit, the panel's and window's Quit, Command-Q on the Mac) now asks first when this process serves the gateway and agents are wired to it. The window comes up on a sheet (quitask.js, lazy-loaded) that names each agent cut off, says closing the window keeps magpie running (menu bar on a Mac, system tray elsewhere), and offers Quit (focused), Disconnect and quit, and Cancel. Disconnect and quit puts each agent back as its row's Disconnect does, then quits; a disconnect that fails keeps magpie open, named in the status line. A second Quit within a minute of the question quits, so a window that can't show it traps nobody. With nothing wired, or another magpie serving the gateway, Quit quits at once. Not asked: a restart to update, Uninstall, a browser's page (magpie web), logging out or shutting down, and the Dock's Quit (AppKit terminate:). Found while checking the report: - Closing the window on Windows hides it; magpie stays in the tray and the gateway keeps serving (tried for real, below). Not a bug. - Autostart is off by default on Windows. - The proxy / NO_PROXY in the report isn't magpie's to fix: the 502 is magpie's port with nothing behind it. Strings in en, zh, zh-TW, ja and de (existing terms: Agent, 退出). No native dialog, no <select>. TestCoreScriptBudget met without a raise: app.js gains two lines, the sheet is outside the core, and driftFix's comment block is cut to six lines (453 bytes back; main's core had grown to 258 bytes over with these lines in). Run, at this head (on origin/main |
||
|
|
57246b3818 |
usage: a provider's accounts together, and a routing group's (CryptoSarom on X)
CryptoSarom on X (tweet 2116797183207035245, the tray panel's Usage tab):
"能否支持合并用量和额度显示? 有时候更关心某个模型还能用多少 ... 同个供应商
同模型可以合并 ... 或者单个路由组单独显示用量和额度. 有需要关心账号限制
的时候可以进详情再去看".
What it does:
- A Usage card of several accounts has "All N accounts" under its head:
each window the accounts share, one figure and a thin bar, and how
many couldn't be read. The tray panel's group of several has the same
strip above its cards (at most 3 windows). Each account stays below it
as it was: the details are where they were.
- A routing group's row (Routing › groups) has a line for each provider
among its members: "WorkBuddy AI, 4 accounts: Credits 355 / 1,500
credits · 23.7% used · 1 couldn't be read", following Used/Left.
The design, and why:
- Only what reads alike goes together (mergeQuotas). Counted windows of
one name and unit add their amounts and limits, the share is of the
sum; wallets add balances in one unit. A window said only as a share
is the mean over accounts on one plan, whose allowances are the same
size, so the mean is the share of their allowance together; two plans
are never averaged, and a share is never added to a count. Text-only
windows are left out; unlimited only when every account read says so.
- An account whose reading failed is unknown, not 0 or 100: left out of
the figure and counted ("1 couldn't be read"). A window an earlier
reading (asOf) stands in for, past its reset, is left out the same way
and counted in its tooltip. No single reset is claimed for the whole;
the tooltip says when the first of them starts again.
- Only what two or more accounts have goes together: one account's
window is already below it.
- No switch: the strip is additive and quiet (no gradient, no coloured
stripe; the pill grey of the page, the accent bar the cards use), and
it names no account, so Hide accounts holds.
- The code is in quotaall.js, imported when a provider first has two
accounts (quotaAllJS) or a routing group's member has readings, and
each place is drawn again once it is in. app.js has the loader and the
two call sites; three comments in the quota code were cut to keep the
core inside its budget (1,533,096 of 1,533,105), no raise.
Run, at this tree (rebased on origin/main
|
||
|
|
f06551c277 |
gui: a closed window's page is told it is out of sight
A macOS orderOut hides the NSWindow but can leave its WKWebView document visible. The Routing page's frame loop and SVG animations therefore kept running in a closed window (20-40% Web Content CPU; reopening and closing returned it to 0%). Tell the page before every app-window hide and again on show. Compose that signal with WebKit's own hidden state, and pause CSS animations while out of sight. Verified with: - go test ./internal/gui -run '^(TestCoreScriptBudget|TestClosingWindowMarksPageOutOfSight|TestClosingHidesShownAccounts|TestPanelCloseHidesIt|TestPanelJoinsFullScreenSpaces)$' -count=1 - node --test internal/gui/tests/window-visibility.test.cjs (Chromium and WebKit) - the new JS test against v0.1.2049's app.js: it times out without the bridge - the new AppKit test with hideMain calling Hide directly: it times out without the visibility signal - go vet ./internal/gui - GOOS=linux CGO_ENABLED=0 go vet -tags nogui ./internal/gui - GOOS=windows CGO_ENABLED=0 go vet ./internal/gui The full GUI package still has unrelated environment failures in TestProxyCheckSaysAProxyPassedBy and TestMainWindowCorners on this macOS 27 setup. |
||
|
|
947377307b |
usage: the Sessions tab's token totals count the cache, as the Overview's do (#2591)
n1majne3 reports the usage totals ignoring the cache reads the same page
shows beside them. The Overview's totals have counted the cache on request
since #2378 (magpie.usageWithCache); the Sessions tab counted tokens in and
out alone wherever they showed: the tokens tile, a session's row in both
lists (the Usage page's and the Sessions page's, sessSpent), the projects
and models bars and pickers (sessSums, spent), the day chart's bars,
tooltips and calendar, and the top sessions. A reader who asked for the
cache on the Overview saw two different totals for the same period.
The tab now reads usageTokens everywhere, so the one pick decides for both
pages. Its tokens tile carries the same label pop-up and says the cache's
count in its line; a pick made there refreshes the tab it is on, not the
Overview. The chart's day and week buckets carry the cache's counts now
that their value reads them, and the top sessions, ranked without the
cache, are ranked again by the count the reader sees. The default stays
without the cache, as #2378 left it; the per-session median and p90 stay
counted in and out (Stats.Overview ranks them), and the Requests tab's
totals always counted every token (allTokens).
Run at
|
||
|
|
5dfbca6274 |
cli: magpie settings list|get|set|reset, through the window's own save (#4745)
Stage 1 of #4745 (StringKe): every setting POST /api/settings saves can be read and set from the terminal. - internal/settingsapi holds the save the handler made: Merge (the carry of keys a page leaves out, moved verbatim from api.go, plus upstream's RouterNote line), the vision/imageGen/searcher checks, settings.Save's own checks, catalog.Touched. POST /api/settings and `magpie settings` both call settingsapi.Apply, so a value is checked and saved one way. It sits outside internal/gui so the nogui build has it. - `magpie settings` (list, the default, with value, default and choices; get; set; reset to settings.Defaults()), --json on list and get. Body sends the whole file with one key changed, so a key the save keeps when absent (noBird, refusalRetries, ...) is set even to off. A flag where a key or value goes, an unknown key (with near matches named) or a refused value writes nothing and exits 1; --help prints usage. - Parity guards: TestKeysAreWhatTheSaveWrites (each Settings field sent changed on its own; what the save takes must equal Keys), TestSettingsCLISetsWhatTheWindowSaves (every key the page's prefsKeep and savePrefs send is a key), TestEveryRouteHasACommandOrIsNamed (each /api route has a command or a reason in notYet, which later stages shrink; 36 have one now). - Item 3 of the stage (per-provider CLI-only fields in the window) is left for stage 2. - The open app's in-process follow-ups (fonts, Dock, tray menu, alerts, language, update re-check) run only from the window's save: #4752. Run (mote, at the pushed head |
||
|
|
9097687a31 |
gui: Hide accounts leaves the user's own account names and plans in sight (#3656)
With Hide accounts (账号打码) on, the name a user gave an account (#1515) was blurred like the account, so faketrader's several Antigravity accounts couldn't be told apart; and an Antigravity account whose value is "Google" blurred "Google" of its plan "Google AI Pro" on Usage and on the Providers row. The name the user gave an account is shown text, not an identity. The account is. - provider: a card's Alias says whether it is the user's own name (SubscriptionQuota.Named, set by withAccountNames from AccountNameOf), since Alias is also a plugin's name for an account (PluginUserOf, a masked phone, #4416) or a seat's key plan, and the Usage page and tray panel may have no /api/providers to tell them apart. labelProvider is AccountLabelOf's "plugin:" lookup, shared. - app.js names(): the user's own names (accountNames) and named aliases are no longer accounts to hide; accountUsers, an unnamed alias and a seat still are (noteAccounts keeps an alias without named). - app.js mask(): labels are scoped by element, never by value (LESSONS: scope an exemption by where the value sits). In .own-name, .plan, .acct-plan (the Providers row's plan pill, new class), .model-value and .subscription-head > b only an address is hidden; a plan's and a model's tooltip too (TIPS). The own name's tooltip ("name · account") is masked in full. - .own-name is set only where the text is the user's own: the editor's rename span when it has one (else it shows the raw account and stays hidden), Usage's quota-alias and the panel's pq-user when q.named. From skygunner's patch (95c0511 on |
||
|
|
4c815ac2a5 |
search: searchers picked to follow the one named, tried in their order when it fails (axelburks on Discord)
axelburks asked for more than one searcher, so that when one fails another provider searches. A searcher named in Settings gave way to no other provider before, only to the Search APIs. Automatic already fell back to up to three. - settings: SearcherThen, the searchers after the one named. Entries are trimmed. Blanks, "off", the named one and repeats are dropped. - gateway: when the named searcher fails (the context still live), modelSearch asks each of SearcherThen in order and skips one that can't search now or is the same model. The first that searches answers, and the call is marked searchingInstead, so the Routing row says why the named one didn't search. If all of them fail, their errors go back together, saying "the searchers picked ..., in their order", and webSearch goes on to the Search APIs as before. SearchFailure.Instead names the one that searched in its place. - gui api: searchFailed.instead. A save takes only searchers that Searchers() offers. A save without searcherThen keeps the list, since the page's prefsKeep doesn't send it, and [] clears it. - Settings › Web search (plugins/search/settings.js, outside app.js's budget): an "If it fails" row under a named searcher, with numbered chips and Add. A chip's picker changes the chip or removes it. The row is hidden for Automatic and Off. The failure line names who searched instead, or says the ones after it failed too. The help text says the same in en, zh, zh-TW, ja and de. - docs: gateway-routing's failing searcher, and gui-shell. Tests: - TestPickedSearchersInTheirOrder (gateway): one test where the named searcher answers without searching and one where it fails. A gone entry and one that can't search are skipped, and the third searches once. With no working entry, the error says so and Instead is empty. - TestSearcherThenSaved (settings) and TestSearcherThenFromSettings (gui): what is saved, kept and cleared; refusing an entry that can't search. settings_keep_test sets SearcherThen. - searcher-then.test.cjs: chromium and webkit, en, zh, zh-TW, ja, de, at 560 and 1000 wide. Checks the row's place and words, what Add offers, the posted lists, that the chips fit with no horizontal scroll, that no click moves the page, and both failure lines. Broken by hand: running no fallback turned TestPickedSearchersInTheirOrder red (both subtests: "ds2 searched []"). Not keeping the list on save turned TestSearcherThenFromSettings and the keep test red. Run on mote (mote-run): - At the pre-rebase tree (base |
||
|
|
90c02326bb |
gui: an app takes the gateway over from its older copy once idle, and says any other version serving it (matrix0487)
matrix0487 on Discord: after an update, pi said 404 'magpie knows no model "kimi/k3.1-pro" ... add a provider in magpie first'. The app had written pi a model its older gateway didn't know, and updating the gateway fixed it. A magpie that finds another one serving the gateway used to log it and wait for that one to quit (watchGateway took the port only once nothing answered). Only the Gateway page said so. Now (otherServes, gateway_older.go): - An older released copy of the app (it says serves app or tray, and a pid) is this app's predecessor. Once its /v1/magpie/concurrency says nothing is in flight (gateway.ServedBusy; unknown is never idle), the app quits it the way the Gateway page's button does (quitMagpieOnPort: a magpie only, by its program) and serves the gateway. A stream through it runs to its end first. watchGateway looks again every 15s while another serves. At most three times a run; a quit that fails is left to the button. - Any other one (magpie serve or the service, magpie web, a TUI, a newer magpie, a build of its own) is left running. /api/state carries it as gatewayOther, and the Agents page says it above the list with what to do, plus the take-over button for an older one (gatewaySkewLine, in plugins/gateway/client.js so app.js stays under its budget). A dev build of this magpie says nothing. New strings in zh, zh-TW, ja and de. How the reporter's older gateway outlived the update isn't known: they never said whether one ran separately. A failed handover leaves the old app serving for up to 15m, and a magpie serve left running is another source. Both are covered now: the first is replaced, and the second is said. Known gap: a request that starts between the idle read and the quit gets the older app's short drain. A socket handover between two running apps (no gap) is not built. Run on mote at 0f8ea30bb (this change on |
||
|
|
3f2faef620 |
gui: the Providers page has its own Hide accounts switch
Routing's Hide accounts (账号打码) also masked the Providers page, where nothing showed it was on or let you turn it off (Discord #feedback, 1566189346665799752). The Providers page now has its own switch beside its search box, placed and drawn like Routing's (.rt-mask moved from routing.css to app.css), and each page follows its own switch: Routing, Usage and the tray panel follow magpie.maskEmails, Providers follows magpie.maskProviders. The user's own choice is kept: when maskProviders was never stored, it is seeded from maskEmails and written at once, so someone who had masking on stays masked on both pages after the update, and someone who turned it off stays unmasked. A switch with a stored choice is not changed by Mask personal data's follow(); turning Mask personal data on still masks both (hideAccounts.set(true, true), in app.js and plugins/redact/page.js). show() asks hideAccounts.page() to re-mask when the page in sight follows the other switch. No new strings: the button reuses Routing's translated label and title. app.js 1,310,438, core under its budget, no raise. Run: - New internal/gui/tests/provider-mask.test.cjs, both engines, all 5 languages, at 1000 and 420 wide, plus the touched window-mask, account-eye, privacy-hides-accounts, mask-emails, plugin-name-unmasked, masking-demo-unblurred: 134/134 on mote. At the rebased head (origin/main |
||
|
|
e1aec53895 |
routing: each session sending at once has its own context window, named by its title (tjhhhh on Discord)
tjhhhh runs several agent sessions at once. The Routing page's context
window card followed whichever request came last, so it jumped from one
session's prompt to another's. The card still tells of the request it
picked. Under it, while two or more sessions are live, a strip now
shows one small block per session (renderCtxSessions):
- keyed as the card's line of prompts is (sessionKey, else the
conversation);
- named by the agent's title for the session (sessionName), else its
folder's last level, never a bare id;
- holding that session's newest reading through context.js's stack bar,
exported as window.ctxStack.
A session is live while a request of it is under way, or while its
newest request is within 15 minutes of the newest overall. At most six
blocks show, newest session first. A block keeps its place while the
sessions take turns, because blocks are ordered by each session's first
request. The block the card tells of is lit (aria-pressed), and a click
on a block picks that session's newest request. The card's footer names
the session by its title too. New words are in every locale in
plugins/routing/i18n.js. The strip reuses the card's tokens: no select,
no coloured border, no gradient.
The strip sits under the card, not over it. Over it, the strip's first
appearance moved the card, and routing-ctx-still ("the cache kept its
place") went red in both engines. It is green at base
|
||
|
|
fb29cd30f9 |
tray: the Mac's menu bar figures are regular weight, a lone one in the menu bar's own font (qingnianxiaozhe on X)
Beside Surge's speeds and another app's stacked "0 KB/s", magpie's
"93% / 98%" read visibly bolder, and a lone "98%" too small and too
heavy, so the reporter kept it out of the menu bar. mpRowFont drew two
stacked rows in 9.5pt semibold and one row in 11pt medium, both since
|
||
|
|
ceeb73a0f1 |
app: the desktop app writes its log to app.log; magpie log and Settings › About › Log find it
rayem1w on X (0.1.2330, macOS) was asked for ~/Library/Logs/magpie/serve.log while chasing a Codex "hit a snag" through the gateway, and had no such folder. Only the launch agent (magpie daemon install, written by launchd) and a gateway magpie tui left running wrote a log; the app opened from the Finder, the Dock or the Start menu logged to a stderr nobody reads, on every system. Now runGUI and runPanel (magpie, app, tray, panel, a window view, a magpie: link) call applog.Start before gui.Run. It sends the standard logger (the gateway, the plugin host, providers and Wails' error handler all log through it) to app.log as well as stderr, and points debug.SetCrashOutput at it so a panic's trace is there too: macOS ~/Library/Logs/magpie/app.log Windows %LOCALAPPDATA%\magpie\logs\app.log Linux $XDG_STATE_HOME/magpie/app.log, else ~/.local/state/magpie/app.log portable data/logs/app.log app.log, not serve.log: on a Mac launchd writes serve.log for the service, another process. The file is 0600. At 5 MiB it becomes app.old.log (two files at most); when another magpie (an update's new process) rotated it already, it is only opened again; when it can't be moved it is emptied. stderr goes first, through a writer that never fails, since io.MultiWriter stops at a failed writer and an app opened from Explorer has no stderr. Secrets: the log calls name header names and paths without queries; no key or token was found logged (grep of log.Print* in gateway, provider, plugin, gui, agent). scrub masks bearer/basic credentials, key/token query parameters and sk-, AIza, gh?_ and JWT shapes anyway. How a user finds it: Settings › About › Log, with the path, Copy and an Open that shows its folder (POST /api/settings/log/reveal; the row is hidden in magpie web, which writes no file). magpie log prints where every log is (the app's, app.old.log, the service's, the tui's background serve.log); --path the app's alone, -n N its last lines, -f follows it across a rotation. Docs: reference.md, gui-shell.md, site start (FAQ "Where is magpie's log?" and the CLI table) and privacy (files on your computer), en/zh/ja. Run: At 227ce6074 on origin/main |
||
|
|
e6b851b0fe |
update: magpie update in a terminal restarts the app with its gateway handed over
gaubeebangeel on X has an agent run the magpie upgrade at 4am and had
to give that agent its own provider: magpie couldn't serve it through
the upgrade.
Cause: `magpie update` put the new version in and printed "quit and
reopen magpie to use it" (a .app) or "updated to X" (a binary). The
running app never restarted, so the agent (or the user) had to restart
it by hand, and a plain restart closes the port and drops streams.
Measured before, on mote, a sandbox HOME `magpie serve` with a fake
upstream streaming 61 chunks at 100ms, restarted by SIGTERM + start:
- the stream was cut at chunk 15 of 61 (unexpected EOF); SIGTERM to exit
took ~18ms, no drain;
- requests during the restart: 289 answered, 5 refused over 87ms.
Now `magpie update`, once the new version is in, POSTs it to the
running app's /v1/magpie/restart (gateway/restart.go). It is answered
only to a program on this computer over loopback; a LAN caller, a page
(Origin / Sec-Fetch) and another Host get 403. The updater's
restartBeside (gui/update_beside.go) restarts only when its own exe was
the one replaced (replaced() now also compares a .app's binary,
bundleExe), takes the version as ready without the feed, and runs the
same restart as Settings' AutoRestart: at once when it cuts nothing
short, else through waitIdle. On macOS and Linux that restart is the
existing SCM_RIGHTS handover, so the port never closes and in-flight
streams finish in the old process. The command prints what happened:
restarting (handing the gateway over), waiting for N requests, another
copy (current), magpie serve (unsupported), not running, or too old
(404: the first update into this version still needs a manual
restart).
Tests:
- TestUpdateInATerminalRestartsTheAppWithoutCuttingIt (darwin, linux):
a stream through the gateway, the exe rewritten, magpie update's ask
answered "restarting" with handover; the successor serves a request
while the stream runs, the stream ends whole, the old one quits only
after it. Red by hand with the route removed ("magpie update's ask:
404").
- TestUpdateOfAnotherCopyLeavesTheAppBe, TestRestartAskedOnlyFromThisComputer
(refused cases never reach the restarter), TestUpdateAsksTheRunningMagpieToRestart
(each reply, a 404 magpie, none running).
Run at this tree:
- rebased on
|
||
|
|
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 |
||
|
|
d159314e35 |
gui: a hidden window's WebView2 goes on its low memory target on Windows
molamaker11 on X: "magpie后台占用快接近600MB了。win端 这个能优化一下吗。比如剔除一些动画".
Cause. On Windows the tray panel and the main window are both made at
start and only hidden when closed, so two WebView2 renderers, the GPU
process and the browser process stay up in the tray. They were kept at
WebView2's normal memory target, so a hidden window held what it last
drew: after the window had been open, the GPU process kept ~85 MB and the
main renderer ~70 MB. Animations are not the cost: hidden pages run no
layout or style (LayoutCount/RecalcStyleCount 0 over CDP), the JS heaps
are 5 to 8 MB each, and the Go process is ~40 MB private (liveHeap 25 MB).
Fix. lowWhileHidden (memtarget_windows.go) sets
ICoreWebView2_19::put_MemoryUsageTargetLevel to LOW on each hide and on a
page that comes while the window is hidden (both windows are made hidden,
and get no hide), and back to NORMAL on each show. The page stays loaded
and running, unlike lightweight mode, whose default the owner turned off
on 10-21 because reopening reloaded the page. The vtable slot is 120:
ICoreWebView2_19's vtable holds every inherited method, counted in
WebView2.h of SDK 1.0.2210.55 (a first build that used slot 4 called
get_Source and crashed at start). zoom_windows_arm64.go's reflection walk
to the controller is now chromiumPart, shared with it. macOS and Linux:
WKWebView and WebKitGTK have no memory target magpie can set, so
memtarget_other.go is a no-op.
Numbers. xiaomi-gpu, Windows 11, WebView2 156.0.4314.50, a release build
of each (-tags production,comlauncher -H windowsgui) in its own sandbox
profile with the same seeded sessions and usage (~248 MB of Claude
projects, 72 Codex rollouts, a 4.2 MB usage.jsonl), tray start. The whole
process tree (magpie plus msedgewebview2), private working set (Task
Manager's Memory column) / commit, MB:
v0.1.2297 this change
fresh tray, window never opened 205-209/316-332 81/323
window open, every page clicked 304/482 236/467
1 min after closing it 265/479 69/459
5 min after closing it ~203/~476 64/453
idle 15-30 min later (sampled /5min) 200-214/474-481 -
1 min after closing, by process: GPU 85 -> 2.6, main renderer 70 ->
7.3, panel renderer ~50 -> 1.3, browser ~30 -> 6.2; magpie itself
~47 either way.
The commit charge barely moves: WebView2 trims the pages out of RAM to
the standby list and the page file rather than freeing them, so the
saving is RAM other apps get, not address space.
Reopening. Three trials, each window closed 3 to 5 minutes first, the
time for a view switch and two frames over CDP: the first trial took
901 ms on the first switch after reopening (v0.1.2297: 47 ms), then
12 to 31 ms; the other two trials were the same on both builds (first
frame 132 vs 131 ms, first switch 28 vs 30 ms, then 9 to 46 ms either
way).
Run: gofmt -l internal/gui (clean); on mote GOOS=windows go vet ./...,
GOOS=windows GOARCH=arm64 go vet ./internal/gui, GOOS=linux go vet -tags
nogui ./..., go vet ./..., go build; go test -timeout 45m ./... on this
tree (057c21b30, this commit with a draft message, on
|
||
|
|
2604d68db0 |
routing: the live card stays on the request it tells of while others come at once
qiang2040 on Discord ("狂闪", a screen recording): with Codex
conversations sending at once on group/glm-5.3-flash-free and
group/deepseek-v4.1-flash, the Routing page's top card (head, story,
context window) jumped to the newest request on every trace update,
and to "magpie hasn't routed this request yet" for each new one.
told() picks the request the card tells of: it stays on the one it
shows until that one is done, then goes to the newest, and a newer
request routing hasn't picked for yet doesn't take it from one that
was routed. play(), resume(), the live poll and rebuild() use it;
requests that come meanwhile still fly on the stage, without a caption
of their own. Pinned, replay and day views are unchanged.
Run:
- routing-concurrent-hold.test.cjs (new; two conversations interleaved,
every frame's head watched; en, zh, zh-TW, ja, de): red on the old
code in Chromium (mote); green on this code in Chromium (mote and
WSL) and WebKit (WSL).
- Broken by hand: told() returning newest() -> 6 of 6 red in Chromium
and WebKit (WSL), "the card stays on 101 while it is under way".
- routing-* and panel-routing* in both engines on WSL, against a base
worktree at origin/main: the reds are the same on base. row-swap is
red 3/3 on base too (#3799); live-patch's folded sample caught a
count-up mid-way once (129K vs 130K, the right request; #2174); the
rest are WSL WebKit reds under #4121.
- go test ./... -timeout 45m on mote: 80 packages ok; internal/gui's
10 real-window AppKit tests were killed at their deadlines (mote's
pboard/launchd state, #4125; also #2645, #1936). This change is
JavaScript only.
- The whole GUI suite (node --test, both engines) is still running on
WSL at push time; reds it shows that aren't on file get issues.
- At the pushed head (rebased on
|
||
|
|
7d4a631480 |
tray: pick which of a subscription's windows the menu bar shows (StrikingRaw on X)
Claude Pro's menu bar card drew its 5-hour and 7-day windows as two
small stacked numbers, and the user wanted one of them alone. Settings ›
Usage › Menu bar windows (under Allowances in the menu bar) lists a pill
per ticked subscription with two or more windows ("Claude Code · All
windows"), opening the app's menu: All windows, then each window. The
choice is settings.TrayWindows, by provider id (every account of it, the
in-use "|*" card too) and by window kind from the span ("5h", "1d", "7d",
"month", "15m", "name:<name>" when the span is unknown), so a vendor
reordering windows changes nothing. Unset shows every window as before;
a pick whose windows are all gone shows every window again, never an
empty card. Only the bar's rows and the Linux label are filtered; the
tooltip still says every window. One row draws at mpRowFont's 11pt
single-row size. Hidden on Windows (its tray shows no text). Per
computer through KeepOwn. The GUI learns kinds from trayKind on
/api/usage/quotas (withTrayKinds; model and aside windows get none). The
row's code is a lazily imported traywindows.js, so the core script
budget is not raised (app.js +4 lines for the call and the prefs keep).
Run:
- mote (macOS): go test -run 'TrayWindow|TrayUsage|WithTrayKinds|
CoreScriptBudget|AppScript|TrayImage' ./internal/gui/ ok;
./internal/settings/ ok; davsync TestSync ok. TestTrayImageOneWindow
draws through AppKit: Claude's card one line ("42%"), both windows two;
the PNGs were looked at.
- mote: gofmt -l empty; go vet ./..., GOOS=linux go vet -tags nogui
./..., GOOS=windows go vet ./... ok; go build, GOOS=linux go build
-tags nogui, GOOS=windows go build ok.
- magpie-desktop (Linux VM), --test-concurrency=1, BROWSER=chromium and
webkit: tray-windows (en, zh, zh-TW, ja, de; picking All; hidden on
Windows / single-window / no cards; 360px narrow), i18n-keys,
old-webkit, tray-usages, tray-logos, tray-cost, quota-pace: 43/43 each.
After rebasing on
|
||
|
|
2ec3453647 |
gui: the main window opens where it was left (jorbenzhu)
jorbenzhu on Discord: after every update and restart the panel is back in the middle of the screen. It is the main window: after an update magpie starts again with `magpie gui <tab>`, and Wails opens a window centred unless told otherwise. Its size and maximised state were kept; its place never was (gui-shell.md said "The window's position is not kept"), so nothing was lost on upgrade, there was nothing to restore. The tray's panel opens under the tray icon on the Mac and Windows, and where the click was on Linux, so it is not what moved. Now settings.WindowAt keeps the window's top left corner (system coordinates across every screen), per machine like Window (KeepOwn, and the Settings page's save carries it over). keepAt saves it once a move or resize has rested 500ms, unless the window is maximised, full screen, minimised or hidden; settings.Save writes through temp and rename, and an unreadable settings file is left alone. On the first show placeMain puts it back (putBack): openAt picks the screen holding most of the window and moves it fully onto that screen's work area; when no screen holds any of it (a monitor gone) or the screens or the file can't be read, it stays centred. Under Wayland a window can't place itself, so nothing is kept or restored there unless GDK_BACKEND is x11 (keepsPlace). Run: - mote, at 3f8f1d88b (on |
||
|
|
6d154ef1e1 |
context: scripts (curl, Bun, python-httpx…) are one Scripts card, not an agent each
A request whose User-Agent names only an HTTP library or an SDK (curl, Bun, node-fetch, undici, python-httpx, requests, aiohttp, Go-http-client, okhttp, the OpenAI/Anthropic SDKs, …) or nothing at all got a Context scorecard of its own, as if it were an agent (theforeveriris on X: "Bun", "curl", "python-httpx" cards). usage.IsLibrary names those clients; contextOfRecs folds them and "other" into one "Scripts" card at read time, so older history reads the same way, and the card's meta line and tooltip list the libraries by count. The cached day records are not changed. No setting: it works as is. The Usage page's Agents list still shows each library by name, with its Hide and Count-as-agent controls. i18n for zh, zh-TW, ja, de. Existing context.js comments were condensed so TestCoreScriptBudget holds without a raise (core scripts -28 bytes). Run, at this head (rebased on |
||
|
|
46fb0c1b93 |
gui: the tray panel switches a Claude Code's or Codex's account (shuizhuyu on X)
shuizhuyu asked for a global shortcut to switch accounts. v0.1.2143's Quick panel shortcut opens the tray panel, but the panel had no account switch: switchable() returned null there, because the panel reads no provider list (a fresh /api/providers reads every sign-in, seconds after a start, #1519). Now a Claude Code or Codex not connected has an "account" line in its opened panel row (switchEntry, the window's Switch accounts only menu). The line is drawn from the list kept from the last read (GET /api/providers?last=1, no keychain read; panelAccounts in app.js), read fresh only when nothing is kept. Opening the menu does one fresh read and opens on what it says. Manage accounts… and a lapsed pick open the window's Providers (window/main?view=providers). The provider and login actions now keep their answer as the last list (keepProviders), so a switch made in the window or the panel is in the next kept read. app.js stays under its budget with no raise: my own comments and two older ones (the usage accounts note, the sidebar note) were cut down. Run: - GUI, Windows box (xiaomi-gpu, win-run), Chromium + WebKit: 31 files (panel-*, panel-switch-accounts, agent-switch-accounts, switch-only, claude-switch-only, keep-login, agent-failover, agent-row-disclose, getting-started, click-scroll, i18n-keys, gui-zh-tw, gui-ja, gui-de): 503 of 503 pass. Not the whole GUI suite. - mote: no browser could launch there (pboard down, #4125; every WebKit and later Chromium launch timed out at 180s), so the GUI runs there were cut short. agent-panel-name-width, red there in both engines, is red on origin/main too (#4304, #4203), and this change doesn't draw the closed rows it measures. - mote: go vet ./internal/gui; go test -run 'TestKeptProvidersFollowActions| TestLastKnownProviders|Budget|TestProvider' ./internal/gui ok (includes TestCoreScriptBudget). gofmt -l clean. GOOS=windows go vet ./... ok. GOOS=linux go vet ./... fails only in wails/v3 pkg/application (cgo off when cross-compiling), the same on origin/main |
||
|
|
3bebc38393 |
gui: a key combination opens the quick panel from any app (ben hanks)
ben hanks on Discord asked for a global shortcut that opens the menu bar or tray panel. Settings › General has a new row, Quick panel shortcut, with none set by default. Clicking its field records the next combination: a letter, a digit, Space or F1–F20 with Ctrl, Alt/Option or Cmd/Win, or an F key on its own. Esc or a click elsewhere stops recording, and the cross clears the shortcut. It is shown the system's way (⇧⌘K on a Mac, Ctrl+Alt+K elsewhere). POST /api/settings/panel-shortcut checks the combination, has the running app bind it through Wails' GlobalShortcut (Carbon hot keys on the Mac, RegisterHotKey on Windows, XGrabKey on X11), and saves it only once it is bound. One the system refuses is not saved, the old one stays bound, and the status line says why. A pressed shortcut toggles the panel as a tray click does. The shortcut belongs to each computer (KeepOwn), the Settings page's own save leaves it alone, and the old Mac process lets go of it as it hands over. On Wayland no app may grab keys, so the field is turned off and the row names the command (`magpie panel`) to bind in the desktop's own keyboard settings. Every string is in en, zh, zh-TW, ja and de. No size budget was raised: app.js is 1,315,252 of its 1,315,316 after older comments were cut. Run at this head (rebased on origin/main |
||
|
|
9101bb8879 |
privacy: a request masking would change can go as written to a model you picked
jessyoungyu on X: when a masking rule hits, send the request to a self-hosted model instead, so a prompt like 「百度这家公司怎么样」 gets an answer about Baidu, not about a placeholder. Settings › Privacy › Instead of masking, send to (settings redactRouteTo). It is Off by default, and nothing changes for a user who leaves it Off. It is picked in the app menu, and only models whose every route is unmasked can be chosen: the provider is set to Send requests unmasked, it is on this computer or the network, it has no account, and any fallback or group member is unmasked too (gateway.MaskRoute, the same rule as provider.SkipsRedaction). The setting is saved on its own with POST /api/settings/redact-route, which checks it with MaskRoute. The general settings save keeps the value. Decisions: - When a value would actually be masked on an agent's turn (maskHits.n > 0), serve sends the request to the chosen model unmasked. Warn-only hits don't count, and Block still answers 400. - If that model fails, the request fails. It is never masked and re-sent to the model the agent asked for, and never goes to a cloud model with the unmasked text. Falling back to a masked cloud request would answer a different question in the background. The user picked this route because masking breaks the answer. - Streaming works the same as on any route. - The route is checked again on every request. A model that is gone or no longer unmasked, or that the caller's gateway key may not use, means the request is masked as before. - Covered: agents' Messages, Chat, Responses and Gemini turns (serve, marked by serveAgent), count_tokens, Codex magpie-model turns, and Codex own-sign-in /responses (codexMaskRoute). - Not covered: magpie's own asks (ownAsk clears the mark), embeddings, audio, images and video. These stay masked. GUI: redactRouteRow lives in plugins/redact/settings.js and wraps renderRedact, so app.js is byte-for-byte unchanged and the core budget is not raised. Strings are added in zh, zh-TW, ja and de. Docs: gateway-routing.md, gui-shell.md, and site/public/docs masking (en, zh, ja). Tests: internal/gateway/mask_route_test.go (TestMaskedRequestGoesToTheModelSet: unset, set, streamed, nothing to mask, local fails, falls back to a vendor, no longer unmasked, count_tokens; TestCodexSigninTurnGoesToTheModelSet; TestMaskRouteTakesOnlyUnmaskedRoutes; TestMaskRouteOnlyForTheAgentsTurn); internal/gui/redact_route_test.go; settings_keep_test.go; internal/gui/tests/redact-route.test.cjs (every language, chromium and webkit, 1100 and 640 wide). Broken by hand, each red: - serveAgent without the agent mark; - MaskRoute taking any route (TestMaskedRequestGoesToTheModelSet, TestMaskRouteTakesOnlyUnmaskedRoutes; at the pushed head); - the codex hook removed; - count_tokens without the mark; - ownAsk not clearing it; - no key check; - no reroute in serve; - the GUI: no keep in the general save, no MaskRoute check on save, and the picker listing every model; - the plugin script left out of index.html (redact-route.test.cjs 22 of 24 red; at the pushed head). Run on mote: - at 221ede767's tree, this change on |
||
|
|
af8f3a9399 |
sessions: a new install reads no agent's session history until the user allows it (RustCats on X)
RustCats on X: a fresh magpie showed every agent's session history on
the Sessions page before anyone agreed to it, and asked for a per-agent
choice instead.
- sessions.Reads(agent) (internal/sessions/access.go) is the one gate,
from settings.SessionReads {Asked, All, Agents}. Every lister asks it,
the aggregators (allFiles, callFilesWith, callSourcesWith,
traceLineFiles, wslFiles, DesktopDataDirs) filter by it again, and
readers of an already-listed session (TranscriptOf, ContentOf,
SearchSession, SubagentTranscript, CarryOver, ReadCallSource) return
ErrNotRead, so a cache from before a switch was turned off goes no
further. The Sessions list, stats, /api/sessions/overview, the call and
trace indexes, Usage's agent-file calls and the Codex/Pi title readers
all pass it.
- SettleReads decides once and saves: an install with sessions.json or
a calls-v* cache read sessions before and keeps all on; a fresh one
reads none, not asked. A saved value is never replaced; save, sync and
restore keep it (KeepOwn); only SetSessionReads writes it. An
unwritable settings.json reads nothing this run.
- GUI: GET/POST /api/sessions/reads. While not asked, the Sessions page
shows a consent card: each agent found (by a stat of its folder only)
with a switch, Allow selected and Allow all. Settings > Privacy >
Agents' session history has "Agents found later" and a row per agent.
Strings in en, zh, zh-TW, ja, de.
- CLI: magpie sessions read [on|off all|<agent>...]; magpie sessions
says on stderr when nothing is allowed yet; the TUI's empty Sessions
page says how.
Read either way, because none of it lists or shows a session: the
gateway's own usage ledger, its projections and the conversations it
recorded (magpie's own records, so usage and cost keep working); the
agents' config and sign-in files; Claude Code's and Codex's
history.jsonl last-used time and a session file's mtime for a quota's
first use; Codex's newest rollout's last line before magpie restarts
Codex (codexTurnOpen).
Tests: TestFreshInstallReadsNoAgentUntilAllowed,
TestSettleReadsKeepsWhatWasThere, TestSessionReadsRoutes,
TestSessionsRead, TestSessionsNotAskedSaysHow, sessions-reads.test.cjs
(26 cases: consent and Settings in 5 languages, Chromium and WebKit,
390 to 900 wide).
Run on mote:
- full Go suite (gofmt -l, go vet ./..., GOOS=linux go vet -tags nogui,
GOOS=windows go vet, go build, go test -timeout 45m ./...) at this
change on
|
||
|
|
8e5567161e |
settings: an older settings.json with no Dock choice keeps Hide
v0.1.2060 ( |
||
|
|
1407c9a3bb |
gui: the Mac's window is in the Dock and Command-Tab while it is open, by default (ShouguangCao on X)
ShouguangCao on X: on the Mac, with the window (Settings) open, magpie wasn't in Command-Tab, so going back to it to paste an API key copied in another app took the menu bar. Cause: Settings > Show in Dock already had "With window" (#101: Regular activation policy while the main window is up, Accessory once it closes, in openMain/hideMain through inDock and setDock), but the default was Hide, so out of the box magpie stayed Accessory with its window open. The main window is magpie's only window besides the tray panel, so no other window kind needed it. Change: With window is now the default. inDock is `s.Dock || !s.DockNever && shown || fullscreen`; Hide is a choice of its own, settings.DockNever (KeepOwn, like Dock and DockWindow), and the page reads the choice through dockChoice (With window unless Show or Hide was chosen) and saves dockNever with it. DockWindow is still written when chosen, so an older magpie reading the file keeps With window. The tray panel never calls dock(), so it is unchanged; Windows and Linux have no Dock (setDock is a no-op there) and are unchanged. For existing users: Hide was the default and was stored as nothing, so a user who picked Hide before can't be told from one who never chose; both now get With window, and choosing Hide again sticks (dockNever). Run on mote at origin/main |
||
|
|
75a7db27b9 |
usage: an allowance card can be hidden from the Overview (whqtian_07012 on Discord)
whqtian wanted StepFun's plan card on Usage › Overview without its
balance card. Right-click a card (or long-press it on a touch screen)
and the app menu offers "Hide from Overview". With several accounts on
one card it says "Hide this account from Overview". A plan card that
carries its key's balance also offers "Hide its balance from Overview",
which keeps the plan. Each hidden card is saved as its tray card id plus
its kind (stepfun|balance, kimi|me@x|plan) in settings.UsageCardsHidden,
through POST /api/usage/arrange (cardsHidden). The Settings save keeps
it. Under the cards, a quiet "{n} hidden" line opens them, each with
Unhide, and Show all from two. It is the same pattern as the Agents
list's hide.
Display only: routing, caps, counting, the Accounts list, the tray
panel's Allowances (it has its own Arrange) and the menu bar cells
never see it. A cell clicked for a hidden card shows it until the page
is left (usagePeek). UI: the app menu, not a native select, no
coloured stripes, no new button on the cards.
Run at this head (rebased on
|
||
|
|
6915c8cdea |
agents: a model list's button says its ticks: all, one or two by name, or how many of how many (NG_shiyu on X)
NG_shiyu on X: the closed model field reads 「路由组,模型+数字」 on one row and just 「路由」 on another, while the menu opened shows every model either way. Why: two different controls stand in that place. An agent whose own model menu is the list picked here (ZCode, Claude Desktop, Cursor Private Inference, WorkBuddy, T3 Code, ...: listsMenu) has a multi-select list, and menuSaid named its first two ticked models and "+N". Routing groups are listed first, so with every model on it read "Never stuck, DeepSeek Pro +2": like a pick of one group and one model. Every other agent's start picker names the one model or group it starts on, e.g. a group named 路由. Neither said "all". Decided: the list's button (and the panel row's words) says what its ticks are, as the open checklist shows them and as the Models entry already words it (fillModelsEntry): - every model ticked: "All N models"; - one or two ticked: their names (蓝猫's few-picked case, |
||
|
|
317aa54d9c |
agents: a click anywhere on a connected agent's row opens or closes it (NG_shiyu on X)
NG_shiyu, new from CC Switch: on the Agents page the space between a
row's name and its model did nothing; only the small "Models {n}" link
with its arrow opened the row, which is a long way to aim on a large
screen. A disclosure row on the Mac opens on a click anywhere on it,
and the panel's rows already did.
connectRow now hands a click on a connected row to that link
(expandLink), so the link stays the one control the keyboard and a
screen reader use, with its aria-expanded. Buttons, links, inputs,
labels, anything with a role (the start picker, the switch), the grip
(still hover-only) and the opened sheet (.ag-exp) keep their own
clicks, and a click that ends a text selection does nothing. An
unwired row has nothing to open and is unchanged.
Run:
- agent-row-disclose.test.cjs (new): window at 1100px and 560px, en
zh zh-TW ja de, Chromium and WebKit: 20/20 pass. It clicks the empty
gap between the name and the link, checks aria-expanded follows, that
a click inside the sheet keeps it open, the name and the link toggle
it, Enter on the link toggles it, the picker opens #pop.model-picker,
the grip .pop.row-menu and the switch its #modal ask without opening
the row, the scroll position is unchanged, no overflow, no page
errors. On the old app.js it fails ("the row didn't open", webkit en
1100).
- click-scroll, agent-expand-steady, zcode-models, cursor-local-models,
desktop-model-menu, agent-menu-label, i18n-keys, both engines: all
pass except i18n-keys' "a plugin's words are its own" ("Runs as" in
plugins/library/i18n.js vs internal/cli/claude_code_cli.go), which
this change doesn't touch (#3897).
All of the above ran at base
|
||
|
|
5eab14a8cc |
plugin pages: magpie web reaches a page's local service on its own address, so the chat page works from another computer
aigcfree (Discord DM) runs `magpie web --addr 0.0.0.0:3430` on an Ubuntu
server behind nginx and opens it from a Windows PC. Plugins -> 对话
(@magpie-community/page-chat) showed "127.0.0.1 refused to connect": the
page sends its frame to the chat server on 127.0.0.1, which in that
browser is the Windows PC.
A plugin now declares its page's service (package.json
magpie.page.service {port, option}: the port, or the plugin option that
holds it, from its plugins.json options; plugin.ServiceSpec). Served to a
browser (isWeb), /api/plugin-pages gives the page `service`:
_magpie/service/ under its token, and the bridge hands the frame
magpie.service as an absolute address. The desktop window and slot pages
get none, and the routes answer 404 there, so the local path is as before.
servePageService reverse-proxies /_magpie/plugin/<token>/_magpie/service/…
to 127.0.0.1:<port>. The service stays on loopback. The way in is the
page's own: the per-run token that only a signed-in /api hands out,
behind AllowGuard. Nothing is weakened:
- Host is set to 127.0.0.1:<port>, which the service's rebinding check
wants.
- The window's cookie is taken off.
- Origin must be absent or null (403 otherwise).
- Set-Cookie is dropped.
- Every reply is sandboxed (sandbox allow-scripts; frame-ancestors
'self'), with Referrer-Policy no-referrer and nosniff.
- The gateway's own port is never served, since a request from this
server is loopback and the gateway takes that without a key.
- Event streams flush as they come (FlushInterval -1, X-Accel-Buffering:
no for nginx). webCompressed no longer gzips text/event-stream, which
held a stream back until gzip's buffer filled.
- A redirect to the service's own address is made relative.
- The entry starts the plugin host as the page's HTML does (pageHost).
- A service not up yet answers its frame with a 502 page that tries
again in 2s.
page-chat 0.1.2 (magpie-community/plugins 4a46212, on dist) declares the
service, goes to magpie.service when given one (else 0.1.1's path:
127.0.0.1 on loopback, the SSH-tunnel note from elsewhere), and asks
api/… by relative address.
Docs: plugin-runtime.md P4 (the page row), gui-shell.md (no gzip for event
streams).
Tests: TestPluginPageServiceListedToBrowserOnly, TestPluginPageServiceSpec,
TestPluginPageServiceProxied (through webHandler: Host, cookie, Set-Cookie,
CSP, escaped path and query, foreign Origin 403, made-up token 404,
redirects, SSE first event before the end and not gzipped),
TestPluginPageServiceDown, TestServiceLocation; plugin-page.test.cjs
checks magpie.service in a browser page and its absence in a slot.
Run at 276683d85, this change on origin/main
|
||
|
|
3959192e94 |
gui: Settings' web search rows move out of app.js to plugins/search/settings.js (#4133)
TestCoreScriptBudget was red on main: the context map's tile wording ( |
||
|
|
0ee31d4736 |
gui: Routing and Usage keep the reader's place when wheeled as they open, heard late or never (issennknight)
issennknight on Discord (macOS 13.7.8, v0.1.1902), after |
||
|
|
a0ba8e1f2e |
grok: each model's context_window follows Long conversations, and one set by hand stays through a sync (uk.jent)
uk.jent (Discord #feedback) reported that magpie writes every Grok Build model's context_window as the model's whole window. They wanted about 300K without editing dozens of models, and they lost hand edits on each sync, because SetTOMLTables replaces the [model."magpie/..."] tables whole. Grok Build now uses Long conversations, the mechanism Codex and Claude Code already use. grokWindow gives: - min(window, Compact) when the model or provider has its own threshold; - otherwise settings.Working(window): 272K by default on longer windows, the typed size, or the whole window with Full context. What magpie wrote is stashed under grok:<path>:windows, and grokOwnWindow uses it to tell a hand edit apart: - A value that differs from what magpie last wrote is the user's, and it stays. - In a config written before the record, a value other than the model's whole window is the user's. - Disconnect forgets the record. The agent sheet's Long conversations row now shows for Grok Build (AGENT_PREFS). Its texts, the provider editor's hint, the Context tab's note and `magpie model compact` now name Grok Build, in en/zh/zh-TW/ja/de. setCompact and setAsync now share prefWrite. That dedupe keeps app.js under its budget, which is not raised. Behaviour change: a Grok Build model whose window is over 272K now gets 272K by default, as Codex does, unless Full context is on. Run on mote, at this head (c893c2229, rebased on |
||
|
|
a1f06bd780 |
gui: a browser tab offers the fonts of the computer it runs on (Norcleeh)
Norcleeh (Discord #general): magpie in Docker, used through the web GUI,
Settings' font menu doesn't list the fonts he installed on his own
computer; the app does. Cause, confirmed in the code: a tab's list is
/api/fonts, the server's families (none in a nogui build such as Docker)
plus commonFamilies, filtered by what the browser draws. A family that
is only on the browser's computer was never offered, and a choice the
server doesn't list was dropped by desktopFonts.available.
Now (webfonts.js, which only a browser tab loads; the app's windows are
unchanged):
- Where the Local Font Access API is (Chromium on https or localhost),
the press that opens a family menu calls queryLocalFonts() once a
page, and at load when the local-fonts permission is already given.
The families join the list with their real styles ("SemiBold
Condensed Italic" -> weight 600, 75%, italic).
- Elsewhere (Safari, Firefox, a plain-http LAN address, a refused
permission) the menu's search says "Search or type a font name…" and
offers Use "name" for a family the list lacks, enabled when the canvas
probe says this browser draws it, greyed with "This browser can't find
this font" when not; Enter takes it.
- A chosen family the server doesn't list stays in the tab's list on
later loads while the browser draws it, so it keeps being applied.
- The app's menu (openProtoMenu), never a <select>. Strings in zh,
zh-TW, ja and de. docs/subsystems/gui-shell.md says so.
Budget: no raise. here() moved out of fonts.js into webfonts.js, which
isn't a core script: loadFonts import()s it in a tab only (the page has
no CSP). The core is 106 bytes smaller than origin/main's.
Run (mote-run). At this head on
|