ccbbcbffcba0507ee3536bf63e5fb56a12e7d5a9
843
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
ccbbcbffcb |
gui: a restart to update leaves the Mac's menu bar icon for the next magpie (Mitsuha, audie)
From v0.1.1354 a restart to update hands the gateway over, and the old
magpie hides its own menu bar item with Wails' Hide, which is
[statusItem setVisible:NO]. AppKit keeps that in the app's defaults by
the item's autosave name ("NSStatusItem VisibleCC Item-0" = 0 on macOS
26), and the next item made under that name starts hidden. So after the
update the icon was gone, and quitting and reopening didn't bring it
back (Mitsuha on v0.1.1364; audie on two Macs, macOS 27.0.1).
Evidence: a 30-line Cocoa probe made a status item, setVisible:NO, and
every later launch of the same program started with visible=0 and the
key = 0; removeStatusItem kept nothing; removing the key brought it back
on the next launch. This machine's com.yetone.magpie.sbhandover.plist
(the handover commit's own sandbox run) holds
"NSStatusItem VisibleCC Item-0" => false.
Fix (internal/gui/trayshown_darwin.go, app.go):
- leaveMenuBar (was the onHandedOver closure) queues forgetTrayHidden
on the main thread after Wails' hide block, so the hide is made on
screen but not kept.
- bringTrayBack, once per computer (a flag in the Mac's defaults, never
in a WebDAV backup), forgets a kept hide before the tray is made: that
repairs everyone an older magpie already hit. A hide kept after that
is the user's and is left alone.
- A magpie handed over to by an older one (which still hides for good)
forgets the hide once that pid has quit and shows its item, unless a
hide was already kept when it started.
docs/subsystems/gui-shell.md says so under the handover.
Run (worktree at origin/main
|
||
|
|
ed91aa04ef |
checkin: an inactive or ineligible check-in shows the plugin's reason (plugins#304)
Qoder's plugin 0.2.32 (magpie-community/plugins 74be632) says why no check-in was offered: it asked with this machine's own device identity and Qoder offered no campaign, and Qoder desktop can claim one it shows. magpie dropped a hook's message for inactive and ineligible and showed only "No check-in event now". Now: - GUI: the Usage card's row reads "<label> · <message>", wrapped under the label rather than cut off with "…" (data-why, as a failed row's reason wraps, #821); Settings' check-in line under the plugin's switch carries it too. A result without a message reads as before. No new i18n keys: the message is the plugin's own text, as for failed rows. - TUI: the Usage cell is too narrow, so it adds "c says why"; c's flash carries the message (checkinWhy). - CLI: `magpie accounts checkin` prints it after the label. - The Qoder mover's min is 0.2.32 (npm view --prefer-online: 0.2.32). - docs/subsystems/provider-plugins.md says how the message is shown. Run at this tree (based on origin/main |
||
|
|
a3b45eb91e |
provider: a re: pattern matches in any case, as a glob does (usrname1833 on Discord)
A routing group's patterns (Group.Match) and a provider's auto-include rules both compile through compilePattern. A glob compiled with (?i) and a re: pattern without it, so re:gpt-.* missed GPT-5.5 while gpt-* took it. A re: pattern now compiles as (?i)^(?:…)$; (?-i) inside it makes case matter again from there on (re:(?-i)gpt-.*). The Routing page's editor works out a pattern's models in JS (patternRe in plugins/routing/client.js) and refused what JS can't read. It now reads re: with the i flag too, and takes Go's leading flag group ((?-i), (?s), ...) as JS flags, so re:(?-i)OR/B is taken and matches as the gateway will. A flag group further in is still refused there (JS has no bare (?-i)); the CLI takes it. Said in groupmatch.go's comments, magpie group's and magpie provider auto-include's help, and providers-accounts.md (Routing groups, List schedule and rules). No GUI hint said a pattern's case, so none changed and no string was added. Run: - TestRegexpPatternIgnoresCase (new): ok. With compilePattern's (?i) taken off by hand: FAIL, "re:GPT-.* ~ gpt-5.5: false, want true" and three more cases. - group-patterns.test.cjs, chromium and webkit, en and zh: 4 of 4 ok. With patternRe put back to the old re: line by hand: 4 of 4 red, "(?-i) keeps case 0 !== 1" (old JS refused re:(?-i)OR/B). - gofmt -l: nothing. go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./...: clean. - go test -tags nogui -timeout 45m ./internal/provider ./internal/cli ./internal/gateway under a sandbox HOME at 1a956129c's tree: ok, ok, ok (380s). go build for darwin, linux (nogui) and windows: ok. - A full ./... run was started and stopped: the machine's disk was full (1GB free), and internal/agent's tests failed on "no space left on device" in TempDir, not on this change. No full suite ran. Not tried: the full suite (above); a real provider's auto-include fetch with mixed-case ids; the Linux app's WebKitGTK; a (?-i) further into a re: in the GUI. |
||
|
|
edff2f819a |
provider: levels kept of a model's own narrow only what is offered again (#92)
|
||
|
|
4a3e07f1cf |
model: magpie model spec sets a model's window, output, vision and levels at once
Dani Ariyanto on Discord (#feedback, 10-24): a custom provider's models (kenari/*:free) had no window, reply limit, vision or reasoning known, and there was no one place to say them. magpie model spec <provider/model> what it has, and whose each value is magpie model spec <provider/model> [--context <n>] [--output <n>] [--vision on|off|auto] [--reasoning <levels>|off|auto] magpie model spec '<provider>/*' --context <n> --output <n> magpie model spec <provider/model> --reset magpie model specs It writes the stores magpie model context/output/images/efforts write (providers.json contexts; settings.json modelOutputs, modelImages, modelEfforts, modelReasonless), so every reader that went by those goes by a spec: entryFor/EntryOf/Served, /v1/models, max_tokens, the GUI's /api/providers badges and chips, and the agents' model lists. Every part is checked before anything is written; a refused command writes nothing. Agents are told once. Readers that bypassed the stores and now honour them: - provider.Efforts returns the kept levels, so the gateway fits a request to them (fitEffort): xhigh asked of a model kept to low-high goes as high. This reverses #92 ( |
||
|
|
ea9454d2d8 |
usage: count two ids of one model as one, magpie model alias (SlouchyQuill507 on Discord)
A vendor names one model two ways (deepseek-v4.1-flash and deepseek-flash),
and Usage, Usage > Sessions and `magpie usage` showed two rows. Now:
magpie model alias deepseek-v4.1-flash deepseek-flash
magpie model alias deepseek-v4.1-flash (what it is counted as)
magpie model alias deepseek-v4.1-flash --reset
magpie model aliases
kept as settings.json "usageAliases" {from: to}. Off until one is written.
Ids match as routing groups match them (provider.sameModel: vendor/ prefix,
case, "_", snapshot date), at every provider; a chain is followed to its
end; an alias to itself, a loop, or a flag as an id is refused. A loop
written into the file by hand counts each model under its own id.
Display only: requests, agents' model lists, /v1/models, routing groups,
Same as and prices never read it. Each call is priced by the id it was
made under and only then counted under the alias; the alias's own price
is never put on the other id's calls, and a merged row is priced only
when every id in it is. Applied in usage summarize/direct (Models
groups), the gateway sessions projection (alias read before
gatewayCache's lock; the cache key hashes usageAliases), and
sessions.List/Get/Find/Stats (read before storeMu/mu, merged into new
slices so the memo is untouched; ModelEffort rows merged too). A failed
settings.json read keeps the last aliases read, and SetUsageAlias refuses
to write over an unreadable file (EditUsageAliases under fileMu). The GUI
settings save carries usageAliases. No GUI control.
Not aliased: the Requests ledger's per-request model and its model
filter, which show each call's own id.
Run (worktree at
|
||
|
|
f4640c0aee |
sessions: an agent's folders are one list, newest first, the temporary ones folded at the end
The Sessions page drew each folder as a boxed group with its checkbox,
path and buttons always showing. Now it is one list, the way Finder's
recents read: a row says the folder's name, where it is (home as ~, from
the manage reply's new `home`), its newest session's title, when, and how
many. Temporary folders, the disk's root and apps' hidden folders under
home wait folded under Other folders at the end; a search or a session
opened from elsewhere unfolds them. Checkboxes and the Delete bar come
only with Select, and Done lets the pick go. Relocate project and Delete
all sessions move into a folder's ⋯ menu (hover, always on touch, and
right-click); Delete all asks in magpie's own dialog.
Asked for by the owner ("这个会话页面其实特别丑"), who approved the design.
Tests: sessions-folder-list.test.cjs (new) checks the order, the ~ path,
the fold and its count, Select/Done, the ⋯ menu's Delete all and its ask,
and no horizontal scroll, in Chromium and WebKit, en/zh/zh-TW/ja/de, at
1000 and 420px. The other sessions tests follow the ⋯ menu and Select.
Run at this head (rebased on
|
||
|
|
17a2b00efb |
gui: the sidebar's open page moves from row to row on a spring, as iOS's selection does
The owner asked for the sidebar's pages (Providers, Routing, Gateway…) to slide from one to the next like their sub-tabs do, "like iOS". The open page's row is now marked by one shape (.nav-top-hl) that navTopGo moves on a damped spring (NAV_SPRING: SwiftUI's response 0.42s, damping 0.84; navTopStep, four sub-steps a frame, dt capped): - it sets off as the row is pressed, and comes back if the press leaves the row or the page refuses to be left; - being physics, a press that changes its mind turns it with the speed it has, never a jump; - it follows its row while Usage's tab list folds above it and lands where the row ends up; - it is put in place, not sent, when the window opens on a kept page or the rows move under it at rest (ResizeObserver); away while Settings is open, it fades back in on its row; reduced motion jumps; the header's tabs keep their .thumb and draw none. The rows give up their own ground (open, hovered, pressed) to it. #nav is position: relative in the sidebar for it, so .seg's centring left/top are reset (without that the whole list sat 105px right). Tests: - sidebar-glide.test.cjs (new): Chromium + WebKit, en + zh, 1024 and 1440, plus 900 (header): at rest on its row and the list in the sidebar, no ground hovered, press sets off before release and comes back off the row, Providers→Usage→Agents by frames (≥3 moving frames, overshoot < 3px) landing on the row, Settings hides it and Routing brings it back, reduced motion jumps, no page errors. Broken by hand: without the left/top reset the list check goes red; before the "not seen yet" rule the boot slid from Agents (red). - sidebar.test.cjs: a pressed page row no longer darkens itself (the shape comes to it); Settings still must. - routing-idle-frame.test.cjs counted every self-asking rAF callback as Routing's loop, so navTopStep after the click read as 33 Routing frames. It now counts only callbacks no global holds (app.js's are globals; Routing's frame is in its plugin's scope). Broken by hand: Routing's loop made to always ask again → 4 red; green on main's assets and on this change. - TestCoreScriptBudget: app.js 1,343,324 / core 1,535,084 with no room added; the sidebar is the window's shell, not a page a plugin can take. Run: - Full GUI suite at 183fa169b (this change on |
||
|
|
a95f0b83ff |
gui: a restart to update hands the gateway to the new version (xuanwo on X)
Before, a restart to update ended the gateway, so it waited until no agent request was in flight (#577). An agent busy for hours held the update back, and Restart now cut its replies off. On a Mac and on Linux the restart now starts the new version beside the old one and hands it the gateway's listening socket. The new version takes every new connection at once. The old one stops accepting, finishes the requests it has (up to 15 minutes, as `make dev` already gave), then quits. Nothing an agent sends is refused or cut short. How (docs/subsystems/gui-shell.md, "A restart to update hands the gateway over"): - internal/handoff, new, darwin and linux. The old magpie opens a unix socket in a 0700 temporary folder and writes handover.json (fresh for 2 minutes) in its config folder. The new one finds it, says Hello, and gets the listening socket by SCM_RIGHTS with the address, its pid and a callbacks socket. Only the same program (same path, same uid) is given it. When TMPDIR is too long for a socket path (sun_path is 104 bytes on a Mac), the folder goes in /tmp (sockDir). - gateway: Inherit/Listen serve on the socket given, and acknowledge once serving. HandOff gives the old one handedOffDrain (15m) instead of the 2s an ordinary end gives. A Claude Code run of the old magpie whose helper calls its tools on the port gets those calls passed back to the old one over the callbacks socket (forwardCallback, mcpCall, ownCallback). The bridge's turns are counted on their own (Busy.Bridge, BridgeLast). - gui: restartInto calls beginHandover (OpenBeside `open -n` on a Mac, StartBeside for the binary on Linux). On the new version's ack, the old one hides its menu bar icon, panel, window and Dock icon (Mac), ends its backend, waits for its requests, and quits. OnShutdown leaves Codex's failover, the thread port and the install to the new one, which serves the gateway they point at. - Never two on screen. Mac: the old one lets go of its instance lock just before giving the socket and takes it back if the handover fails, then hides on the ack. Linux: Wails holds the D-Bus name until exit, so the new one serves the gateway at once but puts its tray up only once the old pid has exited (awaitExit, 16m at most). Until then the old tray stays. - What a handover can't carry: the subscription bridge's Claude Code turns live in the old process, so the restart still waits for those (restartBusy = blocking(Busy, true)), along with turns parked on tools. Every other request is not waited for. The update badge, the Updates page and Settings' "Restart automatically" say so, in every language in i18n.js. - A handover that isn't made restarts as before: socket not opened, new version not started, no hello in 60s, no ack in 90s. Because the restart didn't wait for the requests in flight, it now waits for gatewayBusy to be idle (fallbackWait, 15m at most) before it quits and relaunches, so a failed handover never cuts a request. - The overlap. The instance lock is handled as above. Both processes write: the sticky routing is flushed before the hand (FlushSticks), and files go through the existing locked or atomic writes. Counters (RPM, concurrency) are per process for the overlap (gateway-routing Constraints). OAuth refresh: the previous commit locks Codex's and the ChatGPT API's refreshes across processes. The rest were already locked or don't rotate (providers-accounts Constraints). - Not changed: Windows (no SCM_RIGHTS; it restarts as before and still waits for idle, #577), `magpie web` (re-execs in place), and `make dev` (its own Handover). MAGPIE_NO_HANDOVER=1 turns it off. Found by the sandbox run, fixed here: in run 2 the sandbox's long TMPDIR made the socket bind fail ("bind: invalid argument"). The restart fell back at once, cut the stream at chunk 6 (curl exit 18), and 4 of 381 requests got no answer over ~2s. Two fixes: sockDir (/tmp fallback), and the fallback that waits for idle. Tests (each red when broken by hand or on the old code): - gateway/handover_test.go: TestHandedOverGatewayFinishesItsStream (drainFor without handedOff: "the old one ended with a stream in flight"; takeAck off: "the new one never said it serves"). TestToolCallOfTheMagpieBeforeGoesToIt (mcpCall forward off: 404; ownCallback forwarding off: 401). TestInheritedForAnotherAddressIsLetGo, TestCallbacksSocketServesOnlyToolCalls, TestBridgeTurnsCount, TestSameAddr. - handoff/handoff_test.go: TestHandOverListener, TestNoAckKeepsTheSocket, TestTakeOnlyAFreshOfferForThisProgram, TestCloseRemovesOnlyItsPointer, and TestOpenWithALongTemporaryFolder (red on the old Open: "bind: invalid argument"). - gui/handover_unix_test.go: TestRestartHandsTheGatewayOver, cross- process. The test binary re-execs as the new magpie. A stream through the old one finishes whole, requests during the restart are all answered, the next ones reach the new pid, and the old one quits only after its stream. On the old restart it is red: "quit with a reply streaming". TestHandoverNotMadeRestartsAsBeforeOnceIdle ("never says hello", "doesn't start") is red on the code before the fallback drain: "quit with a reply streaming" / "the restart didn't try to hand over". - gui/handover_test.go: TestRestartWaitsForWhatAHandoverCantCarry, TestHandsOverOnlyWhereItCan. - update/relaunch_open_test.go: TestOpenBeside, TestStartBesideWaitsForNothing. - GUI: update-wait.test.cjs (the handover wording on the badge and page), update-restart.test.cjs (Settings' description). Real run, Mac, sandbox (env -i, HOME and XDG_CONFIG_HOME in a scratch folder, a long TMPDIR, MAGPIE_ADDR 127.0.0.1:63249, MAGPIE_UPDATE_FEED pointed at a fake feed). The app is -tags production, ad-hoc signed, bundle id com.yetone.magpie.sbhandover, built as 0.1.9001 and 0.1.9002. autoRestart is on. A fake upstream streams 100 one-second chunks. The real app found the update, downloaded and staged it, and restarted with the stream in flight (run 3, at this change's tree before the rebase): - 18:31:43, pid 59833 serves. 18:31:51, the new pid 60477 serves; v1 logged "magpie 0.1.9002 (pid 60477) serves the gateway now". - Requests: 375, failed 0. 19 were answered by 59833, then 356 by 60477. - The stream got all 100 chunks, END and [DONE] at 18:33:24, curl exit 0, 92s after the hand. 59833 exited within 3s of the stream's end. Run at the pushed head (7a5bca443's tree, on origin/main |
||
|
|
85cde4a4de |
provider: Codex and ChatGPT API refreshes lock across magpies
Two magpies can now run at once: a restart to update hands the gateway
over and the old one finishes its requests for up to 15 minutes (next
commit), and a magpie run from a terminal can sit beside the app. Codex's
auth.json and the ChatGPT API sign-in rotate their refresh token on every
refresh. Their refresh locks (codexMu, siwcRefreshing) were a sync.Mutex,
held in one process only. So both magpies could refresh with the same
refresh token, and the second got refresh_token_reused, which signs the
account out.
Both are now a filelock.Mutex beside logins.json (.codex.lock,
.siwc.lock). The sign-in is read again once the lock is held, so a magpie
that waited uses the tokens the other one wrote instead of refreshing
again. Claude's saved tokens, MCP servers' and plugins' were already
locked across processes. Google's, Vertex AI's and Copilot's refresh
tokens don't rotate. Docs: providers-accounts.md, Constraints.
Tests: TestCodexRefreshWaitsForAnotherMagpie and
TestChatGPTAPIRefreshWaitsForAnotherMagpie. Each holds the file lock as
another magpie would, mid-refresh, writes that magpie's rotated tokens,
then lets go. The refresh must return those tokens and send nothing to
the token endpoint.
Broken by hand: with both locks put back to sync.Mutex, both tests are
red ("refreshed 1 times beside another magpie").
Run: see the next commit's body. The provider package ran at the pushed
head with -timeout 45m.
Not tried: a real Codex or ChatGPT API account refreshing in two magpies
at once. The tests use fake token endpoints.
|
||
|
|
a2e98cd799 |
gateway: a streamed Codex turn goes to ChatGPT over its WebSocket (brickhao)
brickhao on Discord: long Codex turns through magpie died with "stream
closed before response.completed". Their network (FlClash) cuts a
streamed HTTP reply from chatgpt.com at about 120 s: 120.7 s through
magpie, 121.5 s over HTTP without magpie. Codex's own WebSocket to the
same backend ran to the end twice (124.5 s, 131.4 s). magpie has no
120 s timer of its own (no WriteTimeout, 10 min to the first header).
The cut is on the leg from magpie to chatgpt.com, which was always
HTTP. Codex answers magpie's 426 by falling back to HTTP, and over
loopback that is harmless.
What changed: codexSocket, first in upstreamTransport, sends a POST to
CodexBase/responses with "stream":true over the backend's WebSocket, as
codex-rs does (ResponseCreateWsRequest, build_websocket_headers).
- Handshake: the turn's headers plus OpenAI-Beta:
responses_websockets=2026-02-06. x-codex-turn-state and the
responses-lite header go in client_metadata instead. The message is
the body (zstd decoded) with "type":"response.create" ahead of it.
- Frames come back as the SSE the HTTP route sends.
codex.rate_limits and codex.response.metadata are also given as the
x-codex-* and x-codex-turn-state headers. websocket_timing is dropped.
- An error frame ahead of the reply becomes its HTTP status and body,
so account rests and failover work as before.
- These go over HTTP: a refused handshake (and the host stays on HTTP
for 10 min, unless the refusal was 401/429/5xx),
websocket_connection_limit_reached, and a body that isn't a streamed
turn.
- A socket closed before the end reads as a cut stream.
- Both Codex's own sign-in passthrough and magpie's ChatGPT accounts
take this path. Codex identity, instructions and prompts are
unchanged. coder/websocket is now a direct dependency (it was
indirect).
Run:
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows ok.
- go test -race -count=3 of the five new tests: ok.
- go test -timeout 45m at 1a5911612 (rebased on origin/main
|
||
|
|
34f9686bd2 |
agent: dsh's desktop app is DeepSeek's own DeepSeek Harness; the community DeepSeek Hermes is not it
WuSix on Discord (Windows 11), on v0.1.1337: the desktop app still isn't in magpie's Agents, and the repo |
||
|
|
d3f3df746e |
routing: the page's head has Routing groups, which brings the groups at the page's foot into view (shihh on Discord)
The routing groups sit below the stage, the story and every request; with many models (shihh on Discord) they are a long scroll down. The Routing page's head now has Routing groups (#rtGoGroups) beside New group: a down arrow, its name, and a tooltip saying where they are. Its click goes through scrollOnPurpose, brings .rt-gsec to the top of the view and moves the focus into it. The page's layout is unchanged (no #1354-style move): the groups stay last in #rtMore. fitGo gives the button only the head's spare room (the .grow spacer): named, its arrow alone (still named to a screen reader), or left out, so nothing else in the head moves or wraps. Strings in zh, zh-TW, ja and de. app.js untouched (plugin files only). Test: routing-groups-jump.test.cjs, Chromium and WebKit x en/zh/zh-TW/ja/de x 1000px web, 480px web, 640px window: 30/30. It is red on main's assets (no button), red with the scrollOnPurpose check removed (the app's guard pulls the view back), red without the focus move, and red with fitGo removed (de at 480px web: Hide accounts moves). Run at this change on |
||
|
|
de281760e2 |
gateway: a conversation going round one tool call with the same result is answered by magpie after 8 turns (audie on Discord)
audie on Discord: on 10-21 Codex Desktop, routed to WorkBuddy's deepseek-v4-pro, ran the same read-code tool call 308 times between 13:24 and 13:52 (316 requests, 212.65 credits). That evening it did it 340 more times between 19:58 and 20:22 (343 requests, 324.52 credits). loopGuard only catches a loop inside one streamed reply. Here every reply was a short, valid call. The loop runs across turns, so it shows in the request's own history. stoppedToolLoop (internal/gateway/tool_loop.go) runs in serveAgent after the session is recorded and before hooks, middleware and routing. It also runs in the Codex backend's passthrough on Codex's own ChatGPT sign-in. It needs the last 8 turns to be the same exchange: - the same calls: name plus arguments, key order ignored, call ids ignored; - answered with the same results: text, error flag and images, with Codex's "Wall time", "Chunk ID" and "duration_seconds" taken out (runNoise); - with nothing else said on the user's side. When it finds one, it answers the turn in the agent's own protocol, streamed or whole (Responses, Chat, Anthropic, Gemini through relayStatus), with a notice that names the call. Nothing goes upstream, and no prompt, base_instructions or identity text sent to a vendor changes. A different result, or any word from the user, starts the count again. The notice is a turn without calls, so the user's next message carries on. The check keeps no state, so it is per conversation, and a retried request doesn't count twice. The turn is recorded the way Codex's title turns are. sentNowhere's body becomes answeredHere (from-protocol aware): the Routing trace shows "Tool loop stopped", and a usage row has provider magpie, rejected, the conversation's session and native session, and an error starting "tool loop:". So Usage and Sessions both show why. Cost: a body with fewer than 8 tool results isn't parsed (a bytes.Count). For a longer one, only the newest 64 items are parsed, found with gjson (tailOf). For a 1.5MB Codex turn that is 1.1ms and 2.5MB, against 30ms and 20MB for a full parse (BenchmarkToolLoopCheck). There is no new setting. Settings › Models › Replies › Stop looping replies (noLoopGuard, on by default) turns this off together with the reply guard, and the notice says so. The GUI sub-text is unchanged. docs/subsystems/gateway-routing.md has a bullet on it. Run at this commit (vet/build/race at parent bf2e067ef; the full suite after the rebase onto |
||
|
|
50f52b540b |
redact: a text masked for a vendor before is masked as it was then, so a cached prompt stays cached
With Privacy masking on, a value masked once is "known" and masked
wherever a later request has it (redact/known.go). When a rule first
finds a value in a later turn (a tool printing DB_PASSWORD=...), that
value was masked from then on in the system prompt and the turns already
sent with it as written. The prefix the vendor had cached changed, so
the whole prompt was written to the cache again and none of it was read.
Reported by audie on Discord: DeepSeek Harness on a routing group served
by a custom Anthropic-compatible provider. Adjacent turns 10s apart had
cache_read 0 and cache_write 412K to 427K.
Fix: Mask and MaskJSON (the vendor-bound paths, via masking.Masker) now
use sentKnownSpans. A text masked before gets the known values it had
the first time, keyed by a sha256 of the text and the options. Only
hashes and spans are kept, never a value, in two generations of 65536.
New text still gets every known value masked. Scrub (archives, sessions,
OTel; local only) keeps the latest known set.
Unchanged: if magpie restarts, or a text falls out of both generations,
the text is masked under the current known set once, as before.
What was run:
- internal/redact TestSentTextKeepsItsMasking and internal/gateway
TestMaskedConversationKeepsItsCachedPrefix. The gateway test sends a
dsh-shaped Chat Completions conversation to a group with an Anthropic
member, and a Claude Code-shaped /v1/messages one. It checks that each
turn's system, tools and earlier messages reach the fake upstream byte
for byte. Both tests are red with sentKnownSpans forced back to
knownSpans: the system prompt became "{{SECRET_...}}" on turn 3. Both
are green with the fix.
- With masking off, a probe of the same dsh shape had the system, tools
and earlier turns byte-identical on every turn.
- gofmt -l: clean. go vet: darwin, GOOS=linux -tags nogui ./...,
GOOS=windows ./...: clean.
- Full suite at 8187919d7 (this tree, on origin/main
|
||
|
|
bf2e067ef6 |
gateway: a Codex account with credits is asked again at its allowance's edge, never benched (豆子, Zhenzhen)
Two Discord reports about ChatGPT accounts left to spend their credits
(the default):
- 豆子: an account whose allowance is used up but which still holds
credits got a long rest. It should go ahead of accounts with neither.
- Zhenzhen: a Pro lite account ran out mid-session and the running
session failed with "usage exhausted", while a new session worked.
The cause: when a window fills, ChatGPT can answer that turn 429
usage_limit_reached before it spends the credits, and serve the next
turn on them. magpie took the 429 as quota. On the routed path it
rested the account until the window renewed (candidate.full drove
those rests). On the relay (Codex's own sign-in) it passed the 429 to
Codex, which ended the session.
- /wham/usage's credits (has_credits with a balance over 0, or
unlimited) are now read into QuotaWindow.Credits, Limit.Credits and
Allowance.OnCredits.
- Routed path: a 429 quota refusal from such an account (and one let
spend them, CodexCredits) is asked again at once, once per request,
before a reset is looked at (creditsAgain, Try.Credits). If it is
refused again, it rests fallbackCooldown (Rest.By "credits") and its
usage is read again. full() is zero for it, so a full window rests it
nowhere else (spendsCredits).
- Relay: the same ask-again, once (relayOnCredits).
- Order: Smart, Pace and Least used put a credits account first of the
98%+ tier (Seat.Credits, spentBefore). That is after accounts with
allowance left and ahead of those with nothing left.
- Routing page: says why such an account went first or where it waits,
tells the asked-again try ("{n} used · on credits"), and the "credits"
rest. Strings in zh, zh-TW, ja and de.
- Not a plugin path: Codex has no plugin.
Zhenzhen's suggestion to switch to credits early (~3% left) was weighed
and not done: the vendor spends credits only once the allowance is used
up, so switching early only wastes what is left. Retrying at the edge
keeps the running session alive. Codex identity, base_instructions and
prompts are untouched.
Tests, each red on the old code (the GUI test against the old
client.js, the Go ones with spendsCredits/relayOnCredits forced false
or the old strategies.go):
- TestCodexCreditsAskedAgainAtTheEdge: relayed, routed, set not to
spend. Fake ChatGPT backend that refuses the edge turn and then
serves on credits.
- TestCodexCreditsNoLongRest: refused again gets a rest of at most
fallbackCooldown; a 500 gets backoff; no credits keeps the long rest.
- TestCodexCreditsFirstOfTheSpent (gateway) and TestCreditsFirstOfTheSpent
(routes, Smart/Pace/LeastUsed).
- TestCodexCreditsBalance gains the onCredits column.
- routing-codex-credits-again.test.cjs: en/zh/ja/de, Chromium and
WebKit, 8/8.
Run at this head (rebased on origin/main
|
||
|
|
a77b5b4fc9 |
gui: Check in now says what the press came to, not "refreshed" (#3326)
Promised to connoryang331 on #3326: a press of Check in now said "Check-in
status refreshed" whatever happened. It now says, in the same toast, a
count per kind (checkinPressSaid): "Claimed: 1 (+200 credits)",
"Already checked in today: N", "Not available yet: N" (inactive,
ineligible, or an "already" magpie asks again), "Check in in its own app:
N" (captcha, Trae's 9074), "Check-in failed for N account(s)" (red, as
before). No layout change. en, zh, zh-TW, ja, de.
A result counts as claimed now only when the vendor was asked on this
press: WorkBuddyCheckin.Asked is now sent as "asked" (omitempty). It is
still never kept: checkinNow writes the file before setting it. An
account claimed earlier today, settled and not asked, counts as already.
The TUI and CLI already say each account's result ("+N", "· already"),
unchanged.
app.js and the core budget: +771 bytes over the previous commit, 349 over
the budget after compacting the helper, raised by exactly that with the
reason in core_budget_test.go (the check-in row is the core's, the tray
panel draws it too).
Tests:
- checkin-early-done.test.cjs: the press's toast is "Claimed: 1 (+200
credits)" in each language, and checkinPressSaid's text for already,
not yet and a mix (claimed x2 +150, already, failed), bad = 1 for a
failure. qoder-checkin-recheck.test.cjs now wants "Not available yet:
1" for its inactive press.
- Red on the previous commit's app.js: both files 0/20 in Chromium.
Run at this tree:
- GUI: checkin-account, checkin-early-done, i18n-keys, plugin-checkin,
qoder-checkin-recheck, usage-card-refresh, usage-checkin, Chromium and
WebKit: 177/179; the 2 reds are usage-checkin's WebKit Qoder check-in
tab, red alone on origin/main
|
||
|
|
45fa29973c |
checkin: an early "already checked in" is asked again, not kept for the day (#3326)
connoryang331 (v0.1.1328, Windows): at 00:00:28 Beijing 14 of 29 plugin
check-ins (AutoClaw CN x5, WorkBuddy x2, CodeArts, Trae x3, MiniMax,
Raccoon x2) answered "already" (done). magpie kept that as the day's
result and never asked again, and Check in now answered from the record
without asking. A real claim at 10:54 paid +200: the vendors' days turn
later than Beijing midnight, so 00:00's "already" was yesterday's.
The class, in the checkiner every check-in shares (built-in and plugin):
- A done, inactive or ineligible answered before noon Beijing
(checkinSureHour) for an account magpie hasn't seen claim that Beijing
day is provisional. The loop asks it again 30 minutes (wbCheckinEvery)
after the answer, until a claim or an answer from noon on: at most 24
more asks a day per such account, none once magpie claims.
- A press (soon) asks again at once for done, inactive and ineligible,
whatever the hour. own-app (Trae 9074) and captcha still stand.
- A claim stamps Claimed, carried over while later answers that day say
done, so a done after magpie's own claim is settled (Qoder's claim then
done case).
- The record goes out with again: true (worked out when shown, never
kept). The card says "{name} says already checked in; its day may not
have turned yet, so magpie asks again later" and keeps Check in now;
Settings, TUI and CLI say the same. en, zh, zh-TW, ja, de.
- Qoder's recheck (#2696, pluginRechecks) is unchanged: its tests pass
as they were.
The plugins repo does not cache "already": autoclaw reads the task list
or calls dailySignin each time, codearts, minimax, raccoon and trae ask
the server each call (read at magpie-community/plugins origin/main
652f06d). No plugin change, publish or mover min.
Tests:
- TestPluginCheckinEarlyDoneAskedAgain (the reporter's 00:00:28: loop at
+29m no ask, +30m asks then claims; a press at 10:54 claims; done all
day is 25 asks and settles at noon; done after magpie's claim settled)
and TestWorkBuddyCheckinEarlyDoneAskedAgain.
- TestPluginCheckinOthersSettledForTheDay now answers at 12:00 Beijing
and checks a press asks again (claimed still settled);
TestPluginCheckinRunsAsTheBuiltinsDo, TestTraeCheckinAnswers and the
WorkBuddy nothing-to-claim/refused tests follow the new rule.
- TestCheckinAgainNotShownAsToday (TUI words and cell).
- checkin-early-done.test.cjs: again card's wording, data-state wait,
Check in now asks plugin-checkin {provider: autoclaw-cn}; a kept done
is "Checked in today +50" with no press. Chromium and WebKit, 5
languages, 900 and 440px, 20/20.
Red on the old code: with the non-test change reverse-applied (fields
kept so it compiles), TestPluginCheckinRunsAsTheBuiltinsDo,
TestPluginCheckinOthersSettledForTheDay (inactive, done, ineligible) and
all 4 subtests of TestPluginCheckinEarlyDoneAskedAgain fail; with
origin/main's app.js, checkin-early-done fails ("Checked in today").
Run at this tree:
- gofmt -l clean; go vet ./... (darwin), GOOS=linux go vet -tags nogui
./..., GOOS=windows go vet ./... clean.
- go test -tags nogui ./internal/provider/ -run 'Checkin|CheckIn',
./internal/tui/ -run 'Checkin|OwnApp': ok.
- GUI: checkin-account, checkin-early-done, i18n-keys, plugin-checkin,
qoder-checkin-recheck, usage-card-refresh, usage-checkin: 177/179. The
2 reds are usage-checkin's "webkit en/zh: Settings has a Qoder check-in
tab", red the same alone on origin/main
|
||
|
|
0815c91864 |
claude: a reply that writes its tool calls as "[tool call …]" text makes them for real instead of showing the lines (Zhenzhen on Discord)
Claude Desktop 3.1623.0 on a Claude subscription ("Fable 5.1 High",
magpie 0.1.1327) showed replies holding lines like
[tool call mcp__magpie__mcp__ccd_turn__update_plan id=toolu_0Validate args={"advance":true}]
[tool call mcp__magpie__Bash id=toolu_0Validate bash args={"command":"cd /Users/... && git diff --check ..."}]
and nothing ran. That is the form renderCachedParts gives past calls when
a run is told the conversation as text (renderClaudePrompt for a run
started anew, renderClaudeTurn for a turn with the client's own calls).
The model copied it: Claude Code had no call to make, the turn ended
end_turn, and the client showed the lines as words.
- readOutput holds a reply's words back from the first line that opens
with "[tool call " (textCalls); words before it, and lines that only
start like it, go on as they come. A reply that ends there with
end_turn and calls none of the client's tools isn't ended: once the
turn's result is in, the run is told textCallsAsk as a user message on
its input, and the reply goes on in the next message (one
message_start, as after Claude Code's own call). The client gets the
real tool_use, registered by mcpCall, so its results go on in the run.
Asked once per reply; written as text again, the words reach the
client as before. No input (a run that ends by itself) or a reply that
also called a client tool: not asked.
- A prompt that tells past calls as text ends with pastCallsNote: the
lines record earlier calls, and writing one calls nothing. Placed after
the messages (before </current_turn>), so the history chunks and their
cache marks are unchanged. A prompt with no call is told as before.
- Neither text names magpie, Claude or Anthropic (checked in the test).
Claude Code's own prompt and identity are untouched.
docs/subsystems/claude-subscription-bridge.md: new section "Tool calls
written as text", tests added to Verification.
Run at base
|
||
|
|
3b8bcc3654 |
provider: a ChatGPT token the backend calls expired before its exp is refreshed once and read again (willz on Discord, #2973)
willz on Discord (macOS, v0.1.1330): two saved Team Codex accounts showed
only "Unauthorized". /backend-api/wham/usage answered 401 "authentication
token has expired. Please try refreshing it." while each access token's
JWT exp was still ahead, so codexToken and savedLoginToken handed the
same token back on every read, and on every request, until the account
was signed in again. #2973 is the same 401 on the request path.
What changed
- SignInExpired (codex_expired.go) tells such a 401 by its words:
token_expired, "authentication token is/has expired", "Please try
refreshing it". It never matches refresh_token_expired, which is a
revoked sign-in. accountJSON now keeps the first 4KB of a refusal's
body on accountStatusError for it.
- Refreshes are keyed on the token that was turned away:
codexTokenRenewing(dir, stale) for Codex's own sign-in and
renewSavedLoginFrom(user, stale) for a saved one. Under the lock that
signing waits on, each reads its store afresh. If the store holds
another token by then (renewed by Codex or by another reply), that
token is used and no refresh is spent, so two replies for one token
spend one rotation. Otherwise they refresh. Codex's own sign-in is
written back through codexStore.write (temp and rename, every other
field kept). A saved one goes through writeLogins and only its own
row is changed; nothing is matched by name.
- The usage read (codexWindowsRenewing) refreshes once on such a 401 and
reads once more, never again. It is used by loginQuota (saved and
current accounts), codexSubscriptionUsage, and the reset spenders
through codexUserWindows (autoreset, expiring, stillExpiring), which
read the same windows with the same tokens.
- A refresh that is refused shows its own words on the card: a saved
account is marked lapsed, "add the account again to use it"
(savedRefreshFailed); Codex's own says "run codex login".
- A token that was refreshed and is still called expired says "sign in
to this account again" (errCodexStillExpired).
- A refresh that got no answer is shown as that, not as signed out.
- Request path: noteSignIn renews the account a request went with
(NoteExpiredSignIn, at most 20s, through Account.renew, which is set
on Codex's own account and each saved one). Nothing is marked. The
request fails over as a 401 did before, and the next one goes with
the new token.
- Docs: providers-accounts.md ("A token called expired") and
gateway-routing.md.
The request-path hook and its gateway tests (codex_refresh_401_test.go,
taken as written) are ggbdpq's patch on #2973. Here they rest on the
stale-keyed refresh. The patch's forced refresh skipped the fresh
keychain read, so it could spend a refresh token Codex had already
rotated.
Tests
- TestCodexUsageRenewsTokenCalledExpired: a saved and a current account,
both with an hour left, get 401 token_expired. Each is refreshed once,
read once more, and kept where it lives (auth.json in the sandbox
HOME, logins.json). A second read refreshes nothing.
- TestCodexUsageExpiredOnce: a refused refresh says to sign in again; a
token still called expired is read no third time.
- TestCodexUsageOther401NotRenewed, TestSignInExpiredWords,
TestNoteExpiredSignIn (two replies for one token make one refresh).
- ggbdpq's TestCodexExpired401RefreshesLogin and
TestCodexOther401DoesntRefresh.
Run at 482d6707a (this change) (rebased on
|
||
|
|
56418ac5cb |
gateway: a client's reasoning effort "off" is magpie's none (plugins#334)
A raw reasoning_effort "off" to the gateway wasn't read as off: no check knew the word, so a Command Code DeepSeek (plugin 0.1.15) was asked with no off level and still thought, while "none" turned thinking off (CHENJIAMIAN on plugins#334). serve now reads a Chat or Responses body's effort spelled "off" (reasoning_effort, or reasoning.effort; any case, spaces trimmed) as "none" before anything else reads the body (offAsNone), so every route, retry and check downstream (bodyEffort, agentEffort, ThinkOff, the IR's effortOf, fitEffort) sees magpie's own none. A model asked "<model>:off" is asked as "<model>:none" (askedAt). What goes upstream is then what "none" gives today: a model with an off level gets its provider's own spelling of it (the Command Code plugin's "off"), and one without one goes at its least level (fitEffort). A literal "off" is never forwarded. saysOff scans for the word without parsing, so only a body naming it is decoded; the rest of the body (numbers included) is kept as it came. Anthropic's output_config.effort and Gemini's thinking level are left alone: neither API has an "off" level. docs/subsystems/gateway-routing.md says so. Run at |
||
|
|
a1cce7faa1 |
gateway: the decision model's timeout is a setting (#2934, reyoung)
A routing group's intent classifier (askChat) and System One (askJev) were each given a fixed 8s. A slow subscription classifier can now be given longer in Settings > Models > Replies > Intent classifier timeout. settings.json's classifyTimeout takes 1..60 seconds; 0 or missing keeps 8s. save() refuses below 0 or above 60, and ClassifyWait clamps a value edited by hand (below 1 gives 8s, above 60 gives 60s). A settings file that can't be read gives Shared()'s defaults, so 8s, never no timeout. Both askChat and askJev read it per call. The GUI row is the app's own segmented control (8, 15, 30, 60, plus a value set by hand), and other saves carry the value on (prefsKeep, api.go). zh, zh-TW, ja and de strings; the routing reference and the en, zh, ja docs say it. Ported from reyoung's classify-timeout-2934 (author kept). On top: - askJev's defer reworded any error once ctx had expired, so a refusal (decideRefused) or an answerError read as the wait ran out lost the type askDecideTries rests an account by. Now only errNoAnswer, which systemOne returns when postDecide failed with ctx done, is reworded to "<provider> gave no answer in <wait>". - ja intent.html: a stray space in "遅いモデルだと 設定した". - app.js: the Image generation timeout row and the new row share waitRow (~350 bytes less). TestCoreScriptBudget was red (app.js 1,337,982 > 1,337,000); budgets raised to the exact sizes, app.js 1,337,633 and core 1,529,393, no room added. Run (macOS, Go env pinned, sandbox HOME): - Full go test -tags nogui -timeout 45m ./... at 766cf1cf9: 68 packages ok; internal/gui red on TestCoreScriptBudget only, fixed above. - At ed008ca9f and again after rebasing on |
||
|
|
a6efe07cd7 |
davsync: a GitHub backup too large for one request goes up in parts (Zhang-Wei, Discord)
Zhang-Wei (Discord, v0.1.1327) saw every GitHub sync fail with "GitHub sync: HTTP 422: Sorry, your input was too large to process. Consider creating the blob in a local clone of the repository and then pushing it to GitHub." Their exported backup is 50.8 MB; with the library's sync off it works. |
||
|
|
f81913994a |
gateway: a Responses Lite compaction's summary request offers no tools, and a reply without a summary says what it held (WuSix on Discord)
WuSix (Discord) got "compaction: codex/gpt-6-astra failed to summarise
this conversation 3 times in a row (last: the model wrote no summary)".
codex/gpt-6-astra's catalog entry is Codex's own (codexcat.ownEntry), and
Codex's entry puts gpt-6 on Responses Lite: its tools go as an
additional_tools input item, none in tools. codexInputAs set "tools": []
for magpie's summary request but left that item in, so the model was
asked for the summary with every Codex tool still offered (tool_choice
auto, which codexBody sets anyway). A reply that is a function_call and
no message is "the model wrote no summary". codexInputAs now leaves the
additional_tools item out when it turns the trigger into the summary
prompt; calls in the history stay as they came.
The 502 and the held message now say what the reply held instead
(answeredWith: "(it answered with function_call shell)", "reasoning",
"nothing"), so the next report says which it was.
Hypothesis, not confirmed on a real reply (see below): the fake backend in
TestCodexLiteCompactionOffersNoTools answers a call whenever any tool is
offered, as an agentic model mid-task may. What the test holds is that
the request offers none.
Run at base
|
||
|
|
398803e3f5 |
gateway: a model slow to start again and again rests on its account (小八)
小八 on Discord (2026-10-23): a WorkBuddy plugin account answered magpie's
own 504 "no first token in 30s" 58 times on kimi-k3-1 and glm-5.3 (the
vendor's per-model token limit, which it never names, it just stalls).
The group went on each time, then asked the same account first on the
next request: 15 slow starts in 17 minutes in one session.
Cause: gateway.go's hw.slow branch (the group's FirstToken let a member
go) never rested anything, by design ("a long prompt being slow to start
anywhere"), and nothing counted slow starts. So every request waited out
the whole FirstToken on the stalled member before falling back.
Now restSlow (routing.go) counts slow starts per restID (provider,
account or key, model). Once rests nothing, as before. The second in a
row, within slowForget (30m) of the last, rests that model on that
account: 1 minute, doubling each time after, capped by the provider's
RestCapOr(longestRetry), never for a provider whose rest cap is off. An
answer clears the count (servedCandidate). A client-cancelled request
never reaches the slow branch, so it counts nothing. A longer rest
already there is kept. The rest carries Rest.Model, so the Routing page
shows it on that model's rows only. The Routing story of a rested slow
try says so, and the group editor's slow-to-start hint no longer says
"It doesn't rest" (en, zh, zh-TW, ja, de).
Tests: TestSlowStartsRestTheModelOnItsAccount (once: no rest; an answer
in between restarts the count; twice: the model rests on k1 with Key
a#k1/m, Model m, under a minute; k1's whole key and k2/m don't rest; the
next request asks k2/m first; a/n still goes to k1; a third slow start
backs off longer; an answer ends it). TestCanceledSlowStartRestsNothing
(three client cancels during the first-token wait: no rest, no count).
routing-went-on.test.cjs gains a rested slow try in five languages;
group-first-token.test.cjs's i18n list has the new strings.
Broken by hand: restSlow's result ignored in gateway.go -> the first test
red at "twice in a row" (Rest nil); servedCandidate not clearing
routed.slow -> red at "an answer in between starts the count again";
restSlow called in the cancel branch -> the cancel test red at "cancel
2: k1/m wasn't asked (rested?)". All restored, green.
Run at the worktree on base
|
||
|
|
ecd9835005 |
agent: Claude Code's subagent effort writes nothing without a subagent model (KorenKrita)
KorenKrita on Discord (cause confirmed by them): with Claude Code's
subagent model unset ("Claude Code picks") and a subagent effort set,
claude.go wrote spell(tierWith(main model, effort)) into
env.CLAUDE_CODE_SUBAGENT_MODEL. That pinned every subagent to the main
model, so Claude Code's own pick (the Agent call's model, the subagent's
frontmatter) never ran.
Agent wiring (internal/agent/claude.go):
- With no subagent model, magpie writes no effort, and
CLAUDE_CODE_SUBAGENT_MODEL stays unset.
- The saved effort is kept, not deleted (the user set it). It lives in
the stash under claude.subagent_effort, and the subagent effort's Get
reads "" while there is no model. A model picked later takes it
("v/glm:high").
- A value an older magpie wrote that way (the main model at an effort,
not own, while routed: subagentFollowing) is moved into the stash and
taken out of the env by writeTiers and by Sync on start.
- subagentOwn no longer counts that value as the user's own model.
- Doc: docs/subsystems/agent-wiring.md, the Claude Code "subagents" entry.
GUI (window, opened Claude Code row):
- The subagent effort moves from its square under the session defaults
to the right of the Subagents row. It uses the tier rows' markup and
code (effortBtn in connectPanel, ag-eff), so it lines up with
Opus/Sonnet/Haiku's effort.
- While the subagent model is unset it shows Default, is disabled, and
its title says "Set a subagent model first". The new string is in zh,
zh-TW, ja and de.
- The old square is removed from the opened row. No other layout changes.
- The tray panel's own square is left alone: #3308.
Tests:
- New internal/agent/claude_subagent_effort_test.go
(TestClaudeSubagentEffortNeedsAModel). On the old code it is red:
an effort with no subagent model wrote
CLAUDE_CODE_SUBAGENT_MODEL="v/glm:high"
With the Sync branch broken by hand it is red at "Sync left an older
magpie's CLAUDE_CODE_SUBAGENT_MODEL="v/flash:high"". It also checks
that a set model plus effort still writes "v/glm:low".
- claude_tiereffort_test.go now expects no env for an effort with no
model.
- New internal/gui/tests/claude-subagent-effort-row.test.cjs (16 cases):
chromium/webkit x en/zh x 1100/560px x with/without a subagent model.
It checks:
- the control sits in the Subagents row at the tier efforts' x and
height;
- with no model it is disabled at Default and opens no slider;
- with a model it posts subagent_effort, with no scroll;
- the old square is gone.
It is red against the old app.js ("the old square is still there").
- tier-effort.test.cjs is updated for the moved control.
Run at this tree (parent
|
||
|
|
4f6498f822 |
routing, usage: an account renamed in magpie reads by its new name (magpie-community/plugins#310, molvqingtai)
molvqingtai renamed a Kiro (plugin) account from "example@gmail.com (foo)" to "example@gmail.com (bar)", and the Routing page kept saying "(foo)" on every request made after. Cause: the Routing page never looked up the user's name at all. A trace's `who` is the vendor's account name (Weighed.Who), and plugins/routing/client.js showed it as it was. Usage records (ProviderAccount) keep the vendor's name the same way, and the Usage page's Accounts, the request log's Account filter, `magpie usage`, a gateway key's accounts (AccountNames, /api/caller-keys) and Routing's "Several accounts" pools (onOf) all showed it raw too. This affected built-in and plugin providers alike. Records still keep the vendor's name. It is the key the user's name is stored under (providers.json AccountNames, in lower case), so it stays the identity: Routing still groups and ranks by `who`. The name is looked up when it is shown: provider.AccountShown / AccountShownOf / AccountRef.Shown in Go, and userShown (accountNameOf over /api/providers' accountNames) on the Routing page. So requests from before the rename read by the current name too, and a cleared name goes back to the vendor's. A key's name and an unnamed account read as before. Already right before this change: quota cards and the menu bar (Alias), `magpie accounts`, and the editor's account row. Record for this push: 13 commits on origin/main |
||
|
|
cba59b05e1 |
gui: the middle button's autoscroll scrolls a page instead of twitching (#2767)
#2767 (znbsf, with AvatarGanymede's recording on the Discover page) and 多喝热水 on Discord, on Windows: pressing the wheel and moving the mouse made a page twitch instead of scrolling, or pulled it back. znbsf's patch found the same cause. Chromium and WebView2 give the autoscroll a pointerdown of button 1 and then no wheel, touch or drag of the reader's. The "where the reader is" rule put back each of its scrolls as it came, so the page twitched between where it went and where it was. What changed (internal/gui/assets/app.js, the click guard): - From a trusted middle press on a view that can scroll (`panning`), that view's scrolls count as the reader's, and what a click held is let go. This lasts until the autoscroll ends as Chromium ends it: on the next press (seen only as a pointerup with no pointerdown), on a key, on blur, or on the lift after the mouse moved more than 15px while held. - A field the guard brings back into view after putting a scroll back must have been focused since the reader last scrolled that view (`scrolledFrom`). Before, the button the middle press focused, which the autoscroll or the wheel took out of sight, was brought back by the next scroll that was put back, and the page jumped to it. - docs/subsystems/gui-shell.md says both. Guarded by internal/gui/tests/view-middle-autoscroll.test.cjs: a real middle press and move in Chromium, en and zh, a scroll by code still put back after the autoscroll ends, and WebKit (no autoscroll) left as it was. Broken by hand: - app.js put back to its base: Chromium 0/3 ("the autoscroll scrolled the page: at 0, passed 0,0,0,…"). WebKit passes, as expected. - Only the panning line taken out: Chromium 0/3, same message. - Only the scrolledFrom check taken out: Chromium 0/3 ("after the autoscroll: a scroll by code is put back (was 374, asked 1212, at 126)"). Record for this push: 13 commits on origin/main |
||
|
|
c417b1f4e3 |
library: a skill removed from its source is said so, and every such skill goes in one click, asked first
スライム on Discord (#help, 10-22): taste-skills took some of its skills
out, Update all reported each of them as a failure, and the only way
out was to delete them one by one.
An update or a check that reads the source whole and finds the skill's
folder (or its SKILL.md) gone now calls it removed upstream, not a
failure. GitHub tarballs and other git repositories both work this way.
- UpdateSkill returns *GoneError.
- UpdateSkills and UpdateSomeSkills list it in Result.Gone, not
Unupdated.
- A check gives status "gone".
- Each marks Skill.Gone. The mark is cleared when a check or an update
finds the skill there again.
- A fetch that failed, a skill left out of a fetch as too big, and a
folder that can't be read stay unknown, never gone (goneFrom).
Nothing is deleted by itself. RemoveGoneSkills takes the named skills
out, or every marked one when none are named, through RemoveSkills, so
the folders go to the backups. A skill found in its source again is
kept and said so.
- GUI: a "Removed upstream" tag replaces Update available and the
update icon. Update all says gone skills apart from failures. "Clean
up N" sits in the group heading, or in the bar when there is one
group, and opens a sheet naming each skill. One changed here carries
"Changed here". Strings are in en, zh, zh-TW, ja and de.
- CLI: `magpie library skill rm --gone [--yes]` asks at a terminal and
refuses without --yes otherwise. It names the ones changed here.
update and status print the hint.
- TUI: the row says "removed from <repo> · d takes it out".
- API: POST /api/library/skills/remove-gone {names}.
- Docs: the Skill updates row and Verification in
docs/subsystems/library.md.
Record for this push: 13 commits on origin/main
|
||
|
|
93b87d0004 |
davsync: a GitHub backup too large for the Contents API goes up as a blob (Zhang-Wei, Discord)
Zhang-Wei (Discord, v0.1.1318, 102 skills) saw every sync fail with "GitHub sync: HTTP 422: Sorry, the file is too large to be processed" on magpie/magpie.magpie-backup; the last backup that went up was about 19 MB. The Contents API's PUT refuses files well under the 100 MB a blob can hold. A repository with commits is now written through the Git Data API: the ref's head, the file's version at that head (it must still be the one sync read, or errChanged), a base64 blob, a tree on the head's tree, a commit with the head as its parent, and a ref update without force. Still one commit per write or removal, and the version is the blob SHA as before. A ref update that is not a fast-forward is built again on the new head (the blob is kept), up to three times, then errChanged; if the new head changed the backup it is errChanged at once, so another computer's backup goes through the normal merge. A branch deleted meanwhile is an error, not created. Usage files and their removal take the same path. An empty repository has no head to build on, so its first write still goes through the Contents API (one commit, unchanged). If that is refused as too large (422 "too large" or 413), a short README.md in magpie's folder makes the first commit and the backup follows as the second. Reading was already right for large files: the object media type gives encoding "none" over 1 MB and bytes() downloads by blob SHA; the new test covers it at 21 MB. The fixture now serves the Git Data API (blobs, commits, trees, a fast-forward-only ref update) and refuses a Contents PUT over contentsLimit with GitHub's 422 text. docs/subsystems/sync-backup.md says how writes go and names the new tests. Record for this push: 13 commits on origin/main |
||
|
|
efd4770015 |
agent: a reasoning effort picked in VS Code's Copilot Chat survives magpie's sync (chim3744 on Discord)
chim3744 (magpie 0.1.1318) picked "max" for a magpie model in Copilot
Chat's model picker, and requests went out at "low".
Cause: VS Code 1.142 keeps that pick inside the provider group, as
settings["<model id>"].reasoningEffort (languageModels.ts
setModelConfiguration). magpie's setGroup built its group with
vscodeGroupJSON, which has no settings key, compared the whole object
with sameJSON, and edit.SetJSONItem replaced the whole group. Every Sync
(catalog.Changed on start, a vendor list fetch, a provider edit) and
every magpie model pick in VS Code wiped the pick, and Copilot Chat fell
back to the model's first level ("low" of [low, high, max]).
Fix: vscodeGroupKept lays magpie's group over the one in the file with
mergeTheirs, as theirsKept does for the other agents (#2030). Every key
magpie doesn't write stays: settings, and anything else VS Code or the
user puts there, such as an apiKey reference. The models list stays
magpie's whole, so a model gone from the catalog still leaves it. The
settings of a model magpie no longer lists are kept, since they are the
user's values. When nothing magpie owns changed, the compare is a no-op
and the file is not written. This covers VS Code, VS Code Insiders and
VSCodium (customendpoint and customoai), every profile, since all go
through setGroup. agent-wiring.md lists what is kept.
Siblings checked:
- chatLanguageModels.json is written only by vscode.go. Cursor
(cursorlocal.go) writes nothing of Cursor's. magpie writes no
language-model groups for Windsurf, Trae or Kiro IDE.
- Every other syncJSON caller in internal/agent already merges through
theirsKept, piBlockKept, openCodeKept, mothxBlockKept, qoderKept or
t3Merged (
|
||
|
|
ca4a1cde0d |
dsh: maxTokens leaves dsh half its window, or a quarter for output where that is more (#3298 item 3)
|
||
|
|
c2636b7b5b |
library: an MCP command given to agents in WSL is checked in their distro
loong on Discord, Windows host with agents in WSL: a stdio server whose
command is a WSL program (`node /home/loong/tools/xxx.js`), given only to
WSL agents, showed "exited (1) … Node.js v24.9.0" on the Library's MCP
page. The check started it on Windows, where his agents never do; a
sibling written as `wsl -d Ubuntu … node …` checked fine.
What changed:
- checkSides (mcp_check_wsl.go) reads each agent id's `@wsl:<distro>`.
No WSL agent, not Windows, a Windows path for the command
(windowsPath: magpie's own image server, `C:/x/npx.cmd`) or Settings'
Detect agents in WSL off: this computer, as before. Otherwise each
distro is a side, after this computer when an agent here has it too.
- In a distro the command is found as the agents' shell finds it
(new wslrun.In: the same login-then-interactive probe Find uses, so
nvm's node is found; cached for findAge) and started through
wslrun.Tool.Command, the existing `wsl.exe -d D --exec /usr/bin/env
PATH=… MAGPIE_WSL_RUN=… <path> args` path, so no new quoting. Its
env goes over WSLENV (Tool.Env); its Cancel stops the run inside the
distro.
- A distro that isn't running is never started for a check: Why
"wsldown", naming it, painted as not checked (ring), like novar.
Beside a side that was checked it is left out.
- Mixed: each side in turn, the first failure ends it. ServerHealth
gains Checked (where it started, "" for this computer); the row says
" · WSL Ubuntu" / " · Windows" on a failure, the tooltip "Failed in" /
"Checked in". New strings in zh, zh-TW, ja, de.
- healthKey (Go and client.js) includes the sides, so agents moving into
WSL is a check anew.
- docs/subsystems/library.md says all this.
Tests:
- TestCheckWSLOnlyServerInItsDistro: ok in Ubuntu with the exact wsl.exe
argv; a stopped Arch is wsldown with no probe and no run; a command
the distro lacks is notfound there.
- TestCheckWindowsServerHere: a Windows-only server checked here, WSL
never asked; Windows-path commands stay here.
- TestCheckMixedServerEachSide: ok in both; WSL exit named Ubuntu's;
Windows failure stops before WSL; stopped distro = checked here only;
healthKey differs when agents move into WSL.
All force wslrun.On and fake wsl.exe (Run) and the distro run
(wslCommand runs this test binary as the fake server).
- library-mcp-health-wsl.test.cjs: chromium + webkit, en/zh/zh-TW/ja/de.
Broken by hand, each red:
- checkSides always this computer: WSLOnly and Mixed red.
- windowsPath exemption removed: WindowsServerHere red.
- mixed drops this computer: Mixed red.
- healthKey without sides: Mixed red.
- stopped distro reported as a failure: WSLOnly and Mixed red.
- client.js without the " · <place>" on a failure: the GUI test 12 of 12 red.
Run:
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows ok.
- GUI: the 94 library-*/mcp-*/i18n-* files, both engines: 780 of 783;
library-loading (webkit) and library-pick-remove (chromium zh-TW) red at
--test-concurrency=4, load ~45, pass alone 3 of 3; filed #3300, #3299.
- Full suite at 3831de1a3 (base
|
||
|
|
8278fd9b0c |
gateway: Volcengine Ark's monthly 429 rests the key until the reset it writes (+0800 CST), not 15 minutes (#3251 CNife, #3276 wyx1818)
Ark's 429 for a used-up month says "You have exceeded the monthly usage
quota. It will reset at 2026-10-25 23:59:59 +0800 CST." with no
Retry-After. resetsWhen read an offset only after UTC or GMT, so nothing
read it, the key rested quotaRest and was asked again every 15 minutes
until the month turned. Two more limits stood behind that one: a written
reset over 7 days off (longestWritten) isn't read, and a quota rest is
held to 8 days (longestQuota), so wyx1818's reset 9 days off would still
have fallen to the 15-minute loop.
- resetsWhen also reads the time as Go prints one (Ark's): four offset
digits, a space and the zone's name in capitals, then punctuation or
重置. The offset is read, the name isn't (CST is more than one zone).
The UTC/GMT form is unchanged; a bare offset with no zone's name, or
"+08:00" without UTC, isn't read, as Ark doesn't send them.
- monthlyWords (monthly, 月度, 每月, 本月): a refusal that says its
allowance is a month's has its written reset believed up to
longestMonthly (35 days) instead of the week (longestSaid). That covers
Zhipu's 1310 "Weekly/Monthly Limit Exhausted" too (resetsZhipu), the
sibling held to the same week.
- In failQuota the 8-day cap is lifted to 35 days only when the rest
came from the vendor's own reset ("resets") and the refusal is a
month's. A window read full, a Retry-After and the user's own quota
rest are held to 8 days as before.
Ported from skygunner's branch skygunner:fix/volcengine-resets (e6c2b6fb,
posted on both issues). Taken: the monthly trust window, longestMonthly,
monthlyWords, the reporters' bodies as fixtures and the shape of
TestMonthlyWrittenResetRestsTheMonth. Changed:
- its regex made UTC|GMT optional and took any 2 to 5 letters,
case-insensitively, after any offset, for every vendor, so "reset at
<date> +8 now." would read. Scoped here to Go's layout, the zone's
name matched case-sensitively.
- it lifted the cap to 35 days whenever the body said monthly, whatever
the rest came from (a window read full, the user's own rest); here
only for the vendor's written reset.
- its resetsZhipu kept the week; here it shares longestSaid.
vincenty on Discord: no link to another fix is on either issue
(skygunner's commit is authored as "vincent").
Not changed: Ark's plan windows read by its AccessKey (volcPlanQuotas)
still reach only the usage card, not routing (layer 2 of #3251: the
quota is the account's, not one inference key's, and a provider has one
plan, #2849). #3251 stays open for it.
Tests (fixtures: #3251's and #3276's bodies byte for byte, #3276's as
its pretty-printed JSON):
- TestResetsWritten: ark (3 days), ark 9 days off, ark escaped, 35 days
read and 36 not, past, cut after the offset / in the offset / before
the full stop, without the zone, +9900, Ark's form without "monthly"
9 days off (0: the week holds), WorkBuddy's en 9 days off (0: another
vendor unchanged), "retry after … +0800 CST." (0). Every existing
WorkBuddy and UTC/GMT case passes unchanged.
- TestResetsZhipu: 1310 9 days off read, 36 days not; 1308 over a week
off still 0.
- TestMonthlyWrittenResetRestsTheMonth (new): Ark's 429 3d7h and 9d12h
off reads failQuota and rests by "resets" till then, raw and as the
agent's error with keepRetry's note; the same body without "monthly"
rests quotaRest; a month's refusal with no time on an account whose
window reads full 20 days off rests 8 days by "window".
Broken by hand, in the worktree:
- old routing.go with the new tests: TestResetsWritten (ark: 0s, want
79h7m59s; 9 days, escaped, 35 days), TestMonthlyWrittenResetRestsTheMonth
(79h0m0s off: rests 14m59.99s by quota) and TestResetsZhipu (1310, 9
days off: 0s) red.
- cap not lifted: 228h0m0s off rests 191h59m59s by resets, red.
- longestSaid always the week: ark 9 days / 35 days and Zhipu 1310 red.
- zone's name made optional: "ark without the zone" reads 79h7m59s, red.
- skygunner's cap (any monthly body): window 20 days off rests 479h59m,
want 192h, red.
Each restored, green.
Run at 268c1d34c (this change on origin/main
|
||
|
|
efb7cb11d4 |
gateway: a safety refusal said in a stream is a refusal for a client answered whole too, and rests nobody (#3274, CartethyiaQwQ)
CartethyiaQwQ (#3274): Codex's "safety filter: cyber_policy" refusal (the Daybreak note) set healthy accounts aside; two such turns benched a five-account pool for about 17 minutes. Cause: the HTTP 400 cyber_policy is already a refusal (policyRefusal reads its code: next account asked, nobody rests), and so is one said in a stream relayed as a stream. A Codex account is always streamed upstream, so a stream:false Responses, Chat or Messages request is answered from that stream whole. There, a response.failed or error event whose error has a code (cyber_policy) but no invalid_request_error type got no status from the decoder, and the whole path answered it 502 api_error: retried on the same account, then every account asked, each one but the last resting by backoff. A refusal after a few words went to the client as a finished 200 turn, and the failure after it rested the account. Fix, at the decoders and the whole path: - filterRefused (fallback.go): a stream error event refusedCode reads as the safety filter's gets status 400 and Said {"error":{type invalid_request_error, code}}. Used by every decoder that set Code: refusedCode -- Responses (both error sites, after requestRefused), Chat, Anthropic and carriedError. - The whole path (gateway.go) answers a reply the filter cut part way as the refusal, not its words so far, and notes it in refusedHeader, since Anthropic's error shape drops the code that settle reads. - restAfterMarked: a 400 whose error object policyRefusal reads as a refusal rests nobody and counts no failure (By "off", Why refused), as the ZDR refusal does, for any route that reaches it. - docs/subsystems/gateway-routing.md says so. Review of the submitted patch (dc6c695db, not taken as is): it matched `safety filter|cyber_policy|Daybreak access` anywhere in a 400's words, so a 400 that echoes the user's prompt in its message skipped the rest too; its fixture was magpie's own refusedError text, which restAfter is never handed for a 400; and it gated on status 400, while the path that rested (above) answered 502, so it would not have stopped the rests. Its restAfter unit tests' shape is kept in TestRestAfterPolicyRefusal. Run at |
||
|
|
21f7f9df23 |
checkin: the Qoder plugins' check-in is asked again within the day, as the built-in's was (#2696)
The native Qoder and Qoder CN plugin check-in (pluginCheckinProvider) built
its checkiner without recheck, while the built-in qoderCheckiner set it.
So an inactive or done result was kept for the whole Beijing day, and a
press of "Check in now" was answered from that record too. Qoder CN's
campaign runs 10:00 to 09:59 the next day (mufanmu), so an early read
describes yesterday's campaign and said nothing about today's.
What changed:
- provider: pluginRechecks(id) is true for "qoder" and "qoder-cn" only,
and sets recheck on their checkiner. A press asks at once. The loop asks
again after wbCheckinEvery (30m) for inactive and done. Every other
plugin stays settled for the day.
- GUI (checkinRow): a Qoder account (built-in or plugin) whose check-in
found no campaign today keeps "Check in now". A press reports "Check-in
status refreshed" instead of "Checked in", since it may still find
none. The unused "Checked in" key is replaced in all four languages.
- docs/subsystems/provider-plugins.md names the exception and the tests.
Taken from LoKi's (lokic7123-star) patch on the issue: the recheck on the
Qoder plugin ids, the Check in now button for an inactive Qoder card, and
the neutral press status. Their GUI test was adapted into
qoder-checkin-recheck.test.cjs.
Left out, as the earlier review asked: the blanket 30-minute message, the
UTC timestamps and the client-computed next check. Also left out: the
"Already checked in today" wording and the "· credit" display. That is
not this bug, and the TUI and CLI would need the same change.
Run:
- Red on the old code:
- All 8 subtests of TestPluginCheckinQoderRechecksCampaigns
({qoder,qoder-cn} x {inactive,done} x {loop,press}) fail without
the fix.
- Forcing recheck on for every plugin turns
TestPluginCheckinOthersSettledForTheDay red.
- qoder-checkin-recheck.test.cjs is red on the origin/main assets (no
.ci-now on the card).
- At 91bb01e65 (base
|
||
|
|
5871f02dd6 |
plugins, provider, gui: a keyless plugin sign-in needs no key, and a single-identity plugin has one account (#2695, LoKi)
LoKi's patch (lokic7123-star), picked onto origin/main |
||
|
|
240f3eb4c5 |
gateway: a name a fake-IP resolver answers is fetched through its TUN or a local proxy (#2593)
With Clash's TUN fake-ip (Clash Verge Rev on Windows, TomXPRIME), Surge's enhanced mode (h4rk8s) or Loon on, the system resolver answers every name in 198.18.0.0/15, which the download guard (image_fetch_guard.go) listed as special. So web_fetch, a caller's image (fetchPicture), a vendor's image or video by URL and generate_image's download (imagemcp) refused every URL as "a private address". All of them go through publicTransport; nothing else uses it. What changed: - The address rule moved into internal/netguard (Public, FakeIP, LoonPaired), shared by the gateway's guard and a provider's icon (icon.go's publicIP is now netguard.Public or FakeIP, as #252 meant). The icon guard gets the gateway's stricter list with it (Teredo, 240/4, NAT64 and 6to4 forms of a private address are refused there too). - publicTransport: a name (never an address literal) whose every answer is in 198.18.0.0/15 is fetched. With no proxy (pure TUN) the fake address is pinned and dialled, and the dial guard lets that one address in, no other. Through a proxy on this computer (loopback or localhost) the proxy is given the name, never the fake address: h4rk8s showed a real Surge CONNECT by name works and by the 198.18 address doesn't. A plain http:// request's Host to that proxy is the checked name, never the caller's own Host. Through a proxy elsewhere it is refused. - An answer with any other address beside the fake ones (private or public) is judged as before, so fake + 192.168.x is refused; loopback, RFC 1918, link-local with 169.254.169.254, CGNAT, unspecified, multicast and documentation stay refused; every non-fake answer is still pinned; redirects are re-checked as before. - Loon's synthesized AAAA (fd27:712::/96 holding an A answer of the same reply) is left out and the A answer judged in its place, as icon.go already did, so a Loon answer isn't refused as fc00::/7. - docs/subsystems/gateway-routing.md says all of this, and the trust it asks for: where a fake-IP name really goes is decided by the fake-IP resolver, which magpie can't see, so a name pointing at the user's network is reached if that resolver's rules send it there. The icon path already accepted this (#252). Credit: ggbdpq found the cause and wrote both patches on the issue (hunt/2593-webfetch-fakeip, then hunt51-a-fakeip-proxy: the fake-only, loopback-proxy, name-not-literal predicate and its test shapes, which this follows); h4rk8s's real Surge comparison showed the pin had to go for a proxy; TomXPRIME's Windows report showed pure TUN needs the direct dial. Run (darwin/arm64, worktree rebased on origin/main |
||
|
|
226551d0d8 |
gateway: MiniMax M3.1-Flash is sent its effort in output_config (shin4 on plugins#316)
An OpenAI client's reasoning effort (Responses' reasoning.effort, Chat's
reasoning_effort) for MiniMax Code's MiniMax-M3.1-Flash or -Preview, built
into an Anthropic body for the minimax plugin, went as a thinking budget
alone. Under the reporter's 8192 cap medium, high, xhigh and max were all
budget_tokens 7168, so the level was lost before the plugin saw it.
The two models join GLM-5.2/5.3 in effortInOutputConfig: buildAnthropic
sends output_config.effort next to the budget, and an Anthropic client's
budget gets its nearest level there too (withOutputEffort, passthrough).
MiniMax Code's catalog marks M3.1-Flash forced_on at low..max. The budget
stays as it was (the owner's plan on plugins#317); dropping thinking for
the managed-login route, as MiniMax Code 3.1.4 does, stays the plugin's
call. Nothing goes into prompt text. Claude, MiniMax-M3 and other vendors'
models keep the budget alone. MiniMax's public Anthropic API doesn't list
M3.1-Flash (platform.minimax.io text-anthropic-api), so the rule reaches
MiniMax Code's subscription and any relay serving those two models.
Tests (internal/gateway/minimax_effort_test.go, fake plugin $FAKE_MINIMAX):
- TestMiniMaxPluginGetsTheNativeEffort: the reporter's Responses request
and its Chat form, low..max, both models, on minimax-code and
minimax-code-global through the plugin host (bun), plus an Anthropic
client's budget 10000 -> medium; MiniMax-M3 keeps no output_config.
- TestNativeEffortLeavesOthersAlone: claude-sonnet-4-5, kimi-k3 and
MiniMax-M3 on an Anthropic relay get budget 7168 and no output_config.
Run at
|
||
|
|
ccbc727818 |
agent, gateway: a Claude model magpie can only ask translated no longer keeps auto mode's server review on (nexnull on Discord)
nexnull (Claude Code 2.1.308, magpie v0.1.1318, DeepSeek 4.1 flash) saw
Claude Code's notice that auto mode's classifier "isn't eligible because
your requests go through 127.0.0.1:3425". The wiring leaves
CLAUDE_CODE_AUTO_MODE_SERVER unset while any model Claude Code can reach
through magpie is reviewed (claudeReviewed), and it judged that by
AutoModeReviewed, which counts a Claude model by its name. A relay that
lists claude-* beside DeepSeek with only a Chat (or Responses) URL, or a
Claude model the user pinned to chat, is asked translated: a probe showed
such a request goes to /v1/chat/completions with no safeguards and no
safeguard_results. So the review stayed on and the notice showed.
AutoModeReviewable (gateway/automode.go) is AutoModeReviewed on a route
that reaches the Messages API: the Claude subscription, or a provider
with an Anthropic URL whose APIs for the model (a user pin first) include
Anthropic. claudeReviewed asks it for the provider and each fallback, so
Claude Code and T3 Code get CLAUDE_CODE_AUTO_MODE_SERVER=0 there. It is
still magpie's own stashed value (claude.auto_mode_server): a user's own
value is left alone, and disconnect or restore takes magpie's off.
serverReview, already on the Messages route, keeps AutoModeReviewed.
Chosen on purpose: any reachable model that is really reviewed keeps the
review on. Writing 0 by mistake would lose server review on Claude
silently, while leaving it on by mistake costs the notice, which Enter
dismisses for 24h. A relay with an Anthropic URL (OpenRouter, AiHubMix)
still counts as reviewable, since some pass the field through. No
client mimicry and no prompt or identity text changes.
Pass-through on Anthropic routes (asked in the same task): no defect.
Probes against a fake upstream showed the anthropic-beta (with
dangerous-tool-use-2026-09-03) and anthropic-version forwarded, the
safeguards body byte-identical, a stream:false reply relayed byte for
byte with safeguard_results and an unknown key intact, and the SSE relay
keeping an unknown key, an unknown event type and toolu ids. The probe
file was removed and is not committed.
Full run at 983425662, the same change one commit back:
- gofmt -l: clean. go vet ./..., GOOS=linux go vet -tags nogui ./...,
GOOS=windows go vet ./...: ok.
- set -o pipefail; go test -timeout 45m ./...: EXIT 0, 68 packages ok,
no FAIL (internal/agent 386s, internal/gateway 507s), run alone after
another session's suite ended.
- TestAutoModeReviewableAsksOnMessages and
TestClaudeReviewedOnlyWhereMessagesReachClaude are red on the old code
("cr/claude-sonnet-5: true, want false"; "a relay without an Anthropic
endpoint: \"\", want 0").
Rebased then onto
|
||
|
|
0ddcf28a1d |
redact: a backend's id (a UUID, 32+ hex digits) goes as written, never a piece of it
The owner found UUIDs masked, and a backend looks an id up by every
character: a masked one, or half of one, finds nothing or the wrong row.
A probe with every kind on and the model labelling each value found five
ways a UUID went masked:
- a piece of one: PHONE took 13800138000 at the end of
…-a13800138000, BANK_CARD took 4111-1111-1111-9007 across a UUID's
groups, and the id went half a placeholder;
- the SECRET rule in a field named for an id, a cursor or a request:
secret_id, token_id, api_key_id, access_key_id, next_page_token,
nextPageToken, csrf_token, trace_token, secret_hash;
- the bare "key" rule ("key": "<uuid>", Idempotency-Key);
- the serial rule (sn:, Serial Number:);
- the model labelling a UUID a name, an account and so on (only
"secret" was held back before), and a phone number masked earlier
being found again inside a UUID.
noIDs (internal/redact/ids.go) drops, after every finder, a span that is
a piece of an id, and a whole id unless the user's own words or rules
found it, a PASSWORD/API_KEY/TOKEN/PRIVATE_KEY rule did, the SECRET rule
did in a field named for a credential (password=, api_key=, X-Api-Key,
refresh_token, session_token, token), or it was masked before in full.
32 hex digits without hyphens the model calls a secret in prose ("the api
key is 9f8e…") stay masked; a UUID it calls one does not, as before.
Run in ~/workspace/projects/magpie-wt/mask-act at this tree:
- TestIDsGoAsWritten: 7 id shapes × 22 contexts kept, 7 credential
contexts masked, the model's every label kept, a known phone not found
inside an id, a phone and a card number of their own masked, the user's
word masked. With noIDs taken out of mask(): 108 failures; restored: ok.
- The first full redact run caught two of my own mistakes, now fixed:
idAround didn't check the run's inside, so a 33-character IPv6 address
counted as an id (TestMoreKinds), and the model's 32-hex API key went
unmasked (TestModelSecretIsNoID).
- go test ./internal/redact ./internal/maskrec ./internal/gwmw
./internal/settings ./internal/gateway (-timeout 45m, -count=1): all ok (gateway 439s)
- gofmt -l: none; go vet ./internal/redact for darwin, linux, windows: ok.
Not tried: a real request through a running gateway with the local model
on; the model's labels are simulated with fakeModel.
|
||
|
|
c036d6c34a |
gui: what the window shows can be selected and copied, its controls can't
Outvi V on Discord: the page is user-select: none as a whole, so nothing could be selected or copied into a bug report, only the few places that opted in. Two rules at no specificity after body in app.css now make content selectable: paragraphs, pre and code, a detail's values (dd, td), hints, notes, every error class (.err, .error, *-err, *-error), a conversation (.sess-talk, a subagent's too), a request's story and log on Routing (.rt-log, .rt-steps, .rt-time). Controls stay unselectable with what is in them, as in a Mac app: buttons, labels, summary, select, the navigation, menus (.pop), tabs, switches, segments, grips, draggable rows. With no specificity, a view's own rule still decides (a list being sorted, a blurred value), and a field stays a field. An account's or a key's name was selectable by accident through its row (a button inside .accts > [data-account-id]); .acc .rename now says so itself, and account-arrange keeps checking it. user-select.test.cjs: on Routing, a mouse drag across a vendor's error in a request's story selects it; a drag across a request's row selects nothing, and the row still opens on a click with text selected elsewhere; no nav, button, tab, segment or option is selectable, and no field is unselectable. Both engines, en/zh/ja/de, 1100 and 420 wide: 16/16, twice. Red on HEAD's app.css (16/16 fail: 'none' !== 'text'). Ran: click-scroll 22/22, agent-grip 10/10, provider-order 6/6, search-order 16/16, account-arrange 2/2 (red in chromium before the .acc .rename line), account-alias 20/20, panel-arrange 8/8, sessions-talk 4/4, sessions-subagents 40/40, usage-ledger-detail 6/6. Not tried: the app's own webviews (WKWebView, WebView2, WebKitGTK); only Playwright's Chromium and WebKit. Run for this batch of seven commits (devin, routing zh, qoder, masked words any case, Long conversations, Claude subagents, user-select), in a worktree, sandbox HOME, never against live configs: - At e352cc823 (tree ea497c9f5, on origin/main |
||
|
|
2ea148b103 |
gui: Claude Code's unset subagents read "Claude Code's own pick", not "same as model"
KorenKrita on Discord wanted Claude Code's subagent model left unset so
Claude Code picks. magpie already leaves env.CLAUDE_CODE_SUBAGENT_MODEL
out when the field is unset (writeTiers deletes it, setSubagent too),
but the GUI called unset "Same as model", which says the subagents run
on the main model. They don't: Claude Code 2.1.306 (read from the
installed binary) takes the Agent tool call's model, then the subagent's
frontmatter model, then the variable, then the lead's model; the
built-in Explore inherits, capped at opus.
The unset option is now "Claude Code's own pick", its note "{model}
unless the lead or the subagent names another", and the field's title
says what a model set there does. Translated in zh, zh-TW, ja and de.
Codex keeps its own lead's-pick wording.
Tests:
- TestClaudeSubagentsUnsetWriteNothing: routed, pick a model, take it
back, move the main model; the variable stays absent. Red when
writeTiers writes the main model for an unset sub (broken by hand).
- claude-subagents-pick.test.cjs: 5 languages x 2 widths x 2 engines,
20/20. Red on HEAD's app.js and i18n.js (chromium 0/10).
- Ran: codex-subagents-lead 20/20, claude-auto-mode 8/8, desktop-tiers
4/4, tier-effort 8/8, i18n-keys 3/3; go test -run TestClaude
./internal/agent ok.
Not tried: a real Claude Code session picking a subagent model with the
field unset.
Run for this batch of seven commits (devin, routing zh, qoder, masked words
any case, Long conversations, Claude subagents, user-select), in a worktree,
sandbox HOME, never against live configs:
- At e352cc823 (tree ea497c9f5, on origin/main
|
||
|
|
9691997bb0 |
gui: Long conversations stays in Settings when no Codex or Claude Code is here to hold it (Linka)
Linka on Discord runs magpie in Docker, with no agent installed. |
||
|
|
9a0df964e4 |
gateway: a relayed Chat reply that made calls and ended "stop" ends "tool_calls", streamed and whole
喜欢一个人 on Discord (v0.1.1299, deepseek-v4.1-flash through a relay, usage row stop "stop"): the agent loop ended mid-turn. Their first ask: when a reply calls tools, finish_reason must be tool_calls on every path. Checked each path on origin/main |
||
|
|
d1173c8c16 |
gateway: DeepSeek's calls close left in a reply's text (</||DSML|| calls>) is dropped, after a call the upstream made too
喜欢一个人 on Discord (v0.1.1299, macOS arm64, a Responses client translated to Chat, deepseek-v4.1-flash through a relay, 232312 in / 645 out, stop "stop"): the client got the text "\n</||DSML|| calls>" and the agent loop ended mid-turn. Their history has ||DSML|| calls> 712 times against 133 <||DSML||invoke. Reproduced on origin/main |
||
|
|
b00c82acfa |
masking: each kind is masked, sent with a warning or held back; a Never mask list and Try it (#1977)
Settings › Privacy gets two sections under What to mask:
- When a value is found: Mask, Warn or Block per kind (redactActions;
a kind left out is masked). Warn sends the value as written and records
it with a placeholder nobody remembers, not counted as masked. Block
masks it as before and the gateway answers 400 naming the kind and the
value's hint, never the value, with nothing sent (maskBlocked); the
record is kept as Blocked. The secret kinds come first, the personal
ones behind Show all kinds. A Never mask list (redactAllow) lets a whole
value go as written in any case; a longer value it is part of is masked.
- Try it: POST /api/masking/preview masks a text as a request would
(redact.Preview) and remembers nothing: no placeholder stands for it
afterwards and its values aren't masked later as seen before. The page
shows the vendor's text, what was found and what would be done, and
keeps the text in no storage.
The masking card counts requests held back and values sent as written; a
call whose values only went as written gets an amber badge on Recent calls
and the Routing log. zh, zh-TW, ja and de throughout. Docs: gateway-routing
and gui-shell.
Broken by hand: the new GUI badge assertion fails on the old maskedBadge
(no .warn badge drawn); TestSettingsSaveKeepsWhatItDoesNotSend went red
until the two settings were in its fixture; "{n} held back" turned
i18n-keys red against the routing plugin's "{n} held" and was renamed.
Run at this tree (base origin/main
|
||
|
|
9b0f48612b |
gateway: a plugin's model that searches by itself can be the web searcher
01huadalang (Discord #feedback, 10-20): Settings › Web search offered only Antigravity; Trae's search model couldn't be picked, "可能也有别的模型能搜索 但是识别不到". partSearcher and modelSearches answer false for every provider with an account behind it, so no plugin-served provider was ever offered, and a plugin had no way to say which of its models searches. A plugin now marks such a model with `searches: true` (in its config models or the list its models hook gives). host.js passes it on, plugin.Model carries it, and pluginCatalog makes it WebSearch "native". partSearcher offers a plugin provider with such a model, with those models only, at rank 4 (as Command Code's search models); remoteSearch asks it in plain words, the way it asks Command Code's. A client's own web_search sent to that model still goes to magpie's searcher (searchesModel is unchanged): the plugin's upstream takes no web_search tool. Behaviour change: a marked plugin model ranks ahead of Antigravity and Google (rank 5) when magpie picks the searcher itself. Run: - TestPluginSearchModelIsASearcher (new; a fake plugin's model marked searches answers a weather question with a URL): red on the old code (the picker offers [], want the plugin's fake-search alone), green now. - Broken by hand: host.js without the `searches` passthrough; the test goes red at the picker. - gofmt -l clean; go vet darwin, linux -tags nogui, windows on gateway, plugin, provider, catalog. - set -o pipefail; go test -timeout 45m ./... at this tree: 68 ok, no FAIL. Not tried: the Trae plugin itself. It declares nothing about search yet; marking Trae CN's search_agent there needs a Trae account to try it with, which this machine doesn't have. No GUI files changed. |
||
|
|
f5b0157420 |
gateway: a tool Claude Code's tool search loads goes to OpenAI's Responses API where it was loaded (#2660)
Through /v1/messages translated to a Responses provider, every deferred
tool ToolSearch loaded joined the top-level tools on the next request, so
the prompt changed from its first bytes and the cache missed on each load
(maximia's probe: cached tokens dropped on every request after a load).
Now, where Request.LoadedInPlace is set, a deferred tool (defer_loading,
Tool.Deferred) that a tool_result's tool_reference names (toolRefs,
Part.Loads) goes in an {"type":"additional_tools","role":"developer",
"tools":[...]} item right after the run of tool outputs that loaded it,
once, and not in tools (buildResponses). Parallel results and one result
naming several share one item; a tool named again isn't repeated; the
output's text is as before. A history whose loading result is gone
(compaction, edits) puts the tool back in tools: a new prefix, expected.
Scope (loadsInPlace): OpenAI's own API with a key (api.openai.com,
*.api.openai.com), whose tool search guide documents the item and says
its tools load at the end of the context so the cache is kept; and a
provider the user sets with `magpie provider set <id> additional-tools=on`
(Provider.AdditionalTools, kept by the GUI's save like codexAsSent).
Nothing else: xAI answers the item 422 (#350), the ChatGPT backend has
been seen taking it only for Codex's Responses Lite, Azure, plugins and
relays are untried. An upstream that refuses a request holding the item
with a 400/422 naming additional_tools is asked again with every tool in
tools, logged ("turned away additional_tools ... loaded tools go in tools
from now on") and not sent the item again while magpie runs.
Not handled: a tool a tool_addition block in a system message loads (MCP
late tools, the advisor) stays in tools. Not tried against a real
upstream: no OpenAI key or custom Responses relay was used; the item's
shape and position follow OpenAI's docs, and the fixtures follow
maximia's three-request probe (Claude Code 2.1.302) and the
tool_reference shape Claude Code 2.1.306's binary writes.
Tests: TestLoadedToolsKeepThePrefix (top-level tools and instructions
identical across the three requests, each input a prefix of the next),
TestLoadedToolsInOneItem (parallel, batch, repeat), TestLoadedToolsWhereNotTaken
(unsupported upstream unchanged; compacted; non-deferred),
TestLoadsInPlaceScope, TestLoadedToolsThroughTheGateway (off by default on
a relay, on with the flag, refusal retried without the item and not sent
again), TestAdditionalToolsPair (CLI). Broken by hand: with the
buildResponses placement disabled, the first two and the gateway test go
red; with the refusal retry disabled, TestLoadedToolsThroughTheGateway
goes red.
Run at cff7dc67d (this change on
|
||
|
|
62a3e79b7b |
redact: more file names that read as addresses stay as written (willz on Discord)
willz (#feedback) asked to tell image names like image@2x.png apart from emails. |