ae3c2ec4e90da14caef83f52894c510e9ffc1ea4
6576
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
ae3c2ec4e9 |
fix(netproxy): the health check pings a silent connection after 10s, not 20 (#4936)
What changed The HTTP/2 health check is the only probe of a connection whose path has died silently, so a turn in flight on such a connection waits for the next one: with PingAfter at 20s a first try read EOF came ~20.5s after it was written (Antigravity through a local proxy whose tunnel a NAT or a relay had dropped, yetone/magpie#4936), and magpie's own retry served at once on a new connection. PingAfter is 10s now: finding a dead path costs at most half of what it did, and the margin a body under uploadBytes needs on a slow uplink — the budget PingAfter+PingWait, a ping queued behind the body and answered only after its last byte (#3909) — still covers 64KB at about 3KB/s. Run go test -tags nogui -count=1 ./internal/netproxy (a new test walks a turn onto a connection whose path dies under it and watches it fail at the health check, then a retry serve on a connection of its own; a second locks the sizing) go test -tags nogui -count=1 ./internal/... — TestMothX, TestProxyCheckSaysAProxyPassedBy and TestHostToldTheGatewayAddress are red alone on the parent commit too; TestCodexPoolSaysTheClientsVersion is a known full-suite flake, green alone go vet, gofmt, GOOS=linux GOARCH=amd64 go build, GOOS=windows GOARCH=amd64 go build, go build on darwin. Reviewed and ported: every line read against origin/main |
||
|
|
f76b48ea09 |
gateway: a Chat finish of tool_calls with no call in the stream ends stop (#4944)
What changed: Hermes through magpie (stream=true, tools, deep
reasoning): a reply of text alone ended, on the reporter's upstream, on
a frame saying finish_reason "tool_calls" that no delta ever carried a
call for - the shape the reporter's bare call of the model ends its
real calls with ("delta":{"reasoning_content":null},
"finish_reason":"tool_calls","matched_stop":1); its text-only turns end
there too, and the client took every such turn for one whose calls were
dropped and re-prompted, three times a reply. The other gateway on the
same upstream said stop.
chatTidy's mend that ends a finish of tool_calls with no call left stop
(#1475) only ran for a choice some delta had carried a tool_calls key
for: the case "tool_calls" sat inside the t.called[choice] guard the
case "stop" needs, and a reply whose stream never carried the key
passed the misleading finish on. The switch now runs for every choice's
finish: a finish of tool_calls with no readable call ends stop whether
or not a delta carried the key, and the stop of a choice that made
calls still ends tool_calls. A legacy function_call a client may still
be reading (#4659) keeps a finish that says the turn ended in a call,
and a "function_call": null is still the contract's own nothing.
Whole replies are untouched: #1475's review narrowed chatWhole to a
finish whose call was dropped and pinned a whole reply that came with
no tool_calls at all as going as it came
(TestToolCallsFinishWithNoCallsStaysWhole); no report covers them.
Run: go test -tags nogui -count=1 ./internal/gateway: one red,
TestCodexPoolSaysTheClientsVersion, green on its own - the known
pre-existing red of this machine; the two new tests and the family
guards among the rest, ok. go test -tags nogui -count=1 -timeout 45m
./internal/...: 74 packages ok; the four failures are all red at the
parent
|
||
|
|
2f59545d29 |
gateway: a key not given a group listing alone is listed the members it may use (luckymanjc)
luckymanjc on Discord (#general, 11-05): on a second computer, through
Remote magpie, his three Codex accounts offered GPT-6-Luna alone, with
the key his Remote magpie uses held to "Codex 的全部模型" (codex/*),
GPT-6-Luna and the accounts. His screenshot of that key's picker, on the
host, offered GPT-6-Luna alone under Codex too.
Cause: a routing group listing alone (Group.Unlists, "the group alone")
keeps its members out of Catalog(), so out of /v1/models and the key
picker (/api/caller-keys/models), as the group stands in for them there.
Since
|
||
|
|
51bdc985bc |
provider: a cap set on a window a plugin later sets aside still holds; WorkBuddy min 0.2.24 (ferock on Discord)
WorkBuddy 0.2.24 stops an account by a new "Total credits" window (the
plan's credits and the extra ones together) and sets "Credits" and
"Extra credits" aside, so the Routing page reads every account the same,
its plan's credits spent or not. Routing skipped every window set aside,
caps included, so a cap the user had set on "Credits" would have stopped
holding the account: magpie's change overriding the user's value.
Now a window set aside, not a pool's or one model's, rides in each
limit's pool (allowanceOf), as a pool's windows do, and holds the
account at a cap set on that window itself (WindowCaps.own), never at the
account's cap or a Codex credits hold, which never reached it before.
WithCapped marks such a window Capped with OwnCap, so the GUI shows the
mark and the "at its cap" note for it, counts no account cap on it
(windowCapOf), and offers its meter as a button only while it has a cap
of its own, to change or lift it; no new cap on a window set aside.
app.js grows 48 bytes, inside the core budget (no raise).
Run (mote): go test ./internal/provider (ok) and ./internal/gui
(TestCoreScriptBudget ok); window-cap, window-cap-pool and account-cap
GUI tests, both engines, 420/1100, five languages: 136 pass.
internal/gui's TestMainWindowCorners/macOS_26_SDK (#3949) and
i18n-keys "a plugin's words are its own" (#5327, #5332) are red the same
on origin/main
|
||
|
|
a9b1877cfc |
routing: a session's name stays when a later poll answers without it (#5365)
refreshOtherNames deleted a name the page had whenever a poll of /api/gateway/session-titles came back without it, so a read that failed or ran late (ZCode's database busy or slow, Flandern1211's report) put the card back to its folder until a later poll named it again. An answer without a name is unknown, not a session that lost its name: the page now only takes new names in. 226fc8ea3 makes ZCode's poll fast; this is the "names that vanish" half of #5365, which that commit leaves alone. Co-authored-by: Flandern1211 <163982805+Flandern1211@users.noreply.github.com> Run (mote, via mote-run): - node --test internal/gui/tests/routing-session-name-kept.test.cjs (new; Chromium and WebKit, all five languages, 1100 and 420): 20 pass. With client.js at origin/main: red, the card reads "Claude Code · work/zc" after a poll without the name. - go test ./internal/gui (budgets, i18n guards): ok but TestMainWindowCorners/macOS_26_SDK, #3949. - node --test on the 8 GUI files that fake session-titles (claude-subagent-tag, routing-by-key, -credits, -moved-why, -request-metrics, -session-folder, -session-title, -sessions) and i18n-keys: 185 pass, 1 fail, i18n-keys "a plugin's words are its own" on two words in files untouched here (#5332, #5327). Not tried: the whole GUI suite (one routing file changed by four lines, no new strings, no new API call). |
||
|
|
52563d1cdf |
sessions: a ZCode name poll reads its sessions' messages for their stamp, as the listing does (#5365)
226fc8ea3 lists ZCode's sessions for Titles from their rows alone, with
size 0 and the row's time_updated as the file's stamp. Two things followed
from that stamp:
- ZCode writes a message without touching its session's row, so a session
still under its default title, first read before its prompt was in, was
never named by that prompt while only the Routing page polled.
- The cache kept size 0 and the row's time, where the Sessions page's
listing (zcodeFiles) keeps the message count and the last message's
time, so each read the session whole again after the other.
zcodeTitleStamps gives the sessions a poll asks for (their key wanted,
subagents under it too) the same count and last activity, from a
COUNT/MAX over each one's own messages by session_id, not the join over
every session's. A session whose messages can't be read keeps its row's
stamp, as before.
Co-authored-by: Flandern1211 <163982805+Flandern1211@users.noreply.github.com>
Run (mote, via mote-run):
- go test ./internal/sessions -run TestZCode -count=1 at 226fc8ea3 alone:
TestZCodeTitlesSeeNewMessages red (after the prompt: "") and
TestZCodeTitlesKeepTheListingsStamp red (kept size 0 mod
1790496000000000000, listing has size 3 mod 1790496030000000000). With
this change both green. On origin/main
|
||
|
|
24e1a21095 |
sessions: list ZCode's rows, not its messages, for a title poll
Titles listed every agent's files, and zcodeFiles joins the message table to give each session its size and last activity. On a ZCode database of 1,022 sessions and about 1 GB of messages that join took ~20 s, while the Routing page asks again every 15 s: its cards showed the folder for a while, and a poll that came back empty dropped a name it had. Titles now lists ZCode's sessions from their own rows (zcodeTitleFiles: id, parent, time_updated) and names them through the same assembleListed/parseOpenCode path as before. A ZCode subagent, which ocRoots files under its parent's key, is named from its own file's cached row when the key asked for matches no group. Run: - go test ./internal/sessions -run 'TestZCodeTitlesByRequestID|TestZCodeSubagentTitlesByRequestID|TestZCodeTitlesWithoutMessageTable|TestZCodeDefaultTitleFallsBackToFirstPrompt|TestSessionTitles|TestZCodeCalls' -count=1: ok. - go test ./internal/gui -run TestSessionTitlesNameOtherAgents -count=1: ok. - Broken by hand: with zcodeFiles (the message join) in place, TestZCodeTitlesWithoutMessageTable fails with an empty title; with the subagent fallback removed, TestZCodeSubagentTitlesByRequestID fails; with the sess_ alias removed, TestZCodeTitlesByRequestID fails. - Real ZCode database on Windows: Titles for three live sessions went from 20.4 s to 780 ms cold and 74 ms warm; a ZCode and dsh poll took 80-160 ms. - go build ./...: ok. The full sessions package has the same three Windows-only failures as before this change (TestAgySessions, TestAgyRowOnly, TestCCListingKeepsItsNames). |
||
|
|
d3a0be6dda |
provider: Google's verify link is the one Gemini CLI opens, read whole from any body (pppuuu)
pppuuu (Discord) tested an Antigravity model, got Google's 403 "Verify your account to continue." with a link, and opening the link gave Google's own "400. That's an error. The server cannot process the request because it is malformed." What magpie showed was checked first, and it was Google's validation_url whole: a realistic VALIDATION_REQUIRED body (ErrorInfo metadata with validation_url, validation_error_message, validation_url_link_text, a google.rpc.Help detail, & written raw and as &) sent through the Antigravity model test (TestAntigravityModelTest) and through the gateway to an agent (TestVerifyLinkWhole) shows the URL with every parameter on the old code too. Google's own Antigravity flow gives the same 400 to many accounts (discuss.ai.google.dev 119780: cleared google.com cookies, Chrome, or removing Antigravity from third-party access fixed it). What differed from Google's own client, and is fixed here: - Gemini CLI (classifyValidationRequiredError) opens the google.rpc.Help detail's link first, past a "Learn more" one, then the ErrorInfo's validation_link, then validation_url. magpie took validation_url first and never read validation_link. It now takes them in Gemini CLI's order. - Metadata was read as map[string]string, so one non-string value made the whole body unreadable and the link was lost; values are read one by one. - A message magpie already put the link in, passed on again as a JSON error body (a Remote magpie's, the gateway's), has & as &; the raw read stopped at the \ and found no link. It is read from the decoded words now. Tests: TestVerificationLinkWhole and TestVerificationLinkAsGeminiCLI (provider), TestVerifyLinkWhole and a verify case in TestAntigravityModelTest (gateway). Run on mote: go test -run 'TestVerification|TestAPIError' ./internal/provider ok; go test -run 'TestAntigravityModelTest|TestVerify|Restricted' ./internal/gateway ok; go vet (darwin, linux, windows) of internal/provider and go vet internal/gateway ok; go test ./internal/provider: ok (178s). Broken by hand: with the old test.go, TestVerificationLinkWhole (escaped read-back) and TestVerificationLinkAsGeminiCLI (Help link) are red; the gateway cases pass on the old code too, which is the evidence the shown link was already whole. Not tried: a real account Google wants verified (none here), and pppuuu's exact body and link, which aren't known; whether Google's Help link and validation_url ever differ is not known. |
||
|
|
1b0340fdbc |
provider: WorkBuddy's mover min is 0.2.23, which hides DeepSeek Harness's name
plugins 4912c608 (npm 0.2.23, checked --prefer-online): a "Hide DeepSeek Harness's name" switch, on by default, takes dsh's identity lines out of what goes to WorkBuddy (NancyTom18 on X, an account banned after use from dsh). keepMovedCurrent brings moved users up to it. Run: go test ./internal/provider on mote at this tree, ok (219s); gofmt -l clean. Not tried: a real WorkBuddy account. |
||
|
|
6d9fb7ef0f |
routing: a dsh request names the dsh session its first prompt was read from
changqiu4890 on Discord: Routing -> Requests showed dsh's requests with no session id. dsh 0.2.1's pi-ai routes (openai-completions, anthropic), which magpie configures, send no session header (pi-ai's session affinity is withheld by dsh's compat gate), so a route had only its Conv, the hash of its first user message. The Context page already found dsh's session by that hash (dshConvs); the Routing page grouped by header session only. pricedRoutes now gives a dsh route with no session of its own the dsh session whose Convs hold its Conv (convOwners, shared with the Context page's joinConvs), from an index rebuilt at most every 2s when a conv is missing and every minute otherwise. Grouping and titles (dsh:<id>) follow. A route with its own session, another agent's route, and a conv two sessions share stay as they were. Run (mote-run, this tree): - go test -tags nogui ./internal/gui/ ./internal/sessions/: ok, ok - TestRoutingDshRoutesNameTheirSession and TestContext*: ok - GUI routing-sessions, routing-session-folder, routing-by-key, ctx-route, routing-day-window: Chromium 160/0, WebKit 80/0 - go vet darwin, linux (nogui), windows ./internal/gui; go build all three - gofmt -l clean Broken by hand: `r.Session = owners[k]` -> `_ = owners[k]`; the new test's dsh chat and messages routes went red. Not tried: a real dsh through magpie. A brand-new session's first request shows no session until dsh writes its session file and the index refreshes. The in-flight list (Active, concurrency endpoint) is unchanged. |
||
|
|
4f624241f7 |
codex: the ChatGPT app left on "hit a snag" after an app-server restart is reopened when idle (#4550)
ysm119 on Discord: each Restart of Codex in magpie left the ChatGPT desktop app on "ChatGPT 遇到了问题 / 请重试" till it was quit and opened again. magpie ends the app's own app-server cleanly (code 0); a signed-in ChatGPT 26.1021 then fails "Hosted AppServerManager identity is not ready" on the one it starts, logs fatal_error_broadcasted and shows the page. That is the app's bug; magpie now follows it up. - provider/codex_app_crash.go: for 60s after every end magpie makes (the watcher's step, RestartCodexApp, RestartSwitchedCodexApp) the app's logs are read for a whole fatal_error_broadcasted line stamped after the end. On one, with no request through magpie since or in flight and no Codex turn opened since, the app is quit and opened once. Otherwise it is left as it is and logged. Where it can't be reopened (Linux, an app that didn't quit) the Agents row says "The Codex app hit an error · quit it and open it again" (appSnag) until the app-servers seen then are gone or the app is closed. Unreadable logs reopen nothing. - agent/codex_app_crash.go: the logs as the app's file logger writes them (macOS ~/Library/Logs/com.openai.codex, Windows %LOCALAPPDATA%\Codex\Logs and the Store package's LocalCache, Linux $XDG_STATE_HOME/codex/logs; YYYY/MM/DD folders, tail-read, half lines dropped). The relaunch is the Agents row's: on macOS ChatGPT.app found by its bundle id, quit as ⌘Q does and opened once it has ended, never forced; on Windows codexAppReopen. - GUI line in en, zh, zh-TW, ja, de; docs/subsystems/agent-wiring.md. Run on mote (macOS) at this head on origin/main |
||
|
|
08982805eb |
gui: spinners stand still under reduced motion instead of flickering
_yukirock on X (0.1.3036, macOS 27.3): spinners ran far too fast. The
reduced-motion rule cut every animation to .01ms but left endless ones
endless, so a spinner restarted every few microseconds and each frame
caught it at a random angle (seen frame by frame in the reporter's
video: the arc jumps 90-180 degrees per 60fps frame). It hits anyone
with the system's Reduce Motion, or magpie's own (Settings > General).
The rule now also sets animation-iteration-count: 1, so an endless
animation runs once, ends at once and shows its base style, as the
spinners that declare `animation: none` there already did (ag-up,
quota-refresh, saving). routing.css's busy spinner asked for a 2s turn
under reduced motion; the global !important rule always overrode it, and
it now stands still with the rest.
reduce-motion.test.cjs puts a sign-in spinner in the page and waits up to
1s for its animations to finish: they do while motion is reduced, and
never otherwise. (Counting running animations two frames on was red in
Chromium at the rebased head: a compositor animation can take longer to
start.)
Run on mote (Chromium and WebKit):
- reduce-motion plus every GUI file that reads animations under reduced
motion (33 files, 1034 tests): 1011 pass, 23 fail. The failing four
files (context-map, found-skill-pick-remove, mobile-web,
tray-cell-click) fail the same on origin/main
|
||
|
|
965ae78e1e |
gateway: a routing group draws on its own image member, Codex's tool too
changqiu4890 on Discord: the group smart-split has three Codex CPA chat models, DeepSeek-V4.1-Flash and Codex CPA's gpt-image-2.5, and dsh, Codex and Pi are set to it. Image requests went to other providers' image models. Two causes in magpie: - drawingTries tried every member of a group named for a drawing in the order chat routing plans them, so the chat members came first. group/smart-split drew on cpa/gpt-6-astra, which was asked as a chat for an image, before it reached the group's image member. A group with members that make the kind (drawsModel, or servesKind for video) is now tried on those members alone. The fallback between them stays as it was. - Codex's image tool drew on the provider that served the turn, else on Settings' pick. A group's image member was never used: a turn on DeepSeek, or on the relay, drew with Settings' model or with the relay's other GPT Image. codexDrawingProvider now also returns the routing group the turn asked for. When that group draws (GroupDraws), the drawing goes to its image member through resolveDrawing, which keeps the member's provider. The reporter's Routing screenshot also shows explicit requests from a client magpie names "Mozilla": x0-15/gpt-image-2.5, codex/gpt-image-2.5, and bare gpt-image-1 and gpt-image-1.5. magpie routes a request that names a provider to that provider, and a bare id to the first provider whose Drawers list it. Nothing in such a request links it to the agent's group, so this commit leaves those requests alone. Tests: - TestMixedGroupDrawsOnItsImageMemberOnly (new): the reporter's group shape on fake upstreams, with another relay listing gpt-image-2.5 first. Red before the fix (drew on cpa/gpt-6-astra), green after. - TestCodexDrawingTakesItsGroupsImageMember (new): red with the group branch turned off by hand (drew on chat/gpt-image-2), green with it. - TestMixedGroupMakesVideoOnItsVideoMemberOnly (new): a guard for the video sibling. It passes with the filter turned off as well, because video's mediaMembers already keeps only video members (KindGroup). Run on mote (mote-run) at this tree: - gofmt -l - go vet ./internal/gateway on darwin, GOOS=linux -tags nogui and GOOS=windows - go test -count=1 -run 'Group|Draw|Image|Video|Media' ./internal/gateway - go test -count=1 -timeout 45m ./internal/gateway ./internal/provider Not tried: - a real Codex CPA relay or a real dsh session - the image MCP's default for a non-Codex agent set to a group: the MCP call carries no link to the agent's chat route, so it still uses Settings' pick - chat routing to a group's image member when the member's provider has no picks: the member's provider is still the pinned one, and this commit doesn't change it |
||
|
|
331f201faf |
plugin: a cross-signed root copy in Windows' ROOT store no longer shadows Bun's own root (youyo.p_10001)
youyo.p_10001 (Discord #feedback, magpie 0.1.2993 windows/amd64, Bun 1.4.4, Clash Verge on 127.0.0.1:7897): every MiniMax plugin request to agent.minimaxi.com failed "unable to get issuer certificate", while the same chain verified outside the plugin host. Cause: magpie hands Bun the user's Windows ROOT store as NODE_EXTRA_CA_CERTS. Bun (BoringSSL) builds the chain up through the first trusted certificate with the subject it wants, the extra file's ahead of its own bundle, and stops when that one's issuer is missing. A ROOT store holding USERTrust RSA's copy cross-signed by AAA Certificate Services (agent.minimaxi.com's chain goes leaf, WoTrus DV, USERTrust RSA) gave Bun that copy ahead of the self-signed root it ships, and AAA is in neither. Node, curl and Schannel go on to the self-signed one, so outside magpie it worked. Fix: rootsFirst writes the self-signed roots first and keeps another certificate only when its issuer is in the file too. Bun never ends a chain on one that isn't self-signed (no partial chains), so one left out could only stand in front of a root. NODE_USE_SYSTEM_CA=1 stays: the system store Bun reads itself comes after its bundle and shadows nothing (tried, below). Also, for the next report like it: - the host logs its network settings when it starts, and when the proxy (or the gateway's address) moves, old to new: the proxy without user and password (netproxy.Redact), NO_PROXY, NODE_EXTRA_CA_CERTS, NODE_USE_SYSTEM_CA, SSL_CERT_FILE/DIR (netLine); - a fetch Bun refuses for the certificate keeps Bun's words and its code and cause, and adds "(UNABLE_TO_GET_ISSUER_CERT: the plugin host's TLS didn't verify agent.minimaxi.com's certificate chain against the roots it trusts)", so it doesn't read as the vendor's fault (throwTLS in host.js). The plugin side, a China-site account call that can't reach agent.minimaxi.com going once to agent.minimax.cn, is opencode-minimax-auth 0.2.3 (magpie-community/plugins#757). Run: - Reproduced on xiaomi-gpu (Windows 11, Bun 1.4.2) with the real host and the real ROOT store: the real cross-signed USERTrust RSA (valid to 2028) imported into LocalMachine\Root, then a scratch test through bunCommand (NODE_USE_SYSTEM_CA=1 included) fetching https://agent.minimaxi.com/: the file as before -> UNABLE_TO_GET_ISSUER_CERT, rootsFirst's -> 200. Certificate removed after (checked); without it both 200. Also as NODE_EXTRA_CA_CERTS alone: cross copy -> UNABLE_TO_GET_ISSUER_CERT; self-signed then cross -> 200; cross then self-signed -> UNABLE_TO_GET_ISSUER_CERT; cross with AAA either order -> 200. The cross copy in CurrentUser\CA with NODE_USE_SYSTEM_CA=1 -> 200 (no shadowing from the system store). - New tests: TestRootsFirstPutsTheSelfSignedCopyAhead, TestBunGetsPastACrossSignedRootCopy (a synthetic cross chain through Bun), TestPluginTLSRefusalSaysWhose (through the fake plugin's fetch; Bun's message there is the reporter's "unable to get issuer certificate"), TestNetLineSaysNoSecret. Green on mote (macOS, Bun 1.4.2) and on xiaomi-gpu via win-run, with the systemca tests beside them. - Broken by hand on mote: rootsFile without rootsFirst -> TestBunGetsPastACrossSignedRootCopy/the_cross-signed_copy_first red; throwTLS rethrowing as is -> TestPluginTLSRefusalSaysWhose red ("err = unable to get issuer certificate"). - mote, at this tree: gofmt -l clean; go vet, GOOS=linux go vet -tags nogui, GOOS=windows go vet of internal/plugin ok; go test ./internal/plugin ok (111.7s). xiaomi-gpu: go test -run 'Proxy|CA|TLS|Roots|NetLine|LAN|Network' ./internal/plugin ok. Not tried: the reporter's own machine and store (what put the cross copy in their ROOT store is a guess from the error; the host's new log line will show NODE_EXTRA_CA_CERTS, and the file is in the cache's bun folder); Bun 1.4.4 (the reporter's; 1.4.2 here); macOS keychain copies (rootsFirst applies to systemRoots there too, untried with a real cross copy); Linux takes the distribution's bundle as it is, unchanged. |
||
|
|
97ccb90e88 |
routing: a group with no rule shows only the example rule's button, no paragraph under Rules (mr_coffee0083)
|
||
|
|
a732f3c493 |
gateway: models of one API other than chat are grouped by id on their route (#5339)
XYenon (Discord) has the same embedding model at several providers and
asked why it isn't grouped the way chat models are. It wasn't even
listed: a fetched list dropped every embedding, rerank, speech and
transcription model, so "embed-1" on /v1/embeddings was a 404 unless a
hand-made group named it.
- catalog: a fetched list keeps those models, tagged with their API
(Model.Serves, read from the id by ServesOf: rerank, embed/bge-,
whisper/transcribe, tts-/-tts). Chat() and Live() leave them out, so
agents' model lists, gateway keys and Routing's chat pickers never
see them; LiveServing(id, kind) reads them. The live file says
"kinded": true; a list fetched before this is fetched again once a
run (autolist), with no schedule needed.
- provider: KindGroup(kind, ref) is made per request, never stored, so
it is in neither Groups() nor Catalog(). Its id is
auto-<kind>:<model> ("group/auto-embedding:embed-1"); its members are
the providers that serve exactly that id for that API, in the order
they were added, none off, decide-only, serving none, or with the
model disabled.
- gateway: embeddings, rerank, speech, transcriptions and videos pick
the group by route (mediaMembers): a bare id is a kind group when
more than one provider serves it, the group's own id always; a
hand-made group still works through offChatList. A group is of its
own API: an embedding model's id on /v1/rerank is a 404.
Run at
|
||
|
|
b63b289589 |
provider: WorkBuddy's mover min is 0.2.22, extra credits keep the account going once the plan's are spent (ferock)
ferock on Discord (2026-11-05, WorkBuddy China): once an account's base credits were used up magpie moved to another account, though WorkBuddy goes on serving it on its extra credits. workbuddy 0.2.22 (magpie-community/plugins 36fc59a7) sets the plan's Credits window aside once it is spent with extra credits left, and Extra credits stops the account, for the extra credits only the detail lists carry too, as the summary's own split already did. keepMovedCurrent brings every moved user up to it. npm: `npm view --prefer-online --registry https://registry.npmjs.org @magpie-community/opencode-workbuddy-auth version` answered 0.2.22 before this commit (the publish run is red only on think-tags 0.1.1's E404, plugins#180). Run at this tree on mote: go test -timeout 45m ./internal/provider/ ok (302.7s); gofmt -l clean. Not tried: a real move to 0.2.22, or any real account with extra credits (the China desktop sign-in here is refused 401 by the billing meter). |
||
|
|
d620ff6b54 |
codex: an old OpenAI thread follows Codex onto magpie by its row, and back at the Disconnect (Parry_Moody, Cyrus)
Parry_Moody and Cyrus on Discord: Codex on OpenAI through an API key
before magpie, and for two days the Codex app answered every older
conversation "继续聊天未成功: This chat uses openai, but your current
provider is magpie. Switch to openai to continue."
Cause, from Codex's source (rust-v0.167.0-alpha.3.1, same in 0.166.0):
every thread Codex 0.166 starts is paginated (history_mode 'paginated'
in its state-DB row), and for those thread-store read_thread takes the
provider from the row, never the rollout ("Paginated history may contain
only a suffix, so its display metadata lives in SQLite"). The app sends
thread/resume with modelProvider null (ChatGPT.app 26.1021, Kct in
app-shared), so the row alone decides, and load_for_resume refuses a row
other than the current provider. bringOver moved threads by rewriting
files: plain ones in place, packed ones only from the last 30 days and
128 MB a sync. An older or packed OpenAI thread kept an openai row.
Now sessions.RetagPagedCodexThreads moves every paginated thread on a
provider by its row alone: any age, packed or not, an id of any length,
no file read, written or copied. Each thread is held by its writer lock
(an open one stays: its writer would write the provider back), one
written to in the last minute waits, 200 rows a transaction. It runs
after the in-place relabel in bringOver, bringBack (so a Disconnect no
longer copies a whole paginated history to the trash), bringOfficial and
bringBeside, and giveBeside by ids (RetagPagedCodexThreadIDs). Legacy
threads keep the file path. The Sessions page lists a paginated thread
on its row's provider (codexPagedProviders, memoised on the DB and WAL
stamp), so it isn't offered a Move it had.
Run:
- real codex-cli 0.166.0 (npm latest) on mote in a sandbox CODEX_HOME,
a fake Responses server: a thread started with OpenAI (API key,
openai_base_url) is paginated, row openai; with model_provider magpie
`codex exec resume` failed with exactly "This chat uses openai, but
your current provider is magpie" (modelProviderMismatch). After
magpie's RetagPagedCodexThreads on that home (a throwaway test calling
it, not committed) it resumed and answered; the rollout still names
openai. Reversed (magpie -> openai) with config back on OpenAI, it
resumed again. The first retag try moved nothing: the rollout had been
written <1 minute before, the ActiveWindow skip, as intended.
- mote: gofmt -l; go vet darwin, GOOS=linux -tags nogui, GOOS=windows
for ./internal/sessions ./internal/agent; go test ./internal/sessions
./internal/agent: ok (sessions 20.1s, agent 194.4s) on mote, plus go vet on darwin, linux -tags nogui and windows
Broken by hand:
- RetagPagedCodexThreads returning nil (the old behaviour):
TestCodexPagedThreadsFollowByRow red (250 packed 90-day-old threads
"on openai, want magpie"), TestRetagPagedCodexThreads red.
- the writer-lock hold skipped: TestCodexPagedThreadsFollowByRow red,
the open thread moved to magpie.
Not tried: the Codex app GUI itself (the app goes through the same
app-server thread/resume, whose modelProvider it sends null); Windows
and Linux runs (vet only). Codex rebuilds a row from its rollout when a
search listing reconciles it, which puts a retagged thread back on its
file's provider until the next sync; not seen, read from the source.
A legacy thread packed over 30 days still waits for Sessions' Move.
|
||
|
|
bd0f338282 |
hermes: a Claude model goes on anthropic_messages, so cache_ttl 1h works; the user's api_mode stays (#5315)
cherish_onlyy (#5315): magpie wrote providers.magpie as chat_completions at the gateway's /v1 for every model. On chat completions to a custom provider Hermes sends no cache marks (anthropic_prompt_cache_policy gives (False, False)), and the marks magpie adds for a Chat client last five minutes, so prompt_caching.cache_ttl: 1h never reached the vendor. They set api_mode: anthropic_messages and the gateway's root by hand and got 1h writes; magpie's next sync or connect wrote chat_completions at /v1 back. Hermes takes api_mode per providers entry, never per model (_resolve_named_custom_runtime, hermes_cli/runtime_provider_custom.py; aliases in config_providers.py's _API_MODE_ALIASES, transport read when api_mode is absent). On anthropic_messages its adapter strips a trailing /v1 and the SDK adds /v1/messages, and for a "claude" model on a third-party gateway it puts its own system_and_3 marks at the configured ttl (agent/prompt_caching.py, read at d914e233). So magpie now writes two entries, as dsh already splits its routes: - magpie: chat_completions at gw/v1, every model not on Messages; - magpie-anthropic: anthropic_messages at gw (no /v1), the models whose native API is Anthropic's Messages and not Responses (hermesOnMessages). model.provider follows the picked model (hermesRoute), in every profile; a sync moves a Claude model magpie had set under "magpie" onto magpie-anthropic, and drops that entry when no model is left for it. Disconnect takes both out. The user's own value: an api_mode or transport on one of magpie's entries that isn't the one magpie writes there (by Hermes's aliases, so "openai" is still magpie's chat) is the user's (hermesModeIn). It stays through sync and pick, base_url follows it, and on "magpie" that entry then serves every model and no magpie-anthropic is written, which is the reporter's set-up exactly. magpie only ever wrote chat_completions into providers.magpie, so nothing earlier is mistaken for the user's. Tests: - TestHermesClaudeGoesOnMessages: Claude on magpie-anthropic (mode, base without /v1, models), deepseek stays on magpie at /v1, Get/Check/Drift clean, a pick moves model.provider back, a bot profile too, Disconnect removes both entries from every profile. - TestHermesSyncMovesClaudeOntoMessages: an existing connected config is moved on sync, and back when the provider goes chat-only. - TestHermesKeepsTheUsersAPIMode: api_mode anthropic_messages at gw, transport: anthropic, codex_responses: each survives two syncs and two picks, base_url kept; api_mode: openai is still magpie's. - internal/gateway TestHermesHourMarksReachTheVendor: a Hermes-shaped /v1/messages turn with 1h marks reaches the Anthropic upstream with every mark at 1h; the same turn on /v1/chat/completions goes at 5m. This one passes on the old code too: the gateway already passed the marks through; it guards that and records why the mode matters. Run (mote-run, this tree): - go test ./internal/agent/ -count=1 -timeout 45m: ok - go test ./internal/gateway/ -run 'TestHermesHourMarksReachTheVendor|TestResponsesToClaudeMarksLastAnHour' -count=1: ok - go vet ./internal/agent/ ./internal/gateway/, GOOS=linux and GOOS=windows: ok - gofmt -l: clean Broken by hand: - hermesSplit returning (nil, false), the old one-entry behaviour: ClaudeGoesOnMessages, SyncMovesClaude and the openai-alias case fail. - hermesModeIn never reporting the user's mode: all three KeepsTheUsersAPIMode cases fail at "sync". Not tried: - Hermes itself: it was not run (running it under a temp HERMES_HOME rewrites the live launcher); its behaviour is read from its source at d914e233. No real 1h cache write was measured against a vendor. - Group models whose members are all Claude, and Claude Code sign-ins (no Native API), stay on chat_completions; GPT on codex_responses is #3080. - Windows and Linux runs of the agent package (vet only). |
||
|
|
465928bcce |
backup: the default backup folder says a reinstall takes it too; docs say how to keep magpie on another disk (two_2025.)
two_2025. on Discord asked to pick magpie's config folder: on Windows it is on C:, and a system reinstall without a backup loses everything. Two ways already exist and neither is said where the user looks: automatic backups can go to any folder (Settings > Sync and backup > Backup folder > Change...), but default to auto-backups inside magpie's own folder, lost with it; and portable mode (a data folder beside magpie.exe, internal/appdir) keeps everything on another disk. So no new data-folder setting: moving the live folder would have to repoint the library's links, agents' configs and a running gateway, and its pointer would sit on C: and be lost on the same reinstall. - AutoStatus reports inside: the backup folder is settings.Dir() or in it, letter case aside off Linux. The Backup folder row then says a reinstalled system or a lost disk takes these backups too, and to pick a folder on another disk or a cloud drive's (en, zh, zh-TW, ja, de). A folder picked elsewhere says nothing new. - docs/start (en, zh, ja) #data-folder: pick a backup folder on another disk and restore from it after a reinstall, sync for the keys, or run portable from D:\magpie with a data folder beside magpie.exe. - docs/subsystems/sync-backup.md names the field and the tests. Run (mote, at this tree on origin/main |
||
|
|
435f041514 |
gateway: an account near its usage cap takes one turn at a time (dyzdyz010)
dyzdyz010 on Discord: two Claude Code accounts, each capped at 90% of its five hours, Stop at the caps and Check usage near the cap on, and both read 100%. Routing holds a capped account by its last reading. Turns sent together (an agent's subagents, several agents) were each planned on the same reading, so an account a point under its cap took every one of them, and went as far past it as they used between them. Check usage near the cap reads the usage again before planning, but every turn read the same figure: each saw 89%. - gateway (cap_near.go): within 5 points of a usage cap (carefulNear), an account takes one turn at a time. A turn that finds it busy goes to the next candidate first, the account moved behind them once; the last candidate waits for it. Once its turn comes capHeld judges it again, by what the reply before it said (codex.rate_limits, rate_limit_event), or by the usage read again when that reply said nothing (at most carefulWait). Held, it is passed over, or the agent gets the cap's 429 when nobody is left. The cap is passed by one turn at most. - A conversation kept on its account by Stays: Strict takes no turn there and goes on past the cap, as before. Neither does an account already held when its try begins, let in past its cap on purpose (a Codex reset spent for it, its credits). - docs: gateway-routing.md's capHeld step, providers-accounts.md's cap sentence. Run (wsl-run, magpie-desktop, Go 1.26.8): - go test -tags nogui -run 'NearCap|FarFromCap' -v ./internal/gateway: the five new tests pass. - go test -tags nogui -race -count=20 -run 'NearCap|FarFromCap' ./internal/gateway: ok. - GOOS=linux go vet -tags nogui ./internal/gateway, GOOS=windows go vet ./internal/gateway: ok. gofmt -l: nothing. - go test -tags nogui -timeout 30m -run 'NearCap|FarFromCap|CodexNoCredits|Reset|Strict|Cap|Credits' ./internal/gateway: ok. - go test -tags nogui -timeout 45m ./internal/gateway ./internal/provider, at this tree rebased on |
||
|
|
01a260af46 |
routing: a group with no rule says what a rule is for, with an example rule (mr_coffee0083)
mr_coffee0083 on Discord asked how to set up a group where one model
thinks and several others write code: the group editor's rules part
had no word on it and no example to start from.
- plugins/routing/client.js: a group of two models or more, not routed
by hand, with no rule yet, says under Rules that every turn goes by
the routing, and how one model thinks while others write code: the
coding models in a group of their own added first, the thinking model
after it, routed In order, and a rule sending planning and hard
problems to the thinking model. "Add an example rule" beside "Add a
rule" adds that rule, its intent filled in ("planning, design, or a
hard problem to think through"), for the editor to finish. Neither
shows once the group has a rule, or for one model, or routed by hand.
- i18n.js: the three strings in zh, zh-TW, ja and de, with each
language's own word for In order.
- routing.css: the button wraps and reads in the accent colour, as the
text buttons beside it.
Run (wsl-run, magpie-desktop, Node 22, Playwright 1.62.0):
- routing-rule-example.test.cjs (new): 20 of 20, chromium and webkit,
en zh zh-TW ja de, at 1100 and 390 wide. The hint and button show,
nothing is past the editor's side, pressing adds one rule to opus
with the translated intent, Save posts it with the classifier Jev;
after a reload a group of one model, or routed by hand, shows
neither.
- the 16 i18n-*, routing-rule*, routing-rules-*, group-editor-* and
routing-classifier* files: 190 of 221. The 31 reds are in
i18n-keys (#5327, #5332), routing-rule-drag, routing-rule-models,
routing-rule-remove and routing-rules-line (#4585, #5088, #3789,
#4112, #4560). Those five files run alone, one at a time, at clean
origin/main
|
||
|
|
5db1b07ed9 |
gui: the tray panel's Usage tab is drawn again in Settings' currency picked alone, and when its read came before the state (dLdgKyRd)
dLdgKyRd on Discord, v0.1.3025 on macOS: the menu-bar panel's Usage tab said ≈$12.36 while the window's Usage page said ≈¥82.61 for the same day. v0.1.2913 ( |
||
|
|
a2f7ed2e81 |
gateway: a hand-made group of embedding, rerank, speech, transcription or video models is served when its providers have picks
XYenon on Discord: a routing group of embedding models was a 404 on /v1/embeddings. Picks are of chat models, so membersFound dropped every member of a provider with picks as unpicked (#3911). |
||
|
|
2891ec7a7b |
docs: Trae / Trae CN through magpie, in the start page's FAQ (en, zh, ja)
A user (tz_188, Discord) confirmed Trae works with magpie this way: the gateway's address in Trae's custom model settings, Share on local network (局域网共享) turned on, and a gateway key as the API key. Trae keeps custom models in the Trae account, server-side, so magpie can't set it up in one click, and Trae may not reach 127.0.0.1. The FAQ entry (#trae) says that, hedged as a user report, and links Remote magpie's #share. Run: node --test site/*.test.mjs via mote-run at this tree, 84 of 84 ok. (Run with -C site it is 83 of 84: the sponsors test reads ../README.md, which -C site doesn't copy; not a red.) No Go test reads site/public/docs (pluginrt's tree walk skips site/), so none was run. Not tried: Trae itself; the steps are the reporter's, not reproduced here. |
||
|
|
06508f2bf5 |
library: a stdio server that refuses home is checked again in a project folder (fff)
math_milian on Discord: fff-mcp worked in their agent, but Library → MCP
said "fff exited (1)". fff-mcp indexes the folder it starts in and
refuses a file system root or home ("Can not run certain FFF features in
a file system root or home directories"), exiting 1. magpie's check
starts every stdio server in home (#1727), where agents never start it;
they start it in their project.
When a local check exits, it now starts the server once more in an empty
project folder of its own (removed after). If it answers there:
- given to agents that start it themselves (no router, not Codex on
magpie, or hub "direct"), the row shows its tools, and the tooltip says
it exits in home, with what it said;
- run by magpie in home for agents (the MCP router, or Codex on magpie's
RunPath), the row says "won't start in home" (why "home"), and its
editor offers "Through the MCP router" to turn off, even with the router
off, so each agent starts it in its project.
A server that exits in both places reads as before. WSL checks are
unchanged. healthKey (Go and client.js) now includes whether magpie runs
it in home, so a router change checks it again. startServer takes the
dir; the hub and the RunPath runner still pass home.
Run:
- go test -count=1 -timeout 30m ./internal/library on mote: ok (159s).
- TestCheckServerThatRefusesHome red on the old code: State error, Why
exited, Code 1, with fff's text, the reporter's case.
- Real fff-mcp 0.11.0 (cargo-built on mote, sandbox HOME resolved through
/private/var) via CheckServer: direct ok, 3 tools, Project; router on,
Why home, Code 1.
- go vet ./internal/library ./internal/gui (darwin), GOOS=windows and
GOOS=linux go vet ./internal/library on mote; gofmt -l clean.
- GUI on mote, Chromium + WebKit: mcp-home-health (new, every language,
1100 and 390), library-mcp-health, mcp-hub-direct, library-mcp-hub,
library-mcp-health-wsl, i18n-en-no-cjk, i18n-keys: 91 of 92 ok. The red
is i18n-keys "a plugin's words are its own" on search_row_archive_test.go's
"View routing", red on main since
|
||
|
|
24d315fa85 |
routing: the request list can be grouped By key, each gateway key's calls under its name
acezan (#help on Discord) asked to see API use on the Routing page the way
it shows each agent's, live and in the history. The list's group bar gets
a third button, By key, after By request and By session. It shows once
Settings has a gateway key (/api/caller-keys). Each head is the key's
current name (else the name the route kept, else its id), with its agents
dim beside it and the usual count, tokens, in progress and cost. Calls with
no key (from this computer, or kept before 75fb76186 named the key) go
under "No gateway key". A row's tooltip names its key too. The choice is
kept in localStorage (magpie.routingGroupBy), and the old
magpie.routingBySession still works. Text added in zh, zh-TW, ja and de.
click-scroll counted two group buttons and now counts three, with By key
hidden when there is no key. purpose-filter clicked .last() for By
session and now picks [data-by="session"].
reference.md and gateway-sessions.md describe By key and Route.CallerKey.
Run (WSL magpie-desktop: mote's disk is full, ld errno=28):
- routing-by-key.test.cjs: 20/20 in chromium and webkit, in en, zh,
zh-TW, ja and de, at 1100 and 420. Red 20/20 with client.js and
i18n.js at the parent (waits for By key).
- 254 Routing-related GUI files at concurrency 4. Every red was rerun
serially, with this change and at origin/main
|
||
|
|
5fe4c48df9 |
gateway: a route names the gateway key it came with, by id and name
The Routing page is to show each gateway key's requests as it shows each
agent's (acezan on Discord). A route kept the key's id only for
sessionLatest, unexported, so neither the trace nor the routing history
said it. Route.CallerKey and CallerKeyName are now in its JSON: the id and
the name the key had, never the secret. A request with no key names none,
and so does every route the history kept before this.
The trace is told to this computer alone (/v1/magpie/trace is loopback
only, /api/gateway/trace the GUI's), and /v1/magpie/route sends
sessionRouteOf's projection, which carries neither field.
Run (wsl-run, magpie-desktop; mote's disk was full, its link failed with
errno 28): go test -count=1 -run
'TestTraceNamesCallerKey|TestSessionRoute|TestCallerUsage|TestRejectedRequest'
./internal/gateway ok. Broken by hand: with trace.go, unrouted.go and
session_route.go back at
|
||
|
|
b95a78d43c |
gui: the editor says where magpie found a relay's balance, with Use
A relay added by hand with no Balance URL has its balance found by magpie, but nothing in the window said so. A user who saw a wrong amount couldn't tell it was a guess or where to put it right. Under the Balance URL, in Advanced, the editor now shows "Found by magpie: <url> <field>" with Use, which copies the query into the Balance URL and Balance field to be changed. Check balance draws the line again from what it found, and when it found nothing it says "No balance at /v1/usage or /api/usage/token" instead of "No Balance URL to ask". /api/providers carries balanceFound and balanceFoundField. The check's reply carries looked, found and foundField. The line is in balfound.js, loaded when the editor draws a relay's balance with no Balance URL. Its one call and the check's text in app.js are paid for by three provider editor comments cut down, so there is no raise: the core is 1,533,452, 350 under its budget. zh, zh-TW, ja and de are translated. Run on mote: - go test -count=1 -timeout 45m ./internal/gui: ok, except TestMainWindowCorners/macOS_26_SDK, mote's macOS 27 (#3949). - GUI, both engines: balance-found (new, 900px and 420px, every language) 22/22. balance-url-first, balance-fix, balance-method, balance-field-default, key-balance-card and old-webkit: ok. i18n-keys: "a plugin's words are its own" is red (#5327), as on main. Broken by hand: with the import taken out of app.js, balance-found is 0/11 in chromium. Not tried: the whole GUI suite at this head (run after the push), and the real app with a real relay. |
||
|
|
464cc30f91 |
provider: a relay's found balance query is looked for again each day
A relay added by hand with no Balance URL has its balance found at
/v1/usage or /api/usage/token (
|
||
|
|
2488532257 |
provider: a relay added by hand finds its balance where relays tell it
The same relay user had added yylx.io by hand: no Balance URL, so no balance anywhere until they deleted it and imported it from the relay's site, whose link names the query (小鱼 of yylx.io, WeChat, 11-05). A provider added by hand, or from a relay's preset, with a key and no Balance URL, at no host magpie knows a query for, is now asked at its base's origin: /v1/usage (sub2api, $remaining), then /api/usage/token (new-api, $data.total_available / 500000), with the key's own auth and headers, as balanceRead asks. A 200 whose field reads is the query. It is kept in memory per origins and key (the key hashed), and so is finding none, for 6h (5 min when the relay can't be reached), so a poll asks once. Nothing is written to providers.json. The card, Check balance and `magpie provider show` (BalanceQuery) read the found URL; none found is no card, and the editor's "No Balance URL to ask". Never asked: a vendor's or local server's preset host (api.openai.com, api.anthropic.com, api.deepseek.com…), this computer, opencode.ai and api.cline.bot, a plan whose windows are its card. The subsystem page has the row. Run (mote, go1.26.8): - go vet ./internal/provider; go test -count=1 ./internal/provider: ok. - The new tests: a sub2api relay read at $10472.14 with /v1/usage asked 3 times over the probe, a Balance and a card poll; a new-api relay found after /v1/usage's 404; a relay answering HTML 200 everywhere has no card and is asked twice in all over two polls; the hosts left alone. Broken by hand: with the probe taken out of balanceRead, the three HandAdded tests fail (balance "" false; a card with no balance). Before this, TestOpenCodeZenSaysItTellsNoBalance caught the probe asking opencode.ai for OpenCode Go and a custom inference provider; those hosts are left out now. Real use (mote, sandbox HOME holding only the owner's yylx.io provider, copied with its key, removed after): `magpie provider yylx-hand` (no preset) and `magpie provider yylx` (鱼鱼连线's preset, Global region) both show "balance $19.97 from https://global.yylx.io/v1/usage $remaining". Not tried: a real new-api relay; a new-api relay that routes unknown /v1 paths to its upstream. |
||
|
|
e2aaf21f73 |
gui: a custom provider's Balance URL is asked above its balance token
A relay's user wanting their balance opened the editor and found "Account balance" asking for a new-api System Access Token or a sub2api JWT and user id, while the setting that worked (Balance URL https://app.yylx.io/v1/usage, token left empty) sat at the foot of the form under More endpoints (小鱼 of yylx.io, WeChat, 11-05). The Balance URL and Balance field now sit right above Account balance in Advanced (balSlot), and Advanced opens when a Balance URL is saved. The token's hint says first to leave it empty, that most relays tell a key's balance at the Balance URL above (sub2api's …/v1/usage, new-api's …/api/usage/token), and only then what the token is for. zh, zh-TW, ja and de have it. In Advanced's narrower column the method picker and URL wrap, so the URL keeps at least 120px at 420px. Run (mote, Playwright 1.62.0): - balance-url-first (new), balance-fix, balance-method and the other balance-* files: 186/186 in Chromium and WebKit, at 900 and 420px, en/zh/zh-TW/ja/de. - The whole GUI suite, cut short after 733 tests (it ran for hours beside other sessions): red only in account-eye chromium en/ja (#5052) and account-weight webkit ja 390 (#4644), both open and in files this change doesn't reach. - i18n-keys: "a plugin's words are its own" red, the same on main (#5327). TestCoreScriptBudget: the hint took the core 494 bytes over its budget; five comments in the provider editor were cut (573 bytes), so it is 79 under, with no raise. - go test ./internal/provider ./internal/gui ./internal/cli ./internal/tui at the rebased head: ok but internal/gui's TestMainWindowCorners on mote's macOS 27 (#3949, open) and the budget before the cut. Broken by hand: balance-url-first on the old app.js fails at "a saved Balance URL opens Advanced" (chromium). Filed: #5336, Advanced is 46px too wide at 420px on main (the Rests tick's label); the new test checks only the balance rows for it. Not tried: the real app on Linux (WebKitGTK); no motion or new API here. |
||
|
|
373cab2b08 |
provider: the Cursor mover's min is 0.2.41 (plugins#706)
cursor 0.2.41 (plugins#706, ooboqoo): a short session whose parent Run
waits on tool results no longer loses that step's usage. The later Run
of the conversation collects it, and it is counted once. Raising the
min makes keepMovedCurrent bring every moved Cursor user to it.
npm view --prefer-online @magpie-community/opencode-cursor-auth version
gave 0.2.41 before the change and again right before this commit.
Run on mote at this change on
|
||
|
|
2947685999 |
claude: an interactive run's calls keep the conversation they answered when their line comes late
kay20475 on X (magpie 0.1.3005, local magpie -> shared server magpie ->
Claude subscription, interactive bridge): a Claude Code sub-agent's
requests on one account read 99%, 6%, 6%, 99% from the cache; the two 6%
requests were 169.1k each, 35s apart, about 3s long with a short reply.
That is the shape of Claude Code's AgentSummary: every ~30s it sends the
sub-agent's conversation with its last results and "Describe your most
recent action in 3-5 words", while the sub-agent's own run has already
taken those results.
Cause. Such a request finds no run waiting on its calls and should go on
in a branch of the sub-agent's run's session (branch). branch takes it
only when the conversation stored on the call's line (callLine.told)
matches the one before the reply. park stored that only on lines it
already had. The interactive mode streams a reply first and reads its
session lines from the file afterwards (118-162ms after the call). So the
run parked before noteLines had the call's line, and the line came in
with no conversation. The next park then gave it the next request's
conversation. branch returned nil, and every AgentSummary (and every
fork directive) was told the whole conversation in a new Claude Code,
pasted as one text block. A single block can't match the cache beyond
the tools and system prompt, so 6%, and the next summary missed the same
way because its tail differs.
Fix. park also keeps the conversation for each call the client was shown
(r.shown), as a line with no uuid yet. noteLines keeps it when the line
comes, and branch skips lines with no uuid.
Test: TestClaudeForkBranchesOffTheLeadsSession/interactive now has the
fake write the call's session line after the reply's stream, once the
result is handed over, so after the park, which is the real order.
Broken by hand: with this test and the old claude_subscription.go on
mote, it fails ("told it whole", want "branched at line-...").
Run on mote at this tree (base
|
||
|
|
3518445947 |
gui: the self-remote notes are shorter, the core back under its budget
|
||
|
|
4cb7159f18 |
routing: a ChatGPT account whose usage can't be read is asked, not starved
peterpark8527 on Discord: 11 ChatGPT accounts under Use before expiry,
one never used. An account whose wham/usage reading fails (or names no
window, or is held by "When I ask") stayed not known for good:
Use before expiry counted it a fresh week (FreshPace, ~0.6/h), behind
every known week being spent; Smart put it after every known account.
NoteCodexLimits only updated accounts already read, so its replies'
x-codex-* headers never made it known. Its week, once started by
magpie's own turns or warm-up, lapsed unspent. A simulation of 11
accounts over 4 weeks (Pace, Poisson load 30/60/90%) had it at 141 of
~1200 used at 30% load, losing 3406, while every known account was used.
- provider: a reply that tells an unread account's week makes it known
from that (usedCache.heard), kept over failed readings, until a good
reading tells it; a 5h window alone still makes nothing up.
- gateway: a Codex account not known, weighed against one known, is
Learns, like Claude's: asked first once so its reply tells its week,
and again an hour after its last answer if that told nothing
(codexAnswered, codexLearnAgain). Of accounts none known the order
stands, so no week is started before it is needed.
- docs/reference.md: Smart and Use before expiry say so.
Ruled out (by design or not starving): an unstarted Codex week lasts
until its first request, so last is right for it; ties go by decayed
tokens, not a fixed order; a 5h-only account goes by its 5h pace
(ahead); rests are time-bound with probes.
Run:
- wsl-run go test -count=1 -timeout 45m ./internal/gateway
./internal/routes ./internal/provider ./internal/middleware: provider,
routes, middleware ok; gateway had 3 reds (TestAccountProxy,
TestCodexDrawMovesToNextAccount, TestWeeklyPace's five-hours case):
accounts none known reordered by answers earlier tests left in
codexAnswered. Fixed by the known-peer gate above; then wsl-run
go test -count=1 -timeout 45m ./internal/gateway ./internal/routes:
ok (809s). The none-known guard's u00 line was added after that run
and run alone on Windows (win-run -run TestUnknownCodexAccountIsAsked
./internal/gateway, with the reds above: ok).
- win-run the two new tests on the old code (
|
||
|
|
87c51cd6bb |
gui: a tap that comes let go before it is pressed clicks its control once (refeccd)
refeccd on Discord (magpie 0.1.3014, macOS 27.2 26B123): with Tap to click on, a tap often does nothing, in the tray panel and the window, and almost always inside a dialog, sheet or menu opened from the active window. Cause: WebKit's WebViewImpl::nativeMouseEventHandler hands every mouse event to NSTextInputContext handleEvent:completionHandler: while an editable element has focus, and before WebKit ba0432f3f5 (2026-11-04, bug 329642, "Dispatch mouse events to the page in the order sent to the input method", rdar://102126328) each event was dispatched from its own completion handler. Some input methods answer out of order, so a tap, whose down and up are a few ms apart, reaches the page as mouseup then mousedown: no click, :active stuck, and the next tap's mouseup pairs with the left press and clicks where the two meet (the "second tap works" of the earlier reports). A physical press is ~100ms long, so its order holds. Dialogs focus their first field when they open and menus focus their search box, which is why dialogs are almost always hit. macOS 27.2's system WebKit predates the fix. Not proven on refeccd's machine: no real trackpad with an input method was used; the order is reproduced, not observed there. Change (app.js, the one capture-phase tap net every control goes through): a press within 300ms and 12px of a release that had no press, and not let go within 100ms, is such a tap (tapBack). Its control (the lost-click net's selector) is clicked once after 100ms, and the trusted click the next release pairs with it (detail > 0, so never a keyboard click) is dropped. A release within the 100ms means the press was in order after all: nothing is clicked by the page and the browser's click is kept. The segs press tracker and the lost-click net ignore a tapBack press. Comments in app.js were condensed to keep the core script budget (main was already 380 bytes over it, #4526's test); no budget raised. Not covered: an inverted tap on a dialog's backdrop doesn't close it (backdropClick pairs pointerdown/up); nothing is clicked for it. Run (mote, at this tree rebased on origin/main |
||
|
|
9d143eacab |
uninstall: install.sh --uninstall disconnects every agent first, a deleted magpie too
whimsical_wolf_15477 (Discord): after uninstalling magpie, Codex didn't go back to its own config. `install.sh --uninstall` deleted the magpie command and app and left every agent wired to a gateway that no longer runs: Codex kept openai_base_url (or model_provider = "magpie" and model_catalog_json) pointing at 127.0.0.1. A magpie deleted by hand undid nothing either, and `--purge` refused with no magpie left to run. - `magpie uninstall --keep-data` (uninstall.KeepData): every agent disconnected and its own values put back from stash.json, the service, autostart, shortcut, scheme and helpers removed, magpie's settings, providers and usage kept. - install.sh --uninstall runs `magpie uninstall --yes --keep-data` (--purge: `--yes`) before deleting anything, and stops if it fails. With no magpie of its own (deleted by hand) but magpie's config left, it fetches the newest release into a temporary folder, checks its sha256, runs that, and deletes it after. An older magpie without --keep-data gets the newest one for this too. A magpie on PATH that the script didn't install is left to its own `magpie uninstall`, and said so. - MAGPIE_UNINSTALL_SCRIPT=1: under the script magpie doesn't ask to delete a path that the script deletes next. - docs (en/zh/ja start.html #uninstall) and READMEs: what the line does, that it works for a magpie already deleted, and Codex's lines by hand. Run (WSL magpie-desktop; mote's disk is full, nothing run or deleted there): - go test -tags nogui -run "Uninstall|Help|TestKeepData" ./internal/cli/ ./internal/uninstall/: ok. node --test site/install.test.mjs: all pass. - The new install tests against the old install.sh: 5 red. Broken by hand (--keep-data case removed, Data() back in KeepData): TestUninstallKeepData and TestKeepData red. - Real e2e: magpie built from this tree, Codex wired in a sandbox HOME (not signed in, and ChatGPT signed in), magpie installed and deleted by hand; install.sh --uninstall with a local feed. config.toml's diff before wiring vs after is the [model_providers.magpie] table only (kept on purpose for threads started on magpie); model, effort, openai_base_url, model_provider and model_catalog_json are the user's again; settings kept. - gofmt -l clean; go vet GOOS=windows/darwin/linux (nogui) for the two packages; sh -n and dash -n install.sh. Not tried: macOS's zip path for a deleted magpie run for real (tests cover it with fakes), Termux, Windows (no install.sh there; docs say download magpie again and use Settings › Uninstall). The full internal/cli package timed out at 10m under WSL load in providers_unreadable_cli_test (not touched here); see the full suite record. |
||
|
|
73c98ebc20 |
gateway: a search API's or plan service's ask is routed and archived (axelburks)
axelburks on Discord: when magpie searches for a model through a search API, the Routing page doesn't say which API answered, and Usage → Requests lists the row but has no request archive, so the request and response sent to the API can't be seen. A model's search (searchWith) was already routed and archived. A search API's ask (askSearchAPIKeys, a plugin's search hook, a signed-in search API) and a plan's own search service (Kimi Code, GLM Coding Plan, WorkBuddy, Codex's searchBy, and searchBy's Kimi branch, which wrote no row at all before) only wrote a usage row. Now every ask that writes a row goes through keepSearch (search_archive.go): a done web_search route, agent magpie, For the agent searched for, the API's name as model and its host as provider, seated on the masked key or account; a Recent call with ring-cut bodies; and with the request archive on, archiveOwn of the exchange as sent. The row gets RouteID and Archive, which the Requests tab already opens. Each ask has a searchWire in its context, filled where it is sent (tapSearch tees the answer as read; the last exchange stands, so GLM's MCP tools/call is the one kept). A plugin's search is noted as what magpie handed the hook (key masked) and what came back (PLUGIN method). The key is replaced by MaskSearchKey in path, query, headers and both bodies before anything is kept; the archive's own scrub runs on top. Bodies are kept up to RequestArchiveMaxMB (longer marked cut); archive off keeps nothing on disk, the route and Recent call stay. Run (mote's disk filled mid-work, see below; the rest on WSL magpie-desktop via wsl-run): - mote-run: go test -run 'Search|Archive' ./internal/gateway ok; GUI usage-ledger-search, routing-side-calls, request-archive-usage in chromium+webkit, every language and width: 38 pass. - wsl-run: go test -run 'Search|Archive' ./internal/gateway ok; go vet ./internal/gateway ok; GOOS=windows go vet ./internal/gateway ./internal/gui ok; GOOS=darwin CGO_ENABLED=0 go vet ./internal/gateway ok; GUI usage-ledger-search, routing-side-calls, request-archive-usage, search-instead, search-mcp in both engines: 68 pass, 0 fail. - gofmt -l clean. Broken by hand: keepSearch's call commented out turns all five new gateway tests red; taken()'s key masking turned off turns TestSearchAPIAskIsRoutedAndArchived and TestSearchAPIKeyInQueryNotArchived red. TestSearchRowKeepsRouteAndArchive (internal/gui) is a guard that the row's RouteID and Archive reach /api/usage/requests; it passed on the old code too. Not tried: real Tavily/Brave/Kimi/GLM/WorkBuddy/Codex accounts (httptest stubs only); Linux go vet of internal/gui (WSL lacks gtk4/webkitgtk); web_fetch (search_fetch.go) and a vendor's own search (search_native.go), which magpie doesn't send, are unchanged. Full suite runs after the push. No GUI asset, API call or i18n string changed. |
||
|
|
1826c4bd99 |
providers: a Remote magpie that is this magpie says so and is left out, unless kept (hanslin1666)
B uses A through a Remote magpie provider, and sync carries that
provider to A, where it points at A. Each of its models was one of A's
own, listed again beside it and taken by A's found groups, and a request
through it passed through A's gateway twice.
A fetch of a Remote magpie's list now reads its models' magpie_via: when
the magpie that listed them (the last entry) is this magpie's own
catalog.Self, remote-self.json keeps the provider id and the address it
answered at (noteSelf). Another lister, or a list with no via, takes
the record away; an empty list or a failed fetch changes nothing; a
provider moved to another address is not self until a fetch there says
so. The file is this computer's own, never in a backup or sync.
Such a provider is left out (SelfLeftOut in On, SwitchedOff and
remoteMagpies): not in /v1/models, the catalog or a found group. A
request naming one of its models, an agent's pick synced from B, is
served here with the remote's id taken off (ThroughSelf in Resolve and
ResolveRoute), once through the gateway. A 404 for it says why and how
to keep it.
The Providers row shows "This magpie" (greyed while left out), with the
reason as its title; the editor has a note and a "Use it anyway" tick
(KeepSelf, POST /api/provider/keepself). KeepSelf belongs to the user
and to this computer: Mirror and Restore keep the local value (false for
a provider new here), davsync's hashes blank it, and a provider save
keeps it. Strings in en, zh, zh-TW, ja, de.
Docs: providers-accounts.md (two magpies row), sync-backup.md (what
stays on each computer).
Run at this tree on origin/main
|
||
|
|
583fe70751 |
provider: WorkBuddy's mover min is 0.2.21, whose sign-in page shows 企业微信 (shenyebuwu)
shenyebuwu on Discord signs in to WorkBuddy with 企业微信 (WeCom), and the plugin's sign-in page had no WeCom entry. The plugin opened the login page with version=2.0.0; WorkBuddy's China login page hides WeCom below 5.8.0. Plugin 0.2.21 (magpie-community/plugins a90b7aa4) opens it at the desktop app's version, as WorkBuddy desktop does; keepMovedCurrent now brings every moved user to it. Run at this head (mote): gofmt -l internal/provider empty; go test -timeout 45m ./internal/provider ok. npm view --prefer-online shows @magpie-community/opencode-workbuddy-auth 0.2.21. Not tried: a real WeCom sign-in to the end. |
||
|
|
5b9bfe407c |
gui: the tray panel's Allowances tab folds what has nothing left behind "{n} at 0" (runking on Discord)
.runking on Discord: "额度面板那里能不能那些额度是 0 的可以隐藏掉啊 现在我一堆是 0 的".
What counts as at 0 (quotaAtZero): a fresh reading whose every window is used up (or held by another), and whose balance, if any, is 0 or below ("¥0.00", "-$1.20", "$-1.20", "0 credits"). A balance card folds on its own; a vendor's group folds only when every account in it is at 0. Never folded: a failed reading, an old one (asOf), a percent balance part, a text or unlimited window, a window used part way, a Codex account with credits on, reset credits, a check-in, and a card a menu bar cell opened.
Folded cards are not hidden silently: the foot gets "{n} at 0" (pq-more, beside Arrange); a click shows them and the button reads "Fold the ones at 0". The choice is kept in localStorage (magpie.panelZeroOpen). The click doesn't move the page and keeps the keyboard on the button. The Usage page and routing are unchanged. Strings in en, zh, zh-TW, ja, de. No new API call, no CSS.
Run on mote (mote-run):
- node --test internal/gui/tests/panel-zero-fold.test.cjs: 10/10 (chromium and webkit; en, zh, zh-TW, ja, de at 440px).
- The panel-*, quota-*, i18n-*, gui-zh-tw and click-scroll GUI files: 564 pass, 1 fail ("a plugin's words are its own": my first title said "Accounts and keys", the routing plugin's word; reworded). After that: i18n-keys, gui-zh-tw and panel-zero-fold 17/17.
- go test ./internal/gui -count=1: only TestMainWindowCorners/macOS_26_SDK is red, the macOS 27 red already filed as #3949 (AppKit, not touched here). TestCoreScriptBudget and TestAppScriptBudget pass; no budget raised.
Broken by hand:
- The test against origin/main's app.js and i18n.js: 10/10 red ("claude|a@b.c is folded").
- Dropping the asOf and creditsOn guards: chromium 5/5 red ("kimi stays in sight").
Not tried: the real tray panel on macOS, Windows or Linux with real accounts; the whole GUI suite (only the files above; no API call was added).
|
||
|
|
c2b8814e75 |
gui: the tray panel keeps the latest height it asked for, its fits sent one at a time (robot_yz on X)
robot_yz on X (11-05, v0.1.3005): the menu-bar panel had become short, and the Allowances tab's one card, Zhipu GLM (max, rings 5h 7%, 7d 18%, MCP 1%, a curve), was cut off by the foot. Cause: Wails v3 serves each request from the page on a goroutine of its own (application.go, `go a.handleWebViewRequest(request)`), so two window/fit requests sent together reach fitPanel in either order. In a real WKWebView under Wails on mote, 69 of 400 pairs of fetches sent together reached the handler the wrong way round. When an older, smaller height lands last, it stays: fit.last in app.js and the panel's own panelHeight both take the newer height as done, so nothing asks again until the content's height changes. Since |
||
|
|
4e85cac01d |
agent: OpenCode installs as OpenCode 2 (@opencode/cli, opencode.ai/v2/install) (math_milian)
math_milian on Discord: magpie's npm command for OpenCode installs
OpenCode 1, and OpenCode 2 isn't installed that way. On 2026-11-05
opencode-ai's latest is 1.19.5 and it has no 2.x; OpenCode 2 is
@opencode/cli (2.2.5, anomalyco/opencode's README), and
opencode.ai/install refuses a 2.x ("not an OpenCode 1 release") and
points to opencode.ai/v2/install.
- Install: opencode.ai/v2/install on a Mac or Linux, then
npm install -g --allow-scripts=@opencode/cli @opencode/cli. Air's
"OpenCode isn't installed" notice says the same, in every language.
- Update: an install from either package is updated within it (npm,
bun, pnpm by where it sits; brew's opencode or anomalyco/tap's
opencode-v2). An installer copy in ~/.opencode/bin is offered its
own line's newest: OpenCode 2 @opencode/cli's, OpenCode 1
opencode-ai's, since OpenCode 1's opencode upgrade runs the v1-only
installer. An unreadable version promises none.
- An existing opencode-ai install isn't moved to OpenCode 2: its
config differs, and npm needs --force over the other package's bin.
Run (mote): gofmt -l, go vet ./internal/agent, GOOS=linux/windows go
vet, go test ./internal/agent -run 'Install|UpdateCLI|HowInstalled|Mend|
Npm|Bun|Pnpm|Shim|Scripts|CLI|OpenCode|Air' ok; node --test i18n-keys,
i18n-en-no-cjk, agent-air-own, agent-notice-lang, agent-cli-missing: 82
pass. Real, sandbox HOME on mote: curl -fsSL opencode.ai/v2/install |
bash gave ~/.opencode/bin/opencode and opencode2, "opencode v2.2.5";
`opencode upgrade 2.2.4` from there went to v2.2.4 (magpie's target
form); npm 10.9.4 and 11.21.2 with magpie's exact command gave v2.2.5,
opencode2 too; `opencode acp` is in 2.2.5 for Air.
Broken by hand: opencode-ai first in npm turns TestInstallCommands red;
without the line hook TestUpdateCLIOpenCodeKeepsItsLine/1.19.4 is
offered 2.2.5 and TestUpdateCLIOpenCodeTakesVersion goes red.
Not tried: Windows npm install for real, Homebrew's opencode-v2 tap,
moving a real opencode-ai user to OpenCode 2.
|
||
|
|
06808ad308 |
agent: an agent's npm package that needs its install script gets it run on npm 12, bun and pnpm
npm 12 runs a package's install script only when told to (--allow-scripts=<pkg>), and bun (--trust) and pnpm 10 (--allow-build) do the same. A package whose postinstall puts its binary in place then installs a stub: @opencode/cli 2.2.5 from npm 12.2.2 or bun 1.4.2 without the flag prints "@opencode/cli's postinstall script was not run" and exits 1 (mote, sandbox HOME). OpenCode's own v2 updater passes the same flags. cliSpec.scripts marks the agents whose npm package has an install script: `npm view <pkg> scripts` on 2026-11-05 named one for claude, cline, crush, deveco, mothx, omo, opencode and snow, and none for the rest. Their install command, their npm/bun/pnpm update and the mend hint now carry the manager's flag. npm 10 and 11 run scripts anyway and take --allow-scripts as an unknown config. Run (mote): gofmt -l, go vet ./internal/agent, go test ./internal/agent -run 'Install|UpdateCLI|HowInstalled|Mend|Npm|Bun|Pnpm|Shim|Scripts|CLI| OpenCode|Air' ok, and GOOS=linux/windows go vet ok. Real: on mote, npm 10.9.4, 11.21.2 and 12.2.2 with --allow-scripts=@opencode/cli each gave a working opencode v2.2.5; npm 12 without it and bun without --trust the stub; bun with --trust a working one. Broken by hand: withScripts never adding the flag turns TestInstallLetsScriptsRun, TestUpdateLetsScriptsRun and TestUpdateCLIChecksItRuns red. Not tried: pnpm and yarn for real (mote has neither), the other seven agents' packages on npm 12. |
||
|
|
3587bf70e2 |
providers: a plugin account's Select all available ticks its own list; zcode min 0.1.51 (young02036)
young02036 on Discord: their two ZCode accounts in magpie, one with no GLM Coding Plan whose Start Plan holds glm-5.3-flash and one subscribed whose gift shows as glm-5.3-flash-trial, failed while the ZCode app worked; picking each account's usable models by hand worked. They also said ticking the available models by default didn't work. - zcode mover min 0.1.51: the plugin now lists for a gift-only account only the models its Start Plan balance names, as ZCode 3.17.2 offers it, not every model of the Start Plan config, so routing stops sending GLM-5.2 or GLM-5-Turbo to an account that holds only GLM-5.3-Flash (plugins c96d04bb, npm 0.1.51 checked with --prefer-online). - Select all available in an account's model picker ticked every model shown for a signed-in account. provider/keylisted now answers for a plugin's account with the models its plugin lists for that account (plugin.Account.Models, by the provider's listed ids), and the picker asks it for accounts as for keys. An account the plugin keeps no list for (one account has them all) or doesn't have is unknown, which still ticks every model shown; a non-plugin account is unchanged in effect. The account title says so, translated in zh, zh-TW, ja and de. Run on mote: - go test ./internal/provider -run 'TestKeyListed|TestPluginAccountModels': TestKeyListedIsAPluginAccountsOwnList red on the old code (the key account's list: [], want [fake-1]), green after. - node --test account-models-available.test.cjs (chromium + webkit, en zh zh-TW ja de, 900 and 420px): with the old app.js the new plugin account case and the Codex case (now asks keylisted) are red; green after. i18n-keys green. - go test ./internal/gui -run Budget, go test ./internal/provider (whole package), GOOS=windows go vet of both packages, GOOS=linux go vet of internal/provider (internal/gui's wails needs cgo for a Linux vet from mac), gofmt. Not tried: a real ZCode account (none available); whether the 3012s young02036 saw came from these requests is not proven; the whole GUI suite (only this picker's file and i18n-keys). |
||
|
|
ea3d1c62e7 |
gateway, codexcat: Codex's image detail "original" goes as "high" to a relay's Responses API, and only DeepSeek's own API is told it takes it (qiu_eth)
qiu_eth on Discord, v0.1.2885: the Codex App on opencode-go/deepseek-v4.1-flash got 400 "invalid image detail" / "this feature is not yet supported by atlas" for every screenshot. Where the values come from: - input_modalities ["text","image"]: models.dev lists deepseek-v4.1-flash under opencode-go with input text and image, and |
||
|
|
116f23c784 |
plugins: an agent plugin whose agent isn't on this computer says so, not "Adds Kimi to Agents" (zzZ)
zzZ (innerscw) on Discord: Kimi no longer shows in Agents, even with the
plugin installed. Nothing in magpie regressed. Kimi Code CLI (built-in
`kimi`, ~/.kimi-code) is found on main: installed with Kimi's own
install.sh in a sandbox HOME on mote, it is listed. The plugin is
@magpie-community/agent-kimi-desktop. Its agent's folder,
~/.config/magpie-kimi, is made by its adapter only once Kimi desktop's
Work runtime has written its config.json (bootstrap() in adapter.mjs).
Until then Detected() is false, so Agents lists no row for it. All the
while, the Plugins page said "Adds Kimi to Agents".
/api/plugins's agent now has missing, looks (where magpie looks, ~ for
home) and notice (the plugin's own notice) when the agent isn't found.
The row's line says "Kimi isn't in Agents: magpie doesn't find it in
~/.config/magpie-kimi", followed by the plugin's notice ("请先打开 Kimi…").
It wraps, in muted colour, since it is not a failure. In zh, zh-TW, ja
and de as well. A found agent's row is unchanged, as are fixtures with
no `missing`.
Run on mote (mote-run):
- go test ./internal/gui -run 'TestPluginAgent|TestCoreScriptBudget|I18n|Words': ok.
- node --test plugin-agent, i18n-keys, i18n-en-no-cjk: 30 pass, Chromium
and WebKit, en/zh/zh-TW/ja/de, at 980 and 420.
- go test ./internal/gui ./internal/agent -count=1 -timeout 45m:
internal/agent ok; internal/gui red only in TestMainWindowCorners
(macOS 27, #3949).
- node --test every *plugin*.test.cjs: 1126 of 1130 pass. The 4 reds are
plugin-move-unserved's "Try again takes the models unticked", red the
same on origin/main
|
||
|
|
10f1e97883 |
search: a GLM Coding Plan searches its own models with the plan's web search MCP
young02036 on Discord asked for the GLM Coding Plan's Web Search MCP in
magpie's web search. The plan's key is given for that server, so magpie
now asks it with the provider's own key, with nothing to set up: a
Streamable HTTP session at <host>/api/mcp/web_search_prime/mcp
(open.bigmodel.cn or api.z.ai, docs.bigmodel.cn/cn/coding-plan/mcp/
search-mcp-server and docs.z.ai/devpack/mcp/search-mcp-server), the key
as a Bearer, initialize, one tools/call of webSearchPrime with
{"search_query"}, then the session's DELETE.
- provider.ZhipuCodingSearch: only a provider or key on the plan's
/api/coding/paas/v4 (Zhipu's or Z.ai's host, or the zhipu/zai preset).
A pay-as-you-go key isn't served by the server and never asks it.
ZhipuSearches reads p.Keys itself, since KeysOn is counted per list and
searchesOwn runs on every request. ZhipuSearchKeys lists the plan's
keys, which are asked in turn.
- searchesOwn/ownSearch: the plan's own models search there first, as
with Kimi Code and WorkBuddy, and fall to magpie's searcher and the
search APIs when it fails. This happens only while Settings names no
searcher (glmSearches): a searcher the user named still searches for
every model, which is a value the user set.
- It is not offered as a searcher for other providers' models. A plan
with the Responses base (/api/v1) already searches natively there
(searchHosts, #660), and making it a no-model service would change the
searcher those users have now.
- The reply's text is read as a list of results, a list in a JSON
string, or a list under search_result/results/items/data. isError, or
words with no results, is an error with the key masked. The query is
masked as Settings > Privacy says (maskedQuery). Each ask is a request
log row (logOwnSearch).
- No GUI change: the setting has no switch, the same as WorkBuddy's.
- docs/subsystems/gateway-routing.md has a section on it, and the
searchesOwn lists there and in plugin-runtime.md name it.
Run (mote, at this tree):
- go test -count=1 ./internal/provider ./internal/settings
- go test -count=1 -run 'Search|GLM|Zhipu|Kimi|LoopGuard|Docs|Guard|WorkBuddy'
./internal/gateway: ok
- GOOS=linux and GOOS=windows go vet ./internal/gateway ./internal/provider:
ok
- gofmt -l: clean
The tests use a fake server only and never reach the network:
- TestGLMCodingPlanSearchesForItsModels: Claude Code's literal WebSearch
request to a plan's model. The fake gives an event-stream reply with
a progress notification before the result, and a double-stringified
result. Then a refusal, an unnamed versus a named searcher beside a
search API, and a pay-as-you-go key.
- TestReadGLMSearch: each reply shape, and prose.
- TestZhipuCodingSearchAddress: hosts, presets, a plan key beside a
pay-as-you-go one, a key that's off.
Broken by hand:
- With the old searchesOwn/ownSearch, TestGLMCodingPlanSearchesForItsModels
is red: the model had no search, 400 "no search tool".
- With glmSearches ignoring a named searcher, the test is red at the
named-searcher step: the MCP was asked and the named searcher wasn't.
Not tried:
- No real GLM Coding Plan key was available, so nothing was sent to the
real open.bigmodel.cn or api.z.ai server. The docs give neither the
tool's argument names nor its reply's shape. search_query and the
result fields come from Zhipu's Web Search API and a third-party npm
wrapper (web-search-zaimcp 0.1.2). If the real reply differs, a search
falls to magpie's other searcher or the search APIs and says why.
- The plan's MCP quota, and how a spent quota is worded.
- A GUI hint in Settings > Web search.
|
||
|
|
2260390a01 |
gateway: a Gemini thought signature goes back only to the provider that gave it
mimi001234 on Discord: Pi (openai-completions) on auto/gemini-4-argon, a group of google-vertex and google-aistudio-paid. Vertex AI served turns 1 to 14 and signed its calls; on turn 15 it answered 429, the group moved to AI Studio, and magpie replayed Vertex AI's signatures from gemini-signatures/. AI Studio answered every try with 400 "Corrupted thought signature." A signature is the issuing backend's, and only it takes one. - The provider that gave a signature is noted beside it, gemini-signatures/<key>.by (noteSigner, written through temp and rename), wherever a reply is read: decoderFor (every translated path: Chat, Anthropic and Responses clients, plugins, search, continuations) and sigTidy (a Chat relay, and a Gemini client's reply relayed as it came, now only read, in native mode). - Every request is fitted to its provider: ownSignatures in forwardTranslated, chatCallSignatures and geminiBodySignatures in passthrough. Another provider's signature goes as Google's documented skip_thought_signature_validator on a call, and not at all on text. A signature of no known provider (ids from before this change, a note that couldn't be written) goes as before. - A 400 "Invalid/Corrupted thought signature" (signatureRefused) is asked again once without signatures at any upstream Gemini's signatures reach (signaturesReach), relayed too, not only Vertex AI translated; it rests no account (restAfterMarked) and lets a group go on to its next member (shapeRefused). The signer is the provider id, not the account: two accounts of one provider share signatures as before. Run on mote (mote-run), the targeted run and vets at this change on origin/main |