ccbbcbffcba0507ee3536bf63e5fb56a12e7d5a9
4291
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 |
||
|
|
4683a0382c |
provider: a saved ChatGPT account Codex is signed in to is refreshed in Codex's auth.json, not in its copy
A ChatGPT account switched in to Codex is one sign-in in two places:
logins.json's copy and Codex's auth.json hold one refresh token.
renewSaved refreshed the copy whenever it was asked to: a provider made
for the account while another was Codex's, held over a switch
(SwitchWhenSpent, keep-first), a usage or models read, keep-alive or a
revoked-token check decided "not the live one" just before a switch.
OpenAI rotates the refresh token as it answers, so auth.json was left
with a spent one. The Codex app of an edu or business workspace fetches
its workspace config bundle (/backend-api/wham/config/bundle) at start
with it; the refresh is refused (refresh_token_reused), app-server
answers configRequirements/read with -32603 "failed to read
configuration layers: Your access token could not be refreshed ...",
and the app stays paused on "无法加载组织设置". Reinstalling the app or
changing the preferred account doesn't help: auth.json stays.
renewSaved now asks, under savedTokenMu (which a switch holds too),
whether the saved account is the one Codex is signed in to (sameLogin,
or the same refresh token) and renews it through codexTokenRenewing on
Codex's own store instead.
Reported by 万贤凯 on Discord (two edu_plus accounts, "Codex 始终登录首选
账号" on, both used up).
Run:
- TestSavedRefreshOfCodexOwnRenewsCodexOwn: red on the old code (auth.json
kept refresh token "r" after it was spent), green with the fix.
- Codex app-server 0.163.0-alpha.10.2 in a sandbox CODEX_HOME, edu_plus
auth.json, fake bundle (401) and token endpoint (refresh_token_reused):
configRequirements/read gives the -32603 above, the reply the desktop
shows as the org-settings dialog. magpie's openai_base_url and
[model_providers.magpie] don't move the bundle request (it goes to
chatgpt_base_url, which magpie never writes).
- gofmt -l; go vet darwin, linux -tags nogui, windows.
- Full suite (go test -tags nogui -timeout 45m ./..., through suite-lock,
at
|
||
|
|
a9a001a7a6 |
usage: a window's name too wide for its column goes on to a second line, not under the window beside it (rtbeilin on X)
rtbeilin's ZCode card (X, 10-24) has two windows of one plan side by
side, named by the plugin's byPlan "ZCode 1024 Dev Day · GLM-5.3…",
and the first name ran on under the second window's: the name span was
nowrap with nothing to stop it. Stacked (quotaFit already stacks a card
whose name and count don't fit side by side, and a name wider than its
column always is), the name (now .quota-name) wraps inside its column,
breaking anywhere if a word is wider still. Not cut with an ellipsis:
two windows of one plan differ only at the end of their names.
Run at this head (origin/main 3b10a403d's successor), Chromium and WebKit:
- quota-name-wrap.test.cjs (new): the reporter's two windows, en, zh,
zh-TW, ja, de at 380, 600 and 1100px; each name is inside its column
and not cut. Red on the old CSS in both engines ("runs past its
column (0, -5.3)" at 380px).
- every other quota-*.test.cjs and i18n-keys: 140 pass. Red the same on
main without this change: quota-count-wrap in WebKit at 1100px
(#3404, #2228) and quota-reads WebKit de 360 (#3406, #2150).
Not tried: the real tray panel with a ZCode account.
|
||
|
|
dd1e8822d9 |
provider: the ZCode move installs zcode-auth 0.1.24, so a Claude Code subagent on ZCode sees Bash, Read and Write
小八 on Discord (10-24): through magpie's ZCode plugin (glm-5.3, glm-5.3-flash) a Claude Code subagent's tool list held only deferred MCP tools; Bash, Read and Write were gone, the main conversation was fine. api.z.ai's Anthropic endpoint, given a tool named exactly ToolSearch, shows the model no tool but the ones a tool_reference loaded (input tokens 2886 with ToolSearch, 2439 with no tools, 6346 with it renamed). zcode-auth 0.1.24 (plugins d1b6500) sends the search as ToolSearchTool, without defer_loading or the placeholder, and renames the model's calls back. The Zhipu/Z.ai presets on the gateway's Anthropic route are the same upstream; the cause is on #3253. npm view @magpie-community/opencode-zcode-auth version --prefer-online: 0.1.24 at 23:44 UTC. The plugins publish run is red only for think-tags' known E404 (plugins#180); zcode's line is "+ ...@0.1.24". Run at this tree: gofmt -l internal/provider (clean); GOOS=linux, windows, darwin go vet ./internal/provider (clean); go test -count=1 -timeout 45m -ldflags='-s -w' ./internal/provider ok 86s (the disk had 250MB free, and the unstripped test binary failed to link: no space left on device). Not run: the full suite (same disk). |
||
|
|
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. |
||
|
|
1c617c1532 |
usage: the Requests chart can be drawn as lines, kept per viewer (molvqingtai, Discord)
molvqingtai asked on Discord for the request chart on Usage > Requests to be a line chart. A small two-icon switch (bars, lines) now sits in the chart's header row beside the Token / Cost / Requests / Speed tabs. Bars stay the default. The choice is kept in localStorage magpie.ledChart, next to magpie.ledMetric; any other value, or a read that throws, gives bars. Lines cover every tab. Tokens, cost and requests draw the stacked totals as cumulative lines with a faint band per model and "other" last, so the top line meets the stacked column's top. Speed draws a dashed all-models line and each model's own line, broken where a model has no value. Tooltip, day pick, ranking hover (it now strokes a series instead of filling it), the time-zone handling and the empty state are the columns'. drawLedColumns in core app.js gets one hook, box.drawn, which the Usage page sets; the line code lives in plugins/usage/page.js. The tray panel's chart is unchanged (bars). app.js is 1,343,276 bytes, under TestCoreScriptBudget's 1,343,324; the budget is not raised. New test usage-chart-line.test.cjs (en, zh, zh-TW, ja, de x light, dark x 1180, 420): bars by default, translated labels, the switch inside the header with no sideways scroll and no left border, a click doesn't scroll the page, lines still chosen and drawn after a reload, the top line within 1px of the column top for tokens, cost and requests, speed's dashed line and broken runs, tooltip and ranking hover, the empty state; a "pie" value and a throwing getItem give bars. Run at |
||
|
|
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 ( |
||
|
|
a6a3dbde83 |
provider: the ZCode mover's min is 0.1.23, so a second gift plan's GLM-5.3 shows beside a spent one (01huadalang on Discord)
01huadalang's ZCode account has two gift plans, the 1024 Dev Day plan and
the new-user plan. Once the new-user plan's GLM-5.3 was used up the card
showed GLM-5.3 at 0 and never the 1024 plan's GLM-5.3. The plugin named
every bucket by its show_name alone and sent them in the balance's
order, so the account row's first two windows were the spent plan's and
the live plan's allowance sat in the tooltip under the same name.
Plugin 0.1.23 (magpie-community/plugins 1f8d38b) names each bucket after
its plan when there are several ("ZCode 1024 Dev Day · GLM-5.3") and puts
the buckets a request spends before those set aside. `npm view
@magpie-community/opencode-zcode-auth version --prefer-online` gives
0.1.23.
Run at this tree (origin/main
|
||
|
|
a93190ae19 |
agent: the Codex threads test names what its HOME still holds after removal (#3422)
TestCodexThreadsComeBackOffMagpie/disconnect went red once on macOS CI
(
|
||
|
|
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
|
||
|
|
2b4c0664ee |
update: the fake open in the relaunch test keeps -n on Linux
TestRelaunchOpenTriedAgain was red on ubuntu CI at
|
||
|
|
a218946341 |
gateway: the text-calls tests keep what a run is told as it is written
TestClaudeTextToolCallsUnstreamed was red on macOS CI at
|
||
|
|
27a8255fd7 |
update: the Mac relaunch opens a new instance (open -n), not a reopen of the gone one (Linka on Discord)
Linka's log (Discord, macOS 27.0.1, v0.1.1308) shows the cause of the
"magpie stays closed after updating itself" report that molvqingtai also
hit with the screen locked. After the old process's "Termination
complete", open found LaunchServices still holding the gone app as
running ("Specified target process 41267 does not exist"), so it sent
that process a reopen Apple event (aevt/rapp) instead of launching the
bundle, and failed with -600 procNotFound ("LAUNCH: Launch failed in
CSUI"). The retries from
|
||
|
|
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.
|
||
|
|
f3eb92924e |
update: the Mac relaunch starts the bundle's program when open never works (molvqingtai on Discord)
molvqingtai (Discord, 10-24): on macOS, magpie's restart after a self-update still leaves it closed on versions after |
||
|
|
843417957c |
provider: the ZCode mover's min is 0.1.22, so a Start Plan request goes with ZCode 3.16.3's headers alone (01huadalang on Discord)
01huadalang got the Start Plan's 405 again on plugin 0.1.21. A plugin provider has no account of its own in the gateway, so Claude Code's own headers (anthropic-beta, x-app, x-stainless-*, anthropic-dangerous-direct-browser-access, x-claude-code-session-id) and ?beta=true reached the plugin. 0.1.21 passed them on to zcode.z.ai. The retired built-in never sent them. Plugin 0.1.22 (magpie-community/plugins 57ec655) builds a Start Plan request's headers from scratch, as ZCode.app 3.16.3 sends them: the new x-zcode-query-source: main_turn, X-Os-Version as os.release(), and app version 3.16.3. It also drops the URL's query. `npm view @magpie-community/opencode-zcode-auth version --prefer-online` gives 0.1.22. Run: go build ./..., go vet ./internal/provider, and go test -run 'Mover|Moved|Migrat|ZCode|Zcode|Min' ./internal/provider ok. Plugin bun test (temp HOME): 90 pass. Not tried: a real Start Plan account. Whether zcode.z.ai keys on these headers is not established, and an IP block is still possible. |
||
|
|
a7ed2f61d9 |
antigravity: a model Google marks disabled is left out of the list (kwanyu on Discord: gemini-4-argon-disabled answered 404)
kwanyu picked an Antigravity model in DeepSeek Harness and every request
was a 404 "Requested entity was not found" for gemini-4-argon-disabled.
The id is not made by the Harness: its source (HEAD 22ddee379), the
bundled pi-ai 1.3.0 and dsh's patch add no suffix to a model id, and
magpie's gateway has no generic suffix either. It is Antigravity's own:
a real account's fetchAvailableModels lists gemini-4-argon-disabled with
"disabled": true (magpie's log: "disabled [gemini-4-argon-disabled]"),
and modelInfo kept every disabled model in the list ("still listed, as
before", since
|
||
|
|
b437e4adb4 |
settings: a proxy's username and password have fields of their own for every proxy, HTTP too (微雨南山 on Discord)
Settings > Proxy > Custom now shows Username and Password fields beside the
address for every proxy kind. Before, only a SOCKS5 address had them (the
password is masked). An HTTP or HTTPS proxy's login had to go inside the URL,
so a password holding @ : / % # or a space broke it. Each field is
percent-encoded (encodeURIComponent) when the address is saved.
The setting's format is unchanged: still one URL with the login as its
userinfo. A proxy saved before with user:pass@ loads into the fields. It is
split the way Go's url.Parse splits it (last @, then first :), so
"https://al%20ice:se@cr%23et@proxy.example:8443" shows "al ice" and
"se@cr#et". It is not split through WHATWG URL, which would add a "/" or drop
a default port. A part left as it was loaded keeps its own escapes, so
non-UTF-8 bytes survive. A login pasted into the address moves into the
fields. Describe, Redact and the status line already hid the userinfo
(#1886), and a new test checks that again.
Credit: 微雨南山 on Discord (#feedback), who asked for macOS-style
address / username / password fields after a special character in the
password broke the URL.
Tests:
- internal/netproxy/login_test.go: the login "me@corp:x" / "p@ss:w/rd% #1 x",
saved as the page encodes it, reads back as typed. It signs in to a fake HTTP
proxy (Basic Proxy-Authorization), and to a fake SOCKS5 proxy through both Go's
transport and the plugin bridge's socksHandshake. It also reaches a CLI's
HTTPS_PROXY. One character off is refused (407 / SOCKS fails), and Describe and
Redact show no part of it. TestBunProxyLoginWithReservedCharacters signs in with
the real bun 1.4.2's fetch({proxy}). These pass on the old Go code too: the Go
side needed no change.
- internal/gui/tests/settings-proxy-auth.test.cjs, Chromium and WebKit, en zh
zh-TW ja de, at 560 and 375px: an HTTP proxy has the fields, the login
round-trips encoded and comes back decoded, the password is type=password, and
the status hides it. A login saved in the address loads into the fields, and
Enter on it saves nothing. On the old app.js both tests fail in every language
checked ("an HTTP proxy has a username field / false !== true"; the address
still showed 'https://al%20ice:se@cr%23et@proxy.example:8443').
Run:
- gofmt -l: empty.
- go vet (darwin), GOOS=linux go vet -tags nogui, GOOS=windows go vet: clean.
- Full Go suite at c7ad43426 through the suite lock (-tags nogui -timeout 45m):
68 ok, one red, internal/gui TestCoreScriptBudget. The first app.js was
1338904 bytes over 1338084. The helpers and comments were tightened (not the
budget raised): app.js is 172 bytes under its parent. Then internal/gui,
internal/netproxy and internal/settings: ok at the final tree. After the
rebase onto
|
||
|
|
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
|
||
|
|
c551a22997 |
provider: the ZCode mover's min is 0.1.21, whose Start Plan request keeps ZCode's three system blocks (plugins #343)
zcode.z.ai answers a Start Plan request whose system has a fourth block with 405/3012 "request has been blocked due to unusual activity", and the plugin up to 0.1.20 sent the agent's system prompt as that fourth block, so every agent was turned away on a Start Plan account (fordlyn). 0.1.21 (plugins 44036e2) joins it to the end of ZCode's third block, as ZCode 3.14.3's ContextBuilder joins every dynamic system section. keepMovedCurrent brings every moved user's plugin up to it. npm view @magpie-community/opencode-zcode-auth version --prefer-online: 0.1.21 (its tarball carries the #343 change). Run: gofmt -l internal/provider (clean); GOOS=darwin|linux|windows go vet ./internal/provider/ (ok); go test -timeout 45m ./internal/provider/ (ok, 98.9s). Not tried against the real API: no Start Plan account at hand. |
||
|
|
fa22bc6467 |
cline: the Upstream tick holds Pass DeepSeek on DeepSeek with has, and leaves the plugin's to it
hy125245 (X, 10-23) found that providerOptions.gateway.only ["deepseek"]
alone does nothing on ClinePass: a fake upstream still succeeded. Adding
has ["vision","implicit-caching"] beside it routed the request to
DeepSeek (finalProvider deepseek, ~200-246 tok/s, creditsUsed 0) and made
a fake upstream fail with "no matching upstream".
Changed:
- The built-in ClinePass's Upstream tick now sends, for cline-pass/deepseek*,
providerOptions.gateway {only:[deepseek], has:[implicit-caching]}, with
"vision" first when the model takes images (live catalog) or the request
carries an image part (messages[].content[].type image_url/image/
input_image; the word in text does not count). GLM, glm-5.3-flash's
OpenRouter provider.only and the client's own providerOptions/provider are
as before.
- On the Cline plugin's provider the tick no longer pins cline-pass/deepseek*:
opencode-cline-auth 0.1.11 pins them itself by default, with the has
filter and one unpinned retry on "no matching upstream" or a 5xx, and it
keeps a body's own providerOptions, so magpie's only alone would take its
place. The plugin's GLM pin from the tick is unchanged.
Run at
|
||
|
|
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 |
||
|
|
03951798a1 |
gui: the sidebar's magpie sits 6px further from the traffic lights
The owner asked for a little more room between the Mac window's traffic lights and the logo at the sidebar's top. .side-top's left padding goes from 84px to 90px (still divided by --zoom, so it stays in points). Run at this head: brand, side-width, sidebar, side-toggle, header-zoom-fit and sidebar-tab-top GUI tests, chromium and webkit, 92/92 on three runs. The first run, at load ~290, had 6 reds whose names were lost (only the log's tail was kept); the three runs after it, logs kept whole, were green. Measured in WebKit at 2x: the logo's left edge 84 -> 90px, and at the narrowest sidebar (168px) the name ends at 163px, inside it. Not tried: the real Mac app. |
||
|
|
3b10a403d1 |
provider: WorkBuddy's mover asks for plugin 0.1.31, which renews a 401 once and says to sign in again
wenchen855443 on X reported that WorkBuddy requests return 401. Plugin 0.1.31 (magpie-community/plugins f658842) handles a 401 on a chat or a usage read like this: - It renews the sign-in once, whatever the token's time, and sends the request once more. A token another process saved since is used first; a desktop sign-in re-reads the app's file instead of renewing. - If there is no new token, or the retry is refused too, it answers 401 with a message to sign in again: Providers → WorkBuddy → this account's Sign in again. - It sends X-Magpie-Sign-In: expired only on WorkBuddy's word that the sign-in is gone: the refresh token was refused, or the token got invalid_token with nothing to renew it with. Only the min changes. keepMovedCurrent brings every moved user's plugin up to it. The min is the version npm has at landing: npm view @magpie-community/opencode-workbuddy-auth version --prefer-online gives 0.1.31. The publish run (39967751526) is red only for think-tags' known E404 (plugins#180); its log shows + ...workbuddy-auth@0.1.31. Run (rebased on origin/main, run again after the rebase): - go test ./internal/provider/ -run 'Mover|Moved|Min|Migrat|Move|WorkBuddy|Retir|Plugin' -count=1, with a scratch HOME: ok. - gofmt -l internal/provider: clean. - GOOS=linux and GOOS=windows go vet ./internal/provider/: ok. Not tried: the full suite. The change is one string on the min line, and the mover and plugin guards above cover it. |
||
|
|
ade2f06288 |
gui: a new partner's tile in the add sheet keeps a small dot until it is opened
yetone asked that a new partner's card carry a dot too, small and quiet: "有了新的合作方、供应商,它对应的Card上应该也有小点来提醒一下用户…不要太打扰 用户,也不要太丑". The dot on the + button ( |
||
|
|
91b0be8363 |
routing: a group's row opens into its editor and folds back in motion, and Save shows it
The owner asked (10-23) for iOS-like motion when a routing group opens and
folds, and for a save animation. drawGroups now measures each slot (a
group's row or its editor, data-gslot) before replaceKeeping and, where a
slot changed between row and editor, animates its height from the old one
to the new: opening on SPRING (570ms) with the editor's parts coming in
staggered from 6px above, folding on IOS_EASE (420ms) with the row's
content fading in. A new group's editor grows from nothing. Save shows a
spinner while the gateway saves; the saved row folds from the editor's
height and lights up, with a check that pops in by its name and goes
after ~1.5s. With reduced motion asked for nothing moves.
Folding from the editor's foot (where Save and Cancel are) would let the
browser clamp the shorter page and leave the row above the window
(WebKit showed it). foldInSight moves the page up with the fold, step
for step with the slot's height, as the reader's scroll; groupAction's
own keep-the-saved-row-in-sight check is skipped when the fold did it.
Run at this head (rebased on origin/main), Chromium and WebKit:
- group-morph.test.cjs (new): en, zh, zh-TW, ja, de at 1100 and 420px;
the editor grows from the row's height, the row folds from the
editor's, Save spins, the saved row folds from the editor's height
with its check, the row is in sight after each fold; reduced motion
has no height animation.
- routing-save, group-fold, routing-group-fold, routing-save-blank,
routing-save-keeps-the-row, group-editor-align, group-editor-fits,
i18n-keys.
- go test ./internal/gui -run 'Budget|Plugin|Asset': ok.
Broken by hand: without morphSlots the new test is red ("the editor grows from the row's 57px, not null", Chromium); without foldInSight it is red in WebKit ("the folded row is in sight").
Not tried: the real Linux (WebKitGTK) app.
|
||
|
|
7e0c031059 |
provider, gateway: the magpie serving the gateway fetches the partner list every hour, asked for or not
yetone: 改成后台每小时定时请求一次. Until now the list was fetched again
only when the Add sheet or the TUI asked for it, so an app left open on
another page never learned of a partner added.
KeepPartnersFresh runs beside the gateway's other Keep* loops: it
fetches when the gateway starts, then whenever partnerNext is due (an
hour, ten minutes after a failed fetch). It shares Partners'
one-fetch-at-a-time flag, so it never runs beside a fetch a page
started; while one runs it looks again a second later. Partners and
PartnersNow keep their own due check for a magpie that doesn't serve
the gateway (the CLI, a TUI beside a running app). MAGPIE_PARTNERS=off,
and every test (partnersSource), still asks nobody.
Run at this tree (base
|
||
|
|
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
|
||
|
|
e96d577f28 |
gui: Privacy's kept-from-vendors card, redrawn (the owner's Night design)
The card Settings › Privacy opens with ("没让厂商看到的") is redrawn to
the design the owner approved: quiet, the same background and 1px line
as every other card, no shadow, no gradient, and no shield in the head.
- The number of values masked, in full (5,812, not 5.8K), large and
thin, with Different values, Requests (and Held back / Sent as written
when there are any) on hairlines beside it, over the days' bars.
- From the agents, through this computer, to the providers: a hairline
per share of each agent's values, uneven on the way in, even on the
way out in the accent, crossing a ticked line under the shield, with
a value (round) and a placeholder (square) moving along them, on a
dot grid. Drawn in the middle's own pixels on every resize.
- The latest request with lines: what the vendor saw, placeholders
marked; "As written here" swaps in each value from this magpie's
memory (/api/masking/value, asked only then, never written down).
- What was kept and what found it, beside the values masked most as a
ranked 01-08 list with a hairline share; pointing still shows the
value, a click opens its records.
- Each part rises out of a blur in turn on first draw; reduced motion
turns the moving parts off.
New strings "Different values", "As written here" (zh, zh-TW, ja, de);
"On this computer" is the library plugin's key, so not reused. The
seven strings only the old card used are removed from i18n.js.
app.js stays under its budget with no raise (1,338,079 <= 1,338,084):
the dot grid is a CSS mask, the lines' dash array is CSS, and the
redraw's own code was tightened until it fit.
Tests:
- masking-records: waits for the hairlines, checks the card has no
box-shadow, and toggles the latest request to "As written here" and
back (the value shown, a forgotten one greyed, the marks back).
Viewport 1800 tall so the clicks don't scroll the page.
- mask-actions and privacy-model: the taller card pushed their rows out
of the viewport (mask-actions at 640px de, privacy-model's model row
in WebKit), so they wheel to the row first, as reach-based tests do.
Both were red on my change and green on its base
|
||
|
|
0c679c6404 |
agent: DeepSeek Hermes, dsh's web UI in a window, is found and wired as dsh
WuSix on Discord: magpie's Agents page didn't find the "DeepSeek Hermes"
desktop app, so its models were added in the app by hand.
DeepSeek Hermes is motongv/deepseek-hermes-desktop 1.0.0, an Electron
window around `dsh web` (not Nous Research's Hermes Agent). Read from its
real release files: the macOS zip's Info.plist (bundle id
com.deepseek.hermes.desktop, 1.0.0) and the Windows NSIS installer's
header (InstallLocation under HKCU/HKLM Software\df9f5892-ad1c-5623-a260-
30fb0acc7e55, default %LOCALAPPDATA%\Programs\DeepSeek Hermes\DeepSeek
Hermes.exe). Both bundle @deepseek-ai/dsh 0.1.0-rc.6, which boots the
`web` profile in ~/.dsh (DSH_HOME). There is no Linux build.
Before: with no dsh CLI the dsh row was 未找到 CLI with its settings
hidden, an unopened app wasn't found at all, and a pick would have made
DeepSeek Harness Desktop's profiles/desktop, which Hermes never reads.
Now:
- desktopapp: installed() also takes the Windows exe under the app folders
or the registered InstallLocation; HasApp uses it.
- dsh: DeepSeek Hermes counts as dsh's app. With it (and no Harness
Desktop) magpie writes profiles/web/cordis.patch.yml and the key in .env
only. rc.6's dsh-credentials-local reads only the flat store and refuses
to start on the version 1 .credentials.yaml magpie writes for Harness
Desktop ("the value for "version" ... must be a string"), so that store is
not written, and one magpie wrote before (nothing but its key) is
removed. A store with the user's own keys is left alone. With Harness
Desktop also installed, its profile and store are used as before.
- noticeDsh6 for an unopened Hermes, in zh, zh-TW, ja and de.
Run:
- Real rc.6 in a sandbox HOME (npm --before=2026-08-17), never the live ~/.dsh:
- `dsh -p headless` with magpie's route and the key in .env only against
a fake gateway: POST /v1/chat/completions, model deepseek/deepseek-chat,
Bearer key, answered.
- With magpie's v1 store: `dsh web` exits on the error above; without it,
it boots.
- A web profile holding only magpie's cordis.patch.yml, `dsh web
--dump-config`: rc=0, dsh added package.json, cordis.yml and
pnpm-workspace.yaml, the patch was byte-identical after, and the
composed config has the magpie route, agent-default-model and
web-search-deepseek.
- New tests TestDshHermesFound/Windows/Wired. On the old code (
|
||
|
|
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
|
||
|
|
8ef9fc578c |
provider: a message sent again to the ChatGPT backend goes without its status, as it goes without its id (Doby on Discord)
Doby on Discord: Pi 1.4.0 on Codex through magpie 0.1.1327 is turned
away on every continued conversation:
400 {"code":"unknown_parameter","message":"Codex: Unknown parameter:
'input[8].status'.","param":"input[8].status","type":"invalid_request_error"}
Pi (pi-ai's convertResponsesMessages) sends each earlier assistant
message as the output item it was, {type:"message", role:"assistant",
id, status:"completed", content:[output_text]}. codexInput drops every
item's id, since the backend keeps nothing (store false), but kept the
status. A message with no id is read as an input message, which has no
status field, so the backend refused it. Codex itself sends status only
on the items whose schema has one: codex-rs/protocol/src/models.rs gives
Message an optional status beside its id, Reasoning none at all, and the
tool calls (function_call, custom_tool_call, local_shell_call, whose
status is required) their own.
codexInput now drops status from messages (typed or not) and reasoning
items, the kinds whose ids it drops, and leaves it on tool calls as Codex
sends them. Checked for the same gap: the gateway's own Codex relay
(codex_backend.go) keeps ids, so status stays valid there; the only other
id stripping (chat_call_ids.go) is chat tool_calls; no plugin serves
Codex.
Tests: TestCodexInputDropsStatusWithID (provider) covers each item kind.
TestPiResponsesRelayedToChatGPT's fake backend now refuses an item with
status and no id the way the backend does (codexBackendRefuses).
Run at
|
||
|
|
243594410d |
redact: a tool call's arguments stay JSON when a value follows an escape (#3022)
A history tool call's function.arguments is JSON text inside a string.
MaskJSON masked it as plain text, so the n of a \n started a match:
"\n@mcp.tool()" became "\{{EMAIL_…}}()", the arguments were no longer
JSON, and Ollama Cloud refused every turn that replayed the call with
400 "invalid tool call arguments". Reported by xiaobaifly7 and reproduced
independently by Shane-Meng (\n\n\n@pytest.mark…).
Where a string holds JSON text (asJSON), mask now reads it the way the
vendor reads it once it is unescaped:
- unescapedView: a same-length view in which \n, \r, \t, \b and \f read
as control characters and a \u escape reads as line breaks, so no word
starts or ends on an escape's letter. \" \\ \/ stay as written, so the
SECRET rule's \"-aware quote and Windows paths read as before.
- outsideEscapes: any span (rule, word, model, known) that starts or
ends inside an escape is cut back to the escape's edges, so the JSON
holds and what the span held is still masked. A span left empty is
dropped.
- unescapedPut: the value kept for Restore is the unescaped one, so
Restore (which escapes it again in arguments) gives the agent exactly
what it wrote. Before this, a private key's \n came back as \\n.
Ported from ggbdpq's hunt53-f-redact-json-escape. Their test
TestMaskJSONKeepsArgumentsJSON is kept verbatim. Their guard alone let
"\njo@quill.dev" through unmasked, so this port also adds the view, the
trimming and the restore.
Run at base
|
||
|
|
44d8c742bf |
remote magpie: the guide names Settings → Network and sharing → Share on local network
The Remote magpie provider's guide, its "isn't shared" message and the gateway's LAN errors said "Settings → Share on local network", but that switch sits under Settings → Network and sharing. Every place now names the real path: the en key and its zh, zh-TW, ja and de words in i18n.js, app.js's message key, the preset's EndpointHint, the gateway's and agent's English errors, docs/reference.md, docs/integrating.md, README.zh-CN.md and the remote and docker pages of the site (en, zh, ja). errRemoteNotShared names no Settings path and app.js matches its prefix, so it is left as it is. Run at base |
||
|
|
34ad18ed86 |
gui: a session's row helpers move from app.js to the Usage page's script (#3367)
TestCoreScriptBudget was red on main since |
||
|
|
673651e8dd |
agents: the Codex app left on the old list has a Restart that quits and reopens it
The owner (10-23): the Agents row said "quit it with ⌘Q and open it again" and asked for a one-click restart. The app copy's line now has a Restart beside it, like the daemon's. magpie asks the app to quit (osascript "tell application <bundle> to quit", as ⌘Q does), waits up to 30s for every process under the bundle to end, then opens it again. If the app doesn't end in time (for example, it asks something in its window), that is reported and the app is not opened a second time. Only a bundle that StaleCopies lists as an app left on the old list is quit. StaleCopy now carries the app's Bundle. POST /api/codex/app/reopen refuses any other path. This is macOS only; elsewhere the route says so. Run: - go test ./internal/agent -run 'TestCodexAppReopen|TestCodexStale': ok. TestCodexAppReopen went red with the listed-bundle check broken by hand. - go test ./internal/gui -run TestCodexDaemon: ok. - GUI: agent-stale-copies + i18n-keys, chromium and webkit, en zh zh-TW ja de, 980 and 440px: 83 of 83 pass. - Real osascript quit by bundle path and open, on a stand-in .app in the scratchpad: quit ended its process, and open started it again. - gofmt -l clean; GOOS=linux go vet ./internal/agent and GOOS=windows go vet ./internal/agent ./internal/gui: ok. Not tried: quitting the real Codex app (it is the owner's live one), and the full suite. |
||
|
|
3dc25a6168 |
tests: a plugin fake's vendor counts only its own test's requests (#3357)
Run 39913278700 at |
||
|
|
c8c6e7e23f |
gui tests: modal-morph measures the provider row once the list is still
Chromium at 420px read the row 1 to 5px off the strip the dialog grew
from (401 vs 404-406), red 4 of 4 here on
|
||
|
|
db48697d67 |
gui: a segment pressed in a dialog leaves the dialog where it was
The owner (10-23, a screenshot of Kimi Code's add dialog): every click
on a Plan segment moved the dialog a few pixels down.
The dialog's hold (modalMark at pointerdown, holdModal on the redraw)
keeps what was pressed where it was. A pressed .opt scales (.opt:active,
a .14s transition) and is still scaled when its click redraws; an element
that scales was measured by its parent, the .segs strip, 2px (its
padding) above the button's own top marked at the press. The dialog
went 2px down at every click. modalDepth now measures a scaled element
by its own top as drawn unscaled, from its matrix and transform-origin;
one that turns or skews is measured by its parent as before.
Run at this tree (base
|