01d4489a28bfbc05f5d1c13905fff307f42657d9
6066
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
01d4489a28 |
routing: the trace says what a classifier answered when no rule matched
95cf9d86d (ggbdpq, #4598) records a classifier's answer as it said it (classified.said), even when no intent came of it. The Routing page still showed every such turn as "said none". Geidorf's report was about that page: a turn routed with "no rule matched" and nothing saying why. When a decision model names a choice that no rule's intent came of (its own "none of these", or a kind under the sure-enough bar), the trace now says "answered “…”, which is no rule's intent". A chat model's 0 is none and still says so. The new words are in zh, zh-TW, ja and de. Run (mote, at this commit's tree, chromium and webkit): routing-classifier-said (new), routing-intent-fallback, routing-smart-intent and i18n-keys: 104 of 104 pass. Broken by hand: with the answer not read (answered = ""), the new file is red in 20 of 30: every "answered" case in both engines, five languages and two widths. The "0 still says none" cases stay green. Not tried: the real app with a real decision model's answer; the rest of the GUI suite (text only, no layout or API change). |
||
|
|
06faf449af |
gateway: a relayed Responses stream's sequence numbers keep counting up
257b9ad49 (ggbdpq, #4743) makes a relayed Responses reply's text calls into function_call items. It held the message's done events while it read the text and numbered the events it made on from the last number the upstream sent. The held done events then went out after the calls with their older numbers, and the completed event kept its number, below the calls' numbers. A client that orders a stream by sequence_number saw the stream go back. Everything the relay sends now goes through numbered(). An event whose number is at or below the last one sent goes out as one past it, and an event already past it keeps its number, so a stream nothing was made in is sent as it came. This also removes responsesToolNames, which nothing called: the wiring reads the names with chatToolNames. Run (mote, at bfa911da8 on origin/main |
||
|
|
50be0751ff |
library: a skill lock entry doesn't take over a folder of the user's own
51be9afb0 (ggbdpq, #4645) lets a skill the skills CLI installed be updated from where ~/.agents/.skill-lock.json says it came from. The lock is matched by name and by the folder's write time, and lockOrigin asked nothing about the skill's own source. A skill the user installed from a folder of their own, under a name the lock also has (grill-me from their own skills folder and a lock entry for mattpocock/skills), showed GitHub as its origin, and an update replaced it with the repository's copy. lockOrigin now follows lockRepo's grouping rule: it is the origin only of a skill with no source, or one whose folder is in ~/.agents/skills. Run (mote, at this commit's tree): go test -tags nogui ./internal/library ok, with TestSkillLockOriginUpdates, TestSkillLockOriginStale and the new TestSkillLockOriginLeavesUsersFolder. Broken by hand: without the guard, TestSkillLockOriginLeavesUsersFolder is red: "origin https://github.com/mattpocock/skills" and, after the update, the source is the GitHub tree, not the user's folder. Not tried: the skills CLI itself; the lock is written by hand in the test. |
||
|
|
50d9add249 |
netproxy: the global proxy's move is read from the shared settings
5a26a6af4 (ggbdpq, #4523) checks on every request whether the global proxy changed, through settings.Load(), which reads and parses settings.json each time. Every other per-request read of the settings goes through settings.Shared(), which parses again only when the file changed, so this one does too. Run (mote, at this commit's tree): go test -tags nogui ./internal/netproxy ok; TestGlobalSwitchDropsTheOldProxyConnections passes with Shared, so a switch written to settings.json is still seen on the next request. Broken by hand: none for this line itself (it changes cost, not behaviour); the patch's own test goes red with the move check off ("1 connections through A, 0 through B"). Not tried: a real proxy switch in the app. |
||
|
|
20f27f5148 |
fix(gateway): a relayed Responses or Gemini reply's text is read for the calls written into it (#4743)
What changed - textcalls_relay.go: responsesTextCalls reads a Responses reply relayed as it came — a Codex turn to a provider that speaks Responses itself. Text from where a call is written into it is held from output_text.delta on; the part's output_text.done, content_part.done and the message item's output_item.done wait with it; at response.completed the held calls become function_call items (added, arguments deltas, done) and the completed output says them too. A reply that came whole is read over its output's message items. - geminiTextCalls does the same over candidates[].content.parts: text parts held or trimmed as the chunks come, the held calls functionCall parts at the candidate's finishReason; a whole generateContent reply (Vertex AI) the same. A reply that made calls itself (native) goes as textCallTidy lets a Chat one: only tags left in its text go. - gateway.go: both wired into the relay funnel beside textCallTidy and anthropicTextCalls; geminiToolNames reads a Gemini request's functionDeclarations. Run - go test ./internal/gateway/ -run TestInvokeReported -count=1: the two new passthrough cases red before, green after; the package's full run green. |
||
|
|
c57ac416d3 |
fix(library): MCP writes to Claude Code's .claude.json take its save lock (#4747)
What changed: the Library gave Claude Code its MCP servers by reading ~/.claude.json (or $CLAUDE_CONFIG_DIR's) and writing it back with no lock held, while Claude Code saves the same file often (project state, tips, usage counters) under a lock of its own, <the file's real path>.lock: a save of its own between the Library's read and write was lost. The lock helpers move out of internal/provider into a small claudelock package (the mkdir lock Claude Code 2.1.316 takes, stale after 10s for this file), putClaudeLogin keeps its #4532 behavior through wrappers, and the Library's mcpFile.putEntry and mcpFile.del take <file>.lock around the .claude.json read-modify-write: they wait while Claude Code holds it, take over one left stale, and fail the server's write with nothing changed when it holds one past 20s. A WSL distro's copy is left as it was: the Claude Code there saves under a lock in the distro's own files. Run (mote, -tags nogui): - TestClaudeJSONMCPWaitsForClaudeCodesLock and TestClaudeJSONMCPTakesAStaleLock (internal/library): red on the old code (saved while Claude Code held the lock; a stale lock left behind), green now. - go test ./internal/library ./internal/provider -tags nogui: both packages green, the #4532 lock tests among them (TestClaudeSwitch… refresh/legacy/config, stale takeover, held past the wait). - race on the lock tests of both packages; go vet on the three touched packages for darwin, linux and windows; gofmt clean; go build -tags nogui for darwin, linux and windows. Generated-by: GLM-5.3-Flash (ZCode) |
||
|
|
a4c74a059e |
fix(gateway): Copilot's Gemini takes Codex's disjoint unions as oneOf, its Grok the custom tools as functions (#4374)
What changed: Codex Desktop through Copilot failed on every tool-bearing turn, on two wires at once (#4374). The Gemini models, served on chat completions alone, answered 400 "invalid request body" to a turn whose whole content was "hi" — the tool schemas' anyOf of object branches is what Copilot's Gemini rejects, as #3931's comparisons showed (the same request with the unions as oneOf came back 200). A union whose branches are provably disjoint now goes as oneOf, renamed in place: both branches require a string field whose enum or const values never meet, or one requires a field the other forbids through additionalProperties: false. A union that can't be proved stays an anyOf, Copilot's other models are untouched. Grok 4.7, served on /responses, answered 422 "422 Unprocessable Entity: Unprocessable Entity" six requests in a row: xAI behind Copilot takes no custom tool (#3392), and Copilot's answer in front of Grok says no more than the status (#378), so the refusal-learner that serves the vendors whose answer names them (#2656) has nothing to read. A Codex turn with a custom tool to a Grok model on Copilot is translated from the first ask, as a learned refusal does elsewhere. Run (go test -tags nogui ./internal/gateway): - TestCopilotGeminiTakesCodexUnionsAsOneOf: a fake Copilot refusing a tool schema with an anyOf, word for word as #4374's Gemini record, is answered; the union goes out as oneOf - TestCopilotGeminiKeepsUnprovenUnions: a union no one can prove stays an anyOf and the refusal still reaches the client - TestCopilotGrokTakesCustomToolsAsFunctions: a fake Copilot whose Grok refuses a custom tool with #2951's bare 422 is answered; apply_patch goes as a function, GPT on the same /responses keeps it as it came - RED on the parent commit: the first and third fail with the refusals named above; the second holds before and after — it guards that only what is provable is renamed Generated-by: GLM-5.3-Flash (ZCode) |
||
|
|
e02bc8c49b |
fix(agent/codex): keep the user's model_provider over a takeover or reset (#4347)
What changed: the beside wiring of a Codex takeover took the top-level model_provider down silently whenever a magpie model was picked beside the ChatGPT sign-in — a provider of the user's (CC Switch's custom, an older takeover's) went with it, and every Codex thread saved with that provider stopped resuming (modelProviderMismatch: Codex falls back to its built-in openai, the threads name the provider they were started on, #4347). The wiring now steps beside only from a provider magpie puts back itself (its own, none, CC Switch's mirror of OpenAI, as Join already has it); over a provider of the user's the takeover names magpie instead and keeps the user's spelling in the stash, for Unwire to put back, as any takeover does. A reset leaves the line where the user put it too: it takes magpie's keys out, not theirs. Run: go test -tags nogui -run 'TestCodexTakeoverKeepsUserProvider|TestCodexResetKeepsUserProvider' ./internal/agent/ (both fail on the parent, pass here); go test -tags nogui ./internal/agent/ passes. Generated-by: GLM-5.3-Flash (ZCode) |
||
|
|
0639fdd8f9 |
fix(gateway): a Grok key relay's compaction-blob refusal now strips the sealed reasoning and asks again (#4412)
What changed: foreignReasoning — the words that mark a vendor's refusal of sealed reasoning it cannot read, and put the conversation on the asked-again-without-it path (strip, retry, and the seal left out of later turns up front) — gains one alternative for xAI's "Could not decode the compaction blob. Ensure it is unmodified from the compact response." A key relay that proxies Grok (an opencode-go-style member, no account, any base URL) hands back exactly that for the reasoning item Codex writes with "content": null beside its encrypted_content, and until now the 400 went to the client after a single try: the #3392 shaping (xaiBody's null-content removal) never runs on such a relay because its host is not api.x.ai, and the refusal named no item and nothing of encrypted content, so foreignReasoning passed it by. The wording anchors on "could not decode/decrypt ... compaction blob", so a refusal at fault some other way still is not taken for one. Run: go test ./internal/gateway/ -run 'TestForeignSealGrokRelayCompactionBlob|TestForeignReasoningWords' -tags nogui (both fail on the parent, pass here; the ablation — reverting internal/gateway/affinity.go alone — turns both red again); go test ./internal/gateway/ -tags nogui; gofmt clean on both files; go vet -tags nogui on internal/gateway for darwin, linux and windows; go build -tags nogui for all three. Generated-by: GLM-5.3-Flash (ZCode) |
||
|
|
6803d7d51c |
fix(library): update skills the skills CLI installed from where its lock says (#4645)
What changed: A skill installed with the skills CLI (npx skills add) and brought in or handed over kept only a From label in library.json, so `magpie library skill update` said it "isn't from GitHub or a git repository" and the check for updates skipped it. The lock that named its repository for grouping now names it for updating too: lockOrigin (the lock entry's sourceType is github, the lock says when it wrote the folder, and the folder is the one it wrote, madeBy) is asked where CC Switch's record is, in updatable and prepare. Updated that way, the skill carries the source in library.json from then on, as one installed from GitHub does. A lock entry that says no time, or a folder the CLI didn't write, only groups, and stays as it is. Run: go test ./internal/library/ -run 'TestSkillLockOrigin' -count=1 -v go test ./internal/library/ -count=1 -tags nogui Generated-by: GLM-5.3-Flash (ZCode) |
||
|
|
f73b780422 |
gateway: a group's trace says what its classifier said, as it said it (#4598)
What changed: Classified keeps the classifier's answer as it said it
(said): the number a chat model answered with, 0 for none, or the choice
a decision model named, "none of these" included. readIntent gives the
number back, readJev keeps the choice, and the trace's rule.classified
carries the said on. An answer that named no rule's intent — a chat
classifier's 0, a decision model's own none-of-the-kinds option, a kind
named under the sure-enough bar — all read "said none" in the trace
before, so a group's fallback kind ("not any of the above") that never
matched looked the same as an answer no rule could take.
The matching itself is as it was: a classifier that answers the
fallback kind's number still routes by that rule, which a test now
holds (it passes unchanged); the said is only what the trace tells.
Run: go test -tags nogui ./internal/gateway (pass; without the change
TestClassifiedSaysTheClassifiersAnswer fails "the classifier said 0,
the trace says \"\"" and TestClassifiedSaysWhatJevChose fails "Jev
chose \"none of these\", the trace says \"\""); gofmt -l prints
nothing; go vet and GOOS=linux/windows go vet on the package pass;
go build on darwin, linux (-tags nogui) and windows pass.
Generated-by: GLM-5.3-Flash (ZCode)
|
||
|
|
49c99e18d1 |
provider: quota history draws measured windows set aside for routing (#4612)
chowyuan1314: the Cursor plugin marks its Weekly window aside when on-demand or free credit can pay, and Grok Bot always — using them up doesn't stop the account, so routing sets them behind — and both carry a real percentage. pointOf refused every window set aside that wasn't a pool's, so quota-history.json took no point for them and the card had no curve, while the same account's Codex windows drew theirs. The aside check predates the pools' (#651); the pools' own exception ( |
||
|
|
dd809ea60f |
gateway: an input item's id longer than the 64 an upstream that checks ids takes goes shorter, as its kind's prefix and the sha256 of the whole of it (#4525, #4527)
Codex carries every id an earlier turn came back with, and Copilot gives its items ids hundreds of characters long: 420 as isnine's sessions each showed (#4525), 444 as ghjkllasdf-fake's approval session and its guardian review did (#4527), all of the characters OpenAI takes an id of. plainItemIDs checked the characters only, so every later turn went to Copilot as it came and was turned away 400 "Invalid 'input[N].id': string too long. Expected a string with maximum length 64, but got a string with length 420 instead." — the conversation stuck, a tool call never answered, Codex's automatic approval review failing over it. An id longer than the 64 goes as its kind's prefix ("msg_", "rs_") and the sha256 of the whole of it, cut to fit: the same id to the same shorter one every turn, and no two ids land on one, where a plain cut could (ids of a vendor can begin alike). Copilot's own reasoning, overlong but of the right characters, keeps its place with its seal — an upstream that checks ids made that one, its encrypted_content is its to read, unlike another vendor's, which still goes as it did. A call's call_id was bound already (BoundCallID); one shorter than 65 goes as it came. What changed - gateway: itemIDCap (64) and boundItemID, and plainItemIDs bounds an input item's id at them, on every relay that checks ids as OpenAI does — Copilot's /responses among them (validatesItemIDs) - tests: an id checker that turns an overlong id away word for word as isnine got it; Codex's turn over a Copilot conversation of overlong ids asked twice, the same bound each turn; the 64/65 boundary, determinism, idempotence, two ids that begin alike going to two; the parity harness holding plainItemIDs to it beside what it was Generated-by: GLM-5.3-Flash (ZCode) |
||
|
|
cb35d2fa94 |
fix(netproxy): a switch of the global proxy drops the old proxy's idle connections (#4523)
What changed - Dispatch now remembers the proxy setting each request left under and, when it moves, closes the idle connections it kept (base's and every provider clone's), so the request after a switch dials through the proxy in force. A transport pools by target host, and its HTTP/2 connections by the authority alone, so until now a Test after the switch rode the old proxy's connection and left by the old exit while the new proxy was the one shown. Run - go test ./internal/netproxy/ -run TestGlobalSwitchDropsTheOldProxyConnections fails on the parent (1 connection through A, 0 through B after the switch), passes here; the package's full suite passes (-tags nogui). Generated-by: GLM-5.3-Flash (ZCode) |
||
|
|
a73df419d8 |
davsync: a GitHub blob POST on a slow but live line is no longer cut off at 30 s
What changed: the stall watchdog saw a request as one whose body may outlast the whole metadata limit only by method (GET, PUT), and gave every other request a flat 30 s (#657's rule held for WebDAV and S3, whose remaining requests move a few KB at most). GitHub's uploads ride a POST: each blob POST hauls up to 16 MiB of file as about 21 MB of base64, and a flat 30 s needs 550 KB/s to get one part through (#4576: on a slower line the sync failed on the same POST at every attempt, automatic, at start and manual, and never recovered -- the usage day file froze in the morning while the machine kept working). A request hauling a big body (64 KiB or more) now gets the same moving-aware budget as a PUT: the watchdog is put back each time bytes move, and after the body is all handed over the answer gets 60 s on top of as long as the write took. The metadata requests (the GitHub tree, commit and ref POSTs and PATCH, WebDAV PROPFIND/MKCOL/MOVE/DELETE -- kilobytes at most) keep their 30 s in all. Run: TestGitHubSlowBlobUploadIsNotCutShort (a 272 KB base64 body through a line at 320 KB/s, watchdogs shortened to 1 s/300 ms) fails on the old code with "the server didn't answer in 300ms (POST)", the shape of #4576's error, and passes now; TestGitHubSmallPostKeepsTheLimit pins the small POSTs to the old limit either way. go test -tags nogui ./internal/davsync, vet and builds for darwin, GOOS=linux and GOOS=windows pass. Not tried against a real slow line to GitHub. Generated-by: GLM-5.3-Flash (ZCode) |
||
|
|
3b7fe8e5f3 |
fix(cli): visible <agent> all clears the models taken out and the only-picked switch
What changed: `magpie visible <agent> all` took only the visibility narrowing out, leaving HiddenModels and PickedModels in place. An agent shown none of them — shown only the models picked for it with none picked, then switched to --show-new, which keeps what it is shown by taking the rest out — stayed none through `all`, the very recovery `magpie models` and the gateway's refusal to name a model point at; only deleting hiddenModels.<agent> from settings.json brought the models back (#4587, a DSH behind a Docker gateway saw an empty model list; #3432, closed as not planned, the same for an only-picked agent). `all` now takes the hidden models and the only-picked switch out together with the narrowing, and its usage line says so. Run: go test ./internal/cli/ -run 'TestVisibleAll' -tags nogui — two new tests fail before the change and pass after it. Generated-by: GLM-5.3-Flash (ZCode) |
||
|
|
611ce90d15 |
agent: OpenBot, magpie's models in its model picker (jiezhengj)
OpenBot (nightly-labs/openbot, openbot.run, v0.58.0) is a new row on the
Agents page. jiezhengj on Discord asked for it: today they type magpie's
address into OpenBot by hand and add each model one at a time.
OpenBot lists the user's own OpenAI-compatible endpoints from
openbot-custom-providers-v1.json in its userData folder:
~/Library/Application Support/OpenBot, %APPDATA%\OpenBot, or
~/.config/OpenBot. Connecting adds an entry with id "magpie" pointing at
the gateway's /v1 and holding the models picked for OpenBot, with
secret null. OpenBot seals an entry's key in safeStorage, which magpie
doesn't open, so the entry has no key. OpenBot hands it to OpenCode
keyless, and the gateway accepts it as a request from this computer.
What the entry keeps to:
- OpenBot's decoders drop the whole list over one bad entry. So the entry
has at most 64 models, only ids OpenBot accepts as magpie/<id>, and a
context window only inside 1,024 to 100,000,000.
- The user's other entries stay. The name, harness and secret they give
magpie's entry in OpenBot stay too.
- A sync with nothing to change doesn't write.
- A file whose version isn't the number 1, or whose providers isn't a
list, is one OpenBot refuses itself, so magpie leaves it alone.
- Disconnect takes out magpie's entry, and the file too when only the
version and an empty list are left.
OpenBot reads the file at start, so while it runs, a notice says to
restart it. The notice is in every language.
OpenBot is detected by its userData folder, OpenBot.app
(app.openbot.desktop), or OpenBot.exe under %LOCALAPPDATA%\Programs or
%ProgramFiles%. Docs updated: agent-wiring.md, reference.md, and both
READMEs.
Run at the pushed head, on mote:
- gofmt -l: clean.
- go vet -tags nogui for internal/agent and internal/gui, and for ./...
with GOOS=linux and GOOS=windows: ok.
- go test -tags nogui -count=1 -timeout 45m on internal/agent and every
package that imports it (., backup, cli, davsync, gui, library,
profile, stats, tui, uninstall, plugins/...): ok.
- GUI: agent-notice-lang, i18n-keys, header-relang and about-notices in
Chromium and WebKit: 58 of 58 pass.
After rebasing on
|
||
|
|
d20caffae1 |
release: notes written again on magpie-releases are copied here each hour
GrayRabbit on Discord (11-02): the "更新内容" dialog in Chinese listed v0.1.2634 on as raw English commit subjects. magpie-releases' release runs got "Insufficient Balance" from DeepSeek for both the changelog and its Chinese since v0.1.2634, so those releases went out with the commit list and no <!-- lang:zh --> part, as v0.1.1233 to 1242 did (#2122). magpie-releases b90a82b now writes such notes again each hour (notes.yml) once DeepSeek answers. - notes-mirror.yml, hourly at :53 and by hand: a release here still without the zh marker gets magpie-releases' notes of the same tag once those have it, with the mirror's footer. The app reads magpie-releases through usemagpie.ai, so this is the GitHub page. - release.yml's notice on #2260 names insufficient_balance_error as a DeepSeek top-up and says the notes are written again by themselves. v0.1.2634 to 2644's notes were written by hand from their commits, in English and Chinese, on both repos' releases. Run: actionlint 1.7.7 (mote) on notes-mirror.yml and release.yml: nothing but release.yml's existing unknown runner labels. No Go or GUI code changed. Not tried: notes-mirror.yml on GitHub's runners before this push. |
||
|
|
e87140242b |
settings: Check in now for one account, its switch left as it is (xiaowu_95660)
xiaowu_95660 (Discord #general) asked for a way to check in one account
right now where its daily check-in switch is, without turning the switch.
- provider: a checkiner can be held to one account (`only`), and
CheckInAccount(ctx, by, key) runs the same claim path once for it, for
WorkBuddy, Trae, MiniMax, Qoder and every plugin with a check-in.
CheckinOff is not read or written.
- gui: POST /api/usage/checkin-account {By, Key}. Settings' daily check-in
group (built-ins and plugins) gets a "Check in now" row under its
accounts. One account checks in at once; several open the app menu to
pick one. The line says done, already checked in, not eligible,
inactive, captcha, own-app or the failure. Only quotas reload, so
Settings isn't redrawn under the button.
- The row and press live in the lazy checkinnow.js (core budget unchanged,
three check-in comments cut). Once loaded it draws at once, so a redraw
by the switch doesn't shorten the page for a moment.
- Strings in zh, zh-TW, ja, de. provider-plugins.md says how it works.
Run at befdfa72b (on origin/main d89f03aa9;
|
||
|
|
9f1734645a |
appdir: exports go to the Downloads folder the system keeps, not home/Downloads
1Shin on Discord (#feedback, 11-02): an export (Settings' backup, a
request saved from the archive, a session as Markdown, the usage file)
joined $HOME/Downloads, which is wrong when Downloads was moved: Windows'
known folder (to another drive or OneDrive) or the XDG one on Linux
(~/下载 on a Chinese desktop).
appdir.UserFolder(kind) asks the system: SHGetKnownFolderPath
(FOLDERID_Downloads/Desktop/Documents, KF_FLAG_DONT_VERIFY) on Windows,
used when magpie's home is the profile Windows keeps it for (a home given
of its own, as a test's, keeps home\Downloads); $XDG_CONFIG_HOME/
user-dirs.dirs on Linux and the BSDs, read as xdg-user-dir does ("$HOME/x"
or "/x", quoted, backslash escapes, the last line wins); ~/Downloads on a
Mac. A failed lookup is home/kind, as before. gui's downloads() tries it,
then home/Downloads, then home. appdir's sharedFolder (a data folder
beside magpie there isn't portable data) adds the system's folders to
home's, and Cursor's AppImage is looked for in the system's Downloads too.
update's isDownloadFolder already asked Windows for its known folders and
is unchanged.
Run at this head (rebased on origin/main):
- mote (macOS): gofmt -l clean; go vet ./internal/appdir ./internal/gui
./internal/agent; GOOS=windows go vet of those and ./internal/update;
GOOS=linux go vet -tags nogui of the three; go test ./internal/appdir ok,
-run "Backup|Export|Archive" ./internal/gui ok, -run
"Cursor|Desktop|Sandbox" ./internal/agent ok.
- wsl-run (Ubuntu 24.04): appdir's UserFolder/SharedFolder/ResolveDownloads
tests and gui's TestExportGoesToTheSystemsDownloads,
TestBackupLibraryRoundTrip and the session exports pass. Against the real
xdg-user-dir in a sandbox HOME, "$HOME/下载", "/mnt/d/My Downloads" and
"$HOME/a \"b\"" read the same; "$HOME/" gives home without the trailing
slash.
- win-run (Windows 11): the appdir tests pass, and
TestKnownFolderIsExplorers checks the known folder against Explorer's
User Shell Folders value (read only). Windows expands that value's
%USERPROFILE% once a process, with the first call's environment, so the
check runs in a child of its own. The real profile gives
C:\Users\yeton\Downloads, Desktop and Documents.
Broken by hand: no user-dirs.dirs read, or no profile check on Windows:
TestUserFolderXDG, XDGLines, XDGConfigHome and TestUserFolderWindows go
red. gui's downloads() without the system's folder:
TestExportGoesToTheSystemsDownloads red in WSL (saved in ~/Downloads, want
~/下载).
Not tried: a Downloads really redirected on Windows (to D:\ or OneDrive).
Moving it means writing the user's own User Shell Folders on the test box,
so the redirect is a faked known folder in TestUserFolderWindows only. Not
run: the GUI suite (no GUI file changed) and a full go test ./....
|
||
|
|
4ffd5b96dc |
provider: the Cursor move asks for plugin 0.2.36 (plugins#550)
Cursor plugin 0.2.36 (magpie-community/plugins@24cd0b9, on npm, checked with npm view --prefer-online): a stateless Run whose step sent its calls and then only heartbeats, with no tool count, hands the calls that came to the caller 60 s after Cursor's last non-heartbeat frame instead of waiting 240 s to go quiet. Windsland52's fifth wire trace: a native stall pushed the retry onto the stateless path, where two calls and no count cost another 4 minutes. keepMovedCurrent updates moved users. Run at this head (mote): go test ./internal/provider -run "Mover|Moved|Migrat|Retir|Plugin|Min": ok. GOOS=linux and GOOS=windows go vet ./internal/provider: ok. gofmt -l: clean. The plugin's own run is in its commit (bun test packages/cursor: 380 pass). Not tried: a real Cursor account on the plugin. |
||
|
|
d89f03aa92 |
settings: trayNoNumber is a key magpie settings sets, and GET /api/quit is the window's own (#4793, #4794)
|
||
|
|
3f393a4fae |
redact: a user name is not masked where code has the same word as a name (Tomyu_2034 on X)
Tomyu_2034 on X: "magpie 里面的 masking 很容易把参数变量名当成 user name
给 mask 掉". No sample was given, so the class was measured: with "User
name in home folders" and "User and computer names" on, two finders took
names in code for the user's.
- Known values (known.go). A user name the home rule found once
(/Users/developer/…) is known from then on when it is 8 bytes or more,
and standsAlone's default bound is a letter or a digit only, so it was
masked wherever the word stood between anything else: def
run(developer, developer_dir), developer_mode = True, const developer
= 1, {"developer": true}, - developer_count := 0 in a diff, a tool
call's old_string. A user name such as developer or workspace1 is a
word code has too.
- The "User:" line rule (more.go). Its unquoted value was any
login-shaped word, so user = current_user, user: UserInfo, login =
loginName, username = target_name, a Go struct's "\tUser UserProfile"
and a TS interface's "user: CurrentUser" went as made-up names.
nameAlone now decides a known USERNAME: it is the user's name as a word
of its own in text (a path's part, name@host, --author=name, ls -l's
owner, uid=501(name), prose, a quoted string, chown name:staff), and
code's where it is joined to another part (_ $ a letter or digit beside
it, or a . or - with one past it), declared (const/let/var/def/func/
class/return/import…), assigned or called (name =, name(, name[,
name :=, x = name), a JSON key ("name":), or a parameter ((name, ,name)
name: str, name string), but for id's 501(name)). Nothing is exempted
by a key's name: a tool call's arguments are read by the same rule as
any text, and a quoted value in them is masked as before. The "User:"
rule leaves an unquoted value made of two or more words (split at _ .
and camel humps) one of which says it holds a user (identParts: user,
name, login, current, target, info, obj, id…); a quoted one, and a
login of words of its own (deploy_bot, john_doe), are masked still.
The boundary costs this: prose that puts the name alone in a list
"(developer, alice)" or before "=" now goes as written; such text reads
as code to this rule. A name under 8 bytes was never matched as known,
so for those only the "User:" half changes anything.
Tests (identname_test.go), with "developer" (a common word) and
"rinakato" (a handle), known from a working directory first:
- TestUserNameInCodeIsNoUserName: a Python and a JS file read, a JSON
file, Go code, a diff and an edit tool call's arguments go as written;
a home path, --author=, ls -l, uid=501(), prose, a quoted string, a
JSON value, chown and a bash tool call's ~name go as the made-up name.
- TestUserLineInCodeIsNoUserName: seven code lines unmasked; User:
deploy_bot, USER=rinak, user: "current_user", ssh config's User and
user = john_doe masked.
Broken by hand: with more.go and known.go as on main both tests are red
(12 and 7 failures); with standsAlone's USERNAME case returning true,
TestUserNameInCodeIsNoUserName alone is red.
Run at this head (on origin/main 89ffc58f5; nothing since touches
internal/redact or the doc), on mote:
- gofmt -l clean; go vet ./internal/redact ./internal/masking, and
GOOS=linux -tags nogui and GOOS=windows go vet ./internal/redact: clean.
- go test ./internal/redact ./internal/masking ./internal/otlp
./internal/pii ./internal/sessions ./internal/settings: ok.
- go test ./internal/gateway -run '(?i)mask|redact|privacy|personal|
standin|restore': ok.
- go test ./internal/gui: TestMainWindowCorners/macOS_26_SDK red, the
AppKit title bar on mote's macOS 27 (#3949, open); nothing else.
Not tried: the full internal/gateway package and go test ./... (the
gateway takes ~45 min; pushed at once per the owner's ship rule); the
local model's PERSON finds, which already leave snake_case and
lower-case words (modelTakes, programWords); the home rule's
"/home/<segment>" in a web route ('/home/dashboard'), which reads as a
home folder and is unchanged; a real request with the reporter's code.
|
||
|
|
a8e98e1abb |
gateway: a Claude Code run that exits mid-reply is a failure, not a 200 (#4822)
A Claude subscription run whose Claude Code exited after its reply began, with no message_stop nor a result (only the message_start, or part of the text), closed its segment as if the reply had ended. The client was answered 200 with nothing or the words so far, and the agent took it as a finished turn. - readOutput: at the end of Claude Code's output, a reply begun on the open segment (KStart, tracked in emit as unended until a KStop or KError) ends with a KError, 502, "Claude Code exited before it ended its reply" and the end of its stderr. -p and the interactive mode share this path. - relay, not streamed: any error is a status, words said before it too (was: a 200 with the partial reply), as a translated reply cut short is (errEndedShort). The try's usage is kept as before ( |
||
|
|
89ffc58f5b |
gui: a card's Refresh says the read's failure, and Claude Code's first-run screens say what to do (#4817, uiuing)
From uiuing's branch (1eeb8928b, 66818dbf6), adapted. A usage card's
Refresh showed nothing when the read came back as a card with an
error: only a thrown request reached status. quotaRefresh now says the
refreshed card's error through quotaError, for a single account and
for a provider whose cards were replaced (the one kept in quotas).
quotaError reads the helper's new "stays on its first-run screens" and
an older magpie's "shows its first-run notes" as "Finish Claude Code's
first-run setup, then refresh", in en, zh, zh-TW, ja and de. Comments in
quotaError and quotaRefresh were cut so the core scripts stay in their
budget (1,533,732 of 1,533,802; main was at 1,533,780), with no raise.
Run at the pushed head, on mote: node --test of claude-quota-onboarding,
quota-refresh-order, usage-card-refresh, usage-refresh,
usage-refresh-flight, account-refresh, editor-quota-quiet,
usage-no-reading, usage-remote-cards, tray-usages, glm-quota-error,
claude-usage-asked, allowance-open-read, api-key-usage,
key-balance-card, copilot-signed-out-account, signin-again, plugin-git
and i18n-keys (chromium and webkit, every language each file runs, 440px
where it sets it): 287 of 287.
go test -run 'Budget|I18n|Lang' ./internal/gui ok.
go test -run "Claude|TUI" ./internal/gateway ok. The full
./internal/gateway (-timeout 45m, before the rebase onto
|
||
|
|
af4ff747bc |
claudetui: Claude Code's first-run screens are gone through as a person would, not the run's end (#4817, steven_4422 on Discord)
With "runs as" Interactive, a Claude Code whose onboarding was never finished (no hasCompletedOnboarding in the state file: steven_4422's every request 502'd, uiuing's /usage read in #4817) stopped on the "Security notes" screen, and |
||
|
|
62ffc40169 |
gateway: a waiting request goes to an account back from rest (01huadalang)
01huadalang on Discord (11-01): three ZCode accounts, three requests at once each. The first two got a 405 and rested, so every request went to the third, and those over its three waited in its lane. Once the first two were back, the waiting ones stayed on the third, behind its long turns, until its requests were cut by hand. Same under Smart, In turn and Stays off. Cause: a request that queued in a lane (lanes.take) waited only for that lane's turn. Nothing looked again when another lane gave a slot back or a rest ended. With ZCode's maxAccounts 2, the third took a seat while the first two rested and was a reserve again once they were back, but the requests already waiting for it stayed. laneMate also gave way to a mate resting, because ready() checks only lane and RPM room. Change: - lanes.take takes a move func. While waiting (lanes.await), it looks again when any lane gives a slot back, when a rest is lifted (Unrest, UnrestAll signal lanes.freed), when the soonest rest among the others ends, and at least every 5s (laneRecheck). waitMate finds the first candidate after it in the planned order (then those probeOne left out for resting) of the same provider, or any member of a group, that has a free slot with no queue (tryTake), minute room, isn't resting, didn't give way, and isn't a reserve as keepAtOnce stands now. The request then leaves its queue (errMoved) and serve runs that candidate with the slot already taken for it. A fallback provider is never one. Strict stays leave no other candidate, so nothing changes there. - laneMate skips resting mates. - docs/subsystems/gateway-routing.md Limits row says so. Tests: - TestWaitingRequestGoesToAccountBackFromRest: 3 keys, cap 3, MaxAccounts 2, k1 and k2 resting (405), 9 requests. 3 go to k3, 6 wait for it, and none reach the resting two. Then the rests are lifted (Unrest) or run out (300ms), and the six go to k1 and k2 while k3's three are still out (9 at once). Run under Smart and Rotate, with Stays default and off. - TestWaitingRequestTakesSlotGivenBackElsewhere: 2 keys, cap 1. A third request waiting for one key goes to the other when that one's request ends, under default, order, rotate and usage routing. - TestFullMemberGivesWay updated. c, waiting for first, now goes to second once second's b ends. d (first's fallback is second) still waits for first. Run on mote (mote-run), rebased on |
||
|
|
6b3a6d42c0 |
agent: VS Code's Agents window (vscode_agent_host) counts as VS Code, its turns as Codex's
justruman on Discord (#general, 11-01): VS Code's Agents window showed
in Usage as a raw "vscode_agent_host" row, 23 calls, 7 failed, beside
the "VS Code" row.
Why: VS Code's agent host runs `codex app-server` with clientInfo
{name: "vscode_agent_host"} (microsoft/vscode main at 8fb6054,
src/vs/platform/agentHost/node/codex/codexAgent.ts CLIENT_INFO; it
bundles @openai/codex 0.163.0). Codex sends that name as its
originator and at the head of its User-Agent, and it reads the user's
~/.codex config, so with Codex connected to magpie its turns come here
under VS Code's name. No agent's UA list had it.
- Usage: vscode_agent_host is in VS Code's UA list
(vscodeAgentHostUA), so those calls are VS Code's. Records are named
again at read time (ReportedAs -> AgentOf), so calls already logged
under the raw name fold into VS Code too. Insiders' and VSCodium's
agent host send the same name and are counted as VS Code (Stable):
nothing in the request tells them apart.
- Routing: fromCodex also takes vscode_agent_host (hostedCodex), so
every Codex rule holds for those turns. The one that fails without
it: one of Codex's own models asked there, which no account in
magpie serves, was answered 404 "magpie knows no model" instead of
going on Codex's sign-in (codexOwnOffMagpie). Also now applied:
spawn_agent's model list, compaction told in the stream on a byte
cap/overflow, Codex's headers to a keyed Codex-only relay.
- A test asked as Codex keeps only Codex's own names (codexNamed) as
Codex's shape: the agent host's headers never become it.
- VS Code's Copilot-proxied names (vscode_codex, vscode_claude_code) go
to GitHub, not magpie, and are not matched.
- docs/subsystems/gateway-routing.md says so.
Run on mote at this change rebased on origin/main 16ce5ed23; the
one commit since,
|
||
|
|
e65bc84731 |
plugins: a git plugin updated past the commit the look found waits no more (#4802)
matrix0487 (Discord, #4802): github:faithleysath/magpie-oh-my-aihub, unpinned. The look at 14:38:55 wrote {version: fdaa691, latest: 3b411a5}; the repository moved on to ba898e7 twenty seconds later, and Update installed ba898e7. The dot, "Update all (1)" and the row's New commits stayed until the next hourly look, and every Update after said only "is up to date". Cause (checked against the source, as the reporter traced it): - PendingUpdates kept a git entry until the commit installed was the recorded latest (GitBehind is installed != head, not "behind"), so a commit newer than latest kept it forever. The npm branch compares versions in order and was right. - Upgrade, Update and add never touched plugin-updates.json; only the next CheckUpdates/CheckNow rewrote it. - The page kept /api/plugins/git's old head (3b411a5) in its heads map, and merge() put it over the plugins' own fresher head after the update, so the row's New commits and Update all stayed even with the file right. Changes: - waitsNoMore (shared by PendingUpdates and the new settleWaiting): a git entry also waits no more once the commit installed is not the one the look saw installed (Version). - settleWaiting rewrites plugin-updates.json without what waits no more, after add (every install, npm Upgrade, Update's pinned path), a git Upgrade, Update (Update all) and InstallMissing. Checked time is kept. - reinstall's #2954 "left it at X" error now needs the commit to have stayed: a moved install that can't ask the repository again (rate limit, offline) isn't reported as stuck on the look's older head. - plugins.js: an action on a plugin (Update all: on every one) drops the page's cached head for it, so the plugins' own head is drawn; a git Update whose commit moved says "{name} updated to {commit}" (zh, zh-TW, ja, de), and the Up to date chip's tooltip prefers the row's head over the check's. Siblings: npm (version order already right; now also rewritten on file), a commit pin (dropped once at the pin: test case), Update all (same flow as Upgrade: test case), the toast (above). CheckNow/CheckUpdates rewrite the file as before. Tests (reporter's literal fdaa691 / 3b411a5 / ba898e7): - TestGitWaitingGoneOnceUpdatedPastTheLook: installed ba898e7, 3b411a5, another commit, still fdaa691 (waits), and a pinned spec. - TestSettleWaitingRewritesTheRecord: git + npm entries gone from the file. - TestGitUpdatePastTheLookWaitsNoMore: fake bun + fake GitHub; look, push, then Upgrade / Update / Upgrade with GitHub down after; nothing waits on file or in PendingUpdates, and the update isn't an error. - plugin-git.test.cjs: the repository moves on after Check for updates; Update installs ba898e7, no New commits, no Update all, toast names it. Run at the pushed head (rebased on |
||
|
|
16ce5ed232 |
usage: an account whose longer window is used up adds no headroom to the all-accounts sum (#4791)
hayden4608 (Discord) and handong66 (#4791) have four Codex accounts. Three show 5 hours 100% left with 7 days 0% left, and one shows 5 hours 0% left with 7 days 22% left. The All accounts strip read "5 hours 75% left", but none of those three can spend its 5 hours until its week starts again. The right figure is 0%. mergeQuotas (quotaall.js) is the one place that sums windows across accounts. It feeds the Usage page's strip, the tray panel's strip and the Routing groups' line. The native menu-bar tray, the TUI, the CLI and /v1/magpie/quotas show one account at a time and are unchanged. The GUI's JSON doesn't carry Aside, Model or the matches, so the call is made in Go. provider.WithHeldWindows marks a window heldBy another window of the same account when that other window: - stops the account for every model, by routing's rule: not aside, no model, no matches, used >= 100, reset not passed, and not Codex credits that go on; and - starts again after this one (by reset times, else by span). So 7 days used up holds 5 hours, but 5 hours used up doesn't hold a week with 22% left. /api/usage/quotas and its refresh apply it. mergeQuotas counts a held share window as 100 used and a held counted one as its limit, and the strip's tooltip says how many were counted that way (en/zh/zh-TW/ja/de). The account cards still show the vendor's own figure. Run on mote (macOS) at this head's parent tree: - go vet for darwin, linux (nogui) and windows: ok; gofmt -l: none. - go test -count=1 ./internal/provider ./internal/gui, before the quota_span leftOut line and an i18n comment fix. The provider package's only red was TestQuotaSpanCarriesEveryWindowField, which wanted heldBy named, and it is now named. internal/gui's only red was TestMainWindowCorners/macOS_26_SDK, which is #3949. - GUI, chromium and webkit, every language, 440px and 360px: quota-*, usage-* (all-accounts, merge, accounts, fold, refresh and more), panel-usage/quota/switch-accounts/balance-order, routing-quota-left, routing-group, tray-usage, i18n-keys, gui-de/ja/zh-tw, old-webkit: 704 of 707. The reds were i18n-keys (a quoted "All accounts" in window_held.go's comment, fixed here) and usage-fold's "17 subscriptions and 29 accounts" in both engines, which is #4790 and is red at origin/main too (see below). At the pushed head, rebased on |
||
|
|
99d9016fd9 |
provider: Devin's mover min is 0.1.32, so a system notice mid-conversation keeps its place (plugins #599)
devin 0.1.32 (plugins 17525a7, leosocy) sends a role:"system" notice that comes partway through a conversation as a user prompt, in its place and with its cache mark. Before, the notice was lost. A notice that arrives while tool calls are still waiting for results goes after those results. keepMovedCurrent now updates every moved Devin user to it. npm has 0.1.32: npm view --prefer-online @magpie-community/opencode-devin-auth version. Run on mote at this tree: gofmt clean; go vet ./internal/provider on darwin, linux (nogui) and windows; go test -count=1 ./internal/provider ok. In the plugins repo, at 647039a merged with main: bun test packages/devin 182 pass, and 4 of the new tests fail on the old index.mjs. Not tried: a real Devin account. |
||
|
|
eb3b9376ea |
plugin load: a model listed by another id gets its plugin's load (axelburks)
axelburks on Discord: a plugin reports a model's load through
input.magpie.load by its own model id. A model the user lists in magpie
under another id (Listed as, settings' ModelIDs) showed no load on the
Providers page, and with Busy models last on it was never judged busy;
models whose id wasn't changed worked. The reporter's reading was right:
plugin.ModelLoad keeps the load by the plugin's id and both callers asked
it by the listed one.
Both call sites of plugin.ModelLoad (grep: there are only two) now map the
listed id back through Provider.OwnModelID first:
- internal/gui/providers.go providerInfoWith (models[].load), which
already computed OwnModelID for models[].vendor; it is now read once
and used for both.
- internal/gateway/fallback.go busyOf (restLast's busy ordering and the
trace's busy).
A listed id whose own id is a model@size (grok -> grok-4.7@256k) still
falls back to the model's load inside ModelLoad. The provider-plugins
subsystem page says the lookup is by the plugin's own id.
Tests:
- internal/gui TestModelLoadListedAsAnotherID: a plugin provider with
fast -> big and grok -> grok-4.7@256k listed, loads noted for big,
grok-4.7 and small; models[].load must be 87.4 / 60 / 12 for fast /
grok / small and absent for quiet.
- internal/gateway TestBusyModelListedAsAnotherID: busyOf at 80 judges
fast, grok and big busy, and an unreported model not.
Run at the pushed head on mote (mote-run):
- at base
|
||
|
|
d2a83de612 |
gateway: a try billed before it failed and handed on keeps its usage row
A Claude subscription run that fails after Anthropic's message_start
(an overload, a dropped connection, a cut stream Claude Code gave up on)
is a 502 so another account can take over. That account is a new Claude
Code told the whole conversation, and writes it to its own cache again.
The first try's usage was dropped twice over: relay threw away the reply
start's usage on that path, and serve wrote a usage row only for the
request's last try (and for refusals). The Usage page counted the second
account's tokens alone, with "2 tries" on the row as the only sign that
the conversation went out twice (hhxk233 and Kayrainforest on X).
- relay keeps the usage of the head's KStart/KUsage events on a failure
before content (streamed), and the collector's usage (not streamed).
- serve writes a handed_on row for any failed try that billed something
and handed the request on, to another account or member or the same
one again. The row is written when the next try begins. The refusal
and turned-away paths keep their own row, and a failure that billed
nothing still has none. Totals count a handed_on row's tokens, not a
request, as for refusals. The Usage page already shows such a row as
"<status> · handed on" with its tooltip in every language.
No same-account double send was found: a fake Claude Code breaking its
stream in nine ways (error before or after message_start, a 529 or 500
result, a cut then an error or an exit, text then an error or an exit),
streamed and not, starts one run per account at most. A failure before
content goes on to the spare once. A failure after text ends the
request with no other run.
Run, at this tree on origin/main
|
||
|
|
de7953e3b8 |
browser: browser_evaluate calls an async()=> function and awaits it
The check that tells a function from an expression wanted a space after
async, so `async()=>{…}` was evaluated as an expression: the function
itself came back, serialized as {}, and its body never ran. And a
parameter list could hold parentheses, so `(async()=>{…})()` counted as
a function and its promise was called ("is not a function"). async may
now touch its parameters, and a parameter list holds no parentheses.
The extension goes to 0.1.2.
Found driving X through magpie-browser from Claude Code.
Run on mote (Chrome for Testing 1234):
- MAGPIE_BROWSER_CHROME=… go test ./internal/gateway -run
'TestBrowser.*InARealBrowser' -count=1: ok (46.5s). Five new evaluate
cases: async()=>, async () =>, async function, an async IIFE and
Promise.resolve, each answering "awaited".
- Broken by hand: with origin/main's background.js the test is red at
the first case (async()=>… doesn't say "awaited").
- go test ./internal/browserext: ok. gofmt -l: clean.
Not run: the full suite; not tried in Edge or Firefox.
|
||
|
|
ccd746e039 |
claude: /usage is read in the interactive mode, typed in it, not through -p
With the interactive mode on, the plan's allowance (the Claude account's
usage card) was still read by `claude -p /usage`, the one -p run left
beside a request. Claude Code 2.1.316's -p /usage also tells only the
session's cost, no window. Now claudeUsage, with claudeTUIOn, runs the
interactive mode's helper (claudeUsageTUI) and gives it a line
{"type":"command","command":"/usage"}. The helper types /usage, waits for
the panel to settle (a "N% used" and a second without change, or three
seconds of anything else, 20s at most), closes it with Esc, and tells
what was drawn as -p's lines say it (usageText: "Current session: 0% used
· resets 5am (Asia/Shanghai)"), so parseClaudeUsage reads it unchanged.
No model is asked. The helper types no other command. The machine
reasons a request is refused for (no shim, OS, missing, off) refuse the
read the same way. Turned off, -p runs it as before.
Run (mote, at this tree on origin/main
|
||
|
|
a25d3d0815 |
claude: a JSON schema is answered in the interactive mode, through an answer tool
With the interactive mode on, a request with a JSON schema was refused
with a 400 since v0.1.2592: interactive Claude Code takes --json-schema and does nothing
with it, its StructuredOutput tool being -p's alone. It now runs in the
interactive mode like any other request.
- serveClaudeSubscription compiles the schema (santhosh-tekuri/jsonschema
v6.0.3, draft-07 unless it says otherwise, as -p reads one; a $ref
outside the schema is refused, never fetched) and adds an answer tool,
StructuredOutput or a numbered name apart from the client's tools, with
the schema as its input schema, through the bridge's MCP server. A
schema that can't be compiled is a 400 before any run.
- mcpCall checks each call against the schema: one that doesn't fit is
told why (isError) to be made again, as -p's is; one that fits is kept.
- At the turn's result the kept input is the reply's structured output.
A turn that ended with no call is told once to call the tool, and
fails "no answer fitting the schema" if it still doesn't. Neither the
call nor the words around it reach the client.
- claudePrint no longer lists the schema. The two refusal tests
(TestClaudeTUIOnRefusesPrint, TestClaudeTUIRefusalIsNoAccountsFault)
now use the case that is still refused before any run: an image by
its URL that can't be downloaded (127.0.0.1, which magpie never
fetches).
- The provider editor's card no longer says -p takes "a JSON schema"
the interactive mode can't (en, zh-CN, zh-TW, ja, de).
- docs/subsystems/claude-subscription-bridge.md: the refusal list, and
how a schema is answered.
Run:
- A real run, haiku, the test account in a sandbox HOME, real Claude
Code 2.1.316 through the helper with --json-schema and a stdio MCP
server named magpie serving the answer tool and its description: the
result's structured_output was null (the premise), and the model
called mcp__magpie__StructuredOutput at once with
{"color":"Sky blue","hex":"#87CEEB"}, which fits the schema's
pattern. 7.2s, one turn. Not run: the whole gateway path with a real
account (the unit tests drive it with Claude Code's real transcript
rows).
- mote, at this tree (base
|
||
|
|
14e3513780 |
claude: Claude Code in WSL runs interactively when Windows can't read its transcripts
With the interactive mode on, Claude Code in WSL was refused with a 502
in two cases: the distro user's own folder unreadable from Windows
(\\wsl$ needs the 9P redirector, which a session over ssh hasn't;
"wslread") and a distro whose home the probe didn't find ("wsl-home").
Both now run interactively: the helper reads the transcript inside the
distro.
- claudetui/wslread.go: before Claude Code starts, a shell run through
wsl.exe notes how much of $HOME/.claude/projects/*/<sid>.jsonl is
there (a resumed session's earlier turns), says "ready", then tail -F's
the rest; the helper copies it to a file of its own and tails that as
any transcript. When Claude Code ends it waits for the copy to stop
growing (settle), then closes the shell's stdin, which ends it.
- claudetui.WSL gets Distro (Projects omitempty); the gateway's tuiWSL
sets it when Windows can't read the folder or the home is unknown.
- the wslread and wsl-home refusals are gone (claudeTUI, claudeWhy,
claudeNotTUIWhy); the GUI's "wsl-home" reason and its 4 strings too.
- docs/subsystems/claude-subscription-bridge.md says how it is read.
Run, at origin/main
|
||
|
|
2739626c38 |
provider: the ZCode mover's min is 0.1.41, nothing to claim is asked again in half an hour (plugins#600)
zcode 0.1.41 (magpie-community/plugins#600) gives a daily claim that
found no gift plan an `until` half an hour out, so magpie asks again
through the day and a plan ZCode drops into its feed later (the weekend
plan from 19:00 Beijing) is still claimed. keepMovedCurrent now updates
every moved user's plugin to it.
npm view @magpie-community/opencode-zcode-auth version --prefer-online
--registry https://registry.npmjs.org: 0.1.41, checked when this landed.
Run on mote (mote-run) at base
|
||
|
|
ff65ebd142 |
provider: Zed's plugin is 0.1.14 at least: a Gemini model's efforts are keyed lowercase and its thinking level goes to Zed uppercase (plugins#215)
Zed's /models now lists a Gemini model's supported_effort_levels
uppercase (LOW/MEDIUM/HIGH), so the plugin keyed its variants LOW and
magpie's pi profile, which maps efforts by key, marked every thinking
level unsupported for zed/gemini-* (Yezike-yyy on plugins#215). And a
thinking level reached Zed lowercase, which its serde enum refuses:
400 "unknown variant `low`, expected one of `MINIMAL`, `LOW`,
`MEDIUM`, `HIGH`" (iron-water, plugins#215). zed 0.1.14
(magpie-community/plugins 3618bf9, from ump45nose's #587) keys the
variants lowercase whatever case /models uses and uppercases the level
only on the wire. The mover's min is raised to it, so keepMovedCurrent
updates every moved user.
npm view @magpie-community/opencode-zed-auth version --prefer-online:
0.1.14 at landing.
Run on mote at
|
||
|
|
59fdab0af7 |
gateway: a caller's folder the user hasn't trusted runs in magpie's, not a 502 (lwjef on X)
lwjef (X, 2116867007799030000): a cwd Claude Code hasn't trusted hangs the interactive-mode bridge (paseo chat). Cause: in the user's own account the helper leaves the trust question to the user (no MAGPIE_CLAUDE_TUI_TRUST) and ends at once saying so. Up to 11-01 that run became -p; since |
||
|
|
bee3ea6753 |
claudetui: the first message waits for Claude Code to list magpie's tools (MinhuWang on X)
MinhuWang (X, 2116836405548916907): in the interactive mode the first
message can go before MCP has loaded, and then has none of pi's tools.
Cause: the helper's ready() took the drawn "❯ " prompt as ready. Claude
Code connects its MCP servers beside the prompt, so a message pasted at
once was answered with no mcp__magpie__ tools. Reproduced with the real
Claude Code 2.1.309 (sandbox HOME, a copy of the owner's account): an MCP
server held 8s before answering initialize got "NOTOOL" for "what is the
secret word, use your tool".
Fix: startRun gives claude-mcp-helper a third argument, a `listed` file in
the run's temp folder, which RunMCP writes after it has answered
tools/list. The helper finds that path in the run's --mcp-config
(mcpListed) and ready() waits for it as well as the prompt, inside the
same ReadyWait (45s); past it the run ends saying the tools weren't
listed. Runs without that server (warm-up, model test) don't wait.
Run (mote, at this tree):
- go test ./internal/claudetui ./internal/claudebridge: ok
- go test -run 'Claude|MCP|Bridge' ./internal/gateway: ok
- real Claude Code 2.1.309 here, a sandbox HOME with a copy of the
account's credentials, the new helper and the real claude-mcp-helper
behind an 8s sleep: initialize answered at 12.7s, the first turn called
mcp__magpie__pi_secret and answered "The secret word is PELICAN".
Without the sleep: answered at 2.1s, same answer. 2.1.309 sends
server/discover before initialize; the helper's method-not-found answer
is taken and initialize follows.
Broken by hand: toolsListed returning true made
TestShimFirstMessageWaitsForTools red ("echo: hello (without magpie's
tools)"); RunMCP not writing the file made TestToolsListedFileWritten
red.
Not tried: Claude Code in WSL (the path is the gateway's Windows temp
path, handed to magpie.exe as the callback path is); a Claude Code that
lists tools only on its first request (2.1.309 lists them at start),
which would now wait 45s and fail saying so instead of answering
without tools; the full gateway suite (run after the next commits).
|
||
|
|
79f83798fd |
kiro: the mover installs 0.1.25, which shows bonus credits on the Usage card (plugins#602)
kiro 0.1.25 is on registry.npmjs.org (npm view --registry https://registry.npmjs.org: 0.1.25, shasum 00882472feb467e0ecb59da3c364bda423c5f12f). It is plugins#602 (GiantGKL), squash-merged as 6053811 in magpie-community/plugins: bonus credits (a first upgrade's 500 trial credits, a promotion's) show as aside windows of their own, with when they lapse, and a month used up while a bonus has credits left is shown only too, since Kiro spends the plan's credits first. keepMovedCurrent brings every moved Kiro user to it. Run on mote: - at |
||
|
|
8569f39f6c |
agent: Claude Code's /model hides its own lineup while magpie's list is narrowed
yyhhyyyyyy on Discord picked only a routing group's models for Claude Code
on the Agents page, and Claude Code's /model still listed a model they had
not picked. Real Claude Code 2.1.316 in a sandbox HOME, with the settings
magpie writes, lists: Default, the group (as Custom Opus), Claude Code's
built-in "Fable 5.1" row, then the group as Sonnet and Haiku, then
magpie's modelPicker rows. The Fable row is Claude Code's own lineup.
magpie leaves ANTHROPIC_DEFAULT_FABLE_MODEL unset for a main model that
isn't a Fable (#2090), so Claude Code shows its own Fable there. The
gateway's /v1/models already follows the picks (CatalogFor), and Claude
Code's gateway discovery is off unless
CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY is set. Neither of those is
where the row comes from.
Claude Code's documented modelPicker.replaceBuiltInOptions hides the
lineup and leaves Default and magpie's rows. In the same sandbox, the
same settings with the flag set list exactly those rows. magpie already
set the flag while "Show Claude Code's own models" is off (#4548). It now
also sets it while Claude Code's list leaves out some of magpie's
catalog: only the picked models, some taken out one by one, or a
visibility of families (claudeNarrowed, CatalogFor's hidden list). A
change to the picks already rewrites settings.json through
catalog.Touched and Sync.
The user's own values:
- A user's ANTHROPIC_CUSTOM_MODEL_OPTION, in the settings env or the
shell, keeps the lineup. The flag would hide that row too.
- availableModels was not used. It also hid the Fable row in the
sandbox, but it is the user's key, it blocks --model, and it is meant
for enforcement.
Run at this head (rebased on origin/main
|
||
|
|
2f4c088dce |
usage: Warm up on a Codex or Claude account's card whose 5 hours haven't started
01huadalang on Discord looked for a way to start one account's 5-hour
countdown on the Usage page, not in Settings. A Codex or Claude account
card whose 5-hour window isn't running now has a Warm up (预热) button on
its account line. It sends the request Settings › Warm-up's Warm up now
sends (POST /api/warm-now {agent, user}), to that account alone: for a
ChatGPT account the scheduled warm-up's one "hi" with the account's own
sign-in, on its cheapest model at low effort (warmModel); for a Claude
account Claude Code's own run on haiku (WarmClaudeVia), so magpie sends
nothing that imitates Claude Code. No new server code.
When it shows: the account is one magpie is signed in to (codexUsers /
claudeUsers), its read has no error, and its 5-hour window is idle as the
scheduled warm-up tells it (idle in codex_warmup.go): nothing used and the
reset a whole window away (within warmSlack), or the reset gone by. A
Claude account never used has no window read and shows it too, as
claudeWindowsExpected fills in; a Codex account with no 5-hour window
doesn't. While the request is out the button is disabled (busy), so a
second press sends nothing; once it went, the account's button stays away
for warmSlack (10 minutes), the time a just-started window still reads as
idle, and the quotas are read again (the server marks the account stale).
Refused, the vendor's reason goes in the status line and the button
comes back. Words in en, zh, zh-TW, ja, de (the tooltip is new; the
button and status lines reuse Warm up now's).
Run (at the head before the last rebase onto
|
||
|
|
09d5dfb87b |
gateway: aliased and magpieAliasAsked read one alias parser (#4667)
magpieAliasAsked copied aliased's four prefixes; a fifth form added to one would leave the other behind. Both now read aliasDigits. Run: targeted alias/member/desktop/science tests, gofmt, vet x3 (mote). |
||
|
|
3d64d6c52f |
gateway: a reply to one of magpie's own aliases keeps the vendor's model name (#4667)
leizh007: with Claude Code Desktop served through magpie, ccusage counted the model as "magpie-2213244526.anthropic…" from the 11-01 release on; before it said the subscription's own "opus-5-5". The asked-name rule ( |
||
|
|
567b648bd8 |
gateway: test #4445 on the reporter's route, Codex's ChatGPT backend path
The reporter's turn came to magpie's /backend-api/codex/responses, with
the Model Map plugin naming remote-magpie/codex/gpt-6.1-sol; the patch's
test asked on /v1/responses only. TestRemoteMagpieCodexModelKeepsLiteOnCodexPath
asks the same Lite request on CodexPath.
Run (mote, at this tree, -tags nogui):
- go test -run TestRemoteMagpie ./internal/gateway: ok
- with additional_tools.go and gateway.go put back as on origin/main, the
new test is red with the report's 400 ("Office:
X-OpenAI-Internal-Codex-Responses-Lite requires `reasoning.context` to
be `all_turns`."), as is the patch's own /v1 test.
|
||
|
|
1ff928139d |
gateway: a remote magpie's codex model gets Codex's Responses Lite as it was sent (#4445)
What changed: a Codex Desktop turn on one of its own Lite models (gpt-6.1-sol) routed through Model Map to a Remote Magpie provider answered 400 "Remote magpie: Codex: X-OpenAI-Internal-Codex-Responses-Lite requires `reasoning.context` to be `all_turns`". liteKept treats a Remote Magpie like any plain Responses upstream, so passthrough ran fromLite (the additional_tools item lifted into tools, reasoning.context taken off) and forwardOnce dropped the Lite header. The remote serves codex/<model> through its ChatGPT account, which passes on what it got, and the ChatGPT backend refuses a request for one of its Lite models without reasoning context "all_turns" (#534): the request arrived stripped of exactly what that model demands. Had it gone as Codex sent it, the remote's account path keeps the Lite shape (liteKept true there) and its answer is 200, as the reporter's codex=as-sent workaround showed. liteKept now also keeps the shape, with the model it is asked for: a Remote Magpie's codex model, named codex/<model> — the ChatGPT account's namespace in every magpie's catalog, so the remote lists one only when that account is there to serve it. Its other models still get what Codex sends a model that isn't Lite (#350), header and reasoning context included in the lift (#350, TangForX). Run: go test -tags nogui -run 'TestRemoteMagpieCodexModelKeepsLite| TestRemoteMagpieOtherModelLeavesLite' ./internal/gateway/ — the first failed with the 400 above before the change and passes after; the second keeps the old behavior. go test -tags nogui ./internal/gateway/ passes. Fixes #4445 Generated-by: GLM-5.3-Flash (ZCode) |
||
|
|
6de04a26e2 |
gateway: a Codex memory call on its own bare name follows the session when a provider serves a model under that name too (#4765)
raphael-y7: with magpie as Codex's model provider, the conversation on orbis/gpt-6.1-sol, Codex's memory consolidation — its own background request on its own default consolidation model, asked by its bare name gpt-5.6-terra — went to workbuddy-ai, the only provider of magpie's with a model under that name, and the account it landed on refused it: 400 "model [gpt-5.6-terra] is not allowed for user type [personal_free_user]", three tries, 8.5s, and the memory was never written. The bare name resolved, so codexMemoryStandIn (#742) left the call where it stood; a model of Codex's own asked by its bare name is not a pick of whichever provider has one under that name. Now a memory call whose bare name resolves still follows the conversation's model, as it does on the ChatGPT backend's path (codexFollowTo), when Codex's config names no model for its memories: codexMemoryStandIn asks codexMemorySession first and only falls through to the name's own resolution when there is none to follow. What keeps going as the name resolves: any other call, a model Codex's config names (the user's own pick, a full id or a bare name), a config magpie can't read, and a conversation magpie has no model of (on Codex's own, or nothing answered yet). What this doesn't change: the three tries on a capability refusal, and the model catalog's exposure of a model an account can't serve — the reporter's other two suggestions, both a bigger cut; the auto-review's codex-auto-review and the app's title, description and summary calls, whose as-Codex-sent default is deliberate (codexTitlesTo, codexSideTo; shruru counts a provider serving a luna-named model picking titles up as a feature, #4590). TestCodexMemoryOnACollidingBareNameFollowsTheSession: a provider with a model under gpt-5.6-terra, the conversation on another provider's — the memory call followed the conversation and the named provider got nothing (red before: it got the memory); the config's pick and a plain turn on the name still go to it. Run (darwin arm64, -tags nogui): - go test -tags nogui -run 'TestCodexMemoryOnACollidingBareNameFollowsTheSession|TestCodexMemoryCallsGoWhereItsTurnsGo|TestCodexMemoryStandInFollowsTheSwitch|TestCodexMemoriesFollowTheSession|TestCodexSideCallsKeepTheConfigsModel|TestCodexSideCallsBeforeTheFirstTurnFollowTheSwitch|TestCodexOwnModelOnMagpieThreadGoesOnSignIn' ./internal/gateway: ok (the new test was red before the fix, with the report's routing) Generated-by: GLM-5.3-Flash (ZCode) |
||
|
|
206efc90c8 |
gateway: a Codex side call with no setting still goes on Codex's sign-in (#4590 review)
e99e75dab took every side call on one of Codex's own models (title, description, summary, prediction) off Codex's ChatGPT sign-in. With no setting naming a model, codexTitlesTo and its siblings hand back the bare model Codex asked for, which magpie serves nothing for: a user signed in to ChatGPT whose titles worked through the sign-in got "magpie knows no model \"gpt-6.1-sol\"" 404 for every title, description, summary and prediction. A thread's summary has no setting at all, so it always went that way. Now only a side call whose setting names where it goes (CodexTitles, CodexDescriptions, CodexPredictions: a model or "off") stays off the sign-in (codexSideSet); without one it goes on the sign-in as before. Run (mote, at this tree, -tags nogui): - TestCodexSideCallOnOwnModelUnsetGoesOnSignIn (new: signed in, no setting, each of the four kinds): red on e99e75dab, the 404 above for all four; green now. - go test -run 'TestCodexSideCallOnOwnModel|TestCodexOwnModelOnMagpieThread| TestCodexTitlesSetting|TestCodexTitleOnMagpieProvider| TestCodexDescriptionsSetting|TestCodexDescriptionFallbackOnMagpie| TestCodexPrediction|TestCodexSummar' ./internal/gateway: ok - broken by hand: codexSideSet always false turns gua's TestCodexSideCallOnOwnModelNotPutOnSignIn red (the reporter's 404); always true turns the new test red. |