8a4e32febef69bb797cdf3003ec1395e725d5d63
1766
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
01ccbd40a0 |
library: an MCP router says which computer it is, so an agent can pick between two (packinggoodsllc_07668 on Discord)
Two magpies, one in China and one in Los Angeles, each serve the same tools through their MCP router (/mcp/magpie/hub). An agent connected to both saw two identical web fetches and couldn't pick the one in Los Angeles to reach Google. Each router now says where it is: - initialize's instructions end "This router: <name>. Each of its tools' descriptions starts with [<name>]; ...", and serverInfo.title is "Magpie MCP hub · <name>"; - each tool's description in tools/list starts "[<name>] " (once: a description that starts so already, another magpie's router behind this one, isn't given it twice). <name> is the user's words (settings.RouterNote, one line, 80 characters at most) to every caller. With none it is this computer's name, to callers on other computers only: an agent on this computer has one router at hand, and its prompts stay as they were. RouterNote is this computer's own (KeepOwn): library.json is synced, settings.json isn't, so a sync never brings the other machine's name. It is set in the Library's MCP tab, in a Router name row under the router's address (shown while the router is on): a plain field with the computer's name as placeholder, saved on Enter or leaving it, Escape puts the saved words back, an input method's Enter is its own. POST /api/settings keeps it. Translated in zh, zh-TW, ja, de. docs/subsystems/mcp-router.md has the rule. Run (mote, at |
||
|
|
c903c3a411 |
usage: Use on Codex's window lands over 7 and 30 days, a model's own Compact at named apart (hoobnn on Discord)
hoobnn on Discord (11-01): "观测-用量-上下文里,在7天或者30天的选项里,点击
应用codex的上下文,没生效。" Over 7 or 30 days the range held calls on a
model whose provider has a Compact at of its own (430K); today's didn't.
Tuned for you's "Now" was the largest compaction point over every model
in the range, so it came from that model. Use put the advice in Long
conversations, which did move Codex's other models (Codex's list had
them at the advice), but the card still read 430K and then turned held
("compacts at its own 430K, which comes first"), so nothing seemed to
happen. And with Long conversations at magpie's default, a range of
only such models offered a Use that could move nothing.
codexWindow (internal/gui/tune.go) now reads "Now" from the models Long
conversations moves, and lists each model with its own Compact at as
Apart (largest first). Only a range whose every model has its own is
held (Own), whatever Long conversations says. The card names each
model kept apart under the row: "{model} compacts at its own {value},
which this doesn't move", in en, zh, zh-TW, ja and de.
provider.CompactSetIn is CompactSet with the caller's settings and
group finder, as CompactFor takes them.
Siblings: Claude Code's knob is per model (no max over models), so it
has no such mix. 1, 7 and 30 days go through the same codexWindow;
the GUI test covers 7 and 30 and the Go test the 1-day sample.
Run on mote at
|
||
|
|
7b6b7492a9 |
claude: an account on overages is read with its windows and switched off (#4532)
Claude Code's /usage line "You are currently using your overages to power your Claude Code usage…" was in claudeUsageDenied, so the whole reading became an error: the card lost its windows, and NextLogin, which stays on an account it can't read, left Claude Code billing overages while other accounts had room (StringKe's audit, item 3). Now the line is no error. The windows under it are read as usual, and a Text row "Extra usage" with Used 100 is added (claudeOveragesWindow), so usedPast/roomLeft count the account spent and the switch moves off it. The row ends when the last used-up window renews (the time Claude Code says it switches back), else at the next reading. Routing skips Text rows, so the gateway's own account choice is unchanged. The GUI says the row "In use" in the reader's language (quotaText; a plugin's text row keeps its display as it came). The overages case is out of TestClaudeUsageFailureDoesNotHideAccountErrors: it was the bug. Run (mote): - TestClaudeUsageOverages, TestClaudeSwitchOffOverages: red on the old claude_usage_cli.go (an error; switched to ""), red with the row's Used set to 0 by hand, green now. - go test -tags nogui ./internal/provider -run 'Claude|Usage|NextLogin|Next|Switch' ok. - GUI: claude-overages (new, 5 languages, chromium + webkit) red 8 of 10 on the old app.js (en passes there), green now; with quota-text-row, quota-name-translated, i18n-keys, usage-no-reading: 40 pass. - go vet darwin/linux/windows; gofmt clean. Not tried: a real account on overages; the text is Claude Code 2.1.316's string table, and the windows under it are what StringKe describes. |
||
|
|
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 |
||
|
|
66c0ddc19a |
gui: Busy models last takes a custom threshold, 1 to 9999 (axelburks)
axelburks on Discord: a vendor that queues reports loads past 100%, and
the only way to a threshold such as 150 was settings.json. Settings ›
Network and sharing › Busy models last now ends in Custom…, one more
choice in the same in-app switch (no <select>). It opens a small field
in the row whose sub says what the number means: a load in percent as
the plugin reports it, 100 is all the vendor serves at once, past 100
requests queue (200 is twice that), 1 to 9999. Enter or Apply saves it
through settings/busy-load, Escape or Cancel closes it untouched. A
value that is not a whole number from 1 to 9999 is said in red in the
sub and nothing is posted; the field keeps it to correct. The number
saved shows as its own choice ("Over 150%"), and Custom… opens with it
filled in. The site docs (en, zh, ja) and gateway-routing.md say
Custom… instead of settings.json. Code in plugins/gateway/settings.js
and i18n.js only, so the core budget is untouched.
Run on mote at this tree:
- node --test model-load, i18n-keys, bare-ids, gateway-port: all pass.
model-load's new test runs in Chromium and WebKit, at 420 and 900, in
en, zh, zh-TW, ja and de: Custom… focuses the field, says what the
number means, refuses abc, 0, 10000, 1.5 and -3 with nothing posted,
Escape closes, 150 posts {at:150} and shows Over 150% picked, 2000 by
Enter replaces it, the row and settings don't run sideways, and no
press moves the page more than the row changed height.
- go test ./internal/gui -run Budget: ok. gofmt -l: clean.
Broken by hand: validation turned off (if (false)) went red in every
language; the Custom… entry taken out went red in the old and new
tests; the field without flex:none was squeezed to ~20px and the width
check went red.
Not tried: the real app window (only Playwright's engines), and the
full GUI and Go suites, which run after the push (one suite on mote at
a time).
|
||
|
|
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 |
||
|
|
ed0ad52821 |
gui tests: a picker's item is pressed once the list is drawn for good (#4274)
A model picker draws its list again when its first read of
/api/model-speeds answers (readSpeeds, once a minute and after every
load). searcher-pick's click found the Automatic item after a reload,
the list was drawn again under it, and Playwright gave a null box for
the detached item: "Cannot read properties of null (reading 'x')" at
line 319. reader.cjs's pickItem finds the item again each frame until
its box is the same twice, and presses it there; searcher-pick's click
uses it.
Run on mote (mote-run), chromium, searcher-pick "the provider that
searches..." en and zh:
- origin/main
|
||
|
|
e62a1bc515 |
routing: a trail is drawn in its own agent's colour, and agents on screen don't share one (Pkh)
Pkh (Discord, 0.1.2509, Linux) saw trails in another agent's colour, and different agents drawn alike, on the Routing page. Causes, read in routing/client.js: - Wrong colour: render() coloured a lit row by row.rid, the latest staged request that weighed the seat, not by the request actually on it. With Codex answering and ZCode's request staged later, Codex's trail was drawn in ZCode's colour, and the fold, group and flows layers copied it. - Stale colour: --agent was set when a row lit and never cleared, so a reused row or fold wire kept the last agent's colour. The panel's ps-out wires did the same. - Collisions: hueOf gave 15 makers their own colour and hashed the rest into 8 spares. 49 of 59 agent ids fell into those 8. QwenPaw, ZCode, Qwen Code and AstrBot were all #65a30d. Change: - A row's colour is the agent it answers now (trying), else the agent whose request is on its wire (flying), else the request it answered. It is cleared when the row is off. Folds and groups copy it through tint(), which clears too. A ps-out wire clears when its trip ends. - One PALETTE of 12 quiet colours, same lightness and chroma around the wheel, none near --red. HUES is a maker's place in it. hueOf gives each agent the first colour from its place that no other agent has had, and keeps it while the page is open. hues() keeps the agents shown together apart once more than 12 have come. Tests (red on the old client.js): - routing-reused-row-hue: Codex then ZCode on reused rows. Lit and flows colours are each agent's own, and off wires carry no colour. - routing-agents-apart: four agents on screen at least 20 degrees apart in OKLCH hue, and the same colours after a fifth request. - Both run in Chromium and WebKit, in every language, at 1100 and 420/390 widths. - routing-agent-hue-not-red now reads PALETTE. Broken by hand: - Without the removeProperty, routing-reused-row-hue is red. - With by = r.agent, it is red. Run (all on mote, macOS 27): - The whole GUI suite, Chromium and WebKit, at concurrency 6, at base |
||
|
|
1e6a27d4f8 |
gui: an icon's image URL typed and saved is fetched, kept and shown again (hoobnn)
hoobnn on Discord #general: a custom provider's icon given by an image URL was neither fetched nor applied, and on editing it again the URL was gone. Cause: the Image URL… box ( |
||
|
|
7503beee72 |
plugin, settings: a model's load goes past 100% for a vendor that queues (axelburks on Discord)
axelburks, on v0.1.2547: their vendor queues, so a model's load can be
past 100%, even 200%. magpie clamped every load to 100, and Busy models
last allowed 1-99 only.
- host.js reportLoad and plugin.noteLoads keep a load from 0 up. The
floor is still 0, null still clears it, and a sanity cap of 10000
(LOAD_MOST, plugin.LoadMost) keeps an absurd value from reaching the
UI or the trace.
- settings.BusyLoad takes 1 to 9999 (BusyLoadMost-1). The segment
choices stay Off/50/70/80/90, and a value set in settings.json (150)
shows as its own choice, as before.
- The editor's badge reads "180%". It is a badge, not a bar, so nothing
assumed 100 wide; the test checks it stays on one line.
- Docs: site plugins page (en, zh, ja) Values and Routing bullets, and
provider-plugins.md and gateway-routing.md.
Run on mote via mote-run, on origin/main 8d8df0639+ rebased:
- go test ./internal/plugin ./internal/gateway ./internal/settings -run
'ModelLoad|TestBusy' -v: all pass. TestPluginReportsModelLoad has
over:250 kept and huge:1e9 at 10000. TestBusyModelGoesBehind has 180
behind 120 at a threshold of 150, and 10000 refused.
- Broken by hand in a copy, with the old 100 clamps and the 99 limit:
TestPluginReportsModelLoad red ("ModelLoad(over) = 100; want 250"),
TestBusyModelGoesBehind red (150 refused).
- node --test model-load (with Queued 180% in every language, Chromium
and WebKit, 420 and 900, plus Over 150% picked at 420) and i18n-keys:
46/46 pass. go test ./internal/gui -run Budget: ok.
- gofmt -l: empty. GOOS=linux go vet -tags nogui and GOOS=windows go
vet on plugin, settings and gateway: ok.
Not run before the push (owner: push and tag first): go test ./... and
the whole GUI suite. They are queued on mote behind another session's
suite.
|
||
|
|
788057340b |
library: Magpie Image Recognition in Discover beside Magpie Image and Web Search (matrix0487 on Discord, #4653)
matrix0487 asked on Discord (#feedback) for all three of magpie's own MCP servers, image recognition, image generation and search, in the Library's Discover. Image generation and search were there; image recognition was an address to copy in Settings only (#4653). - `magpie mcp vision` (browsermcp.RunVision) relays stdio to the gateway's /mcp/magpie/vision, as `mcp search` does. analyze_image's relative image path is made one in the agent's folder on the way (imageFrom), since the gateway can't know where the agent runs; an absolute path, ~, a URL or a drive goes as written. - library: magpie-vision is a featured, opt-in server (no agents until picked), any binary's `mcp vision` is one server (serverKey), and it gets the 120s tool timeout (selfTimeout). - Settings › Models › Images: the Image recognition row has Give agents Magpie Image Recognition… / Turn on the Library, none with recognition off or in gateway mode. The three links are one helper, libWay, used by Image generation and Web search too (no budget raised: core 1,533,011 of 1,533,105). - Never a dead tool: Discover lists all three whatever is set up, and one that can't answer yet says why (gateway.OwnUnready, set by /api/library/market/servers as `unready`): a "Not set up yet" badge on its card with the reason as its title, and the reason in its sheet (nothing set up, or turned off in Settings / Plugins). It can still be added; its tools already answer with the same reason until then. - Strings in en, zh, zh-TW, ja, de; docs/subsystems/library.md. Run, all on mote (macOS 27) through mote-run, at this head's tree (rebased on |
||
|
|
8d8df06399 |
plugin, gateway: a plugin reports its models' load, and busy models can go last (axelburks on Discord)
axelburks (Discord #feedback): an in-house vendor queues requests to
its busy models, and the plugin could only put the load in the model's
name, which changed only when magpie re-read the list.
- A provider plugin calls input.magpie.load(provider, {"<model id>":
0-100 | null}) whenever it likes, from its own timer. host.js
(reportLoad) clamps each number to 0-100, null clears a model, every
other value is dropped, at most 1000 a call, and it returns the count
taken. A provider that isn't a string or loads that isn't an object
throws a TypeError. It goes to Go as an unasked {event:"load"}.
- internal/plugin/load.go keeps each by provider and lowercased model
id. ModelLoad answers unknown once a load is older than LoadFresh
(5 minutes), never idle. model@size falls back to its model.
- The provider editor shows it by the model as a grey ctx badge
("87%", titled "87% busy now, as its plugin says").
- Settings > Network and sharing > Busy models last (settings.BusyLoad,
POST /api/settings/busy-load, Off by default, over 50/70/80/90% or
1-99 by hand): restLast puts a model reported over it behind the
ready candidates, ahead of the resting. The trace row has busy:<load>.
At a new turn affine moves a conversation off it (Why "busy",
busyBehind); within a turn it stays. after, readyForNew and leastHeld
skip it. Unknown load, a lone candidate, or all busy: nothing moves.
- Docs: site plugins page (en, zh, ja) "Model load" section and input
table; docs/subsystems provider-plugins.md and gateway-routing.md.
Run, all on mote via mote-run at a42736807's tree rebased on
origin/main
|
||
|
|
e84870f173 |
plugins: an option's words in the window's language, and a filtered model list says so (plugins#590)
anewuser6937 (Discord, plugins#590) saw one model in WorkBuddy's editor
and took the plugin for broken. They had turned on "Free models only"
themselves, but its label and description read in English in the Chinese
window, and nothing by the models said the list was filtered.
A plugin option (auth.options, magpie's own field; OpenCode's AuthHook is
provider/loader/methods and never reads it) may now give `labels`,
`descriptions` and `confirms`, each keyed by the window's language
("zh", "zh-TW", "ja", "de"), beside the plain strings, as a page's
`titles` do. The host keeps only non-empty strings under language names
of 16 or less, 16 languages at most, each capped as the plain one is
(60/300/300). The editor shows the exact language, then its first part
(zh-TW reads zh), else the plain words, in the row, the hint, and the
confirm dialog and its title. `filtersModels: true` says the plugin's
model list leaves models out while the switch is on; while one is on, as
saved, the Models field says under the chips "Only some models are
listed: the plugin option “…” is on." (zh 只列出部分模型:插件选项「…」已开启。,
zh-TW, ja, de too). An older plugin shows what it showed before, and an
older magpie shows a new plugin's plain words with no note.
WorkBuddy 0.2.10 gives "Free models only" in all four languages with
filtersModels (magpie-community/plugins aec58ae, on npm: `npm view
@magpie-community/opencode-workbuddy-auth@0.2.10 --prefer-online` on mote
says 0.2.10, latest), and the mover's min is raised to it so every moved
user gets it. The CLI's `magpie plugin options` stays English, as the CLI is.
The core scripts would have gone 608 bytes over their budget; three of the
provider editor's comments in app.js are cut down instead, no raise
(1,532,865 of 1,533,105).
Run, on mote (mote-run), at this tree:
- node --test plugin-option-words.test.cjs (new): Chromium and WebKit,
1100 and 420 wide, en/zh/zh-TW/ja/de, switch on and off: each
language's label and description, zh-TW falling back to zh and ja/de to
the plain words for a zh-only option, the note exactly once under the
chips in a .hint inside the editor with no sideways scroll, none while
off, the confirm in the language. With app.js put back: 19 of 21 red
in Chromium (only "en off" passes, both widths).
- With plugin-options.test.cjs and i18n-keys.test.cjs, both engines:
68 pass, 0 fail.
- go test ./internal/plugin ./internal/provider ./internal/cli: ok.
TestPluginOptions with host.js put back: red (empty maps, FiltersModels
false). The real WorkBuddy 0.2.10 index.mjs loaded into this host
(a temporary test, not kept): plugin.Providers lists free_only for
workbuddy and workbuddy-ai with all four languages and filtersModels true.
- go test ./internal/gui: TestCoreScriptBudget ok after the cut. Red,
and red the same at origin/main
|
||
|
|
32bedd44f7 |
gui tests: usage-range picks its days from the phone's menu, where the strip is hidden
At 390px the head hides #period behind #usageRangeMenu (the phone head commit before this). The test opens the menu and picks the range opt (its last item) or a preset (its first), and checks the menu names the days picked. Run: usage-range on mote, both engines, en and zh: 4 of 4 pass. |
||
|
|
b791973354 |
gui tests: credit-days reads Today from the phone's days menu, where the strip is hidden
The phone head commit (usage: a phone's head is the tabs over one line of days, sum and refresh) put a phone's days behind a menu over a hidden #period, so the 360px test's click on Today waited 5s on a hidden button in every engine and language (10 of 10 red in the whole suite). It now checks that the menu says Today there; a wide window still clicks the strip. On mote: 10 of 10 green. |
||
|
|
6c29beba1e |
gui: on a phone a picker is drawn as tall as the choice beside it, and search shares a line with Export CSV
Requests' "All models" picker was 44px beside a 26px status strip, aligned at the top, and Export CSV sat alone on its own line. A .sess-pick on a phone is now drawn 32px and taken at 44 by its own ::after, like .segs; the strip in the sess-tools row is 32px (28px options) and centred, and the search field and Export CSV share the last line. Run (mote, at this branch's head after the rebase onto |
||
|
|
457cfd7c63 |
usage: a phone's head is the tabs over one line of days, sum and refresh
The owner's pick of three phone designs (B): Usage's tabs run across the
head, and under them one line holds the days as a menu ("7 days ⌄", the
app's own menu, never a <select>), the sum, and the refresh as a dot and
its figure ("● 5s", green while live). The days strips (#period,
#sessRange, #ctxRange) are hidden behind the menu. It follows whichever
the open tab shows, and a pick clicks that strip's option, so each choice
keeps its one handler; Custom opens the range menu from the head. Each
control is drawn about 30px and tapped at 44. A desktop window keeps its
strips. The refresh keeps its own menu and
its reload icon, unlike the mock-up, which had neither.
usage-phone-head.test.cjs checks the layout, the menu and the taps in
every language and both engines at 390 and 320px, and a desktop
window at 1100px.
Run (mote, at this branch's head after the rebase onto
|
||
|
|
b1fc435407 |
library: Magpie Web Search, magpie's search MCP server in Library › MCP (lutra_fs)
lutra_fs on Discord: magpie's search MCP shows in Settings › Models but not in Library › MCP servers. They were right. The gateway's web search MCP (/mcp/magpie/web-search) was only an address to copy in Settings › Models › Web search. It was never a Library server, so no agent could be given it from the Library, and the Library didn't list it. Change: - `magpie mcp search`: a stdio relay to the gateway's search MCP, made by widening browsermcp's Magpie Browser relay into a bridge with its own path, title and an optional session (search sends none, and has a 5 minute client). It takes no arguments. When magpie isn't running, it says "Magpie Web Search can't be reached: start magpie". - library: Magpie Web Search (magpie-web-search) is a featured, opt-in server beside Magpie Image and Magpie Browser. It is installed with no agents, so the user picks them in its sheet, and it switches per agent like any other row. Its command is the full binary path, and serverKey treats any binary's `mcp search` as the same server. Each agent's tool timeout is at least 120s. - Settings › Models › Web search › MCP server: under the address there is a "Give agents Magpie Web Search…" link that opens its Library sheet, or "Turn on the Library" while the Library is off, as Images does for Magpie Image. Gateway mode has no link. - The sheet's hint says where each search goes and what it costs. All strings are in en, zh, zh-TW, ja and de. - docs/subsystems/library.md names magpie's own servers and the new one. - An agent in WSL gets it through the MCP router, as Magpie Browser does. The image-only WSL side() is unchanged. - The sibling, Image recognition's MCP server, is still in Settings only. That is filed as #4653. Run, at this head (rebased on origin/main |
||
|
|
a6217e83d3 |
plugins: a plugin npm said nothing of offers Install, not Coming soon (zhudabao8433 on Discord)
zhudabao8433 on Discord (#general, 11-01): PowerContext (@magpie-community/gateway-powercontext) could be installed yesterday and today reads 即将上线 again. Cause: PowerContext was never pulled. It is in registry.json since plugins 1e4c8a2 (10-29) and on the dist branch (0.2.0, every dist commit since), and not on npm (E404), so magpie learns its version from the dist branch's ~1.7MB index.json. Coming soon is drawn whenever a listing has an npm answer with no version, and three paths gave one without anything confirming the package is missing: - builds before v0.1.2413 kept a dist read cut off at npmEach (6s) as "not on npm" in plugin-npm.json (ferock, |
||
|
|
445891cf74 |
gui: Insights › Masking keeps to the window's page width, centred, like every other page
refeccd on Discord (#feedback, 11-01): with the window maximised every
page sits in the middle at a fixed width, but Masking (脱敏) runs edge to
edge. The width cap is one rule in app.css that lists the pages by id
(body.window :is(#view-agents, …) { padding: max(16px, 50% - 600px) }).
Masking became a page of the redact plugin (#view-masking, kernel.js)
after that list was written and never joined it. Now it does. The cap
itself is unchanged.
Siblings: every page the sidebar opens (agents, sessions, library,
providers, routing, gateway, usage, masking, plugins) and Settings was
checked against the list; Masking was the only one missing. A community
plugin's page (.view.plugin-page) is a frame the plugin draws and is
left as it is.
The test: page-width.test.cjs no longer keeps its own list of pages. It
reads every page from the sidebar (#nav button[data-view], not a
community plugin's), plus Settings, and requires Masking among them, so
a page added later is held to the same width without the test knowing
it. It now also runs every language at 420px besides en/zh-TW/de at
1920, zh/ja at 2560 and en at 900.
Run (mote, macOS 27, Playwright 1.62.0, Chromium and WebKit):
- page-width.test.cjs on origin/main 6f3dfc282's CSS: red, "masking:
1676 wide at 1920" and "masking: 2316 wide at 2560" in every language,
both engines (12 pass, 12 fail). With the fix: 24 of 24 pass.
- Together, with the fix: page-width, page-width-steady, i18n-keys,
click-scroll and every mask*/masking*/redact*/window-mask/
routing-masking/provider-mask/provider-unmasked/account-mask/
plugin-name-unmasked file: 602 tests, 591 pass, 11 fail. The 11 are
page-width-steady's "opening an agent's details past the window moves
nothing sideways", which fail the same 11 with the file run alone on a
clean origin/main
|
||
|
|
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 |
||
|
|
4794767846 |
routing: back on Routing from another page, the page isn't laid out and drawn again whole (#4652)
xisdumpling (dumplings04605 on Discord), Windows, 0.1.2507: with a
history day of 180 to 298 requests picked, coming back to Routing
stalls the page and the sidebar's highlight. Measured first, with
routing-return-cost.test.cjs (250 rows, a picked day, a request's story
open), which counts what the return does, not how long it takes.
Causes found, each fixed and each red by hand when put back:
- The request list was windowed only from 300 rows, so a day of 180 to
298 had every row in the page. Now from 100 (WIN_MIN); the live list
keeps 60, so it is never windowed.
- Out of sight a view is 0 wide. The ResizeObservers in the routing
client (byWidth, the meta width) and context.js's card sizes took that
as narrow, flipped the narrow layouts while away and flipped them back
on return. A 0 width now keeps the layout it had.
- A hidden list re-windowed itself for a 0-high view, so the return
placed rows and ran metaFit again. It keeps its window while hidden.
- resume rebuilt the whole stage on return. sync("back") rebuilds only
when what the stage was built from (route, pin, day, purpose, lang,
the requests and their accounts) changed, and records it after the
rebuild.
- The visibility observer's group reload was not quiet and redrew the
groups. It is quiet now.
- A providers refresh while on Routing redrew the hidden Providers page.
It is read and drawn when Providers opens (providersBehind).
Not a cause: the nav highlight's rAF reading offsetTop only waited on
the busy main thread; it is one small layout now.
Before and after, the "back on Routing" step (Chromium layout metrics
from CDP; class flips and redraws from MutationObservers, both engines):
- mote, macOS: 25 layouts / 34.9ms of layout, 24 class flips, Providers
redrawn 13 nodes, groups 4, stage kept 0 of 3, 250 rows, 7818 nodes
-> 9 layouts / 3.2ms, 0 flips, 0, 0, 3 of 3, 11 rows, 1367 nodes.
- Windows (xiaomi-gpu, win-run): 25 layouts / 146.4ms, 24 flips
-> 9 layouts / 7.1ms, every check passes. WebKit's counts match.
The test asserts no flips, no redraws, the stage kept, under half the
rows in the page and at most 12 layouts; wall time is logged, not
judged. The page looks the same: no CSS or markup change.
Run:
- routing-return-cost: red on origin/main
|
||
|
|
784b66366f |
gui: Settings opens after Codex's row on the Agents page was opened and shut (ysm119)
ysm119 on Discord (v0.1.2519, macOS): opening Settings showed "null is not an object (evaluating '$(row + ".who").title = t(en)')". Cause: an opened agent row borrows its settings rows (AGENT_PREFS, |
||
|
|
9162277b91 |
routing: Until used up stays on the next account once the first is used up (dzxx0496)
dzxx0496 on Discord: with free accounts one after another, the first used
up, requests went to the second; when the first renewed they went back to
it ("如果第一个恢复了,它又优先用第一个了"). No routing did what they asked:
In order and Smart both put the first back first.
A new routing, Until used up (drain, 用完再换): requests stay on one seat
until its quota is used up, then go on to the next in the list and stay
there. A seat counts as used up when its known allowance is at 100% or
it was refused for quota or credit (failQuota / failCredit, routes.Drained
called where the rest is recorded, so a failover inside one request moves
the pool too). A rate limit or other failure only passes it over while
it rests, as In order does. Each pool (a provider, a group/<id>) keeps its
own place; routes.Forget clears it.
Offered wherever a routing is picked: the provider editor, a group's row
menu and editor (app menu, no native select), the TUI, `magpie group set
<id> routing=drain` and a provider's routing=drain. Nothing defaults to
it, so no saved setting changes. SpentShareOf is 100 for it, as for In
order. Words in en, zh, zh-TW, ja and de (i18n.js and the routing
plugin's own), docs/subsystems and the site's start page (en, zh, ja).
Tests:
- internal/routes/drain_test.go: stays on the next when the first renews,
through a rate limit, all used up, a seat gone, per pool, Forget,
Drained after a renewal.
- internal/gateway/drain_test.go: a real request path with a fake upstream;
k1 refused for quota, k2 takes over, k1 renews: drain stays on k2,
In order goes back to k1. Red without the Drained hook (request 3 went
to k1). A rate limit comes back to k1; drain is saved on a provider and
a group.
- routing-drain.test.cjs: the Routing page's why and mode line in 5
languages, 1100px and 420px, Chromium and WebKit; red on the old assets
(20 of 20).
- routing-group-strategy, routing-save, builtins: the menu has 11 routings.
Run on mote (macOS) at origin/main
|
||
|
|
72114566bf |
routing: an account's row says when it renews whatever it is doing (dzxx0496)
dzxx0496 on Discord asked for the reset time to stay on ("额度恢复时间能不能
常驻"). On the Routing page's stage a known allowance's row said when it
renews only while idle; answering, answered, kept for last or passed
over, the row's status took its place and the time was gone. It now
follows every such status ("· renews in 5 h 5 min"), once. A resting
row still says when it is back instead, a free model has nothing to
renew, and a status that already says it is not told twice.
routing-renews-stay.test.cjs: a request in flight over three known
accounts, one answering, two passed over; each row says its own renewal
once, in en, zh, zh-TW, ja and de, at 1100px and 420px, in Chromium and
WebKit, with no overflow. routing-behind-why.test.cjs's expectations
now carry the renewal on its answered and kept rows.
routing-renews-stay.test.cjs is 2 of 2 red on the old assets. Its
first row and routing-behind-why's answered row renew in 12 h 5 min:
under 10 h the time shows minutes, and a slow run turned 9 h into
8 h 59 min. With the fixtures' clock held back 2 minutes the old
values were 40 of 64 red, these 64 of 64 green.
Run on mote (macOS) at origin/main
|
||
|
|
4464a304fd |
gui: a model row's image chip is as tall as its other chips (nb5p)
nb5p on Discord: on the Gateway page's model list the image chip at a
row's end stood shorter than the reasoning chip ("低–ultra") and the
context chip ("272K"). The text chips are inline-flex with a 16px line;
the image chip holds only the 11px glyph (display:block), so it was 11px
tall. It now takes the text chips' 16px as its height.
modelInfo() is the one renderer of these chips. Its two callers, the
Gateway's model list and the routing group editor's member rows, share
the selector the fix is on. The provider editor shows images as a
checkbox and the Agents page and pickers show no such chip.
gateway-model-chip-height.test.cjs measures every chip of every row in
en and zh, light and dark, at 900px and 420px, in Chromium and WebKit:
same height, same centre line.
gateway-model-chip-height.test.cjs is red on the old CSS (the image
chip 11px against 16px) and green with it.
Run on mote (macOS) at origin/main
|
||
|
|
54087aa43d |
providers: a key's chips keep their whole text; what ends its row goes under it when it doesn't fit (young02036)
young02036 (Discord #feedback, zh, Windows) had a Remote magpie key row whose models chip「全部模型」was squeezed to「全」. The row also showed the protocol pick and the actions (停用 移除 设为首选). Now only the name and the masked key shrink. Every chip and button keeps its whole text. Switch off/on, Remove and First/Make first are held together in one .key-acts group at the row's right. When they don't fit, the group goes onto its own line, still at the right. A press there now keeps its row open (`held`) through the redraw the press brings, until the pointer moves off the row. Without that, a wrapped row drawn again after a click goes back to one line, slips out from under the pointer, and hides the button that was pressed. key-switch.test caught this at en/ja/de 900px. WebKit gets plain `:hover`/`.held` selectors, not `:is()`/`:not()` lists. Trade-off: in a narrow card, a hovered key row grows by one line. Not changed: account rows, which use the .acc-line/⋯ layout, and the gateway's caller-key rows, which ellipsize on purpose. New test: tests/key-row-chips-fit.test.cjs, 60 cases (2 engines x zh, en, ja, de, zh-TW x 6 widths down to 390px). It checks that no chip or button of a key row is cut, and that the actions stay on one line at the right. Run: - key-row-chips-fit + key-switch, Chromium and WebKit on Linux (WSL magpie-desktop): 40/40 each. key-row-chips-fit on mote: 60/60; on Windows (xiaomi-gpu): 30/30. - Whole GUI suite, WebKit, on mote at this commit (another session's suite ran there too, load 55 to 160): 8663 tests, 8489 pass, 174 fail, in 50 files. Each red file was then run alone at origin/main |
||
|
|
699ddf1524 |
gateway: a Codex account can spend its credits only after every other account, key and fallback (gokoshiki on Discord)
gokoshiki wants a Codex subscription first, then an OpenAI API key, then the subscription's credits. Until now an account at 100% that holds credits either kept its place and spent them there (on) or was held (off). This adds a third way per account, "last": - settings: CodexCreditsLast []string, empty by default, so a setting saved before it keeps its order. provider.CodexCreditsLast, CodexCreditsMode and SetCodexCreditsMode(user, on|last|off); SetCodexCredits(on) still means "in its place" and clears last. - gateway: candidate.creditsLast is true for such an account once a window for the model is used up and it is going on its credits (a call ChatGPT counts in no window stays in its place). restLast orders ready, then resting, then those, and marks Weighed.CreditsLast. restLast runs over the asides too, so such an account goes behind a provider's reserves (Accounts at once, |
||
|
|
b9ad353dbe |
gui tests: editor-advanced-align measures the editor drawn last, once its observer has seen it
Red in a whole GUI suite run on Linux and alone on mote, about 1 run in
8 at the accounts-at-once head (4 of 33), 0 of 31 at main
|
||
|
|
2c6b7c0632 |
gateway, provider, gui: Accounts at once keeps the first N accounts taking requests, the others in reserve
01huadalang on Discord (#feedback 1566170404542742740): three ZCode
accounts used at once from one address got the address refused with a
405; two were served. They asked for one account to be used until it
runs out, then the next. Even under "In order", ZCode's maxConcurrency 3
spilled a full lane onto the next account (laneMate) and rests spread
the load, so every account was in use at once.
A provider's MaxAccounts (the editor's Advanced → "Accounts at once",
beside Concurrency; `magpie provider at-once <id> [n|off|default]`) is
how many of its accounts or keys take requests at the same time.
provider.AtOnce() is the user's own value, else what its plugin
declares (maxAccounts on the auth hook or package.json magpie, read by
host.js atOnceOf), else no limit; the user's 0 is no limit over the
plugin's. perKeyBarred keeps the first N in the user's own order
(rank), preferring ones not resting, and keepAtOnce puts the rest after
everything as asides with candidate.reserve (Weighed.Reserve). So in any
routing mode a reserve is asked only once the kept ones failed or rest,
and a kept one that rests gives its seat to the first reserve next time.
Guards: laneMate never spills onto a reserve; a full queue (laneErr)
drops the provider's reserves (dropReserves) and turns the request away
with the 429; session affinity moves a conversation off a reserve once
the kept ones can take it (affine "reserve"; Strict still holds).
Routing says "in reserve · {n} at once" on the row and why in the
request's story. zcode 0.1.40 (plugins 26864ec, on npm) declares 2, and
its mover min is raised to 0.1.40 two commits on.
Known leak, in docs/subsystems/gateway-routing.md: a failure that rests
nobody (a 5xx on one try) still passes that one request to the reserve,
as it does to any next candidate.
Tests: TestAtOnceKeepsFirstInUserOrder (every routing mode, a dragged
order, a resting key handing over its seat), TestAtOnceFullLaneWaitsForTheKept,
TestAtOnceReserveTakesOverAndGivesBack, provider TestAtOnce, plugin
host maxAccounts (hook and package.json), gui TestAtOnceSave, cli
TestAtOnceCmd, provider-at-once.test.cjs (both engines, five languages,
900 and 360px).
Broken by hand, each red then restored: laneMate's reserve guard
removed (FullLane times out); affine's reserve case removed
(ReserveTakesOver answers on k3); keepAtOnce disabled (all three red);
dropReserves disabled (FullLane gets no reply); the Routing row's
reserve branch removed (provider-at-once's Routing test red in all 10
engine/language runs).
Core budget: the field adds ~530 bytes to app.js; the neighbouring
editor comments are cut to fit, so TestCoreScriptBudget passes with no
raise.
Run on mote, Go 1.26.8:
- full suite, -timeout 45m, at a7d4c662d (on origin/main
|
||
|
|
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 |
||
|
|
3cfba2e376 |
test(gui): deprecated-subscriptions times the page's boot as its navigation (#3484)
Follow-up to ggbdpq's change before this one. Looking for an app-side cause behind the WebKit zh red found none. With ?view=providers the view comes before lastView, and renderProviders draws #movable synchronously once /api/providers is read. Run alone, the notice is up 20 to 40ms after the load event. What the 5s wait covered is the boot that follows goto's load event: /api/state, then /api/providers, then the rows. Under the whole suite's load that boot ran past a limit meant for one action on a loaded page. ggbdpq's 15s had no basis beyond being longer. The boot is the second half of the navigation, so it gets the navigation's minute, which #4470 gave every page.goto. The waits inside a loaded page keep 5s. The pageerror filter matched "due to access control checks" anywhere, in either engine. It is now anchored to WebKit and to "Fetch API cannot load …", as title-bar-tools and usage-fold have it (#1350). Broken by hand on mote: with /api/providers held 6s in the test's serve, webkit zh is red at a 5s wait ("locator.waitFor: Timeout 5000ms exceeded … #movable .deprecation") and green at this 60s. Run at the pushed head on mote (load ~115): - deprecated-subscriptions.test.cjs, chromium and webkit, en and zh: 4/4 (13 files, 189 cases, 187 pass. The 2 reds are signin-proxy's webkit zh and zh-TW at 380px, red alone at origin/main |
||
|
|
f802fc3301 |
test(gui): the deprecated-subscriptions waits after a page load get 15s
Under the whole suite's load, webkit zh once waited past the 5s default for the deprecation notice after the reload of Providers (#3484): a page load serves the files one by one, then /api/state is read before /api/providers before the rows, and the red passed alone right after. The notice and badge waits after a load get 15s; a load itself now has the 60s navigation timeout (#4470), and the waits inside a loaded page keep the quick 5s. The injected 6s /api/providers read that reproduces the red also showed a second snag on the same path: a reload kills the page's own background reads (the web update poll, What's new), and webkit reports each killed fetch as a page error on the page it leaves, which the errors assertion would have tripped on in just such a slow run. With every response faked here, that wording only ever means a killed read, so it is not counted as a page error. Landed (yetone): the next commit times the boot as the navigation and anchors the filter to WebKit's wording. Generated-by: GLM-5.3-Flash (ZCode) |
||
|
|
9c8636a351 |
gui: a proxy typed outside Settings takes its login in fields (#3382)
Settings' proxy row keeps a proxy's login in fields of its own, so a
password with @ : / % # or a space survives. The three places that ask
for a proxy of their own still took one line, and the same login had
to be percent-encoded by hand. Those places are the provider editor's
row, each account's and key's line, and the sign-in box's typed proxy.
Each now splits a pasted URL the way Settings' proxyFields does: the
login lands in the fields and the box keeps the address. What the
fields hold is joined back as it is typed, so the value saved (or sent
to a sign-in) is the address Settings would save for the same login:
userinfo in the address, the saved format unchanged. A field left as it
was split keeps its escapes, so a saved login with non-UTF-8 bytes
opens decoded, still works, and saves again byte for byte. A pasted URL
keeps working.
The layout question the issue leaves open ("an account line with two
more fields is wide"): the fields stack under the row, 140px each, so
an account line is no wider. A mode pick that doesn't ask for an
address dims them with the row's own "off", keeping their room, as the
address box always did. proxyLoginRow is the one helper, drawn by all
three places. Settings' own row is untouched. signin-proxy.test.cjs
pins the form's address as its first input, with the two new fields
beside it.
Changed in landing (yetone):
- The fields show for every scheme, as Settings' do. As first written
they showed only for a SOCKS address, but the split ran on any
pasted URL, and join skipped hidden fields. So a pasted
http://name:pw@host lost its login on save. With this change's first
app.js the new HTTP case is red: it saves "http://proxy.example:8080".
- The core budget is not raised. Comments were trimmed to bring the
core to 1,532,444 of 1,533,105.
- The test sets the navigation's minute, as the #4470 guard asks.
Save and the sign-in wait on the post itself, with 30s of room, not
a fixed 2.5s or 2s cap. The sign-in no longer clicks "Sign in
anyway": on main a sign-in again goes straight to the browser.
Broken by hand on mote, chromium en and zh: with app.js and app.css at
origin/main, proxy-login-fields is red 6/6; with this change's first
app.js, its provider case is red 2/2 on the HTTP login.
Run at the pushed head on mote (load ~115):
- proxy-login-fields.test.cjs, chromium and webkit, en and zh: 12/12.
- The same run took signin-proxy, account-proxy, provider-proxy,
provider-many-keys-proxy, provider-advanced-fold, nav-timeout and
i18n-keys in both engines (13 files, 189 cases, 187 pass. The 2 reds are signin-proxy's webkit zh and zh-TW at 380px, red alone at origin/main
|
||
|
|
fcf87a7853 |
test(gui): four pages with a 5s default get the navigation's minute (#4622)
nav-timeout.test.cjs, the #4470 guard, is red on origin/main |
||
|
|
5bfa9f0762 |
gateway: a group's backup gives the conversation back once the member listed ahead of it is ready again (01huadalang on Discord)
01huadalang on Discord, after |
||
|
|
41b5c0f19a |
accounts: Claude Code stays on the account it moved to till that is spent too (hxy920830 on X)
hxy920830 on X wants Claude Code to use one account to 98%, move to the next and use that one to 98%, not jump back the moment the first resets. No setting gave that. NextLogin (#408) signed the agent back in to the first account as soon as it was under 90% again, under every routing. KeepLogin pins one account, In order goes back too, and switch only went back as well. Where the sign-in is what spends the accounts (Claude Code, whose own requests never pass the gateway, and Codex under switch only), the sign-in now stays on the account it moved to until that one is spent or fails, then moves on to the next ticked account with room. It goes back to the first only where the user said the first comes first: routing In order, or KeepLogin. Codex through the gateway keeps going back, because Smart routing sends its requests to the first account (#209) and the sign-in follows it. This is returnsToFirst in codex_switch.go. The return record is still written, so turning In order on later goes back as before. An old record is ignored otherwise, and its "First again" label (logins.go) is hidden. No user setting is overridden: In order and KeepLogin keep their meaning. GUI: the Routing note for Claude Code (and Codex under switch only) now says it stays on the account till that one is 98% used too. The two switch-only tooltips no longer promise going back. New and changed strings are in zh, zh-TW, ja and de. app.js lost a 3-line comment so the core script budget holds without a raise (core 1,531,108 of 1,533,105). Run on mote at 94cd5edde (base |
||
|
|
323159f1cc |
usage: a Codex reset's confirmation picks which of the account's resets is used (01huadalang)
01huadalang on Discord: resets were used only automatically, or by hand
the one that runs out first. Which account was already the user's to pick
(each account's card has its own Use); which of its resets was not.
- Usage card's "Use a reset" and the menu bar panel's "Use one...": when
the account holds two or more resets listed with their ids, the
confirmation has a "Reset to use" pop-up (the app's menu, not <select>),
soonest first and picked unless another is. Once another is picked it
names the account and that reset ("The one used is me@'s reset that
runs out ..."), and says the sooner one is kept and lost if unused.
Escape closes the open menu first, not the confirmation.
- POST /api/usage/codex-reset takes an optional credit. The server reads
the account's resets again and spends that credit only if it is still
held; a gone one is refused and no other is spent in its place. With no
credit it is as before (the soonest). Auto-use is unchanged.
- ResetCard carries the credit id; `magpie quota reset --card n` is the
CLI's sibling, its prompt naming the reset.
- askReset's dialog moved out to resetask.js, imported when Use is
pressed (like signsheets.js), so the core's scripts are 1,530,733 bytes,
under the 1,533,105 budget with no raise (the pick alone took it 2,068
over). Five keys in zh, zh-TW, ja, de.
Run on mote (mote-run), at the base
|
||
|
|
e6b595e1ab |
claude: Interactive only, a setting under which a model request never runs as claude -p (_yuchanns_ on X)
_yuchanns_ on X, on the interactive mode falling back to -p: for people
who stayed off magpie's Claude subscriptions because of -p, a fallback
is a time bomb. Settings › Models › Replies › Claude Code's interactive
mode now has three choices: Off (always -p), On (the default, falling
back to -p as before) and Interactive only.
With Interactive only (settings.ClaudeTUIOnly; ClaudePrintMode set too
wins):
- a run claudeTUI would make -p is not started; the request fails with
the reason and the setting (claudeOnlyErr, claudeNotTUIWhy);
- the helper is handed MAGPIE_CLAUDE_TUI_ONLY=1 (claudetui.OnlyEnv,
claudeCLI.tuiEnv). Where it would exec -p (no start, sign-in, first-run
notes, untrusted folder, 45s timeout) it exits with the reason
(fallBack in Run), and it ignores the broken mark;
- a helper that never answers initialize ends the turn with an error,
not a -p retry, and `broken` isn't counted (claudeMachineWhy), so the
next run tries the interactive mode again;
- the model test's and warm-up's "hi" (askClaude) runs through the
helper (askClaudeTUI) in stream-json, its stdin closed at the first
result. The helper command and env are built in one place now
(tuiCommand, tuiEnv) for both.
Reading the plan's allowance (/usage) asks no model and stays -p; the
setting's text says so. Docs: claude-subscription-bridge.md.
Provider editor, on e8347401f's "Claude Code runs as" pill
(ClaudeMode.Only): with the interactive mode in use and no last
request, it says a request it can't take fails, and the card's foot says
nothing runs as -p. Where the interactive mode can't run, the pill names
Interactive only, never claude -p, the line says "Claude requests fail:
<why>", and Change in Settings goes to the row. A request refused this
way never ran, so it isn't noted as the last request (noteClaudeRun
comes after the refusal).
app.js: the Replies rows share one helper (segRow, which waitRow uses
too), so app.js is 530 bytes under main's with the third choice; no
budget raise.
Tests: TestClaudeTUIOnlyRefusesPrint, TestClaudeTUIOnlyHungHelperNoPrint,
TestClaudeTUIOnlyTellsHelper, TestAskClaudeTUIOnly (gateway);
TestShimOnlyNeverPrints (claudetui: fake fail/trust/login/notes each
exit with an error and no -p, a marked-broken run still interactive);
claude-tui-setting.test.cjs (three choices, Only saves claudeTUIOnly with
claudePrintMode false) and claude-mode.test.cjs (Only in use, and Only where it can't run).
Broken by hand, each red, then put back: the startRun gate off
(RefusesPrint 200); start()'s Only check off (HungHelper 502 without the
Only reason); tuiEnv's OnlyEnv off (TellsHelper); askClaude's branch off
(AskClaudeTUIOnly); the helper's fallBack ignoring only (4 subtests);
BrokenSince's `&& !only` gone ("marked broken"); the save without
claudeTUIOnly (16 of 16 setting tests) and claudemode.js's m.only
branches gone, rebuilt on e8347401f's file (10 of 10 Only tests,
Chromium).
Run on mote at
|
||
|
|
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
|
||
|
|
e8347401fe |
providers: Claude Code runs as is a pill above the accounts, its hover card saying what TUI and -p each are and are good for
The owner asked for this design, and for it to replace the row |
||
|
|
0e90572274 |
browser: Magpie Browser, agents use the user's own browser and its sign-ins
The owner asked for a browser-use MCP of magpie's own, so an agent's browser keeps working when Claude Code switches accounts, and asked that it act in the browser the user uses every day: a fresh Playwright profile is signed in to nothing. Magpie Browser is an MV3 extension (internal/browserext, ID dmlhojidlfnkgamkekjhacgkpanbkeko, pinned by its key) that the user loads once in Chrome, Edge, Arc, Brave or another Chromium browser. It holds a WebSocket to the gateway's /v1/magpie/browser/extension and carries out each tool call with chrome.debugger (the DevTools protocol) in the user's own tabs. The socket is taken only from this computer, with a loopback Host (no DNS rebinding) and the extension's own Origin; a page or another extension that connected in its place would be handed every call. Agents reach it at /mcp/magpie/browser (Streamable HTTP) or through `magpie mcp browser` (stdio), and the Library's MCP market lists it as Magpie Browser, opt-in. Like the image server it is magpie's own, but it is never served to another computer, shared and with a key or not, and never to a web page, since it acts as the user wherever they are signed in. 17 tools: navigate (url, back, forward, reload), snapshot (an accessibility tree with refs, interactive-only on ask), click, type, press, select, hover, drag, upload, scroll, wait (text, gone, seconds), dialog, evaluate, text, screenshot (page, full page, element; JPEG or PNG), console and tabs (list, new, select, close). Each agent session goes on in its own tab; a link that opens a tab is followed, and a dialog a click opens is said in the reply. The Library's sheet for it has Set up the extension…, which writes the extension to ~/.config/magpie/browser-extension pointed at this gateway and shows the folder, the three steps to load it, and whether the browser is connected, polled while the sheet is open. Run: - TestBrowserToolsInARealBrowser: the extension magpie writes, loaded in a real Chrome for Testing 141 (Playwright's chromium-1234, headless=new) with --load-extension, connects, and all 17 tools act in a real tab of a fixture site. Green on mote (macOS 27), on xiaomi-gpu (Windows 11, win-run) and in magpie-desktop (Ubuntu 24.04, wsl-run). Under a test HOME Chrome needs --use-mock-keychain / --password-store=basic, or the extension's storage waits on a keychain and it never connects. - go test ./internal/gateway -run 'Browser|ReadOnly|Image', ./internal/ browserext, ./internal/browsermcp, ./internal/library, ./internal/gui -run 'Library|Browser', ./internal/cli on mote. - GUI: library-browser-setup.test.cjs (new) in Chromium and WebKit, en, zh, zh-TW, ja, de, at 1100 and 420 wide: 22/22. With i18n-keys and every library*.test.cjs: 915 pass, 1 fail, i18n-keys' "Unmarked", red on main since |
||
|
|
80af3b86a4 |
context: the card's head names the agent and the model's lab
The owner asked for the agent's name and the model's icon on the context window card, and picked design A from a mock-up: in the head, right of the title and before the state pill, [agent icon] Claude Code › [lab icon] anthropic/claude-sonnet-5-5 - context.js: the head's model is now a route (.ctx-route): the agent's icon and name (agentIcon, agentLabel, as the Usage page names it), a ›, then the model's lab icon before its id. labIcon picks the lab from the id after its provider prefix (Claude, OpenAI's gpt/o-series/codex, Gemma, Gemini, DeepSeek, Qwen, Kimi, GLM, Grok, MiniMax, Doubao, Mistral, Llama, MiMo, Step, Hunyuan); an id it doesn't know gets no icon, so a wrong logo never stands for a model. - context.css: the name in --fg-2 at 500, the › in --faint, the agent's icon 14px and the lab's 12px; the model id keeps its ellipsis. In a card 420px or narrower the agent's name and the › go and its icon stays; folded and that narrow, the model goes as it did before. - core_budget_test.go: lowered to 1,532,958, the core after this and the text viewer's move to ctxtext.js (the commit before), on origin/main |
||
|
|
9a9967ac28 |
context: a part's text viewer is loaded when a part is first opened
The context window card opens a part to the text the request sent there (readText, longText, picture, pieceView, openCtxText). That viewer is a dialog the user opens by a click, yet its 7KB were in context.js, which index.html loads on every page as part of the core. It moves as it is to ctxtext.js, which context.js imports on the first open, as signsheets.js and navlamp.js are imported; the card hands it the helpers it shares (fmtK, partName, itemName, itemLabel, tagOf). A failed import says so in the status line. The core is 7,005 bytes lighter, which makes room for the next commit (the card's head naming the agent and the model's lab); the budget is lowered there, to the total after both. old-webkit.test.cjs lists ctxtext.js among the scripts loaded later. Run at this tree ( |
||
|
|
20482d71ff |
library: a skill by a name the library has from elsewhere goes in beside it
mora1n on Discord: anthropics/skills' skill-creator and openai/skills'
are two skills by one name, and only the first could be added; the
second was skipped as "another skill called skill-creator, left as it
is". The library keyed being had by name in every place that asked.
Now being had is decided by source (hadSkill): the same source under any
name here, or a skill with no source (taken in from an agent's folder)
by that name with the very same files. Another skill from GitHub or a
git repository whose name is taken goes in beside it as
<name>-<owner> (skill-creator-openai), then owner-repo, repo, a number,
at most 64 bytes (freeSkillName in skill_beside.go). The library's copy
of its SKILL.md gets that name in the front matter's top-level name:
line (nameSkill), so no agent sees two skills by one name; Skill.Called
keeps the name it came with, and the carried bundle carries it. Its hash
is of the renamed copy, and checks (GitHub and git) and updates compare
what they fetch renamed the same way (fetchedHash), so it doesn't read
as edited and an update keeps the name.
The class: probe (Candidate.Have now means this skill; Candidate.As is
the name it has or would get), installFrom (listed and unlisted folder
by that name), the new-skills check (no longer drops a skill because
its name is taken), the market's had check (by name only for a skill
with no repository: none or a folder), carry, the TUI's probe list and
the GUI's probe list ("adds as {name}" with why in its title, "In the
library as {name}"; zh, zh-TW, ja, de; the tag is cut short in its row).
Old data: nothing is renamed. A skill already in the library keeps its
name, folder, SKILL.md and agent links; library.json without "called"
reads as before. Only a skill added from now on can get another name.
Not changed: a folder of the user's own is linked as it is and its
SKILL.md can't be named apart, so one by a taken name is still skipped,
now saying to rename it in its SKILL.md; and an agent's own skills
folder still holds one skill per name (an agent's own skill by the
library's name is settled by Use library / Keep agent's as before).
Run (mote, at c6fd4b37c on origin/main
|
||
|
|
76e4494dbd |
gateway: In turn passes over a provider's fallback while the provider is ready (01huadalang)
01huadalang on Discord (#feedback, 10-31): once the main provider has quota again, requests keep going to the fallback model, which is only meant for emergencies. Cause: a provider routed In turn treated its fallback rows as more of its own keys. A new turn went to the row after the last answerer (after), which past the provider's last key is the fallback, and a new conversation went to the row the fewest conversations held (leastHeld), which is the fallback nobody is on. Both happened while every key of the provider was ready. The session spread already skipped fallbacks (readyForNew); rotate's after and leastHeld(ready=false) did not. Fix: standsIn(order, i) marks a fallback row when the plan's first row is the provider's own. after, leastHeld and readyForNew all skip it, so a fallback takes a new turn or conversation only when nothing ahead of it can. Within one turn (tool results) a conversation still stays on whoever answered, because of sealed reasoning. Stays: Strict is the user's own choice and is not changed. A conversation it keeps on the fallback stays there. The trace now names the provider's ready first row (Affinity.Main), and the Routing page says why: the provider is ready again, Strict never moves a conversation, and new conversations go to the provider (en, zh, zh-TW, ja, de). Tests (internal/gateway/affinity_fallback_paths_test.go): - TestRotatingProviderKeepsItsFallbackForEmergencies (1 and 2 keys) - TestFallbackGivesBackAcrossRoutings: auto, in turn, in turn+session, least used+session, stays turn, and a group fallback with auto, in turn and session - TestStrictKeepsTheFallbackAndSaysTheMainIsReady On the old code, the rotate provider's new turn went to spare-key (Why new-turn), and in turn+session's new conversation went to the fallback (Why first). Broken by hand: with after's standsIn removed and Strict's Main dropped, the rotate test, the in-turn cases and the Strict test go red. session_spread_test's fallback case pinned the old In turn pick; it now expects k2. GUI: routing-affinity-order has a "strict" case. Run (via mote-run unless noted): - go test -tags nogui -count=1 -timeout 45m ./... at b08f35fcc (this change on |
||
|
|
535371c8f3 |
providers: a Claude subscription says whether it runs as Claude Code's interactive mode or claude -p, and why
The owner: the Claude Code provider page should say whether its runs go through the TUI or the CLI, and what tells them apart and what each gains. Under a Claude subscription's accounts a row now says "Running as Claude Code's interactive mode (TUI)" (a green dot) or "Running as claude -p (CLI)" with why: turned off in Settings, failed to start lately, Claude Code in WSL whose home wasn't found, not installed, or a system with no interactive mode. Under the TUI it says which requests still run as -p (safeguards, a JSON schema, an image by URL, a first message over 400KB). "TUI or -p?" opens what each is: entrypoint cli, the plan counting a request at about half; entrypoint sdk-cli, about twice. "Change in Settings" opens Settings › Models at the interactive mode's row. Only switch, which serves nothing, shows no row. The mode comes from GET /api/claude/mode (gateway.ClaudeModeNow), read as the editor opens and kept 30s, never in /api/providers' polls. Its machine-wide reasons are claudeMachineWhy, which claudePrintWhy now calls first, so the row and the gateway's own choice can't disagree. The row is drawn by claudemode.js, which app.js loads with that first read, so it weighs nothing on the core: after a rebase on origin/main |
||
|
|
c30d3b7b63 |
plugin pages: a page the reader left is told, and let go after 10 minutes unless it keeps itself
A plugin's page kept its frame, with its scripts, timers and
connections, for as long as the window was open once it had been
looked at: show() only hid its view, and a frame in a hidden view isn't
hidden to itself (its visibilityState doesn't change), so a page
couldn't even pause on its own. Asked by the owner: is that by design?
Only the lazy first load was.
- The kernel's leave hook now reaches the page part: the page is told
{event: "visibility", data: {visible}} as the reader leaves and comes
back. The bridge has magpie.visible and magpie.onVisibility(fn); hello
carries visible, for a page left before it said hello.
- A page left 10 minutes (IDLE_MS) has its frame removed and loads again
when next opened. Back sooner, it is the same frame. Its hello timer is
cleared, so nothing says it broke.
- magpie.page.keepAlive: true (plugin.PageSpec.KeepAlive, keepAlive in
/api/plugin-pages) keeps a page however long, for one that works while
no one looks at it. Anything but true is false, read as raw JSON so a
wrong type never drops the package's page.
- plugin-runtime.md's page row says so.
Run on mote. The Go suite and most GUI files ran at this change on
|
||
|
|
b75fa328ce |
gui: the ban warning is said once, not again beside accounts signed in
The owner, on Claude Code's editor with four Claude accounts in it and "Claude 账号可能被封禁" shown on Add another: "这里就不要显示可能被封禁了". A subscription that warns before a sign-in (Claude, Antigravity and the plugin-served ones with risk) now warns only while it has no account signed in, and never to sign one of its accounts in again. startSignIn asks hasLogins(agent), and its o.user, before the risk step. The import box keeps its note. What goes with it: Factory's warning offered "Use an API key instead…". Factory is retired and the Add sheet leaves it out with no account, so that warning was reachable only beside an account, and no longer is. Its accounts list's "Add an account by API key…" row still offers the key; factory-key.test.cjs now starts there. signin-close and signin-proxy no longer click "Sign in anyway" in editors with accounts. claude-risk.test.cjs: a new case opens a Claude editor with an account, clicks Add another, and wants the sign-in asked at once with no warning (chromium and webkit, en and zh). The first-account case is unchanged. Run, on the Linux box (magpie-desktop): - Broken by hand: the old app.js with the new test: red in both engines, nothing asked. - All 46 GUI files that reach a sign-in or the warning, plus i18n-keys: 739 ok, 2 red. login-import chromium en timed out waiting on its import box, then passed 4 of 4 alone. i18n-keys' "a plugin's words are its own" is red the same at origin/main |
||
|
|
59ea5dc8f8 |
gateway: a failure with this computer off the network rests nobody (usrname1833)
usrname1833 on Discord: with the computer offline, a routing group's
members failed to connect one after another, each rested, and the first
stayed behind the others once the network was back.
A 502 whose error says no connection was made (dial, lookup, refused, no
route, TLS handshake timeout, and Bun's ConnectionRefused / ENOTFOUND
for a plugin's fetch) now asks whether this computer has a network,
unless any upstream answered in the last 15s: no interface up with a
global address means none; otherwise up to three hosts of the user's
other providers (not p's own, not proxied ones, not localhost / LAN) are
dialled at once (2s), and none taking the connection means offline. The
verdict is kept 5s and asked by one request at a time. Offline, the
member is passed over as a down proxy is (failProxy): no rest, no count,
the trace says Fail "offline". One provider that can't connect while
another's host takes a connection, or while replies came lately, still
rests as before.
Covered where every rest passes: restAfterMarked (so decide_group's and
count_tokens' rests too), the serve loop's next-member path, and the last
member's label. Routing page: "network down" tag and a story for the
next-member and last-member cases, in zh, zh-TW, ja and de.
Run (mote, at this tree):
- gofmt -l clean; go vet ./internal/gateway on darwin, GOOS=linux,
GOOS=windows: ok
- go test -run 'TestOfflineRestsNobody|TestProxyDownDoesNotRest' -v
./internal/gateway: ok; go test -timeout 45m ./internal/gateway:
ok (708s)
- GUI: routing-offline.test.cjs (new) 10/10 and routing-proxy 4/4,
Chromium + WebKit, en zh zh-TW ja de. Every routing-*.test.cjs at once
(load 30-44 on mote): 1997 pass, 29 fail. The untouched base
|