4794de398ea8337d223a91e207181c56fcf4ad76
3181
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
55e81bce40 |
gui: Cancel in an MCP server's editor leaves the server as saved, after a Sign in too (新v学员 on Discord)
GitHub's remote MCP server, brought in from CC Switch with its token as an Authorization header: removing the header, picking Sign in, then Cancel (even with Discard asked and picked) left the header removed in library.json and every agent's file. Cause: Sign in calls ready(), which saved the whole form whenever its name, transport, URL or headers differed from the saved server. The sign-in (mcpauth.Start) uses only the name and URL, so the headers never needed saving for it. Now ready saves only when the sign-in is to another server than the saved one (new, name, transport or URL changed); the button then reads "Save and sign in" (zh, zh-TW, ja, de), and what it saved becomes the form's saved state, so Cancel doesn't offer to discard what is already written. Audited the page's other sheets for the same thing: the hook editor, paste-many, the server sheet, the skill how-to, By agent (Done only) and the confirm dialogs save nothing before their own Save. Env and command arguments in this editor only ever saved through Save; the new test covers them too. Run: - New mcp-editor-cancel.test.cjs: Chromium and WebKit, en/zh/zh-TW/ja/de, 1100 and 390 wide, 22/22 twice. Broken by hand each: the old headers-count rule, the saved state not updated after the save, and the button not saying it saves; each 0/11 in Chromium. - mcp-signin (updated for the new label), mcp-signin-health, library-mcp-health, library-mcp-copy-config, library-servers-bulk, library-env-refs, i18n-keys, ux-safety: pass. - library-mcp-tools and library-mcp-tool-switch have WebKit reds (the footer over the clicked switch) that come and go, 1 to 7 per run, the same with this commit's parent's assets. - Sandbox HOME, rebuilt magpie web: header removed, Sign in (GitHub answered with its no-registration refusal), Cancel, Discard: the header is still in library.json and ~/.claude.json, and no save request was sent. |
||
|
|
eb1fab34c7 |
library, gateway: an MCP server magpie is signed in to no longer shows "Signed in" beside "needs sign-in" (新v学员 on Discord)
What was wrong, reproduced in a sandbox HOME with mcpauthtest's fake OAuth server behind a sandbox magpie: - A server no agent has is checked only on a click (#1597). Clicked before its sign-in it said "needs sign-in"; after signing in, the page rechecked only servers in use, so the row kept that result beside the new "Signed in" tag. The page now rechecks any server it has a result for once its key (sign-in included) changed. - The check sent magpie's token but never renewed it on a 401, so an expired access token with a good refresh token read "needs sign-in" beside "Signed in". checkHTTP now renews once and asks again, as the gateway's relay does. - A server that refuses even a just-renewed token was still "Signed in". mcpauth.Rejected marks such a sign-in run out, from the check and from the gateway's /mcp/<name> relay; ServerHealth.SignIn carries the status back (only for a server magpie has a sign-in record for) and the row's tag turns to "Sign-in ran out". mcpauthtest.Fake gains RefuseTokens for the last case. Run: - go test -tags nogui ./internal/mcpauth/... ./internal/library ./internal/gateway (HOME and GOCACHE in scratch): ok. - gofmt -l; go vet darwin, GOOS=linux -tags nogui, GOOS=windows on the touched packages: clean. - New TestCheckRenewsMagpiesSignIn, TestCheckSaysSignInRanOut, TestMCPProxyRefusedAfterRenewalRunsOut. Broken by hand: renewal removed from checkHTTP, Rejected removed from the check, and from the gateway; each went red. - New mcp-signin-health.test.cjs: Chromium and WebKit, en/zh/zh-TW/ja/de, 1100 and 390 wide, 22/22. Each of the two library.js changes reverted on its own: 0/11 in Chromium. library-mcp-health, mcp-signin and i18n-keys pass. - Sandbox repro before and after with the fake server: both cases now show one tag; forget+revoke shows "Sign-in ran out · needs sign-in". Not run: a real vendor's server refusing a renewed token; the fake stands in for it. |
||
|
|
5c82e6880d |
site: every sponsor link goes through usemagpie.ai/go, so its clicks are counted per place
The home page's "Sponsored by" cards and the READMEs' Sponsors logo linked the sponsors directly, so nothing told the owner how many clicks each seat brought. They now link /go/<id>/home and https://usemagpie.ai/go/<id>/readme. site/sponsors.js holds where each sends the browser (the sponsor's own ref link, unchanged: APINEBULA has one per place). The worker counts a GET as "magpie sponsor go" {id, where, country} in PostHog, beside the in-app partners' "magpie partner go" (whose /go links were already counted), and a HEAD goes on uncounted. A partner's keys/site links are tried first; a sponsor link takes no region. A test fails if index.html or either README links a sponsor's own URL directly, or names a /go link sponsors.js doesn't have. Run: node --test site/worker.test.mjs (20 pass) and site/install.test.mjs (10 pass). Broke it by hand: README.zh-CN.md back on the direct link turns the guard red. Deployed (version e4f40cff); curl on usemagpie.ai: /go/apinebula/readme → 302 apinebula.ai/ref/qmXqFGpr, /go/apinebula/home → 302 apinebula.ai/ref/Gs54HwyB, /go/yylx/home → 302 yylx.io/?ref=magpie, /go/yylx/readme and /go/apinebula/home/x → 404; / and /zh/ serve the /go hrefs. Not checked: the events arriving in PostHog (the worker's key can't read). |
||
|
|
689edbd6be |
gateway: a Codex subagent refused for a sealed task is told the task itself is sealed, which fork_turns="none" doesn't change (#1855, hanekoo)
hanekoo's Codex Desktop lead on gpt-6.1-sol (Codex's own ChatGPT sign-in)
spawned a subagent on antigravity/gemini-3.8-flash with fork_turns="none"
and got the sealed-task refusal, which read as if the lead's turns were
the problem and fork_turns="none" should have avoided it.
What Codex rust-v0.162.0-alpha.17.2 sends (read from its source, not the
reporter's bytes, which aren't available): spawn.rs's fork_mode is None
for "none", so no turn of the lead's is copied in. The subagent's task is
spawn_agent's `message` argument; the ChatGPT backend returns it sealed
(the function call's encrypted_function_args), router.rs's direct_source
makes it ToolCallSource::Direct, agent_message_from_tool makes it
AgentMessage::Encrypted, and to_model_input_item writes it as the
agent_message's encrypted_content under the NEW_TASK header. So the one
sealed thing in the subagent's first request is the task itself: there is
nothing magpie can leave out and still give the subagent work, and no
request flag in Codex asks the backend for plaintext arguments. The
refusal stays; it now says why.
- codex_backend.go: sealedTaskItself, added to all three sealedTaskError
variants (lead unknown / Codex's own sign-in, a relay that sealed it,
plugins#70's earlier chat provider): what is sealed is the task the
spawning agent wrote in spawn_agent, and fork_turns="none" keeps only
the lead's turns out, not the seal. The existing advice (the lead's
model for the subagent, or a lead not on the ChatGPT backend) stays.
- docs/subsystems/gateway-routing.md: the same, under sealed tasks.
- sealed_fork_none_test.go: the fork_turns="none" first request rebuilt
from Codex's source (developer + environment_context + the sealed
NEW_TASK with Task name/Sender lines), a lead first on Codex's own
sign-in, the subagent on a chat provider. It is refused before the
provider is asked, with no ciphertext in the reply, and says the task
itself is sealed whatever fork_turns says.
Run: with the old codex_backend.go put back,
TestSealedTaskWithForkTurnsNoneSaysTheTaskItselfIsSealed fails ("the
refusal doesn't say the task itself is sealed whatever fork_turns
says"); with the change it passes. gofmt -l (empty), go vet / GOOS=linux
-tags nogui / GOOS=windows go vet ./internal/gateway, go build, GOOS=linux
-tags nogui and GOOS=windows go build ./..., go test -tags nogui
./internal/gateway (ok, 353s) under a sandbox HOME with a private GOCACHE.
Not run: the whole `go test ./...` (only the gateway package changed);
no real Codex Desktop or ChatGPT account was used, so the reporter's
bytes are not reproduced; the GUI's sealedKept text is unchanged. The
502 "context canceled" on gpt-6.1-sol in the report is Codex's own
sign-in request most likely cancelled by Codex itself (the client went away), a separate
request, and wasn't chased.
|
||
|
|
c83ab81dff |
gateway: a Grok subscription draws any grok-imagine-image* named bare, and makes any grok-imagine-video* (#1857)
A bare grok-imagine-image-2.0 on /v1/images/generations got 404 "magpie knows no model ... to draw with", while grok/grok-imagine-image-2.0 drew: a bare name was looked up only in grokDrawers, a fixed list of two. The same held for a bare video name not in grokVideoModels, though with the provider named videosCreate already took any grok-imagine-video*. What changed - draw.go: resolveDrawing, after an exact match in any provider's Drawers, sends a bare name of a subscription's image family to it (drawsFamily): grok-imagine-image* on a Grok subscription, gpt-image-* on a ChatGPT account (the sibling list, codexDrawers). The vendor draws it or refuses it in its own words. Exact matches still win, so an API key that lists the model keeps it; a name of no family is still 404. - drawing_route.go: Codex's per-turn preferred provider takes the same family match. - video.go: bareVideomaker takes any grok-imagine-video* on a Grok subscription, matching what videosCreate takes with the provider named. - AutoDrawer and AutoVideomaker are unchanged (still the listed models). - A moved Grok user goes through this same gateway code (drawsGrok covers the plugin's provider; the plugin only signs), so the Grok plugin needs no change and the mover's min stays. What was run - New TestGrokDrawsANewerModelByItsBareName (the reporter's request), TestCodexDrawsANewerModelByItsBareName, a bare grok-imagine-image-2.0 in TestGrokPluginDraws (plugin parity) and grok-imagine-video-2.0 in TestVideoModelByItsBareName. With the family match switched off by hand all four fail with the 404 "magpie knows no model"; restored they pass. - gofmt -l clean; go vet ./... on darwin, GOOS=linux -tags nogui, GOOS=windows; go build on darwin, linux (nogui), windows. - go test -tags nogui -count=1 ./internal/gateway/... ./internal/imagemcp/... ./internal/provider/...: ok (sandbox HOME, private GOCACHE). Not run - Not tried against a real Grok or ChatGPT account: the request sent is the one the reporter already drew with as grok/grok-imagine-image-2.0; only which provider a bare name resolves to changed. Whether chatgpt.com serves any other gpt-image-* is the vendor's to answer. - The full go test ./... was not run. |
||
|
|
248a68598c |
gateway, provider, gui, cli: a key+URL provider may be sent the agent's own User-Agent in place of magpie's (#1851)
Every forward went with User-Agent magpie/<version>. A coding plan that serves only the agents it names (pi, OpenCode, Claude Code…) knows them by their User-Agent, so it turned magpie away. What changed - provider: PassUserAgent (passUserAgent in providers.json), off by default. PassesUserAgent takes it only for a key+URL provider: never a signed-in account, a plugin's, or a vendor whose own client magpie goes as (OwnClient: OpenCode, Cline, Kilo, another magpie). A copy keeps it. - gateway: userAgentFor in forwardOnce (chat, Anthropic, Responses, Gemini, count_tokens) sends the inbound User-Agent unchanged where the provider passes it on. It sends magpie's where it doesn't, where the agent sent none, and on magpie's own requests (magpiesOwn: magpie/…, magpie-router/vision/search, the image tool's "<client> magpie-image/1", which is built from MCP clientInfo, not a User-Agent). magpie never invents another client's. The claude-cli/Codex header copies, the OpenCode/Cline/Kilo overrides and account signing run after it as before, and the user's header.User-Agent is put on at signing, so it wins. - gateway: embeddings, images and videos (retrieveFrom, sendWith, remoteVideoContent) now stamp the same for a key+URL provider through stampUA, from the caller's User-Agent kept on the request ctx (caller.ua, withCaller). Before, they went with Go's default (Go-http-client/1.1). Account and remote-magpie paths are untouched. - cli: `magpie provider set <id> user-agent=agent|magpie`, refused for a signed-in account; `magpie provider <id>` shows it. - gui: the provider editor's User-Agent row, "Send the agent's own User-Agent", with an explanation, for a provider with a key only (the JSON says ownClient for presets and providers); en/zh/zh-TW/ja/de. The TUI only adds presets, so it has no field for this. - docs: reference.md (provider set) and subsystems/gateway-routing.md. What was run - gofmt -l clean; go vet ./... on darwin, GOOS=linux -tags nogui and GOOS=windows. - go test -count=1 ./internal/gateway ./internal/provider ./internal/cli ./internal/gui: all ok (sandbox HOME, private GOCACHE). - TestUserAgentPassedOn covers 7 routes (messages, count_tokens, chat, responses, gemini, embeddings, images) x off / on / on with no UA / on with magpie-router/1 / on with the image tool's UA / the user's header with it on and off. TestUserAgentAccountUntouched: a Factory account with passUserAgent in providers.json is still asked as factory-cli/. Also TestUserAgentClaudeCodeAsBefore, TestUserAgentFor, TestPassesUserAgent, TestAddCopyPassUserAgent, TestProviderUserAgentPair. - Broken by hand, each went red: forwardOnce back to magpie's UA (5 routes red); stampUA removed from embeddings/draw (both red, seen as Go-http-client/1.1); PassesUserAgent ignoring accounts/OwnClient; magpiesOwn dropped (the internal UAs leaked on all 7 routes); the GUI row shown for OpenCode and Save not posting it. - provider-user-agent.test.cjs: 60/60 in chromium and webkit, en, zh, zh-TW, ja, de, at 900 and 440 wide. The provider/editor/add/i18n GUI tests in chromium: 244/244. Not run - Not tried against a real coding plan that checks User-Agent, nor with a real agent through a live gateway. Videos have no test of their own (they go through sendWith, which the images test covers). - The GUI suite was not run in full; the Windows box was not used. |
||
|
|
83cdc72898 |
readme: sponsor logos at 36px, up from 26px
The owner found the README sponsor logos too small. 36px is the APINEBULA SVG's own size (143x37), about 139px wide: clearly bigger than the 20px badges above it, still well under the 112px icon, and six logos at this height fit one row in the 900px column. Both READMEs. |
||
|
|
a4385e0999 |
gui: the Library's Select bar removes the skills, servers or hooks picked, a whole group at once with its header's box (#1852)
What: Select's bar on the skills, servers and hooks pages gets Remove…
(red, beside Clear). It asks first, as Remove all does, naming the count
("Remove 3 skills?", or "Remove pack-a?" for one), and posts only the
picked names to the existing remove-all endpoints (RemoveSkills /
RemoveServers / RemoveHooks), so each goes exactly as its row's Remove
would: same backups, only magpie's own copies. A group's or part's header
box (already there in Select) picks the whole group, so an outdated group
goes in one step. Groups have no menu, so no "Delete group…" item was
added.
A name that wasn't removed stays picked, its row's second line shows
"Not removed: <error>" in red, the status names it ("notes removed ·
stuck wasn't removed: …"), and nothing reports success for it. When every
name fails the endpoint answers 400: the sheet stays open with its button
enabled again. The label stays "Remove…" whatever the count (the count is
beside it and in the sheet): "Remove 3…" rewrapped the bar at 440px in
ja and moved the box under the pointer (library-servers-bulk caught it).
No Go change: the batch removals already reported Unremoved per name.
Strings in zh, zh-TW, ja, de. docs/subsystems/library.md says it.
Run: new internal/gui/tests/library-pick-remove.test.cjs (Playwright
1.62.0, chromium and webkit, en/zh/zh-TW/ja/de, 1100 and 390 px): group
box picks 3, Cancel posts nothing, Remove takes 3 and leaves the rest, a
partial failure keeps the failed one picked with its error, a total
failure keeps the sheet; every click checked for no scroll and nothing
moving. Red by hand: dropping every name from picked after a partial
failure, and dropping the partial-failure status. With it, both engines:
library-servers-bulk, library-hooks, i18n-keys, gui-de, gui-ja,
gui-zh-tw, click-scroll, group-pick-filter, remove-found-skill,
library-items, remove-all-skills: 60/60 pass. library-servers-bulk
chromium failed once in a parallel run, then passed 3/3 alone and 2/2 in
the same parallel run on this tree and on origin/main.
Not run: pick-skills.test.cjs is red in webkit (en, zh: the click on the
"pdf" row times out) on origin/main
|
||
|
|
6669d497d0 |
gui: an account's seat on the Routing stage tells each of its windows and when each resets in its tooltip (#1835)
A seat on the stage says the fullest window's figure while idle
("40% used · renews in 2h"), and what it is doing while it answers. The
other windows, and their resets, weren't anywhere on the stage. Its
tooltip, which held only its id, now adds one line a window, the same
lines Accounts and keys shows (winsOf, the Usage page's readings,
#1833). It is a tooltip rather than a second line on each seat because
the stage is the live picture of a request, and a line more on every
seat would crowd it. Live only.
docs/subsystems/gui-shell.md: under Routing account windows.
Run: tests/routing-seat-windows.test.cjs (new), chromium and webkit,
en, zh, zh-TW, ja, de at 1100 and 420px: the answering seat's title is
its id and both windows, and the seat whose only card is another
computer's keeps its id alone. 22/22 pass, and 11 of 11 fail in chromium
with routing.js as before. Not tried with a real account.
|
||
|
|
0801c7bb02 |
gui: Routing's Accounts and keys has a refresh beside its heading that reads the accounts' allowances again, by hand only (#1834)
The windows each account shows (#1833) are the Usage page's readings, read the ordinary way when Routing opens. To see them fresh one had to go to Usage and back. The icon button beside "Accounts and keys" makes the asked read Usage's Refresh now makes (loadQuotas(true), /api/usage/quotas?asked=1). It turns while the read is on its way, a click then asks nothing more, and the rows are drawn from what comes back. There is no timer: nothing reads again by itself, as #1518 has allowances read only when asked. It shows only live, with a subscription account listed. Its tooltip is new ("Read the accounts' allowances again", in zh, zh-TW, ja, de), and its label reuses "Refresh now". docs/subsystems/gui-shell.md: under Routing account windows. Run: tests/routing-read-allowances.test.cjs (new), chromium and webkit, en, zh, zh-TW, ja, de at 1100 and 420px: title and label, on the heading's line, opening reads only unasked, one asked read on click with the button busy until it lands, a second click while busy asks nothing, the windows show the new reading, the view doesn't move, and no asked read in 2.5s after. A list of keys only has no button. 24/24 pass, and 11 of 12 fail with routing.js, routing.css and i18n.js as before. gui-ja, gui-zh-tw, gui-de, i18n-keys and routing-account-windows pass. Looked at in screenshots at 1100px (en) and 420px (ja). Not tried with a real account. |
||
|
|
6627ddd54b |
gui: a subscription account in Routing's Accounts and keys shows each of its windows and when each resets, as the Usage page read them (#1833)
The list said one figure for an account, the window routing went by. A
Claude account's 5 hours and 7 days, or Codex's, each with its reset, are
now on a line under it ("5 hours 40% used · resets in 2h"). cardOf matches
the route's account to app.js's quotas: a subscription card of this
computer (no from) whose provider is the account's agent (a plugin's
provider id) or its provider, and whose user is the account's, ignoring
case. Nothing new is read from vendors: opening Routing asks
/api/usage/quotas in the ordinary way when the readings are missing or
over a minute old, never ?asked=1. A kept day's list shows none, as its
requests were weighed by readings long gone.
loadQuotas now treats an answer that isn't a list of cards as a failed
read and keeps what it had. Routing reading quotas showed it: a page given
{} stored it and renderQuotas threw on quotas.some.
docs/subsystems/gui-shell.md: Routing account windows.
Run: tests/routing-account-windows.test.cjs (new), chromium and webkit,
en, zh, zh-TW, ja, de at 1100 and 420px: exact window lines, none for an
account whose only card is another computer's, no overflow, no asked
read. 22/22 pass; fails with app.js, routing.js and routing.css as
before. Looked at in a screenshot at 1100px (en) and 420px (de). All 60
routing-*.test.cjs and click-scroll: 636 pass, 5 fail, all in WebKit in
routing-group-fold (en, ja, de) and routing-sessions (en), which fail the
same alone on the old assets at
|
||
|
|
07ec8eadd8 |
gui: Settings › Network's Proxy line says it holds for requests to vendors without a proxy of their own (#1832, wfb835)
Off and Auto-with-no-system-proxy said requests to vendors "go direct", and a proxy set here said they "go through" it. Neither is true for a provider, account or key that names its own proxy (or Direct): netproxy.With keeps that whatever this row is set to. The three lines now say they cover requests to vendors without a proxy of their own, and update checks, in en, zh, zh-TW, ja and de. "Following the system proxy" and "Following HTTPS_PROXY" name where the proxy came from and are left as they are. Run: tests/proxy-own-wording.test.cjs (new) in chromium and webkit, all five languages, at 900px and 420px, for Off, none found and a proxy set here: exact #proxySub text, and no overflow from the longer line. 22/22 pass; with app.js and i18n.js put back to |
||
|
|
403f3845e2 |
gateway: Codex's spawn_agent names every model also when Codex hands it to the lead through a tool search, as it does on 0.162 (Gearclickist on Discord)
Gearclickist, after v0.1.1214: the lead still saw only five models for
its subagents. v0.1.1214 (
|
||
|
|
50adf78e66 |
gateway, gui: the web searcher picked in Settings is never handed on to another provider, and one that answered without searching is said so (Gearclickist on Discord)
Cause: Gearclickist picked the Grok subscription's grok-4.7 in Settings ›
Web search. Their grok rows were about 1.3k tokens. That is the size of a
Grok request that ran no search. With the tool and searching, our real
Grok account gives 6k-66k input every time, and /models says
supports_backend_search for all four models. So on their account Grok
answered from what it knew. searchWith read that as "found nothing", and
modelSearch handed the search to the next of Searchers() by rank: Codex's
gpt-6-astra, a pricier subscription model they never picked.
Change:
- modelSearch: a searcher named in Settings gives way to no other
provider. Its error goes back to the model ("no other provider searches
in its place"), and webSearch then asks the search APIs, if any are set
up. Automatic keeps its fallback (#669) with the Routing row that says
why.
- searchWith tells a reply with no server_tool_use or
web_search_tool_result (errNotSearched) apart from one that searched and
named no page (errFoundNothing). CallFor gets notSearched.
- namedFailed/SearcherFailed keep the named searcher's last failed search,
cleared by its next success or by picking another searcher.
/api/settings returns it as searchFailed.
- Settings › Web search puts a warning at the start of the row's help
(before the ellipsis) naming the searcher, when, and why ("answered
without searching the web, so its account or plan may not offer web
search"). The help text now says a picked provider is never replaced by
another provider. The Routing row (kindWhy) says not-searched too.
zh, zh-TW, ja and de strings added.
- docs/subsystems/gateway-routing.md rewritten for the rule.
Run (worktree on origin/main
|
||
|
|
1404faad51 |
gui tests: tray-logos says what the wheel met when the settings list stays at 0, since Chromium zh's red could not be made again (#1850)
The zh case failed "the settings list must be scrolled" in Chromium in other sessions' runs (wt-nav navrepro alone/full/refail logs, Oct 12; the a1843 full run, Oct 13), each time Chromium zh only, and passed on rerun. What changed: the assertion is the same (scrollTop > 0 after the wheel), but its failure message now records the scrollTop after each wheel, any "refused" scroll-guard console warning, the hovered button's box, #view-settings' rect/scrollHeight/clientHeight/overflow, and what elementsFromPoint finds under the pointer. Nothing in the app changed. Why not a fix: no cause was found. It passed every way tried at |
||
|
|
31c1e3ab1c |
gui: dates, times and numbers read in the GUI's language, not the system's, so a Chinese Mac set to English no longer shows Routing's days as 10月11日 周日 (#1843)
What changed: intlLang() was the GUI's tag for Intl, but returned
undefined for English ("the system's own formats"), and about 60 calls
in app.js, routing.js, library.js, plugins.js, caller-keys.js and
context.js formatted with no locale, [] or undefined anyway. All of
those follow the system's locale, so with magpie set to English on a
zh-CN Mac, Routing's day pills read "10月11日 周日" (the report), and so
did request times, reset/until titles on Accounts and Usage, plugin and
library dates, the restore notice, and key rest times. Now intlLang()
always returns a tag: zh-CN, zh-TW, ja-JP, de-DE for those languages,
and for English the system's own English (en-GB keeps day-month) or
plain "en" on a system in another language. Every date, time and number
formatting call in the assets takes intlLang(); the `intlLang() || "en"`
and `documentElement.lang || undefined` variants are folded into it.
<html lang> stays "en" for English. Routing's clock formatters, made
once, are made again when the language changes.
Tests: dates-gui-lang.test.cjs runs English on a zh-CN browser, English
on en-GB, and zh, zh-TW, ja, de on en-US, in Chromium and WebKit at
1100 and 390px: Routing's day pills (in the bar and under its menu) and
a request's time must read in the GUI's tag and not the browser's.
TestDatesFollowGUILanguage (Go, so CI runs it) fails on any formatting
call in the assets given no locale, [] or undefined.
github-token and reset-each-title computed their expected text in the
browser's locale, i.e. they encoded the bug for zh/ja/de; they now ask
intlLang().
Run: with routing.js put back to origin/main the new GUI test fails 10
of 12 (all but en-GB, where the system's English is right either way);
with intlLang() returning undefined for English the English cases fail.
TestDatesFollowGUILanguage fails on origin/main's routing.js (lines 244,
688, 1925, 2230, ...) and passes on the fix. gofmt -l clean; go vet
./internal/gui on darwin, GOOS=linux -tags nogui and GOOS=windows ok;
go test -tags nogui ./internal/gui ok. Full GUI suite (621 files,
concurrency 6): 51 failures in 21 files; rerun alone, the same 8 files
fail the same way on an origin/main
|
||
|
|
fd03592331 |
provider: WorkBuddy AI's GLM models are text-only, so magpie's image-describing model reads their images; the plugin to 0.1.16 (Yirasumi on Discord)
What: for workbuddy-ai alone, a model whose id starts with glm- is listed
with ImageInput false (wbSite.textOnly), whatever /v3/config's
supportsImages says: in the list fetched, in the built-in list shown
before it, and in a list saved before this change (Provider.available).
The workbuddy movers' min goes to 0.1.16, where the plugin does the same
(magpie-community/plugins cb90931).
Why: checked on 2026-10-13 with the owner's real WorkBuddy AI account.
www.workbuddy.ai/v3/config marks every model supportsImages: true, but
its server takes the image out of a chat to glm-5.3-flash, glm-5.3 or
glm-5.2 and puts "[System reminder: the current model does not support
images. Content filtered. ...]" in its place. Its other models read
images, and WorkBuddy (China)'s glm-5.3-flash does too, so China and the
other families are left as the config says. A user's own answer in
Settings (ModelImages) still wins: entryFor applies it over the list.
Run:
- go test ./internal/provider (full, ok); go test ./internal/gateway
-run 'WorkBuddy|WB|Vision|Describ|Image' (ok).
- TestWorkBuddyAIGLMIsTextOnly fails with textOnly turned off by hand;
TestWorkBuddyAISavedGLMIsTextOnly fails without the models.go case.
- gofmt -l; go vet darwin, GOOS=linux -tags nogui, GOOS=windows.
- Sandbox gateway (own HOME, port 3486, built-in WorkBuddy AI login from
the owner's migration backup, nothing live written): /v1/models lists
glm-5.3-flash, glm-5.3, glm-5.2 as text, deepseek, kimi, gemini, gpt,
grok with image. A blue|yellow split PNG sent to glm-5.3-flash was
described by workbuddy-ai/deepseek-v4.1-flash (Routing kind "vision"),
and glm-5.3-flash answered "left: blue, right: yellow". With
modelImages {"workbuddy-ai/glm-5.3": true} in the sandbox settings,
glm-5.3 listed image again and glm-5.3-flash stayed text.
Not run: the moved (plugin) path through a sandbox app; the plugin's own
bun tests cover its list, and magpie maps its input.image as ImageInput.
|
||
|
|
91e7ef56af |
settings, gateway, gui: a browser extension is listed among the web pages that may call magpie by its origin, chrome-extension://<id> and the like (#1051, SkyAerope on Discord)
What: Settings › Network and sharing › Web pages now takes a browser
extension's origin besides http(s) ones: chrome-extension://<id>
(Chromium, the id 32 letters a-p), moz-extension://<uuid> (Firefox's
Internal UUID) and safari-web-extension://<uuid> (Safari). cleanOrigin
takes only those three schemes, only with an id of that browser's shape,
lower-cased and with a trailing "/" let go; a bare scheme, a wildcard, a
path, a port, user info, a query or another browser's id shape is
refused. The GUI maps the new refusal to the same message, which now
names the extension form, in en/zh/zh-TW/ja/de, and a listed origin
wraps instead of being cut (an extension's runs to 50-60 characters and
was ellipsized at a 440px panel). The 401 a listed caller gets without a
key names extensions too. Docs: gateway-routing.md, the settings field.
Why: an extension without host_permissions (Sider and the like) is held
to CORS; the gateway never answered its preflight, since its origin
couldn't be listed. Nothing else in the access rules changes: corsGuard
treats a listed extension exactly as a listed page (preflight answered,
every call needs an enabled gateway key or gets 401, even on loopback),
an unlisted extension passes with no CORS headers as before (foreignPage
still only judges http/https), and lanGuard's rebound/Host checks, the
allow list and every other route guard are untouched.
The Origin each browser sends was checked, not guessed: real Chromium
(below) sent Origin: chrome-extension://<32 a-p>; Firefox's is
moz-extension://<Internal UUID> (Gotify's and others' CORS docs list
it); Safari's is safari-web-extension://<lowercase uuid>, per Apple's
developer forums (thread 654839), where an Apple engineer notes the uuid
changes on each Safari launch, so a Safari listing lasts until it
restarts (said in the doc). A content script's fetch carries the page's
origin (MDN), so only extension pages, popups and workers are covered.
Run, at
|
||
|
|
fe4295e1db |
gui: sidebar-tab-top also holds the page's own strip and page switching still, in every language (#1844)
lainbo's test checked the sidebar rows in English and Chinese. The rule the
change sits beside ("where the reader is",
|
||
|
|
7d05a00f5f |
gui: a tab picked in the sidebar opens at its top, not where the tab before was left (#1844)
Usage, Library, Plugins and Settings list their tabs under the page in the sidebar (navSubs), and a page's tabs share its one scroll. A row only clicked the page's own tab, so scrolled to the foot of Settings › General and Allowances picked, Allowances showed at its foot; Library › MCP servers and Skills the same. A row that picks another tab now clicks it and scrolls the page to its top through scrollOnPurpose with the row's own click. The tab already open, picked again, leaves the page where it is. The page's own strip (the header's tabs) and switching between pages are unchanged. sidebar-tab-top.test.cjs (Chromium, WebKit, en, zh) fails without the change, 6 of 6: "Allowances opens at its top", 177 (en) and 228 (zh) instead of 0; with the Settings part left out, "Skills opens at its top", about 2100 instead of 0. It passes 6 of 6 with it. go test -tags nogui ./internal/gui in a temp HOME passes. |
||
|
|
28aac86bc1 |
gui: the ja Hooks notice names its agent once, so the ja translation test passes again
|
||
|
|
60808fd9cf |
usage, gateway, gui: magpie's own requests are told apart from the agent's, and a classifier on a subscription says it asks it every turn (#1839)
kensenzhao saw a subscription's allowance spent by requests the agent
didn't make: a routing group's classifier, set to a subscription's model,
asks it as every turn begins, and those calls looked like the agent's own.
What changed
- usage.Group has an own share (calls, tokens, cost) of the calls magpie
made by itself, filled for models, keys and accounts. Record.ByMagpie
is the test: agent "magpie", or one of its own User-Agents
(magpie-router/1, magpie-search/1, magpie-vision/1) where the agents
aren't loaded. The calls still count in the group's totals, as they
went to the same key or account. A group with none sends no "own".
- The classifier's calls are Kind "routing": callKind marks RouterAgent's
requests, and the decision model's record (Jev / System One) is written
with it. A "Routing classifier" purpose names them in the ledger.
- Usage page: magpie's row among the agents and its ledger rows carry a
"magpie's own" mark; an account's, key's or model's row adds "{n} by
magpie itself"; an account's card says how many of the period's
requests were magpie's own, drawn again once the summary arrives after
the allowances.
- Routing page: /api/groups marks a model a subscription account serves
(modelRef.Sub, servedRef). Beside a classifier on such a model, or a
group whose first member is one, the editor says every turn starts
with a request to that subscription, two when it picks both intent and
effort in words. A classifier on a key or a free model says nothing.
- New strings in zh, zh-TW, ja and de. The mark is a muted chip with an
even border all round (no left stripe).
Tests
- TestSummaryCountsMagpiesOwnCallsApart, TestByMagpie (usage).
- TestIntentRoutesATurn and TestJevPicksTheIntent (gateway) now check
the classifier's records are Kind routing and magpie's own, and the
agent's records are not.
- TestServedRefSaysASubscription (gui).
- own-requests.test.cjs: Chromium and WebKit, 1100 and 390 wide,
en/zh/zh-TW/ja/de, the API faked; no click scroll, no sideways page.
- Broken by hand, each turned its test red: addOwn counting nothing;
callKind's routing case removed; decide.go's Kind blanked; the ledger
mark, the agents' mark, the "{n} by magpie itself" line, the card's
line, its redraw after the summary, the Routing hint, its group case
and modelRef.Sub each removed.
Run: gofmt -l; go vet on darwin, linux -tags nogui and windows; go test
for usage, access, catalog, gui (-tags nogui) and gateway in full; the
GUI tests above, the ledger, routing-intent and translation tests.
Not done: the warmups (warmClaude/askClaude) write no usage record at
all, so they can't be marked; that is left as it was. Not tried with a
real subscription classifier against a live account.
|
||
|
|
8653bead72 |
usage, gui: a usage record and a request's details carry its cache read and cache creation beside in and out (#1839)
kensenzhao asked for usage.jsonl and the Usage page's request details to
carry cache read and cache creation tokens beside input and output.
What changed
- usage.Record's cache_read and cache_write are written on every record,
0 too (they were omitempty), so a prompt that missed the cache reads as
that rather than as a record that kept no cache. A record from before
has neither and reads as 0, as it did. Input still holds neither.
- Every route already filled them; this pins it per wire format:
Anthropic messages, OpenAI Chat (prompt_tokens_details.cached_tokens and
DeepSeek's prompt_cache_hit_tokens), Responses
(input_tokens_details.cached_tokens) and Gemini
(cachedContentTokenCount), relayed and translated, whole and streamed,
a plugin's fetch, and the Claude subscription bridge. System One's
decision calls report no cache and are left as they are.
- A request's details in the ledger have a Tokens row at every width:
"{i} in · {o} out · {r} cache read · {w} cache creation", plus the
5-minute/1-hour split when known. Before, the cache showed only as
"{w} written · {r} read" when non-zero, so a missed cache said nothing.
That string is gone; the new one is in zh, zh-TW, ja and de.
Prices and quotas: the JSON tag is the only change to the record, so the
cost math (CostAt -> CostSplit reads CacheRead/CacheWrite/CacheWrite1h),
Totals' cache sums, budget's CacheReads and access/limit's token windows
read the same values as before. Checked by reading each and by the usage,
access and catalog tests passing unchanged.
Tests
- TestRecordAlwaysCarriesCacheTokens (usage): 0s written, old records read.
- TestUsageRecordsCacheTokensOnEveryRoute, TestPluginUsageRecordsCacheTokens,
TestClaudeSubscriptionUsageKeepsCacheTokens (gateway): each wire format,
whole and streamed.
- ledger-cache-tokens.test.cjs: Chromium and WebKit, 1100 and 390 wide,
en/zh/zh-TW/ja/de; usage-ledger-detail.test.cjs updated for the row.
- Broken by hand: putting omitempty back and dropping the Tokens row each
turned its test red. The gateway route tests pin what the routes
already did; they don't fail on the code before this commit.
Run: gofmt -l; go vet on darwin, linux -tags nogui and windows; go test
for usage, access, catalog, gui (-tags nogui) and gateway in full; the
GUI tests above plus the translation tests. Not run: a real vendor
request to see its cache figures land in usage.jsonl.
|
||
|
|
d0c587aeed |
gateway: a tool call a model wrote into the text of a Chat reply asked for whole is made the call it is, as a streamed one is (#1845)
A request with stream:false relayed to a Chat upstream had its reply mended by chatWhole, which only flattened typed content (#483). The rescue of calls written into the text (textcalls.go, #823) ran only in textCallTidy, on a stream. So a DeepSeek reply whose content was its DSML <|DSML|invoke name="Bash">… reached the client as that text with finish_reason stop, and the agent ran nothing; the same request streamed got a real tool_call (#1845, cline-pass/deepseek-v4.1-flash). chatWhole now gets the request's tool names and, for each choice, wholeTextCalls reads the content with the streaming parser (textCallAt + parseTextCalls), so the same formats are taken: Hermes' <tool_call>, DSML, the half-Hermes <parameter> form (#917) and GLM's (#906). The text before the first block is kept (null when none), the tags go, the calls become tool_calls with call_text_ ids and finish_reason becomes tool_calls. As in the stream: a reply that made a call itself, a block naming a tool not offered, arguments that can't be read, or no tools offered leave the reply as it came; tags and nothing else are dropped. A cheap check (tool_call or DSML in the bytes, escaped brackets included) keeps other replies byte for byte. chatWhole is now also used for a whole reply under text/plain or no type, which eventStream had found isn't a stream; before, only JSON types were mended. Routes checked: Chat relayed whole (fixed); a streamed request a vendor answered whole goes through chatWhole before wholeAsStream (fixed by the same, tested); Responses and Anthropic translations of a Chat upstream, streamed and whole, a plugin's, and a Chat request for one body asked streamed (DashScope) all go through textCallSee already (tests added). A relayed Responses or Messages upstream's text isn't read for calls, streamed or whole; unchanged. Run (Go 1.26.8, sandbox HOME, private GOCACHE): - New TestTextWrittenCallWhole (the issue's DSML, after text, Go-escaped brackets, text/plain, Hermes, #823's junk, #917's param, GLM, wrapped invoke, two calls; left as text: no tools, unknown tool, cut short, lookalike, empty content, plain; tags only; beside a native call; truncated body; empty body), TestTextWrittenCallWholeTranslated, a case in TestQuietWholeReplyStreamed and a chat-whole subtest in TestPluginTextWrittenCall. - Broken by hand: chatWhole without names turns 11 subtests of TestTextWrittenCallWhole and the TestQuietWholeReplyStreamed case red; leaving finish_reason alone turns them red on "finish stop"; the old JSON-only gate turns the text/plain case red; turning textCallSee's rescue off turns the translated and plugin tests red. - gofmt -l, go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./...: clean. go test -tags nogui ./internal/gateway in full: ok (363s). - Real: no ClinePass key here, so the reporter's request went through this branch's gateway in a sandbox to DeepSeek's own API (deepseek/deepseek-flash), 5 runs each way. One stream:false reply in DSML came back as tool_calls Bash {"command":"ls /tmp"}, finish_reason tool_calls. Other runs the model wrote other markup (<|tool▁calls▁begin|>…, <|invoke name="Bash"|>) that neither the streamed nor the whole rescue reads, streamed or not; not changed here. Not run: the full go test ./... (only internal/gateway), Windows and Linux test runs, ClinePass itself. |
||
|
|
98b5a02d11 |
gui: the Sessions page draws its folders 100 at a time, so thousands of one-session folders don't hold every click (yetone)
An app that runs Codex once per picture, each in a folder of its own,
left 11,358 Codex folders of one session each on the owner's machine.
The page paged the sessions inside a folder (100 at a time) but drew
every folder: 113,900 elements. In WebKit a click to Sessions held the
main thread up to 2.7s, and since the hidden page stayed in the
document, a click to Library after it took ~240ms instead of ~40ms.
The folders are now drawn a page at a time like a folder's sessions:
the first 100, and a "Show N more folders" that adds the next 100 above
itself without redrawing or moving what is drawn (data-unrolls, as
moreRow). How many are drawn is kept in drawnIn, so it starts again at
a page wherever a folder's sessions do (another agent, the filter), and
unfolding a folder or coming back to the page keeps it. A session
opened from the Usage page has its folder drawn however far down it
is. The bar and a folder's box still pick every session, drawn or not.
New string in zh, zh-TW, ja and de.
Run:
- On the owner's real data (dev backend, 11,584 Codex sessions), WebKit,
this branch's assets vs main's: Sessions 113,900 -> 1,101 elements,
worst main-thread stall 2,675ms -> 44ms; Library click 238ms -> 32-62ms.
- New sessions-folder-paging.test.cjs: 10/10 (chromium + webkit, en, zh,
zh-TW, ja, de, 1000px and 380px). Drawing every folder again turns it
red (expected 100, actual 250).
- Every sessions GUI file (23): all pass except routing-sessions webkit
en, red the same alone on origin/main
|
||
|
|
d9bb0fbc84 |
provider: moved Command Code users get plugin 0.1.12, whose model list follows the account's plan (01huadalang on Discord)
Command Code 0.1.12 (magpie-community/plugins 49e9d89): Command Code's model list is the same for every plan, and the plugin filtered only Go's, by the CLI 1.73.0 table, which lacked Claude Haiku 5.5. So a Go account was shown a model only GOAT and above may use, and GOAT, Pro and Provider accounts every model, those their plan refuses included. Each plan's list now leaves out what the CLI 1.79.2's table refuses it; a plan that can't be read, or an account with bought or free credits, keeps the whole list, and a refused model still reaches the agent as Command Code's MODEL_NOT_IN_PLAN. Only the mover's min string and its note change. 0.1.12 was checked on npm with npm view. Ran: gofmt -l internal/provider, go vet ./internal/provider on darwin, linux and windows, and go test ./internal/provider -run 'Mov|Migrat' (ok, 8.6s). The full suite was not run, as this is a one-string change. |
||
|
|
58b6ad2e80 |
claude: with CLAUDE_CONFIG_DIR set, the keychain item read and written is the one Claude Code keeps there (#1842)
What changed: magpie read and wrote Claude Code's own sign-in under the service "Claude Code-credentials" whatever CLAUDE_CONFIG_DIR said. Claude Code 2.1.296 names its item "Claude Code-credentials-<sha256(dir)[:8]>" when CLAUDE_CONFIG_DIR is set (j$ in its secure storage: the suffix is dropped only when CLAUDE_CONFIG_DIR is unset), which is what claudeDirService already computes for saved accounts' directories. Now claudeHomeService gives that name for the read (both the account's item and by service alone) and for saveClaudeCredential. Why now: the previous commit asks the account's item before the file, so with CLAUDE_CONFIG_DIR set the plain "Claude Code-credentials" item — the default directory's sign-in, maybe another account — would have beaten the .credentials.json in CLAUDE_CONFIG_DIR. It was already wrong before that commit (a sign-in was written to an item Claude Code under that directory never reads), only less visible. Run (tip of both commits, sandbox HOME, fake `security` on PATH, private GOCACHE): TestClaudeConfigDirKeychainItem fails with claudeHomeService ignoring CLAUDE_CONFIG_DIR (it read "home-item") and passes with it. gofmt -l clean; go vet ./... on darwin, GOOS=linux -tags nogui and GOOS=windows pass; go test -count=1 ./internal/provider ok (116s); go test -race -count=5 on the keychain tests ok. Not run: no real Keychain, no real Claude Code run under CLAUDE_CONFIG_DIR (the name rule is read from the 2.1.296 binary), no other package's tests (only internal/provider changed). |
||
|
|
31956b92f0 |
claude: a fresh sign-in goes into the keychain item Claude Code reads, not beside it (#1742, #1842, iefnaf)
What changed: readClaudeCredential asked the Keychain only when the
credentials file held no sign-in. On a Mac whose "Claude Code-credentials"
item is there but emptied (what Claude Code leaves of a sign-in Anthropic
refused to refresh), an older, parseable ~/.claude/.credentials.json was
taken for the sign-in: a sign-in made in magpie was written into that file,
the dead item stayed, Claude Code stayed signed out, and a minute later
claudeIdentity's loggedIn: false lapsed the account and took the provider
out. Now the item under the account ($USER) is read first, emptied or not,
as Claude Code reads it: its own storage asks the Keychain first and reads
the file only when the item is absent, empty or no JSON — the rule
readClaudeDir already applies, with its own test, to the item in a saved
account's config directory. putClaudeLogin, reusing what was found, puts a
fresh sign-in into the item. The item is asked by service alone only after
the file has no sign-in, as before (an earlier sign-in's leftover,
|
||
|
|
552e974f22 |
gateway, gui: a classifier that can't say keeps the intent the turn before had, rather than sending the turn to the group's first member (#1826)
What: in ruleFor, when the classifier errs (an error, no answer within
classifyTimeout, an answer that isn't a number, or resting classifyRest
after a failure) and the conversation's turn before had an intent that
is still one of this turn's (Classified.After), the turn keeps it:
Classified.Intent is that intent, the new Classified.Fallback
(json "fallback") is "previous", and Error is kept. With no intent
before, nothing changes: no rule with an intent matches. The Routing
page's classWhy says "… but couldn't — {err} — so the turn keeps
“{intent}”, as turn {prev} was.", in zh, zh-TW, ja and de too.
Why: #1826 section 3: two timeouts in a row (20:54:43, 20:55:20) sent
turns of a known 复杂 conversation to the group's cheap first member.
Not done: persisting turnRules beside the sticks (the issue's idea 3).
After a restart a turn under way still waits for the next turn, with the
stick holding it meanwhile; with the previous commit the stick's key no
longer changes mid-conversation, which was how the reporter lost both.
Run: TestIntentClassifierFailsKeepsThePreviousIntent (down, then resting,
then a conversation with nothing to keep) fails with the fallback line
taken out and passes now; routing-intent-fallback.test.cjs (Chromium and
WebKit, en/zh/zh-TW/ja/de, 1100px and 390px with no sideways scroll)
30/30, and 10 of 15 red on Chromium with the old routing.js;
routing-intent-entry, routing-effort, panel-routing, routing-folder,
i18n-keys and gui-de pass; go test ./internal/gateway -count=1 green
(295s); go test -tags nogui ./internal/gui green; gofmt -l clean; go vet
on darwin (gateway), GOOS=linux -tags nogui ./... and GOOS=windows ./...
clean.
Not tried: a real classifier timing out in a live session.
|
||
|
|
a1c30b5be9 |
gateway: a user message the agent wrote alone is no new turn, and routing asks about and keys on the user's own words (#1826)
What: one helper, userWords/userSaid in prompt.go, says what the user
said in a text: it drops <system-reminder …> blocks (now with a source=
attribute too, as ZCode sends) and any text that begins as an agent
writes for the model alone, and keeps only what follows the Codex app's
"## My request (for Codex):". The leads, beside agentsFor: Codex's
<environment_context>, <user_instructions>, <turn_aborted>,
<user_shell_command>, <subagent_notification>; Claude Code's and
ZCode's <task-notification>, <subagent-notification>, agent lists
("Available agent types …", "New agent types are now available …"),
TodoWrite and task-tool nudges, rewind notices; ZCode's
<plugin_reference>; the Codex app's <in-app-browser-context …>. Each
was taken from the clients' own code or a real transcript (Claude Code
2.1.296, ZCode.app's zcode.cjs, Codex CLI 0.162.1, ChatGPT.app).
Everything that asks "did the user say something" now goes by it:
- turnIn: a user message with nothing of the user's (and no image or
file) begins no turn. After an answer or a tool round it carries the
turn on (within), so the turn's rule and stick hold and the classifier
isn't asked; right after the user's own message it leaves that turn as
it began.
- userText: the classifier is asked about the last user message with
words of the user's, only those words (it was the last user message,
ZCode's agent list after the user's plugin question).
- firstWords (ruleKey and the affinity scope): the words of the first
user message that has any, so an instruction file or notice the agent
changes beside them no longer moves a conversation to a new key
mid-turn. A conversation with no words yet keys on its first message
as before.
- lastUserText (Copilot's Auto, a sibling): the same.
- userSays (the prompt breakdown's turns) is userWords != "".
Why: #1826 (ZCode) and @321sssrt-bit's comment (Codex): a TodoWrite
nudge was classified as a new, harder turn and sent a 常规 turn to the
复杂 member; a task notification or agent list re-classified the turn;
one ZCode session had three firstWords keys, and the turn that lost its
key fell to the group's first member.
Upgrade: a conversation whose first user message held injected text
gets a new key once (its words only), so its stick and turn rule are
looked up afresh on the first request after the upgrade.
Run: user_said_test.go (TestTurnInSkipsWhatTheAgentPutIn,
TestUserTextSkipsWhatTheAgentPutIn, TestFirstWordsAreWhatTheUserSaid,
TestLastUserTextSkipsWhatTheAgentPutIn,
TestIntentHoldsPastWhatTheAgentPutIn end to end through the server,
TestUserSaysPastAReminderWithASource) fails on the old code (all six
red with the five source files put back) and passes now; go test
./internal/gateway -count=1 green (323s); gofmt -l clean; go vet ./...
on darwin, GOOS=linux -tags nogui and GOOS=windows clean.
Not tried: a live ZCode, Claude Code or Codex session against a
group with intent rules; fixtures are the clients' literal strings.
Not done here: persisting turnRules beside the sticks (the issue's
idea 3); the classifier-failure fallback is the next commit.
|
||
|
|
e59de0c967 |
agent, gui: Codex's magpie API sign-in says its Chrome control needs ChatGPT, so pick ChatGPT to keep it (#1824)
What: the "magpie API" option of Codex's sign-in (internal/agent/codex.go; the GUI picker and the TUI both show the option's note) now ends with "Codex's Chrome control needs the ChatGPT sign-in, so pick ChatGPT to keep it", in en, zh, zh-TW, ja and de (i18n.js). The login field's comment and docs/subsystems/agent-wiring.md say why. Why: with magpie as Codex's provider (no requires_openai_auth), codex-rs's getAuthStatus returns authMethod null and no token, so Codex's Chrome control says "Codex auth token is unavailable". Reproduced earlier with real codex 0.162.1 in a sandbox CODEX_HOME; the ChatGPT sign-in (openai_base_url) keeps the token. Nothing magpie writes can bring the token back on magpie API without turning the Codex app into a ChatGPT account, so the option says what it costs. Run: codex-signin-always.test.cjs (now also zh-TW, and asserts the API note names Chrome and ChatGPT in the page's language) in Chromium and WebKit at 1100px and 440px, 10/10 pass with playwright 1.62.0; with origin/main's i18n.js it goes red for zh, zh-TW, ja, de. gofmt -l clean; go vet ./... on darwin, linux (-tags nogui), windows; go test ./internal/agent ./internal/gui ./internal/tui green. Not run: the Windows box, the real Codex app's picker. |
||
|
|
f4cc7459ea |
gateway: a DeepSeek step that said something before its call leads with its reasoning, so DeepSeek no longer refuses it with 400 (#1822, #1592, #1687)
Codex through magpie to OpenCode Go's DeepSeek (#1822), and to DeepSeek's own API (#1592, #1687), was refused now and then with "The `reasoning_text` in the thinking mode must be passed back to the API". The cause, checked against api.deepseek.com/v1/responses on 2026-10-12: DeepSeek reads each step (a run of reasoning, assistant messages and calls after a user message or tool output) as one assistant message whose thinking is the item the step starts with. In the current turn (since the last user message), a step that has a call or follows a tool output must lead with a reasoning item. [message, reasoning, call] and [output, message] are refused; [reasoning, message, call] and [output, reasoning, message] are taken. When a step had no reasoning (another model's turn, a translated one), magpie inserted its " " reasoning right before the call, which gave [message, reasoning " ", call]. A step with only a call worked, and only the current turn is checked, which is why the reporter saw it come and go. What changed: - responses.go: withReasoningText and buildResponses now share reasonFirst. Each such step leads with reasoning: the step's own first reasoning item is moved ahead, otherwise one holding a space is put first. A sealed item keeps its id and encrypted_content. A body already in that shape goes byte for byte. - Sibling, the same API family: an assistant reply right after a tool result, with no reasoning, is refused too (checked on DeepSeek's Chat and Anthropic endpoints). Chat (withReasoningOnToolTurns relayed, buildChat translated) now gives such a reply reasoning_content " ". Anthropic (withThinkingOnToolTurns) gives it a thinking block. Anthropic takes thinking anywhere in the message, so ordering is not an issue there. - The DeepSeek fakes in the tests now model the real rules. The stricter Responses fake also turns TestDeepSeekGroupMemberAfterChatGPT red on the old code: its "an assistant note" case is this bug, which the old lenient fake hid. - docs/subsystems/gateway-routing.md: the Responses, Chat and Messages replay paragraphs. What was run: - New tests: TestDeepSeekStepSaysBeforeItsCall covers the reporter's shape across OpenCode Go, DeepSeek and a group, streamed and not. Also TestWithReasoningTextLedStepsUnchanged, TestTranslatedDeepSeekStepLeadsWithReasoning, TestChatReplyAfterToolGetsReasoning and TestAnthropicReplyAfterToolGetsThinking. All but the unchanged-body test fail on the old code. - gofmt -l; go vet ./... on darwin, and with -tags nogui on linux and windows; go test ./internal/gateway. - Real API: direct requests to api.deepseek.com (Responses, Chat, Anthropic) with the old and new shapes, as listed above. What wasn't: - OpenCode Go's own endpoint: the test account is refused with "This Go model requires Global regions", an account setting, so its fix rests on it relaying DeepSeek's rule unchanged (the reporter's error text is DeepSeek's). - A built magpie end to end against the real API. - Other thinking vendors (Kimi, GLM) were not checked for the same step rule. Their paths are unchanged. |
||
|
|
e08902e79d |
agent, library: Hermes Agent's folder is %LOCALAPPDATA%\hermes on Windows, and rtk's installer is told it (新v学员 on Discord)
新v学员 runs magpie on native Windows. Library -> RTK -> Hermes Agent
failed with "rtk's installer didn't add its hook to Hermes Agent:
Config: C:\Users\admin\AppData\Local\hermes\config.yaml ...". magpie
hard-coded ~/.hermes. Hermes' own default
(hermes_constants._get_platform_default_hermes_home) is
$LOCALAPPDATA\hermes on win32 (~/AppData/Local/hermes when LOCALAPPDATA
is empty) and ~/.hermes elsewhere, with $HERMES_HOME overriding it.
rtk 0.51's resolve_hermes_home knows only $HERMES_HOME and ~/.hermes,
on every OS.
What changed:
- appdir.HermesHome / HermesHomeIn / HermesDefaultIn: $HERMES_HOME,
else Hermes' per-OS default. This is the one place that resolves it.
- agent: hermesIn (Agents-page model wiring) and hermesProfiles use it
through place.hermesHome / hermesDefault. A WSL distro keeps
~/.hermes (Linux paths, Windows env not read). The Agents-page wiring
was wrong on native Windows too: without HERMES_HOME it wrote
%USERPROFILE%\.hermes\config.yaml, which Hermes never reads.
- sessions.HermesDir uses it, so Windows sessions are found.
- library/rtk: the hermes spec reads and writes the agent's own folder
(a.Dir), and rtkSpec.env passes HERMES_HOME=<that folder> to
`rtk init -g --agent hermes --auto-patch`.
- Tests resolve the folder through appdir instead of home/.hermes. New
TestHermesDefault/TestHermesHome (appdir), TestHermesFolder (agent:
Windows default, profiles under it, WSL unchanged), and
TestRTKHermesHome (library, a fake rtk that behaves like 0.51).
- docs/reference.md and docs/subsystems/library.md describe the
Windows folder and the env.
Run:
- gofmt -l clean. go vet ./... on darwin, GOOS=linux -tags nogui and
GOOS=windows.
- darwin: go test ./internal/appdir ./internal/library
./internal/sessions ./internal/agent ./internal/tui.
- TestRTKHermesHome against the old rtk.go fails with the reporter's
exact message ("didn't add its hook ... AppData/Local/hermes/
config.yaml"), and its default subtest fails with HERMES_HOME="".
- Windows box (cross-compiled test binaries, testenv sandbox
USERPROFILE/LOCALAPPDATA): appdir Hermes tests, agent
Hermes|Reseat|Effort (incl. TestHermesFolder) and library Hermes|RTK
pass. TestRTKHermesHome skips there (shell fake). The sessions binary
failed only TestHermesMessageVisibility, because its testdata wasn't
copied to the box.
- Real rtk.exe 0.51.0 on the Windows box: with
HERMES_HOME=<sandbox>\AppData\Local\hermes it wrote the plugin there
and patched that config.yaml. Without HERMES_HOME it wrote
C:\Users\<user>\.hermes, ignoring a sandbox USERPROFILE (rtk asks
Windows for the home folder). That confirms the cause and the fix.
The stray folder it made on the test box was removed.
Not run: real Hermes on Windows (no install, and running hermes under
a temp HERMES_HOME rewrites the live launcher); the GUI suite; the full
go test ./... ; the reporter's own machine.
|
||
|
|
4c1e6db0fa |
gateway, provider: an image model the vendor turns away in chat, naming its images API, draws there (#1837)
What: when a drawing asked on chat completions comes back 400/422 with the vendor's message naming images/generations, magpie asks the images API with it (and the other way round: an images-API refusal naming chat/completions goes to chat), and tells that second answer. Before, only a 404/405 moved a drawing to the other API. The model test in the provider editor does the same for an image model (DrawsID) refused in chat that way, so it is tested where the gateway draws with it. catalog.PointsToImagesAPI / PointsToChat are the one shared check. Why: #1837, omp's generate_image with Settings > Image generation on agnes-image-2.5-flash got 400 "Model agnes-image-2.5-flash is an image model. Use /v1/images/generations". catalog.ImagesAPI goes by name, and agnes-image-2.5-flash reads like gemini-*-flash-image, which chat, so it went to chat completions and the vendor's 400 was passed on. The vendor's own words are the rule now, not one more name in the list. Run: TestDrawGoesWhereTheVendorPointsIt (gateway; the reporter's exact 400 body) and TestTestModelsGoesWhereTheVendorPointsIt (provider) both fail on the old draw.go / test.go and pass now. gofmt -l clean; go vet ./... on darwin, linux (-tags nogui) and windows clean; go test ./internal/catalog ./internal/provider ./internal/gateway green. Not run: against Agnes's real API (no account); the 400 text is the one in the reporter's screenshot. Image models stay out of chat agents' model lists as before (catalog.Chat / LiveDrawers): the omp error came from magpie's image tool, not from omp's chat model list. |
||
|
|
8751f011f0 |
gateway: a test's fake left out of its allowance no longer answers later tests from its rest (#1840)
Cause: rests are kept for the process in restingUntil, keyed by provider id, and every setup() test's provider is "fake". Since |
||
|
|
7d0c68b187 |
proc: the mise-hangs test gives up on its fake mise once it has written its pid, not after 300ms a loaded machine passes first (#1838)
What: the context an ask of mise runs under comes from miseAsk (a var; production keeps miseWait = 5s, now a const). The "hangs" case of TestFindToolKeepsWrapperWhenMiseDoesntSay cancels it once the fake mise has written its pid (polled, with a minute's cap), then checks that FindTool returns the wrapper within 30s of that (the fake sleeps 60s) and that the fake's process is gone. The other wrapper tests give an answering fake a minute instead of the production 5s. Why: the test set miseWait to 300ms; at load average ~20 the fake's shell hadn't written its pid by then, was killed, and the test said "mise wasn't asked" though FindTool had asked. Under the same load the "fails" case took 4.5s of the 5s budget here, so the answering fakes got room too. Run (go1.26.8, sandbox HOME, private GOCACHE, load avg ~20): - repro on old code: a 0.5s sleep injected before the fake writes its pid -> hangs FAIL "mise wasn't asked". - new code with a 2s sleep injected: pass (hangs 2.2s). Removed after. - break check: miseWhich ignoring the context -> FAIL "FindTool returned 1m0s after mise was given up on". Restored: pass. - gofmt -l clean; go vet ./... darwin, linux -tags nogui, windows: clean. - go test -tags nogui ./internal/proc: ok; -race -count=5 -run 'TestFindTool|TestParseMiseWrapper': ok. Not run: the full go test ./...; Linux CI's run of this test. |
||
|
|
2221b63f93 |
agent, provider: tests no longer read the machine's /Applications or Program Files, so a Mac with DeepSeek Harness.app installed keeps TestAsideOfflineDisconnectRestoresWithoutDaemon green (#1823)
What: every place magpie looks for installed apps outside the home folder now goes through proc.SystemDirs, which in a test binary testenv isolated puts the path under the test's home (as it already does for Homebrew's bin, #1525): - agent: a new macAppFolders(home) (/Applications via SystemDirs, plus ~/Applications) is used by appFolders (desktop apps: Codex, dsh), pencilApp, t3App and reasonixDetected; - cursorLocalRoots: macOS through macAppFolders, Windows' ProgramFiles and Linux's /opt, /usr/share, /usr/lib through SystemDirs; - zedAppPath's /Applications/Zed*.app, npmGlobalPrefix's ProgramFiles npm fallback, and provider's /Applications/ZCode.app builtin config. Production behaviour is unchanged: SystemDirs returns paths as they are outside a sandboxed test. Why: HasApp/AppVersion read the real /Applications, so on a Mac with DeepSeek Harness.app the dsh fixture's CLI was never "missing" and the test failed every time; CI has no such app, so nobody else saw it. The same shape was in five other readers. Test: TestAppFoldersStayInTheTestHome checks every app folder lies under testenv's home (all OSes), and on macOS that an app installed in the sandbox's /Applications is the one found. Run (go1.26.8, sandbox HOME, private GOCACHE): - repro on old code: appFolders pointed at a temp folder holding a fake "DeepSeek Harness.app/Contents/Info.plist" (com.deepseek.dsh) -> TestAsideOfflineDisconnectRestoresWithoutDaemon FAIL "native fixture must report missing CLI". - break check: macAppFolders put back to the literal /Applications -> TestAppFoldersStayInTheTestHome FAIL (appFolders, macAppFolders, cursorLocalRoots look in /Applications; sandbox app not found). Restored: pass. - gofmt -l clean; go vet ./... (darwin), GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./...: clean. - go test -tags nogui ./internal/agent ./internal/proc ./internal/provider: ok. - -race -count=5 on the touched agent tests: ok. Not run: the full go test ./...; Windows and Linux test runs (vet only); reasonix's Windows registry lookup and Zed's mdfind fallback still ask the machine (not folder paths) and are left as they are. Reported-by: mdwsk88 |
||
|
|
8792ee063d |
provider: a Volcengine or Tencent access key is kept through sync, restore, a stale editor and a copy, and a plan card without one says what to give (#1821, Edward4226)
The reporter's Volcengine Agent Plan card vanished: providers.json had
lost accessKeyID/secretAccessKey, and volcPlanQuotas skipped a provider
without them before building any card, so nothing said why.
Writers that dropped the access key, fixed at the cause:
- Sync and restore (Mirror, Restore, davsync take) kept this machine's
access key and balance token only when the incoming provider had no
key at all. A magpie before v0.1.1142 (
|
||
|
|
10d60b1899 |
provider: a provider saved with Select none serves no models, unlisted or not (#1818)
Select none saved `models: []`, which omitempty wrote as no models key at
all, so the provider read back as "no picks" and served the first 24 of
the vendor's list on /v1/models, in auto groups and on the card, while
the editor said none would be served.
What changed:
- Provider.NoModels (json noModels) records the choice; ServesNone() is
NoModels with no picks. A file with no models key still serves the
vendor's list as before.
- Exposed() is empty for it, so the catalog, /v1/models and auto groups
leave it out; resolveIn refuses an explicit pid/model to it; listedBy
and Deciders skip it (a decide-only provider is still a decider).
- SetModels and normalize clear NoModels once there are picks.
- GUI: the editor sends noModels on Save, an edit that omits it keeps it,
the card's exposed count is 0, the hint says nothing is served; with
unlisted the dashed chips explain they are only for groups. Strings in
en, zh, zh-TW, ja, de.
- CLI: `magpie provider models <id> none`.
- docs/subsystems/providers-accounts.md describes it.
Decision (owner delegated): Select none means none, whether or not
unlisted is on; unlisted keeps meaning "hide from the list, still
usable by groups that name it".
Run:
- go test ./internal/provider ./internal/gui ./internal/cli -count=1
(green; second pass ran too) with private GOCACHE and sandbox HOME.
- Broke Exposed's ServesNone check: TestSelectNoneServesNone red
("exposed 24"); broke resolveIn's: red ("watched/m0 resolved"); broke
the GUI keep line: TestProviderSaveSelectNone red ("exposed 24").
- GUI tests chromium + webkit, 5 languages: provider-none-picked 20/20,
provider-draft-picks 10/10 (red with noneChosen broken), plus 12
related model/group/editor tests green.
- gofmt -l clean; go vet darwin, linux -tags nogui, windows clean for the
three packages.
Not run: the gateway package; Codex native model narrowing is unchanged.
searcher-pick.test.cjs fails 3 webkit cases (hover timeout) identically
on the unmodified base
|
||
|
|
49b6e87b41 |
plugin, cli: on Windows, a plugin added from a folder is found by its short name too (magpie plugin off/on/rm/options zz-tags) (#1827)
ShortName cut a plugin's name at its last "/". A plugin added from a
folder is named by its path, and on Windows that path has only
backslashes, so its short name was the whole path: `magpie plugin off
zz-tags` said there was no plugin "zz-tags", and so did on, rm, options
and plugin.SetOptions. It now cuts at the last "/" or "\". npm names
have no backslash, so they are unchanged.
TestPluginOnOffRmShortName was one of the 26 Windows failures listed in
#1827 (CaramelizedCUDA). TestSetOptionsShortName now also checks a
Windows path, so the case fails on every OS without the fix.
Run:
- without the fix, macOS: TestSetOptionsShortName fails, ShortName
("C:\\Users\\me\\plugins\\middleware-zz-tags") = the whole path, want
"zz-tags"; with it, passes.
- Windows 11 box (windows/amd64 test binaries, sandbox USERPROFILE and
APPDATA): at
|
||
|
|
7d9382db23 |
gateway, settings: an unreadable settings.json keeps the allow list read last, or lets in only this computer, never every address
Follow-up to
|
||
|
|
9dd5917a41 |
gui: the session-stats memo lets go of the range asked least recently, counted by asks rather than the clock (review of CaramelizedCUDA's cap, #1827)
9f0c9593 caps the memo at 8 ranges and stamps each with time.Now() when asked. Its test only checked the count and that the newest range stays, which passes with the eviction reversed (k.used.After) or with a hit that doesn't restamp. TestStatsMemoKeepsTheRangeAskedAgain fills the memo, asks range 1 again, adds one more and checks 1 is kept and 2 let go. The stamp is now the memo's ask count: Windows' clock can read the same for two asks in a row, so with time stamps the range asked again could tie with one asked once and either could go. Run (macOS, go1.26.8, sandbox HOME, private caches): - reversed comparison (> for <): the new test fails, "the range asked again was let go before one asked once"; a hit that doesn't restamp: the same failure. Both pass with the change. - go test -tags nogui -count=1 ./internal/gui ./internal/plugin: ok. - gofmt -l clean; go vet on both packages for darwin, linux (nogui) and windows/amd64; go build for darwin, linux nogui and windows. Not run: the whole suite (machine loaded), the new test on Windows. |
||
|
|
d85ef1908a |
ci: Bun on every test runner, and the plugin stderr tests on Windows
The end-to-end plugin test needs bun on PATH, and setup-bun only ran on Linux, so macOS skipped it (run 38250283461: "no bun on PATH"). Windows skips the Test step, so the stderr tests were only compiled there. Both now run: setup-bun on all three runners, and a Windows step that runs the two stderr tests with -v, so a skip shows in the log. Run before this commit: the change is CI-only and is checked by the workflow run on this branch. Reviewed for magpie: the workflow change only drops setup-bun's Linux-only condition (same pinned oven-sh/setup-bun@v2, bun 1.4.2) and adds one Windows step running the two tests; no new trigger, permission, secret or action. The contributor's run 38263044397 shows both tests passing on windows-latest with bun 1.4.2, and macOS green with bun installed. Co-Authored-By: Claude Code <noreply@anthropic.com> |
||
|
|
3f5c3b0553 |
plugin: the host keeps reading a plugin's stderr after a line over 4 MiB, so the plugin host no longer hangs (Windows) or keeps the unread output in memory (Linux)
The host logged the plugin child's stderr with a bufio.Scanner capped at 4 MiB. On the first longer line Scan stopped with ErrTooLong, the goroutine returned, and nothing read the pipe again. host.js sends console.log and process.stdout.write to stderr, so one long line from any plugin was enough. Now the reader drains the pipe past an overlong line and logs what it can, so the output stops being dropped silently. Measured on Bun 1.4.2 (Windows and Linux, official binaries, sha256 checked): on Windows the plugin host stopped answering init when a plugin wrote one long line while loading; on Linux a script writing 200 MiB to stderr with no reader went from 18 MiB to 412 MiB RSS. Each of those reproduced at HEAD and is gone with this change; the Linux memory number comes from that Bun-only measurement, since magpie's own RSS did not differ at this scale. Run before this commit: go test -tags nogui ./internal/gui ./internal/plugin is ok on Linux (WSL2 Ubuntu 24.04, go1.26.8) both on HEAD and on this change. On Windows, go test -tags nogui ./... (49 packages): every failing test also fails at |
||
|
|
bbe8825c04 |
gui: the Usage page's session-stats memo keeps the 8 most recently asked ?days ranges, not one per number a request sends
statsFor keeps a whole sessions.Stats per distinct ?days= value, and only forgetStats ever emptied the map. Each new number a caller sent added a snapshot that stayed until a session was deleted, restored or purged. Now the memo keeps the 8 most recently used ranges. Run before this commit (Linux, WSL2 Ubuntu 24.04, official go1.26.8): the new test fails with the fix reverted and passes with it; go test -tags nogui ./internal/gui ./internal/plugin is ok. Both builds were compared with magpie web on a sandbox copy of a real ~/.codex/sessions: all 10 stats/overview answers byte-identical, and 300 distinct ?days values left HEAD's memory up 21-25 MB against 6 MB for this change. macOS was not run here; CI's macOS job runs the new test. Reviewed for magpie (CaramelizedCUDA/magpie pr/stats-memo-cap at 05f0afa4, cherry-picked onto |
||
|
|
3c4f8f9aed |
gateway: the models added to Codex's spawn_agent are headed neutrally, naming neither magpie nor Codex's limit (Gearclickist on Discord)
|
||
|
|
6ccf23efa6 |
gui: the Library's Backups button is at the top of every tab, after Library folder (Dade on Discord)
Dade: each Library tab's 备份 (Backups) sat at the very foot of the page,
under the whole list, and was hard to find. It is now a button in the
Library's head strip, on every tab (Instructions, MCP servers, Skills,
RTK). That strip stays at the top as the page scrolls. The button sits
right after 资源库文件夹 (Library folder) and looks the same: a small
glyph (a clock with a turning arrow, as macOS draws backups) and a label.
- It opens magpie's backups folder.
- Its tooltip keeps the sentence the foot had ("magpie keeps a copy of
every file before it writes it.") with the folder's path.
- It is disabled until the library has loaded, as Library folder is.
The foot line and its .lib-foot/.lib-link styles are removed. Two
messages that pointed to "Backups, at the foot of the Library" now say
"at the top", in all five languages. The page with no agents, which had
no foot, now has Backups too.
Run:
- library-backups-top.test.cjs covers chromium and webkit,
en/zh/zh-TW/ja/de, each of the four tabs, and browser 1000/420px plus
window 1000/800/560px. It checks the button comes right after Library
folder on the same line and looks the same, waits for the library, has
a label that doesn't wrap, has no left border, causes no sideways
scroll and nothing at the foot, opens the backups folder, and doesn't
move the page on click. 10/10 pass. Without the button appended, red.
- library-loading, library-discover-jump, library-all, library-items,
library-rtk-gain and library-own-folder pass (138).
- go test ./internal/gui -count=1 under a sandbox HOME: ok.
- mobile-web.test.cjs: the phone widths pass. Its desktop 900/1280
comparison with origin/main fails only on the library page (about 650
pixels: the new button in the strip). Its before/after screenshots show
nothing else changed, and it matches again once this is on main.
|
||
|
|
5d33f060b7 |
gateway: Codex's spawn_agent names every model a subagent may be put on, not only the first five (Gearclickist on Discord)
Gearclickist turned on "Codex subagents on any model", but when Codex dispatched subagents only a few models could be picked. Codex itself caps the list: spawn_agent's description names only the first five show_in_picker models of its catalog (codex-rs child_config.rs MAX_SPAWN_AGENT_MODEL_OVERRIDES, multi_agents_spec.rs spawn_agent_models_description), Codex's own ahead of magpie's. Yet it takes any catalog model by name (find_spawn_agent_model_name). So the lead saw none of magpie's models. spawnAgentModels (codex_spawn_models.go) adds the rest of the catalog Codex was handed after Codex's own list, under a line of its own, at most 200. It covers spawn_agent at the top level and in Codex's multi_agent_v1 namespace, at CodexPath (codexBackend) and at /v1/responses for Codex (handle). - At CodexPath the list is Codex's own listed models less those hidden on the Agents page, then CodexListed unless Codex is held to its own. - At /v1 it is CodexCatalog under the key's allowance. - A lead the ChatGPT backend answers in multi-agent V2 seals its subagents' tasks for a ChatGPT account (#619), so it is offered Codex's own only. Only the tool's description changes, never base_instructions. With V1 on, it does change in requests to the ChatGPT backend too. Not covered: the model_catalog_in_context feature (under development, off by default) puts a five-model catalog in context, and it is not widened. Run: - go test ./internal/gateway ./internal/agent -count=1 under a sandbox HOME: ok. - TestSpawnAgentNamesEveryModel uses 40 models on a real Codex 0.162.0 request (testdata/workdir/codex-0.162.0.json). Its 4 subtests are CodexPath, /v1, a sealed V2 lead and a V1 lead, and all pass. - With spawnAgentModels returning body by hand: CodexPath, /v1 and V1 go red. - With the sealed rule taken out: V2 goes red. - go vet on darwin, GOOS=linux -tags nogui, and GOOS=windows; gofmt -l is clean. Not verified: a real Codex lead picking one of magpie's models past the fifth from the longer list. |
||
|
|
7639c1d8db |
gateway, gui: a web search made in place of the picked searcher says in its Routing row which searcher failed or found nothing, and why (Gearclickist on Discord)
Gearclickist picked Grok as the web-search model (代搜). In Codex, a web_search did go to Grok, but Codex's default search model then searched, and nothing said why. modelSearch asks the searcher picked in Settings first. When it errors, or its reply names no page it found, the next of Searchers() searches in its place (#669, up to three). The first error was dropped, so the Routing row only showed the model that answered. Falling back stays. searchingInstead now puts on the search's CallFor the searcher asked first (instead), whether the user picked it (picked), and its error (why) or that it found nothing (nothingFound, from a new errFoundNothing that searchWith and kimiSearch wrap). Routing's kindWhy says "<grok>, the searcher picked in Settings › Models › Web search, didn't search for Codex's <model>: <why>. So magpie had <next>, the next searcher it can use, search in its place." There are 7 new strings, in zh, zh-TW, ja and de. Grok itself: magpie's exact search body was sent to real Grok (4 models, 6 queries) through the built-in, and replayed through the plugin. Every time it answered with pages, so no Grok or plugin cause was found, and there is no plugin publish or mover min raise. The next time Grok fails for Gearclickist, the row now names the error. Run: - go test ./internal/gateway ./internal/agent -count=1 under a sandbox HOME: ok (933s, 720s). - TestSearchInPlaceOfPickedSaysWhy (found nothing, failed) passes. With the searchingInstead call taken out by hand, both subtests go red. - search-instead.test.cjs: chromium and webkit, en/zh/zh-TW/ja/de, at 1100 and 520px: 10/10 pass. With kindWhy's new branch turned off by hand: red. - search-mcp, routing-side-calls, provider-search and routing-kind GUI tests pass. - go vet on darwin, GOOS=linux -tags nogui, and GOOS=windows; gofmt -l is clean. Not verified: a real Grok search failing for Gearclickist's account, since it couldn't be reproduced. |
||
|
|
3a4df527f5 |
plugin, provider, gateway, upstream: a test whose check fails while its fake vendor holds a reply ends with a FAIL, not a package hung until -timeout (#1808)
TestNPMInfoDeadline's fake npm held slow-one's reply on <-release, closed only
on the happy path. A check firing first under load (on the issue's machine,
the quick ones missing at npmAll = 300ms) left the handler held, and
httptest.Server.Close, run in the test's cleanup, waited for it forever:
the whole internal/plugin package hung to -timeout and lost every result.
- TestNPMInfoDeadline: a t.Cleanup registered after fakeNPM (so it runs
before the fake's Close) lets the handler go once (sync.OnceFunc). Its
timing assumptions, all listed: the 2s wall-clock bound on Info is gone
(slow-one is held and npmEach is an hour, so Info coming back at all is
npmAll at work; a minute only turns a wait into a FAIL); npmAll is 5s,
the quick ones' time to answer on a loaded machine, not 300ms; the slow
one's kept answer is polled for 30s, not 3s.
- The same pattern in its siblings, each fake handler blocked on a channel
only the happy path closed, now let go by a cleanup/defer that runs
before the server's Close: TestRestartFinishesTheReply (plugin),
TestPastedAddressAndCallbackFinishOnce, TestPartnersFetchedLastIsHeld
(provider), TestBusy (before gw.Close too, whose request waits on it),
TestLaneReleasedOnFailure (gateway), TestReadOnceInFresh (upstream; its
100ms bound on Of goes the same way as the 2s one: the page is held, so
Of coming back is its not waiting, 10s being short of the read's 15s).
- Audited, already right: grok_accounts, quota_refresh_order,
quota_history_waiter, subscription_usage, sub2api_usage, qoder, routing,
github_test, session_route, request_encoding, key_limits, vertex (quit),
plugin_usage (r.Context).
Run, in a sandbox HOME with pinned caches:
- Old TestNPMInfoDeadline with its check forced (took > 0): "httptest.Server
blocked in Close", panic at -timeout 30s. With a 500ms delay injected into
the fake's answers (a loaded machine): FAIL at the quick-ones check, then
the same hang. New test: with the delay injected, PASS (5.55s); with the
check forced, FAIL in 5.5s and the package's other tests run; with
npmAll an hour (the deadline broken), "Info waited for the slow package"
and the package ends.
- Each sibling with t.Fatal injected while its handler is held: old code,
all five httptest siblings hang to -timeout 90s ("blocked in Close"),
upstream's stalls ~56s; new code, each ends at once with FAIL.
- go test -race -count=5 of every touched test: pass.
- gofmt -l (nothing), go vet ./..., GOOS=linux go vet -tags nogui ./...,
GOOS=windows go vet ./...: clean, before and after rebasing onto
|