Commit Graph
3181 Commits
Author SHA1 Message Date
yetone e001d95acd gui: a subscription's many accounts fold on the Usage page — a card of more than eight accounts (Linx on X: twenty-odd on one plugin for its daily check-ins, "顶成擎天柱") shows the first five, any opened in full and the one carrying the check-in switch, the rest behind "Show N more accounts" at its foot, as a card of many keys does; it opens them in place without moving the page and is remembered by provider (magpie.usageAcctsAll). Eight or fewer, cards of keys and the tray panel are as they were. The strings were already in zh/ja/de. usage-accounts-fold (22 WorkBuddy AI, 9 Trae with one in full and a check-in switch past the fifth, 8 Codex; open and fold by mouse, reload, 440px) passes in Chromium and WebKit, en/zh/ja/de, and fails without the fix. usage-keys-fold, usage-accounts, usage-checkin, usage-fold, usage-card-refresh, usage-quota-head, usage-arrange, usage-refresh, panel-usage, tray-usages, click-scroll, quota-read-at, quota-pools, quota-families, i18n-keys, gui-ja and gui-de pass. On a sandbox with the real accounts (Command Code's two, threshold set to one for the run) the button folds and opens the real card in place in Chromium and WebKit. 2026-10-06 10:10:06 +08:00
tsuixl db55bc8b7a gui: reject unknown Codex auto-review models from known providers (#938) (#943)
Resolve deliberately accepts arbitrary model names under an existing provider.
The auto-review setting consequently accepted fake/missing and fake/, replacing
a valid reviewer with one that fails when Codex requests approval.

Validate against the served catalog at the settings endpoint. Keep model and
group choices, unlisted providers, whitespace trimming and clearing. Rejected
values leave the saved reviewer and model-list tag unchanged.

TestCodexAutoReviewSetting fails against the upstream API with fake/missing
and fake/ returning 200, and passes with the fix. Focused auto-review tests,
go vet ./..., the Windows build and Linux nogui build pass. The full Windows
suite has failures also reproduced with upstream production code; details
are recorded in the PR.
2026-10-06 09:26:04 +08:00
yetone 28049bd290 gateway tests: the rewind tests wait for the rewind to be asked before the resend — letGo runs on its own after the request given up on returns, and keeps the run for the resend just before it tells Claude Code to rewind; the tests sent the resend at once, so under load it found no run kept and started a new one (TestClaudeTurnGivenUpOnIsRewound: "the resend went to another Claude Code"; NotRewound/refuse: "2 runs"), and the refuse case's rewind still read rewindLongest as the silent case set it (the data race in CI run 37395880309 on 2bd49cc5). rewindAsked waits for the rewind_conversation line in the stand-in's log; the resend then waits on the rewind as a real one does. Test-only: a user rewording a message is never that quick. Before, go test -race -count=30 -cpu 1,2 of the four rewind tests failed IsRewound once; with this, -count=40 -cpu 1,2 passes. 2026-10-06 09:10:31 +08:00
yetone 2bd49cc545 plugin: magpie plugin update in a terminal restarts the app's plugin host (#952, mxzs123) — the running magpie noticed another magpie's plugin change only by plugins.json, which an update leaves as it was (the spec stays, bun installs a newer version), so the app's host went on answering with the old code (0.1.17 after the update to 0.1.18, still 403) until it was killed. The stamp checkList compares now also covers what is installed: Dir()'s package.json and bun's lockfile; and Restart takes the stamp as it is, so this magpie's own install isn't taken for another's and restarted twice. In a sandbox (serve on 3476 under its own HOME, the Factory plugin at 0.1.17, unpinned spec; a request, then magpie plugin update in another process, then a request): on 2d85a086 the host process stayed the same (58657) with 0.1.18 installed; with this change it was replaced (60004 → 60583) and the old one stopped. TestTerminalUpdateRestartsTheHost is new and fails without the change; go vet and go test -race -tags nogui ./internal/plugin/ ./internal/provider/ under a temp HOME pass. 2026-10-06 08:47:59 +08:00
yetone 2d85a08635 factory: moved users get plugin 0.1.18, which cuts pi's opening sentence to its first half (#952, mxzs123) — pi 1.0.4 through the plugin got 403 "Factory: Forbidden" for "hi" on DeepSeek (chat completions) and Claude (Messages); the reporter's replays found Factory refusing "You are an expert coding assistant operating inside pi, a coding agent harness." whole, and pi's full request answered with it cut to "You are an expert coding assistant.". 0.1.18 (magpie-community/plugins 4d6dcca, on npm) does that in system and developer prompts on every route; the mover's min is raised so keepMovedCurrent updates moved users. The built-in, which has none of the plugin's Claude Code adaptations either, is unchanged. Not tried against Factory itself (no Factory account here). go vet and go test -tags nogui ./internal/provider/ under a temp HOME pass. 2026-10-06 08:10:48 +08:00
yetone 9abfbff607 cleanup: gofmt the 15 Go files main had unformatted — whitespace, comment alignment and three one-line funcs gofmt opens up; nothing else. go build and vet -tags nogui pass. 2026-10-06 07:43:47 +08:00
yetone 237d216b52 provider tests: TestUnreadLoginsNotWrittenOver counts only the copies kept from its second step — the first add also keeps the half-written file aside (writeLogins always does), named by the second; on a Mac both adds fell in one second and shared a name, on Linux CI (run 37380281215, 8278ccf2) they crossed a second and the test saw two. The test now removes the first step's copy. With a 1.1s pause before the second step the old test fails as CI did and this one passes; -race -count=20 passes. 2026-10-06 07:12:03 +08:00
2cc663d0a2 gui: protect unsaved edits and confirm destructive actions (#820)
* gui: edited forms ask before they are discarded, removals ask before they take effect, and the header keeps its first layout — Cancel, Escape, the backdrop and a page change could throw away a provider's draft, and several account, key, plugin and library removals took effect at once. Modified provider, settings, library and routing forms now ask before discarding; unmodified forms still close without asking, and refresh or closing the browser tab uses its leave confirmation. Removal and discard confirmations are in-app dialogs over the intact editor, centered, with Cancel focused first, Tab kept inside, Escape canceling and focus returned afterwards; destructive buttons have readable foregrounds in light and dark themes. Text and connection settings have Save/Cancel rather than saving on blur; simple switches still save at once. Editors associate labels and help with fields, make the background inert while open and keep focus through redraws; navigation keeps browser back/forward history and its current-page state, errors remain until dismissed or replaced, and focus and validation can scroll into view. Mobile settings tabs have larger targets, fields use 16px text and page zoom stays available. layout.js applies mode and platform before the header paints, theme.js applies the saved text size before styles, and mode-specific window controls stay hidden while app.js downloads. zh/ja/de strings added. routing-shape's global .rt-day selector selected the hidden By session button on WebKit; its history click now stays in .rt-days. ux-safety covers unchanged and modified closes, canceled and confirmed removals, Escape, backdrop, modal focus, light/dark centering and button contrast, explicit saves, browser history and sync-form discard. Rebased onto upstream/main 2f183c4c. Chromium and WebKit each pass 31 related browser tests in en and zh; gui-ja and gui-de pass all 6 browser and translation-parity tests. go vet -tags nogui ./..., go build -tags nogui, go test -tags nogui ./internal/gui, JavaScript syntax checks and git diff --check pass.

Co-authored-by: XYenon <register@xyenon.bid>

* gui: edited providers, routing groups and library forms ask before their drafts are discarded, and only immediate removals ask before taking effect — Settings keep saving on Enter and blur, switches save at once, and the reader's scroll position is restored after an unasked-for scroll. Header rows, fallback models, group members, patterns and rules stay ordinary reversible draft edits. The confirmation dialog keeps its own readable destructive colors; the window's text selection, muted and faint colors, timed status messages, replaceState navigation and iOS viewport policy stay as before. The keyboard scroll assertion is restored, and click-scroll's date buttons are scoped to .rt-days .rt-day so WebKit cannot pick a hidden request-grouping button. The safety tests cover dirty editor closes and page changes, immediate provider deletion, labels, modal focus, Escape and backdrop cancellation, with the withdrawn settings, history and persistent-error assertions removed. First-paint layout and the saved theme/text size remain early.

Co-authored-by: XYenon <register@xyenon.bid>

* gui: old WebKit gets its layout before the header paints, and browser tests answer the new discard and removal questions — compat.js runs before layout.js, whose viewport setup uses ES5; the confirmation uses vh rather than Safari 15.4 dynamic viewport units. Opening a provider from its address keeps the editor pending until its page loads, and fields keep their own nested labels when Names & levels is reopened. An empty model preference map is compared as Save sends it, so opening model settings without changing anything closes without a question. Removal tests assert nothing is sent before confirmation; draft tests answer Discard and retain their Save and Cancel assertions. Plugin migration uses the reader’s wheel rather than a scripted scroll, keeping every scroll assertion. Targeted WebKit regressions pass 40/40, Chromium regressions pass 41/41, and the model-setting and editor-safety checks pass in both engines. go vet -tags nogui ./..., go build -tags nogui, JavaScript syntax checks and git diff --check pass.

Amp-Thread-ID: https://ampcode.com/threads/T-01a108b0-c6a0-768d-ad6a-9a571a10a847
Co-authored-by: XYenon <register@xyenon.bid>

* gui tests: the upstream model list keeps folding with the new discard question — models-fold answers Discard only after picking another model; the short list and an unchanged folded list still close without asking. ux-safety waits for its Relay row rather than matching loading placeholders. Rebased onto upstream/main c353f7bd, including the new model-list expansion. models-fold passes in WebKit and Chromium, as do the English and Chinese editor-safety checks; the related model drafts and first-paint phone tests pass on WebKit.

Amp-Thread-ID: https://ampcode.com/threads/T-01a108b0-c6a0-768d-ad6a-9a571a10a847
Co-authored-by: XYenon <register@xyenon.bid>

* gui: an editor redraw keeps its removal confirmation and menus interactive — Only a fresh modal makes the existing background inert, and closing restores exactly the elements it changed. A redraw no longer disables a confirmation or popup appended over the editor; elements already inert and overlays added later retain their own state. The original background is retained if a new editor interrupts the closing animation. ux-safety redraws Relay twice under its Remove confirmation, clicks Cancel, and verifies no deletion was sent; it also picks a menu item after an editor redraw and checks background restoration. The regression reproduced on WebKit before the fix. All 8 English and Chinese safety checks pass on WebKit and Chromium. The related WebKit removal, draft, routing and phone checks pass, with account-arrange passing separately after a detached-element race in the concurrent run. go vet -tags nogui ./..., go test -tags nogui ./internal/gui, go build -tags nogui, JavaScript syntax and git diff --check pass.

Amp-Thread-ID: https://ampcode.com/threads/T-01a108b0-c6a0-768d-ad6a-9a571a10a847
Co-authored-by: XYenon <register@xyenon.bid>

* gui tests: editor safety uses the page's boot preferences, not its settings — gateway in boot.js is now the gateway-mode flag, whereas settings.gateway is the gateway's URL. Spreading settings into the fixture boot data mistook the URL for gateway mode and redirected a dirty editor's attempted page change back to Providers. The fixture now emits the same language, theme, text size and web fields as the server. The 8 English and Chinese editor-safety tests pass on Chromium and WebKit; gateway-mode, plugin middleware and plugin-market pass on WebKit, and phone-web passes separately after a scroll race under concurrent load. Rebased onto upstream/main 2f135ed4 with gateway-mode navigation and initialization retained. go vet -tags nogui ./..., go test -tags nogui ./internal/gui, JavaScript syntax and git diff --check pass.

Amp-Thread-ID: https://ampcode.com/threads/T-01a108b0-c6a0-768d-ad6a-9a571a10a847
Co-authored-by: XYenon <register@xyenon.bid>

* gui: upstream's new removals and fields follow the editor-safety rules too — Audited GUI changes from the original PR base 2f183c4c through upstream/main 9debc583, including earlier rebases. Bulk group removal uses the in-app consequence dialog rather than a second click, and clearing middleware options asks before deleting saved options. Cancel sends nothing and keeps the selection or editor. Custom group context, Settings' compact threshold, the inline key-weight input and middleware JSON have accessible names; the JSON note/error and group context hint are linked, and invalid input is exposed. The copy-out-of-date skill action is a keyboard button supporting Enter and Space. A skill's immediately saved per-agent transfer choices update the modal baseline, so Done, Escape and navigation no longer ask to discard already saved changes. Settings save behavior, draft-only removals, scroll guard, viewport and themes stay intact. Chinese, Japanese and German consequence strings added; obsolete bulk-removal armed styles and strings removed. The six affected browser files pass across Chromium and WebKit in English and Chinese (54 tests after scoping compact-at to its provider rather than skeletons). Additional provider price, key import/weight, group member/first-token, caller-key, purpose and gateway-mode regressions pass on WebKit; key-weight also passes in Chromium, with a concurrent status-message race passing separately. go vet -tags nogui ./..., go test -tags nogui ./internal/gui, go build -tags nogui, JavaScript syntax and git diff --check pass. The Chinese bulk confirmation was rendered and inspected on WebKit.

Amp-Thread-ID: https://ampcode.com/threads/T-01a108b0-c6a0-768d-ad6a-9a571a10a847
Co-authored-by: XYenon <register@xyenon.bid>

* gui: new upstream key removals and nested group jumps keep the editor-safety rules — Bulk deletion of failing, off and matching keys uses the app's consequence dialog, with Cancel and Escape sending nothing and a redraw leaving its buttons interactive. The shared group-editor entry asks before replacing a dirty draft, and nested navigation waits for acceptance before upstream's explicit scroll. Codex's Sign out uses its existing confirmation once. Group and key filters have accessible names. A focused model-price input is included in leave protection before its change/blur parser runs, and reverting the raw value is clean. Settings saving, scroll protection, draft-only removal, viewport and themes retain their upstream behavior. The affected flows pass in Chromium and WebKit, English and Chinese; Names & levels also passes in Japanese and German. The price fixture focuses before filling because the previous blur normalizes sibling fields, a race reproduced on upstream. go vet -tags nogui ./..., go test -tags nogui ./internal/gui, go build -tags nogui, JavaScript syntax and git diff --check pass. The Chinese bulk-key dialog was rendered and inspected on WebKit.

Co-authored-by: XYenon <register@xyenon.bid>
Amp-Thread-ID: https://ampcode.com/threads/T-01a108b0-c6a0-768d-ad6a-9a571a10a847

* gui tests: Codex's newly removable active account waits for the consequence question (#820) — The latest upstream multiaccount Remove path uses accountAction's immediate-removal dialog. Its test now verifies that the first click sends nothing, Cancel keeps the account, and accepting sends exactly one login/forget request. The original account, status and translation assertions remain. Rebased onto upstream/main 8d3cf5f8; the final Codex, nested-group, bulk-key, focused-price and editor-safety tests pass 48/48 across Chromium and WebKit in English and Chinese. Upstream's new quota, skill-group, hit-rate and translation checks pass; search-first's detached-element failure reproduces on isolated upstream. The complete WebKit suite ran 1413 tests before this final upstream delta, with 1289 passes and 124 failures; failing files were compared with upstream or rerun separately. Syntax and diff checks, go vet and the nogui build pass.

Co-authored-by: XYenon <register@xyenon.bid>
Amp-Thread-ID: https://ampcode.com/threads/T-01a108b0-c6a0-768d-ad6a-9a571a10a847

* gui: the Sessions agent strip reports which reused button is selected (#820, #929) — Rebased onto upstream/main 1330b966, retaining the strip's own scrolling, visible selected agent and preserved buttons. Each redraw updates aria-pressed for the selected agent and clears it for the previous selection. The regression checks All initially, the unselected alternatives, then Zed selected with All cleared; on unmodified upstream it fails with null instead of true. Both strip files pass 8/8 across Chromium and WebKit in English and Chinese, including narrow and wide layout and scroll assertions. The latest ChatGPT API, Codex and editor-safety browser checks pass 32/32. Final GUI, Agent, Provider and Gateway Go checks, go vet -tags nogui ./..., Linux nogui and Windows builds, syntax and diff checks pass. Linux native GUI build is blocked by the orb's GTK 4.8 lacking APIs used by Wails beta.24. The complete WebKit run finished with 1289 passes and 124 failures; all failing files were checked against upstream or rerun separately, with details retained in the review artifacts. The full Go suite's sole sessions rewrite failure also reproduces on upstream.

Co-authored-by: XYenon <register@xyenon.bid>
Amp-Thread-ID: https://ampcode.com/threads/T-01a108b0-c6a0-768d-ad6a-9a571a10a847

* gui: closing editors immediately give clicks back to the page (#820, #944) — Restore the background when the close animation starts and protect it again when an editor reopens. Both New group buttons and the model entry ask before replacing a dirty routing draft; creating a group from a provider waits for navigation to be accepted. The GUI shell reference describes these transitions.

The real mouse click during closing fails without the change in all four engine/language combinations, with null instead of received. The unguarded New group and model entries fail waiting for the discard question; the old model navigation creates a routing draft even after Cancel. ux-safety, provider-remove, click-scroll and group-new-head pass 50/50 in Chromium and WebKit, English and Chinese. Closing/reopening also passes five additional rounds, 20/20. After the final upstream translation and TUI additions, i18n-keys, Japanese/German, ux-safety and group-new-head pass 23/23. Ten Chromium update-wait runs have no no-click-scroll failure; two fail on the Restarting status assertion, also reproduced on upstream.

The complete WebKit run finished with 1,307 passes and 141 failures across 1,448 tests, with no skips or cancellations. It is not green: failures in 63 of its 70 failing files also occur on upstream; the other seven files pass separate PR reruns. The complete suite preceded the final upstream translation deduplication, whose resolved keys and values are unchanged, and the TUI/docs additions. go vet and the Linux GUI build with the Makefile's gtk3 tag, Linux nogui and Windows builds, GUI/TUI Go tests, syntax and diff checks pass. Full nogui Go tests are not green: the sessions same-size rewrite check and the final run's WebDAV slow-transfer stall both reproduce on upstream with -race -count=20 under an isolated HOME with pinned caches.

Co-authored-by: XYenon <register@xyenon.bid>
Amp-Thread-ID: https://ampcode.com/threads/T-01a108b0-c6a0-768d-ad6a-9a571a10a847

---------

Co-authored-by: Amp <amp@ampcode.com>
2026-10-06 06:57:49 +08:00
yetone 9e22ed4461 gui: a provider's many keys fold on the Usage page — a card of keys, each its balance (KeyBalances: OpenRouter, DeepSeek, any provider whose balance is read per key), listed every key, a very long card (361 on Discord). It shows the first three (and any in full), the rest behind "Show N more keys" at its foot, which opens them in place without moving the page and is remembered by provider (magpie.usageKeysAll); the keys' sum in the head when each is one amount in one currency; the head's accounts button counts the keys in sight. Four keys or fewer, and a subscription's accounts, are as they were. zh/ja/de added. usage-keys-fold (12 OpenRouter keys, 5 DeepSeek with one unread, 4 Moonshot, 5 Codex accounts; folded, opens and folds by mouse without the page or card moving, reload, 440px nothing cut) passes in Chromium and WebKit, en and zh, and fails without the fix (all 12 keys listed). usage-unpriced-names, i18n-keys, gui-ja, gui-de, usage-fold, usage-accounts, usage-arrange, usage-card-refresh, usage-quota-head, panel-usage, click-scroll, balance-curve, balance-parts, api-key-usage, quota-read-at and tray-usages pass; vet, darwin/linux/windows builds and go test ./internal/gui/ pass. 2026-10-06 06:46:59 +08:00
yetone 1e0436250a gui: a cost note names a model an agent recorded no name for — tokens under model "" are kept (nonzero) and unpriced, so Usage › Sessions' cost header read "未计入:,没有已知价格" / "Not counted: , with no known price" (tony, Discord). sessModelNames lists the names for every cost note (header, Overview cost tile, a row's cost and models, the detail's model list) and calls a blank one "a model with no name" (zh/ja/de added). usage-unpriced-names checks the header, a row's cost and models in Chromium and WebKit, en and zh; it fails without the fix ("未计入:,没有已知价格"). i18n-keys, gui-ja, gui-de, sessions-usage-open, usage-sessions-agents-fit, currency and sessions-overview pass. 2026-10-06 06:46:59 +08:00
yetone 745dde65b0 gui: the gateway watch ends with the backend, and TestGatewayTakenOver no longer leaks it — watchGateway looped forever, so each run of the test left its watch (and the gateway it took up) running after the test: under -count the old watches read gatewayWatch while the next run wrote it (3 DATA RACEs in 20 runs), and once a run's cleanup put HOME and MAGPIE_ADDR back an old watch could serve the gateway on the default address under the real HOME, which set served in the next run before its other magpie was gone ("took the gateway while the other had it", 3 of 20 with -race -count=20 on 8e853a63; the #948 review saw 3 of 10). watchGateway now takes a context and an interval and returns when the context ends; startBackend gives it backendCtx, so it also stops with stopServing instead of starting a gateway after the backend has ended. The test runs the watch on its own context and, at cleanup, stops it and the gateway it took up before its environment is restored. gatewayWatch is a const. TestGatewayTakenOver passes 50 of 50 with -race -count=50; go test -race -tags nogui ./internal/gui/ ./internal/tui/ pass; vet, darwin, linux (nogui) and windows builds pass. 2026-10-06 06:45:48 +08:00
yetone 8e853a63e0 cleanup: staticcheck SA4006 — the GitHub token test now checks the status GET /api/settings answers (its code was read and dropped), and BackAt declares at rather than assigning a value every branch overwrites. The gui token test and provider tests pass; SA4006 is clean in gui and provider. 2026-10-06 06:39:17 +08:00
yetone 8fb09d03c6 cleanup: drop redact.Known and the quotaWire type — nothing calls either (deadcode -test -tags nogui, git grep). vet on darwin, linux, windows; redact and provider tests pass. 2026-10-06 06:07:02 +08:00
yetone 8278ccf290 gui tests: plugin-move scrolls Zed's editor with the wheel and presses Move where it is — the test set .ebody's scrollTop to 120, which took the Move button out of sight, so Playwright's click scrolled the body back first (120 → 60 or 0, "the failure moved the editor", Chromium, failing in zh on 6e623d16 and in both languages after). It now wheels only as far as the button stays in sight, and presses it with the mouse, checking it is in sight; "the failure/the move moved the editor" are unchanged. Passes in Chromium and WebKit, en and zh, twice. 2026-10-06 05:56:47 +08:00
yetone 9c13625c34 gui tests: currency clicks ¥ CNY where it is, with the mouse — settings rows were added, so in zh the wheel to the page's foot leaves the currency row 0.3px under the header, and Playwright's own scroll into view before its click moved the page a pixel (156 → 155, WebKit); a mouse click there moves nothing (probed: down and up keep 156). The "picking a currency must not scroll" check is unchanged. Passes in Chromium and WebKit, en and zh, twice; failed in WebKit zh on 6e623d16. 2026-10-06 05:56:47 +08:00
yetone 2d837c693a gui: a "Saved" (or any outcome) in the footer no longer makes the page above it 1.5px shorter — ef13e07e's pill (12.5px text, 3px padding) stood 23.5px in the footer's 22px, so each outcome that came grew the footer to 29.5px and the view shrank under the reader; in WebKit a settings page scrolled to its foot moved a pixel on a pick. The pill's line is 16px, so it fits. currency checks #view-settings keeps its height when picking ¥ CNY saves; it fails without the fix (400.5 !== 402, Chromium) and passes with it in Chromium and WebKit, en and zh. cli-update, group-member-info, keep-awake, model-copy-id, model-test-one, panel-profiles, panel-usage, project-servers, rate-limited-sink, routing-levels, routing-compact, sse-body, tray-*, usage-alert, usage-ledger, old-webkit and click-scroll pass in both. 2026-10-06 05:56:47 +08:00
yetone 424fd48449 gui tests: usage-refresh-flight and usage-refresh wait for the Overview's figures, not its skeleton — renderUsageLoading fills #stats with four .kpi.loading-kpi tiles while the opening read is on its way, so "#stats .kpi" was found before the page had its numbers; the timer then had nothing to read again (refreshUsage reads only once usage is drawn) and Chromium, quicker to the fast-forward, saw no second request ("in flight: usage x2 (have usage)"). They wait for a tile that isn't a skeleton. The one-in-flight, queued-ask and failure-releases checks are unchanged. Pass in Chromium and WebKit three runs each (usage-refresh in en and zh); failed in Chromium on 6e623d16. 2026-10-06 05:56:47 +08:00
yetone 28dd70f61f gui: a dialog's fields no longer scroll sideways in the Mac app when the dialog scrolls — WebKit laid a framed editor's grid out at the full width and then let the 8px Mac scrollbar (4dab45e3) take its right edge, so a disconnect preview in a 560x420 window ran 8px wide; the bar's room is now always kept, taken out of the right padding, so fields end where they did when nothing scrolls. agent-disconnect-preview measures the body's content box up to the scrollbar (clientWidth) rather than its outer edge; its "no horizontal overflow" check fails in WebKit without the fix and passes with it in Chromium and WebKit, en and zh. account-arrange, editor-short-window, models-free-only, models-fold, names-fold, plugin-market, whats-new, old-webkit and click-scroll pass in both (plugin-move fails in Chromium the same without the change). 2026-10-06 05:56:47 +08:00
yetone 2bdb0d0e7b gui: a session's title on the Sessions page keeps 100px+ in a 420px window when the list scrolls — its row's five 12px gaps (check, title, cost, Resume, terminal, delete) left the title 90px once the page's scrollbar took 10px (WebKit, a long list); narrow rows (≤560px) now have 8px gaps, the title 110px. sessions-usage-open.test.cjs ("its title keeps room to be read") fails in WebKit without it and passes with it in Chromium and WebKit, en and zh; sess-agent-strip, sessions-bar-names, -folder-delete, -manage, -purge, -today, -toolbar, old-webkit and click-scroll pass in both (sessions-overview and sessions-talk fail in WebKit the same on 6e623d16). 2026-10-06 05:56:47 +08:00
yetone aab2e4412a gui tests: routing-levels and rate-limited-sink wheel the group editor's row into sight before clicking it — the editor grew, so its Levels and Order rows sat at the 1400px window's foot; WebKit's own scroll into view left a 3px sliver above the footer and clicked the footer ("footer intercepts pointer events"). They wheel as the tests' Save already does (the page puts back a scroll the reader didn't make). The click-moves-nothing checks are unchanged. Pass in Chromium and WebKit, en and zh; failed in WebKit on 6e623d16. 2026-10-06 05:56:47 +08:00
yetone b8b7ee507a gui tests: zcode-site-layout clicks the ZCode app's sign-in where it is, with the mouse — Playwright's own scroll into view moved the 440px window's page by 3px before its click, which the test's "the click scrolled" check caught; a mouse click there moves nothing (probed: #view-providers stays at 442). The no-scroll check is unchanged. Passes in Chromium and WebKit, en and zh, at 440, 700 and 960px; failed on 6e623d16. 2026-10-06 05:56:47 +08:00
yetone becdf36fc3 gui tests: zcode-site starts ZCode's sign-in on the Providers page with its list read — subOf tells a subscription moved onto its plugin from that list (pluginSubs reads providers.plugins), so starting the sign-in on the Agents page before /api/providers was ever read threw and the site step never came. The app only starts a sign-in from the Providers page, which reads the list first. Passes in Chromium and WebKit, en and zh; failed on 6e623d16. 2026-10-06 05:56:47 +08:00
yetone 3ab27186c9 cleanup: drop eight functions nothing calls — catalog.ProviderEnv/ProviderAvailable, subscriptionRun.attached, hasTool, kiroSignedIn, SetModelSame (SetModelPrefs calls setModelSame itself; the comments name it), sessions.claudeFiles and plugin.SetConfig. Found with deadcode -test -tags nogui and checked by git grep across .go and .js; the ones only the GUI build or one platform calls stay. vet on darwin, linux, windows; catalog, gateway, provider, sessions and plugin tests pass. 2026-10-06 05:34:29 +08:00
yetone a11a1f2f93 gui tests: session-terminal opens a 1000px-tall window — settings rows were added above the Session terminal row, so in 700px it sat at the foot of #view-settings; Playwright scrolled it in before each click, the scroll closed the menu the first click opened (a menu closes on a scroll), and the second click opened it again ("a second click closes it", Chromium) or found the row out of reach (WebKit). A real click on the open menu's button closes it. Passes in Chromium and WebKit, en and zh; failed on 6e623d16. 2026-10-06 05:07:13 +08:00
yetone 80279137d5 gui tests: redact-rule-row expects the phone-width web layout at 640px — f3ba9184 (#391, two days after the test) wraps every web settings row there, so the added rule's Remove sits on the line under its name at the row's right edge; the test checks that at ≤760px and the same-line layout at 1100px. The fields' one-line, flush-edge checks and "the click moved nothing" are unchanged. Passes in Chromium and WebKit, en and zh, both widths; failed at 640px on 6e623d16. 2026-10-06 05:07:13 +08:00
yetone 362405aaa1 gui tests: seg-contrast follows ec10d3bd, which took the grey track out from under the light switch (the owner: 这个 tab 栏的背景灰色条有点丑) — in light the white thumb sits on the header and is told off by its shadow, so the test asks for 1.05:1 there plus a thumb edge; dark keeps 1.5:1. Passes in Chromium and WebKit, en and zh; failed on 6e623d16. 2026-10-06 05:07:13 +08:00
yetone daab41b566 gui tests: model-price-tiers types the tier's "over" amount and presses Enter — Chromium's fill selected the box, and its blur's change pre-filled the input price with 1, so the price read "12,5". Passes in Chromium and WebKit, en and zh; failed in Chromium on 6e623d16. 2026-10-06 05:07:13 +08:00
yetone 7ca9419bcf gui tests: lightweight and provider-levels-scroll find their rows where the pages put them now — settings rows were added above Lightweight mode, so in a 700px window its segs sat under the footer (the test's window is 1000px tall); and a model row carries its price under its name, so the fixed scrollTop 260 left model-5 out of sight and Playwright's own scroll moved the list. provider-levels-scroll scrolls each row's levels to mid-list by hand (and throws if it can't), then checks a click moves nothing, as before. Pass in Chromium and WebKit, en and zh; failed on 6e623d16. 2026-10-06 05:07:13 +08:00
yetone 82be8c14a5 gui tests: a model chip's right-click settles in Chromium before its menu is read
model-api-preset, model-test-why, provider-detect-models and model-copy-id
failed in Chromium only, on main. They were stale tests, not app bugs:
- To right-click a chip out of sight, Playwright scrolls the editor first.
  Chromium sends that scroll's event a frame later, after the menu has
  opened, and a menu closes on a scroll, so its items were detached under
  the click. rclick() now scrolls the chip in with a trial click, lets two
  frames pass, then right-clicks.
- model-copy-id read the footer as soon as the fake server had the id,
  before the page had the answer. It now waits for the footer.
- model-api-preset's one-API chip menu now has Copy model ID beside its
  test (81879b90). It expects those two items and no "Asked on".

All four pass in Chromium and WebKit, en and zh.
2026-10-06 05:07:13 +08:00
yetone 69665a6960 gui: styles hold up in Safari 15.0–15.3 again (macOS 12, #220) — no :has(), and :focus-visible kept out of selector lists
old-webkit failed on main: app.css and routing.css had :focus-visible inside
selector lists (.quota-refresh, .sess-go, .acap, .alane, .us-handle, the
routing group and member grips) and inside :is() (.am-or's grip). Safari
before 15.4 drops the whole rule, so the hover reveal went too. Those parts
now sit in rules of their own. library.css and routing.css used :has().
A library row with agent chips is now marked .with-agents by agentChips,
and a request whose tag says where it went upstream is marked .upstreamed.

The keys-row collapse (#841) and the library chips' rings kept a control
out with :not(:focus-visible), which Safari before 15.4 also drops whole.
Each now has an @supports not selector(:focus-visible) copy on :focus.
old-webkit's checker now splits a selector list on its own commas, not
those inside :is()/:not(). It also wants that fallback wherever
:not(...:focus-visible...) is used.

The new old-webkit fails on origin/main's assets (12 findings) and passes
with this change in Chromium and WebKit. account-cap, lane-limit,
fold-show-grip, group-member-drag, library-all, library-items, pick-skills,
skill-name-many-agents, routing-upstream, usage-arrange, usage-card-refresh
and click-scroll pass in both. group-arrange fails in Chromium en the same
way on origin/main.
2026-10-06 05:07:13 +08:00
yetone a3726f657e gui tests: agent-leave-magpie turns the switch off on its fake server too, so closing the model list (which reads /api/state again) no longer turns it back on under the click
Chromium failed it on main: the status kept "Claude Code model → Claude Opus 5.5"
because the click asked to disconnect a switch the refetch had put back on.
Stale test, the app is right to show what the server says.
2026-10-06 05:07:13 +08:00
yetone 29e1ad2b63 gui tests: name-suffix-where-named waits for the line under "Provider in model names" to follow a pick — the pick is shown at once, and the line is redrawn when settings/plain-names answers (suffixSegs), so in Chromium the test read the old "My Sol · Relay" before the answer came. It now waits up to 2s for the new line, then checks the one post; the no-scroll check is unchanged. Passes in Chromium and WebKit, en and zh; Chromium failed on 6e623d16. 2026-10-06 05:07:13 +08:00
yetone 5cdfe5a92d gui tests: gateway-model-info expects a routing group's tooltip as afc6623c (#885) words it — "Reasoning: low, medium, high (the levels every model in it has)" and "Accepts images (one of its models does)", since #756 one member that sees is enough. Passes in Chromium and WebKit; failed on 6e623d16. 2026-10-06 05:07:13 +08:00
yetone da7144fd06 gui tests: usage-ledger-chart and web-page follow the Requests tab as it is — its strip has a fifth total, Output speed (5464a362, #860), its metrics a fourth, Speed, and its split a "Model · provider" choice second (f506d08d), so the tests' Provider click (nth(1)) picked Model · provider, the many-providers ranking never came, and web-page's hasText "Provider" matched both buttons. usage-ledger-chart names each split's place (SPLIT) and expects the five totals, four metrics and four splits in en and zh; web-page clicks the split whose text is exactly Provider. No click-scroll or layout assertion is changed. Both pass in Chromium and WebKit, en and zh; both failed on 6e623d16. 2026-10-06 05:07:13 +08:00
yetone 5a4c69fbdc docs: contributors.md lists lunar-me under authors reviewed with extra care (the maintainer chose not to block), with the evidence and what the extra care is 2026-10-06 04:52:27 +08:00
yetone 6e623d1651 tui: a first run with no model catalog says "… syncing model catalog" while it syncs, and S doesn't start a second sync meanwhile
Init set m.syncing on its value receiver, a copy Bubble Tea never sees
(staticcheck SA4005), so the sync ran with nothing on the status line and
S could start another on top of it. newModel now sets syncing when there
is no catalog, and Init starts the sync from it.

TestFirstRunShowsCatalogSync is new and fails without the change. go vet
(darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui
./internal/tui under a temp HOME pass.
2026-10-06 04:31:29 +08:00
yetone 6b975ea9fd gui: i18n.js has each Chinese string once, and i18n-keys.test.cjs fails when a language has a key twice
Eight zh keys were written twice (Close, model {model}, Import…, Time,
Web search ×3, Looking…, {name} is up to date). In an object literal the
later copy wins, so an edit to the first would silently do nothing. The
copies held the same text, so the later ones are removed: the I18N object
is deep-equal before and after. ja and de had none.

i18n-keys.test.cjs is new and needs no browser; it lists the 8 on the
old file and passes on the new one. The ja/de placeholder check run by
gui-ja/gui-de finds 0 mismatches.
2026-10-06 04:30:32 +08:00
yetone 17f790b145 agent: five package-level twins nothing calls are gone — isCodexGateway, ccProviderJSON, fxProvider, hermesProvider and writeMiniMaxEntry
Each was a one-line wrapper of its *At function for the local gateway.
The callers moved to closures of the same name over the agent's own
address (at.v1(), at.gw()), which shadow the package function, so the
wrappers were reached by nothing, tests included (deadcode -test). Their
doc comments now sit on the *At functions, and isCodexGatewayOn has its
own again: it had been left above codexKeptGateway.

go vet (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui
./internal/agent under a temp HOME pass.
2026-10-06 04:04:47 +08:00
yetone 89825eca1a go.mod: go mod tidy — moejs is required directly (internal/gateway imports it), and go.sum drops testify 1.11.1 and go-spew/go-difflib, which nothing builds with
go mod verify, go vet, go build (darwin, GOOS=linux nogui, GOOS=windows) and the gateway and library tests pass.
2026-10-06 04:01:01 +08:00
yetone 690d4c921a ci: a Test run on main finishes instead of being cancelled by the next push, and the workflow's token can only read
On 10-05 and 10-06 nearly every Test run on main was cancelled by the
next push, so a release had no finished run to wait for and Linux-only
failures shipped (LESSONS.md: "Don't tag until a CI Test run ... has
finished green"). cancel-in-progress is now false on main only: a running
run completes, and GitHub still replaces a queued one with the newest.
PRs keep cancelling their older runs. The workflow had no permissions
block, so it got the repository default token; it needs only to read.
2026-10-06 03:56:55 +08:00
yetone fa7a0f23a8 gateway: a streamed reply whose vendor goes quiet keeps its agent alive on a timer of its own, held or passed, so a proxy in front doesn't end it (#947, jorben) — a vendor that sent its 200 and response.created and then nothing had the stream held for its first content with no event to scan, so the agent got no headers at all until it spoke again, and Cloudflare in front of a remote magpie ended the request at 125s (524); a translated reply quiet mid-way was kept alive only as the vendor sent something, and the proxy reset it. holdWriter.watch now runs beside every streamed try (it was only Group.FirstToken's watchFirst): past keepHeldAfter it sends a held try's agent the stream's 200 and SSE comments (keepAlive), none of the try, so another account may still answer in the same stream; once passed, a comment goes between two of its lines after keepaliveEvery of quiet; it stops after keepaliveLongest with nothing from the vendor, and Gemini streams get none (#934). Covers every protocol, relayed or translated. quiet_keepalive_test.go is new (held, mid-reply, failover after keepalives, the 5-minute cap, Responses/Anthropic/Chat relayed and Anthropic from Chat) and fails without the change. go vet, go build (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui ./... under a temp HOME pass (TestUserPath in internal/proc failed once under the full run and passes alone). 2026-10-06 03:51:44 +08:00
yetone 9ae796d5b5 docs: contributors.md says what stops a community PR's review for possible harm, what is closed unreviewed and when an author is proposed for blocking, and AGENTS.md links it 2026-10-06 03:50:07 +08:00
yetone 4b03eda97c docs: LESSONS.md gets the review of 10-06's commits — five lessons seen a second day (siblings, both engines and ja/de, red tests that weren't load, one goal per commit) and a new one: fix what an error is about, not only its label 2026-10-06 03:49:31 +08:00
yetone 34bfb9cab5 gui: the Japanese "RTK can't be given to {agent}" has the English string's placeholders again
4c170cba's ja text had a third {agent} where the English has two, which
gui-ja's placeholder check fails on. The installer sentence now says
"そのための" instead. The check gui-ja/gui-de run (same marks as the
English key for every zh key) finds 1 mismatch on origin/main and 0
with the change.
2026-10-06 03:48:13 +08:00
yetone ccdd18e3f0 provider: Kiro's identity refresh reads askKiroIdentity before its goroutine starts, not inside it
The goroutine read the package variable while a test put its own back,
a data race go test -race reported in the provider package. The value
is taken under the same lock that sets s.refreshing. go test -race
./internal/provider passes twice and -count=10 on the Kiro/Qoder tests.
2026-10-06 03:48:13 +08:00
yetone bfe8bcafb8 provider: ForgetAccounts also forgets which accounts were asked for their model lists a moment ago, so accounts read afresh are asked again
newFetches throttles FetchNew per account id for a minute. ForgetAccounts
cleared the accounts but not that throttle, so an account read afresh
under an id asked a moment before (another test's, or one signed in
again) wasn't asked and the page wasn't told its lists were on their
way. TestProvidersAnswerWhileListsComeIn depended on test order because
of it ("not told the lists are on their way" when run after others).

It fails on origin/main in the full package run and passes -race
-count=5 with the change; go test -tags nogui ./... passes.
2026-10-06 03:48:13 +08:00
yetone b363327d4e provider: a logins.json magpie can't read keeps the accounts read before, and one that doesn't parse is copied aside before it is written over, not read as no accounts
readLogins dropped filememo.Read's error and json.Unmarshal's, so a file
half there (a write by another process, a disk hiccup) read as an empty
list, and the next add, switch or sign-out wrote that list back: every
account gone. d5619d5a only retried for 15ms. Now a failed read returns
the accounts last read or written (a missing file is still none), and
writeLogins copies a file that doesn't parse to logins.json.bad-<time>
before replacing it, so what was in it can be got back.

TestUnreadLoginsNotWrittenOver is new: it truncates logins.json and
checks the accounts are still read and survive the next add, and that a
truncated file with nothing read before is kept aside. It fails on
origin/main ("read as []") and passes with the change. go vet, go build
(darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui ./...
under a temp HOME pass; the provider package passes -race.
2026-10-06 03:48:13 +08:00
yetone 963d8d9d88 gateway: a provider that turns Codex's image tool away with a bare 400 is asked again without it, and isn't offered it again once that works, so a plain chat no longer breaks on it; a ChatGPT sign-in, openai.com and a Codex backend that takes it still get it (#949, cjyrainbow)
Since #870, magpie's provider in Codex's config carries x-openai-actor-authorization, so Codex offers its image_gen namespace tool on every request. A vendor's Responses API that can't take it, a relay's included, answered "bad response status code 400" to "只回复 OK". After a bare 400 (one that names no field or message magpie already knows to drop), a provider other than a ChatGPT sign-in or openai.com is asked once more without the tool. This works both passed through (the namespace) and translated (image_gen__imagegen flat). If the retry answers, the provider is marked unfit for tool:image_gen. If it doesn't, the tool goes back and the vendor's 400 stands, and the cache-key guess runs on the request as it was. The header stays as #870 wrote it.

image_tool_test.go is new. Its fixture is the image_gen tool Codex 0.160.0 sent to a capture server with magpie's provider table and catalog. TestImageToolLeftOutWhereRefused (translated, passed through) fails with the reporter's 400 when gateway.go is reverted, and so does TestImageToolKeptOverAnotherRefusal. TestImageToolKeptForChatGPT fails when the ChatGPT exemption is dropped. docs/subsystems/gateway-routing.md has the rule. go vet, go build (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui ./... under a temp HOME pass.
2026-10-06 03:39:04 +08:00
yetone aab93f9fa8 gateway: in turn, a new conversation goes to the model or account the fewest live conversations are on, so two sessions of one routing group kept for the session no longer share a model (#946, Moody-Sin) — in turn counts requests, not conversations, so a second session started after the first had sent an even number of requests went to the model the first was kept on. leastHeld counts the conversations of the scope answered in the last 30 minutes per key/account and model and puts the least held first; ties, resting ones and a group with a group in it keep routing's order. TestRotateSpreadsSessions is new and fails (after 2 and 4 requests) without the change. go vet, go build (darwin, GOOS=linux nogui, GOOS=windows), the gateway package and go test -race -count=20 of TestRotateSpreadsSessions/TestAffinity pass; go test -tags nogui ./... under a temp HOME failed only TestWSLProbeFindsBunOmp, TestProvidersAnswerWhileListsComeIn, TestUserPath and TestClaudeSignedOut under the full run's load, each passing on its own. 2026-10-06 03:33:04 +08:00
yetone 76dc5aed48 gui: Routing flies a request still under way when the page's first frame came before the trace, and the Requests table's sideways scrollbar goes once the table fits; GUI tests brought up to date with the app
Two app bugs, found where GUI tests failed on main in Chromium:
- Routing: the page's first frame looked for requests to fly before the first trace had come in, found none, and nothing flew them after it came, so a request still under way when Routing opened never reached its member's row (routing-try-fixed failed every run). The first trace now flies those under way when a frame has already been drawn, as coming back into sight does (underWay, shared with resume).
- Usage › Requests: a table that had come to fit its window (led tight) kept #ledHScroll's bar under it with nothing to scroll; ledGrow now redraws the bar on every resize, not only when it leaves columns out (usage-speed "no sideways scrollbar").

Stale or racy tests, the app right:
- library-own-folder, list-sort, shared-skills and nine other Library tests counted the loading skeleton's rows (the "5 vs 4 rows" and the empty lists were the skeleton, not the repo group headers); they wait for .lib-body:not(.lib-skel). library-own-folder's 61px scroll was Playwright's own retry on a button still sliding in, not the app (no scroll setter ran): it waits for the entrance to finish.
- sessions-overview measured the picked bar while the folder's overview redrew the bars; it measures once the overview is in.
- menu-scroll: its agent needs wired and a ref to show a model picker, and the page now asks plugins/updates, usage/quotas, agents/install and whatsnew.
- routing-sessions' large-history tests failed from local midnight until the UTC offset passed: the fixture's times were UTC while the gateway writes local times with their offset, which openRoute takes the day from.
- ledger-hscroll and view-scrollbar measured scrollbars in Chromium launched with --hide-scrollbars; they launch without it, as menu-scroll does.

routing-try-fixed and usage-speed fail without the app changes and pass with them (checked by putting origin/main's routing.js and app.js back). go vet, go build (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui ./... under a temp HOME pass (TestHostJSCancellation timed out once under the full run's load and passes on its own, 3 runs).
2026-10-06 03:20:34 +08:00