2c2d2a5e51b543d7f4cbdbffad282faa1c194740
6241
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
2c2d2a5e51 |
gui: Test models says which key a test goes out with, when several are ticked (water5433)
water5433 (cduyzh) on Discord asked for Test models to say which
account a test uses. Their patch added "Tests use the preferred
account/key by default." to the button's tooltip for every provider,
in en, zh and zh-TW. Taken reworded, because it didn't say what the
code does:
- There is no "preferred" key and no other choice of one: TestModels
(keySeeing in internal/provider/test.go) sends each model with the
first ticked key that serves it, made for its endpoint first, so a
key that doesn't see the model is skipped. "By default" promised a
choice the editor doesn't have.
- A subscription account is a provider of its own, so "account" only
confused it; and with one key, or none, there is nothing to say.
So the line, "Each model is tested with the first ticked key that can
serve it", shows only when more than one key is ticked, in en, zh,
zh-TW, ja and de (theirs had no ja or de, and zh-TW said 默認 where
zh-TW says 預設; it now follows the key list's own 勾選/金鑰 words).
app.js stays in the core budget without a raise: the line's comment
and two comments beside it (modelTestWhy, modelTests, testOne) were
cut down.
Test: test-models-key-hint.test.cjs, every language, Chromium and
WebKit, 900 and 390 wide: with two keys ticked the tooltip has the
line, and still has it after a test run puts the title back; with one
of two ticked, and with no key list, it doesn't.
Run (mote-run, at this commit on origin/main
|
||
|
|
bf47eb46c4 |
gui: a long status line goes after 15s at most, not 80ms a character (water5433)
water5433 (cduyzh) on Discord: an error toast stayed on screen far too long. Since |
||
|
|
12599e9cd0 |
signin: ChatGPT signs in by device code, the first way from another computer
curtinp118 on Discord runs magpie on a VPS and opens its web UI from home. ChatGPT's browser sign-in comes back to localhost:1455, which is the viewer's own computer. The page there won't load, and the box's main line said "The account shows up here as soon as you're done", so the sign-in looked broken. The fix until now was to copy the dead page's address back by hand. ChatGPT now also signs in by device code, as `codex login --device-auth` does (codex-rs login/src/device_code_auth.rs). This is startCodexDeviceSignIn, with StartSignInWith site "device": - magpie asks auth.openai.com/api/accounts/deviceauth/usercode for a code with Codex's client id and headers; - the box shows the code and https://auth.openai.com/codex/device; - magpie polls deviceauth/token, where 403/404 means not entered yet, for up to 15 minutes; - it then trades the authorization code at the token endpoint with the returned verifier and the /deviceauth/callback redirect. Nothing listens on this computer. The window starts this way when magpie web is opened from a host other than localhost or loopback (remotePage in app.js). Either way, the box has a link to the other way: "Sign in with a code instead" or "Sign in in the browser instead". A device code that ChatGPT turns away (404) fails, and that box links to the browser's way. Strings are in zh, zh-TW, ja and de. providers-accounts.md describes the flow. This went over TestCoreScriptBudget. It now fits with no raise (1,533,700 of 1,533,802, on main's 1,533,789). The two way-switch buttons share one helper (codexWay), and eight comments on the sign-in code are cut down: openSignInPage, signingKept, startPluginSignIn, the sign-in proxy, signInProxyChoices, Copilot's GHE.com, dropSigningIn and renderStepPlan. Run on mote (the pushed head is rebased on |
||
|
|
4cd01c964a |
agent: a Linux link handler counts only when its desktop entry and program are there (geddy)
geddy (X, 2117406492832010548) added magpie to Cindy on Omarchy: a blank
Chrome tab opened and magpie said it was handed to Cindy. On Linux,
systemLinkHandler took any answer from `xdg-mime query default
x-scheme-handler/cindy` as "found". xdg-utils 1.2.1 (Arch) checks that the
entry exists only for mimeapps.list; a stale line in mimeinfo.cache or
defaults.list comes back as a name with nothing behind it. xdg-open then
can't find the entry and falls back to $BROWSER / chromium, which is the
blank tab.
Now the name xdg-mime gives is looked up in every XDG data dir's
applications/ (with the dash-as-subfolder variants), and its Exec program
must be there (absolute and present, or on PATH). With no entry, the gone
path goes to OpenAppLink, which returns NoLinkHandlerError ("Cindy's links
(cindy://) open …/applications/cindy.desktop, which isn't there") instead
of opening anything. A read error other than not-exist is returned as
unknown. desktopExec (Lody) now shares the same parse (desktopArgs) and
the XDG dir list.
What was run:
- TestDesktopHandlerNeedsItsEntryAndProgram (new) and -run
'Desktop|OpenAppLink|Lody|CommandProgram' on mote (macOS) and Linux
(wsl-run, magpie-desktop, Go 1.26.8): ok.
- Real xdg-mime on Linux in a temp HOME, XDG_CURRENT_DESKTOP=Hyprland, a
stale `x-scheme-handler/cindy=cindy.desktop;` in mimeinfo.cache and no
entry: origin/main said found and handed the link to xdg-open; this
change returns the error above.
- Broken by hand: returning found with no entry turns the new test red.
- gofmt -l clean; GOOS=linux go vet -tags nogui and GOOS=windows go vet
of ./internal/agent on mote: ok.
- go test ./... on Linux: every package ok except reds that fail the same
at base
|
||
|
|
8e9b048b65 |
settings: a row's explanation shows on hover, not under every name
The owner (11-02, a screenshot of Settings › 模型): hide the lines that
explain a setting and show them on hover, so the page reads quiet and
open ("很简洁,很有呼吸感"). Settings' rows now rest as a name and a
control. The pointer resting on a row (450ms, so passing over rows shows
nothing), or a key reaching its control, shows its explanation whole in a
card under the row's name, or over the row where the window ends; the
card takes no pointer and no row moves. It goes when the pointer or focus
leaves, a key is pressed, or the page scrolls (focus's card follows its
row instead, as Tab scrolls it into sight).
- app.css: in #view-settings, under (hover: hover), a .row.pref's plain
.sub lines are clipped out of sight, not removed, so a screen reader
and the search still read them; each carries --hint: 1, which the card
reads. A search shows them in place again, as before. A touch screen
keeps them all.
- Stays in sight: errors (.err, .bad), states (.say, [role=status],
.proxy-check), warnings (.image-gen-hidden, .sync-sign-in,
.vision-not-marked), .no-names, .pv-hits, .feat-why, .font-note, the
proxy in use (#proxySub), and any line with a button, link, input,
code or a search provider's failure note in it (.acts, which
settingshints.js sets on each such line as it is drawn, through a
MutationObserver, so before it is painted: Safari before 15.4 has no
:has(), and old-webkit holds the styles to 15.0). Disclosures stay too: what tracing sends (otel's
sessions row) and the allow list's addresses, as do a disabled
pattern's matches. .say is new, on the lines that are a state, not an
explanation: the version row's update state, a sync's last sync, the
sync notice, the web page's "Served" line, the local masking model's
state (downloading, on, failed; its two explaining lines, before it is
on, are hidden) and what Check in now came to.
- One-line rows are one height: a row left with its name alone was 48
to 51px by its control (the owner, 10-22: one-line rows of one
height), so under (hover: hover) every Settings .row.pref has a 27px
content-box min-height, 51px with its padding, its line above outside
it. Check in now's row aligns to its top, so its result line grows the
row down and the button stays where it was pressed.
- app.js stays in the core budget (1,533,799 of 1,533,802 at this
head, on main's 1,533,789) with three comments shortened, no raise.
- settingshints.js: the card and the .acts marks, a module app.js
imports at start, not in index.html (one line in app.js; old-webkit's
list of such modules names it). Its :focus-visible check is in a try,
as Safari before 15.4 throws on it.
Tests, run on mote (macOS) at this tree:
- settings-hints.test.cjs (new): Chromium and WebKit, 1100 and 420px,
en/zh/zh-TW/ja/de, Settings › Models. At rest the Image recognition MCP
server's line is out of sight and still in the page; a gone model's
error and an unticked image model's warning stay in sight; hover shows
the whole line in a card off the row's name, inside the window, no row
box moved, pointer-events none; the pointer leaving hides it; Tab (or
Option-Tab in WebKit) to the row's copy button shows it; a search shows
it in place; a line given a link shows at once and rests again when
the link goes. 20/20 green.
- Broken by hand: with the clipping rule's body gone, 20/20 red on "the
explanation shows at rest"; with app.js's import line gone, 20/20 red
waiting for the card; with the .acts observer gone, Chromium 10/10 red
on the link line. Before the kept lines and the row height were
in, checkin-now-account was 20 red (the result line hidden, then the
button moved 7px) and settings-general 10 red at 1000px (one-line rows
48, 50 and 51px); both green with them.
- settings-lines-wrap.test.cjs: a hidden explanation is skipped by its
"cut short" measure and checked whole in its card instead (#visionMcpRow
and the searcher row). 20/20 green.
- 22 more GUI files checked a Settings explanation's text, width or
wrapping in place; each now checks the text and that it is hinted, and
skips its geometry (redact-*, privacy-model, settings-general,
searcher-pick, disabled-models, the *-setting rows, images-codex-one,
and reply-model-setting, new on main since: red 20 of 22 on ".sub
fits" until it got the same check, then 22/22).
These 24 files: 536 pass, 2 fail, both images-codex-one's #pop picker
race, red the same on untouched origin/main
|
||
|
|
1a92a97caa |
provider: the Qoder mover's min is 0.2.56, which signs in to a Lingma 1.0 dedicated domain (Milktea)
Milktea (Discord) couldn't sign in to their Qoder CN IDE enterprise dedicated domain (企业专属域). Their domain answers 404 at /algo/api/v1/version, which makes it a Lingma 1.0 one, and 0.2.53 refused those. In plugins a16adb3, @magpie-community/opencode-qoder-auth 0.2.56: - signs in with the account Qoder CN IDE already holds on this computer (SharedClientCache's cache/id and cache/user, the shapes from Milktea's gist); - chats on the domain itself, as the IDE's worker signs it; - uses the IDE's three models, falling through when one gets "Model not exist"; - reads the IDE's renewed token again when it is near its end or gets a 105. Raising min makes keepMovedCurrent update every moved Qoder user. npm view --prefer-online @magpie-community/opencode-qoder-auth version returned 0.2.56 before this commit. Run at this head (mote): gofmt -l internal/provider is clean. GOOS=linux and GOOS=windows go vet ./internal/provider pass. go test -tags nogui ./internal/provider: ok (104.6s). In the plugin, packages/qoder bun test: 375 pass, and the 11 new Lingma tests are red on 0.2.55. Broken by hand (in the plugin): keeping Cosy-Scene and Cosy-Business-*, or reading past an error said in an OK frame, turns 2 of the 11 red. Not tried: - A real Lingma dedicated domain or a real Qoder CN IDE cache. No such account is at hand, so Milktea is asked to try it. - A move with this min in a sandbox (only the min changed). |
||
|
|
ae060550b9 |
claude-desktop: a tier's pick runs with its tier's Claude prompt (behavesAs)
moer2831 on Discord: a model picked for one of Claude Desktop's tiers ran
in the Code tab on Claude Code's generic prompt, not the one of the
Claude model of that tier ("通用提示词和对应模型提示词差距挺大的,感觉直接
蠢了一个度"). Desktop 4.29 and later hand Claude Code behavesAs only from
a profile's inferenceModels (z3t in 4.4212's app.asar: modelPicker
options with each entry's behavesAs).
What changed:
- gateway.DesktopInferenceModels: while a model is picked for a tier,
the list is every row /v1/models gives Desktop, by its id and in its
order (a non-empty list replaces discovery, pzn), with supports1m,
prefer1m and labelOverride as Desktop read them off the row, and a
pick's anthropicFamilyTier/isFamilyDefault. A pick that isn't a Claude
model gets behavesAs = its tier's newest Claude id (claude-opus-5-5,
claude-sonnet-5-5, claude-haiku-5-5, claude-fable-5-1). Nothing picked
(or a pick no longer listed): no list. Unreadable picks are unknown.
- agent: desktopSyncModels writes it into magpie's Desktop profile on a
tier's Set, as Desktop comes on magpie and on Sync; temp+rename, only
when it changed; taken away when nothing is picked. The list is
magpie's only while its hash is one magpie recorded (stash mark
claude-desktop.models); any other list (the user's) is never written
over or removed.
- Claude Code's modelSettings gets the pick's own window even when it
matches the default (claudeBudget.behaves), since behavesAs would
otherwise give it the Claude model's.
- GUI: the tiers menu ends with one line, "Claude Desktop reads the
tiers as it starts: restart it after a change." (en, zh, zh-TW, ja,
de). The Agents row's Restart already lights from the profile hash.
- docs/subsystems/agent-wiring.md and gateway-routing.md.
Run on mote at this tree (base
|
||
|
|
a5c1fa4b42 |
routing: long routing groups no longer widen the page (noahhrreion)
noahhrreion (Discord #general): on Routing the groups at the foot made the page wider than the window, a scrollbar under it and each row's routing, Edit and switch far off to the right. Cause: |
||
|
|
7c115f6f5b |
provider: picks gone from a list for over an hour serve the list (maxleebeta)
maxleebeta on Discord: with WorkBuddy and WorkBuddy AI both signed in, the Agents page's model picker had no WorkBuddy AI model, and its Providers row read "已登录 · 1 个图像模型 · Free plan" where WorkBuddy's read "1 个模型". WorkBuddy AI's /v3/config (read 2026-11-03 with the owner's account) no longer lists deepseek-v4.1-flash, its free model until now; hy3 is at x0.00 instead. The China build still lists deepseek-v4.1-flash. A pick a plugin's list stops listing goes to Delisted ( |
||
|
|
6a6e4fefac |
sessions: WorkBuddy AI's own sessions are listed under its name (maxleebeta)
maxleebeta (Discord #general) is signed in to both WorkBuddy builds, the
China one and the international one, and the international one was
missing from an agent list. The provider side lists both: provider.All()
and CatalogFor have workbuddy/* and workbuddy-ai/* models under "WorkBuddy"
and "WorkBuddy AI". The sessions package, though, read only ~/.workbuddy.
WorkBuddy AI keeps the same files in ~/.workbuddy-ai (its product.json
dataFolderName, as internal/agent wires it), and nothing read them. So
WorkBuddy AI was missing from the Sessions page's agent picker, from
Usage > Sessions' agent strip, from the reading consent's folders and
from the usage ledger.
Changed:
- WorkBuddyAIDir and workbuddyAIFiles read ~/.workbuddy-ai/projects as
agent workbuddy-ai with WorkBuddy's parser, in allFiles, Dirs,
callSources (wholeCallReaders), Deletable and Found.
- buddyDir picks WorkBuddy AI's own models.json for the
call-through-magpie skip.
- A ~/.workbuddy-ai that is a link to ~/.workbuddy is read once, as
WorkBuddy's.
- skillsCounted names workbuddy-ai (WorkBuddy's parser counts no skills).
- docs/subsystems/gateway-sessions.md has a line for it.
Tests:
- TestWorkBuddyAI checks sessions, cwd, title, tokens, Deletable, Found,
calls, the skip of magpie's gateway, and the link.
- TestWorkBuddyAIGatewayIsItsOwn: one model id that WorkBuddy's
models.json gives to magpie and WorkBuddy AI's gives to the user's own
provider.
- TestWorkBuddyAISessionsListedUnderTheirName checks /api/sessions,
/api/sessions/manage and /api/sessions/stats: name "WorkBuddy AI",
icon workbuddy-color, deletable.
Broken by hand (each went red): allFiles, parserFor, Deletable, Found,
the call sources, the wholeCallReaders entry, buddyDir.
Run on mote at this head (base origin/main
|
||
|
|
c86fa2a341 |
gateway: a relayed citation without the offsets OpenAI's schema wants is dropped, the thread healed (#4921)
A thread a routing group served once on Volcengine Ark (or another vendor whose Responses endpoint writes its url_citations with no start_index/end_index) never worked on a codex member again: magpie relayed the reply's annotations as they came, Codex stored them, and the ChatGPT backend refused every later replay of the history whole — "Missing required parameter: 'input[221].content[0].annotations[0]. start_index'" — five retries a turn, on any codex member, through any upgrade (#4921, the reporter's routing log and rollout). This is #2855's defect with a different field: what magpie hands a client must be something magpie could send again. Such an annotation goes, at both seams, as the reasoning-item fix did: - a whole reply streamed as the vendor's own events (responsesWholeEvents) drops it in every place a client reads a citation: its annotation events, the content part, the item and the reply the client keeps (dropOffsetlessCitations); - the history Codex replays loses it on its way to the ChatGPT backend (withoutOffsetlessCitations, the same leaving-out as a reasoning item's text, #1411): to the backend by its own sign-in and compaction relay (codexUpstreamOn), to it as a group member or an openai.com or Azure upstream (the provider loop, beside withoutReasoningText), and asked again without it where a relay in front of it names the parameter (refusesCitationOffsets), marked so it is never sent one again — a thread already poisoned heals on its next turn, no new thread needed. The text, and a citation that carries its offsets, go as the vendor wrote them; a turn with no "annotations" in it is not decoded (anyInputItem scan, itemCitesWithoutOffsets; the undecoded-turn test holds, allocations and all). Run: the three new tests fail on the base with the reporter's exact 400 and pass here (ablation: the tidy call and the rewrite's body neutralized, tests kept); TestCodexRewritesAsBefore, TestCodexRewritesLeaveTurnUndecoded and the fuzz hold the rewrite to its scan; the citation/whole/reasoning neighborhood ok (23s); gofmt, go vet (linux, windows) and go build -tags nogui clean. Review: this is skygunner's version of the fix (fcea11649), not ggbdpq's 57dc7b420. ggbdpq's stripped citations only for a request that wasn't for a magpie model, so the reporter's own path (a routing group's codex member, the history passed through) kept the bad annotation. ggbdpq's parity table and verification of the report were used to check this one. Changed in review: annotationLacksOffsets looks only at url_citation and container_file_citation, the two types OpenAI's schema gives start_index and end_index. file_citation and file_path carry a single index, so the patch dropped every one of them as "offsetless". TestCitationsWithOneIndexKept (added in review) holds both kinds and checks that a history with only file_citations is sent byte for byte. Broken by hand at the reviewed head: annotationLacksOffsets made to return false, all four citation tests red; the type check removed, TestCitationsWithOneIndexKept red. Restored, green. Run at the pushed tree (this stack of nine on origin/main |
||
|
|
0561d53521 |
gateway: spawned Claude Code registers no claude-cli:// URL handler (#4928)
--setting-sources "" keeps the user's own disableDeepLinkRegistration from loading, so every spawned claude registered the claude-cli:// OS URL handler again and "Claude Code URL Handler.app" came back after the user had deleted it. A headless run has no use for an OS URL handler: the setting is now passed as flag settings (--settings is not one of the sources --setting-sources controls) on the bridge run and the warm-up and usage runs beside it, whatever the user's settings read. Review: applied as ggbdpq posted it (patch sha256 checked against the issue's). Checked in the Claude Code binary that flag settings read disableDeepLinkRegistration === "disable" and that --setting-sources "" doesn't filter --settings. `claude auth login` and `auth status` take no --setting-sources, so the user's own settings already apply there; they are not changed. Broken by hand at the reviewed head: claude_warmup.go and claude_subscription.go reverted to their parent, TestClaudeSubscriptionPromptKeepsForeignHarnessOutOfSystem, TestWarmClaudeAsksClaudeCodeOnce, TestClaudeUsageRunsClaudeCode, TestAskClaudeTUIOn and TestClaudeUsageTUIOn red. Restored, green. Run at the pushed tree (this stack of nine on origin/main |
||
|
|
a8d36b0faa |
fix(claude): a run let go after answering a prompt suggestion leaves its session for the conversation's next turn (#4914)
Claude Code asks its prompt suggestion after each turn as the conversation and one message more, and its run goes on with it (#1638): the run waits on from the suggestion's exchange, under a key the conversation's own next turn never comes by, since the client leaves the exchange out of its messages. While the run is kept, that turn finds it by where it stood before and takes it back to there (resume). But a run let go past idleMost was lost to its conversation: shelve kept its session where the suggestion's exchange had left it, or, when the conversation's own turn had already taken the run back from a suggestion (-p), not at all — its session was marked taken back, which the file may not say, and no session was kept. The next turn found no run and no saved session, and a new Claude Code was told the whole conversation in one message, a prefix the cache had never seen, written to the cache again (a 50k conversation: 19k read and 29k written where 49k read and 50 written; the log said no run here had had a conversation one had). The shelf now keeps a session where the conversation's next turn comes by, too (savedSession.behind, run.behindKey), and unshelve takes it from there when no session waits at the turn's own key. A session taken back is kept once the run has answered a whole turn since (run.replied, set as a turn ends, cleared at each take-back): the file's lines since are that turn and what came after, and Claude Code's resume goes on from them. And a run's end is kept under the boundary before its own (run.convPrev), so the log of a turn that finds it gone says what became of it when its last exchange was a side question. Run: TestClaudeLetGoConversationAfterSuggestionResumesItsSession fails on the parent |
||
|
|
8ea2d48fb2 |
fix(gateway): salt a relayed Messages reply's tool_use id the client has seen again (#4910)
Claude Code keeps every tool_use id of a session in one Set and drops a block whose id it has already seen; a turn whose only block is dropped becomes "[Tool use interrupted]", and the agent loops on calls that did run (#4910). An upstream that speaks Messages itself and is relayed as it came may number its calls' ids by their place in the reply (LiteLLM's bridge: fc_0 on every turn), so the id one turn went out under comes again on the next, and every later call of the session is dropped. A relayed reply's tool_use id the client already holds — an assistant block of the request the reply answers, or one the reply itself said before — now goes out under the mark, the upstream's own id and a fresh salt, which nothing the client holds names; an id the client has seen no more goes as it came, so an upstream whose ids are its own is relayed byte for byte. The answer comes back under the salted id and goes to the upstream as the id it gave, on the call and on the result answering it, so a strict upstream keeps its own pairing and its prompt cache. A reply translated from another wire needed nothing: the model's own call ids pass through there, one fresh a reply. Run: TestMessagesRelayedToolUseIDsUniqueAcrossTurns fails on the old code with the one fc_0 on both turns and passes with the change; TestMessagesRelayedToolUseIDsUniqueInATurn, TestMessagesRelayedOwnToolUseIDsUntouched, TestMessagesTranslatedToolUseIDsUniqueAcrossTurns green. Review, changed from ggbdpq's patch: anthropicInID gives a salted id back unchanged. Without that, a salted id that a later turn sends to an upstream of another wire (a group that moved on) was decoded into the upstream's id plus the salt's NUL byte, and went out with the NUL. TestSaltedToolUseIDTranslatedAsHeld (added in review) checks it, and that anthropicOutID's ids still round-trip. Broken by hand at the reviewed head: the salting turned off in gateway.go, the three relayed-uniqueness tests red (the translated and own-id tests stay green, as they should); the anthropicInID guard removed, TestSaltedToolUseIDTranslatedAsHeld red. Restored, green. Run at the pushed tree (this stack of nine on origin/main |
||
|
|
cc22efebb7 |
davsync: a 403 on the write names the folder it went to, and a full quota (#4927)
The error for a write the server refused, with the address's folder listing fine, said the account couldn't write in that folder (/dav) - but the write went to magpie's own folder inside it, and the listing never proved anything about writing. On 坚果云 (Nutstore) the refusal is usually the free tier's upload quota used up, which answers 403 on a PUT with everything else fine (#4927), so the old text sent the user to check a thing they can't check. The error now looks at magpie's own folder first: there, the server refused to change files in it, and the text says so and mentions the quota; missing, the server refused to have magpie make it, and the text says to make the folder by hand, or put an existing folder in the address. Review, changed from ggbdpq's patch: the folder is named with path.Join(dir, folder). The patch's dir+"/"+folder said "//magpie" for an address with no folder of its own (dir "/"). The test now covers that address too. Broken by hand at the reviewed head: dir+"/"+folder back, TestDAVWriteRefused red; dav.go reverted to its parent, red; restored, green. Run at the pushed tree (this stack of nine on origin/main |
||
|
|
8f6dacbf7f |
gateway: a browser's CORS preflight from another machine is answered, not asked for a key (#4931)
From the report (magpie 0.1.2698, macOS 27.0.1, LAN sharing on, gateway port 3425): a page at https://learn.trancy.org, listed in Settings -> Network and sharing -> Web pages, failed to add itself as a custom engine ("Failed to fetch"). The same OPTIONS preflight for /v1/models, declaring GET and the authorization header with no key on it, was answered 204 with the CORS headers at http://127.0.0.1:3425 and refused 401 with no CORS headers at the machine's LAN address and behind an HTTPS reverse proxy (Nginx Proxy Manager, no CORS handling of its own); the browser logged net::ERR_FAILED, corsError: PreflightMissingAllowOriginHeader, and gave up before the keyed POST. The 401 body was the gateway's own "no API key was sent: send a magpie gateway key as Authorization: Bearer <key> (or x-api-key)". lanGuard sits in front of Handler (Front, oneport.go), and corsGuard is inside Handler, so a request from another machine met the key check first: with the gateway shared (or listening on the network), identifyCaller refused the keyless preflight 401 before corsGuard could see it. On loopback lanGuard asks no key, which is why the same preflight was answered there. A preflight is an OPTIONS that declares the call to come, and per what CORS asks of it carries no key and no body: the browser cannot send one. lanGuard now hands a preflight (corsPreflight: an OPTIONS with an Origin and an Access-Control-Request-Method) to corsGuard instead, after the allow list and the shared/on-network rules have judged it as they judge every request. corsGuard answers a listed origin's with its 204 and headers and refuses any other page's as on loopback; the call the preflight asks after still needs an enabled gateway key, and an OPTIONS that declares no call is no preflight. `magpie web`'s page port, which hands client routes to the same Front, is covered by the same change. Tests (internal/gateway/cors_test.go), from the report's three-row table: - TestCORSPreflightFromLAN: the loopback preflight answered 204 (the row that already worked), the LAN-direct one and the reverse-proxy one (X-Forwarded-For, loopback peer) answered 204 with Allow-Origin and Allow-Headers; an unlisted origin's preflight refused with no CORS headers; a keyless GET and a plain OPTIONS from the LAN still 401; a preflight while magpie isn't shared still refused. Broken by hand (the preflight handoff taken back out of lanGuard): the LAN-direct and reverse-proxy rows go red, 401 with the report's own error body, while the loopback row stays green; restored, ok. Run (macOS arm64, this tree, -tags nogui): - go test -run 'TestCORS|TestLAN|TestForeignPages|TestOpaqueOrigin| TestLocalhostSubdomain|TestRebound|TestOnePort|TestFront' ./internal/gateway: ok. - the same with -race: ok. - go vet ./internal/gateway, and with GOOS=linux and GOOS=windows: ok. - go build . with GOOS=darwin, GOOS=linux and GOOS=windows: ok (the darwin cgo enum-conversion warnings in internal/gui are pre-existing). - gofmt -l on the three touched files: clean. - go test -count=1 -timeout 50m -tags nogui ./internal/gateway: every test ok except TestCodexPoolSaysTheClientsVersion, the known #4807 (another test's Codex identity reaches it in a full package run); it passes run alone at this head. - go test -tags nogui -count=1 ./internal/access ./internal/settings .: ok. ./internal/gui: TestProxyCheckSaysAProxyPassedBy fails, and fails the same way run alone on the untouched base |
||
|
|
0bffc1c5db |
fix(plugin): a silent stream's read gives the fetch up after thirty minutes (#4934)
What changed: a reply body's Read now ends bodyIdleWait (five minutes) after the last byte the plugin sent, gives the fetch up and says so, when nothing more comes. The wait is between bytes, not the reply's whole length: every chunk resets it, so a stream a slow model keeps fed goes on however long it talks. Why: a network drop mid-stream can leave a local proxy's socket open but soundless, and a plugin body's read ended only on a chunk, an answer, a close, a cancelled ctx or the host's death — none ever came, so the request hung until the client cancelled it, with no error frame and no retry (#4934). The gateway's relay already ends a stream whose read fails with a protocol-valid error event; what the plugin leg lacked was any read that fails. Five minutes is the silence the gateway itself holds a client through (keepaliveLongest) before leaving a stuck stream to a timeout; this is that timeout for a plugin's reply. The wait for the reply's head is another wait and stays as it was — this issue is a stream already past its first token. Run: the new TestHostBodyIdleEndsASilentStream failed before the fix (a read held for ever) and passes after; TestHostBodyIdleSparesAFedStream locks the between-bytes reading. go test ./internal/plugin/ ./internal/gateway/ ./internal/provider/ -tags nogui, the host tests under -race, gofmt, go vet and go build all pass, with pre-existing failures on this machine only (TestHostToldTheGatewayAddress, also red on a clean upstream/main; TestCodexPoolSaysTheClientsVersion, the known flake, green on a rerun). Review, changed from ggbdpq's patch: the wait is thirty minutes, not five. Five minutes cut replies that are silent for their whole generation and come in one burst at the end (a model at its highest effort, a relay that buffers its reply): those run past ten minutes, and the gateway already keeps a translated reply's client alive through thirty (translatedQuietLongest). A dead connection's read now ends at that bound instead of never; the reporter's 4m52s case still waits on the client to cancel first, which is the trade. The text above that says five minutes and keepaliveLongest is the patch's first version. Broken by hand at the reviewed head: the idle timer (its start and its reset) set to 1000h, TestHostBodyIdleEndsASilentStream red after its 5s bar; restored, green. TestHostBodyIdleSparesAFedStream guards against a whole-reply deadline, not a mutation of this code: with the reset taken out it stays green (a stopped timer never fires). Run at the pushed tree (this stack of nine on origin/main |
||
|
|
29bd947c62 |
plugin: a lapsed account kept first doesn't say the provider fell back (#4917)
The provider's own row took fellBack and listError from its first account's listing, whatever stood first in the sign-ins. With a lapsed sign-in kept under the provider's own key beside a live account (a Kiro oauth the vendor turned away beside the API key in use), the provider said its list had fallen back although the live account's list told it: the models are the accounts' union, so the provider falls back only when no account tells a list of its own. Reading that row, keepListed put the last list told over the fresh one and the relist stopped dropping the picks of models the vendor no longer lists, for as long as the lapsed account stood first; magpie plugin list said the provider fell back. The last list told is still kept where every account fell back. Review: applied as ggbdpq posted it (patch sha256 checked against the issue's). Broken by hand at the reviewed head: host.js reverted to its parent, TestLapsedFirstAccountKeepsTheProvidersList red; restored, green. Run at the pushed tree (this stack of nine on origin/main |
||
|
|
d97e52aea5 |
draw: Loomy's Hy-Image generators draw on the images API (#4913)
iFlytek's Loomy gateway serves three image generators, each listed in its /v1/models with type "image": Hy-Image-3.5-preview, doubao-seedream-5-lite, qwen-image-3.0-pro. An OpenAI-compatible plugin in front of it lists all three, and the reporter measured all three answering a normal OpenAI-shaped draw on the images API with a 200 and a URL each. qwen-image and seedream match catalog.ImagesAPI's words, so those two reach Settings' image generation picker and draw. hy-image matches only DrawsID's "image", so Hy-Image-3.5-preview stayed a chat model with no way to pick it for drawing — the same reason WorkBuddy's Hy-Image models need their wbDrawers path. Add "hy-image" to ImagesAPI's words: the model is then a drawer on the plugin's row like the other two, and the gateway asks it on the images API instead of chat. No other model's answer changes — every id the new word catches was already a drawer by DrawsID's broader "image"; only where it is asked moves. Test: TestLoomyPluginDraws (internal/gateway) installs a fake Loomy plugin listing the three generators beside a chat model, checks Drawers lists all three, and draws Hy-Image-3.5-preview (images API, image back, chat never asked). Broken by hand: without "hy-image" it is red (drawers [doubao-seedream-5-lite qwen-image-3.0-pro], the Hy-Image one missing). Review: applied as ggbdpq posted it (patch sha256 checked against the issue's). Broken by hand at the reviewed head: catalog.go reverted to its parent, TestLoomyPluginDraws red; restored, green. Run at the pushed tree (this stack of nine on origin/main |
||
|
|
3c2dceb340 |
gateway: "member" in Model name in replies names the member to Claude Code and Codex too (ZoeCats)
ZoeCats (Discord #feedback, after v0.1.2760): with Settings › Models › Replies › Model name in replies on "vendor" the name is no longer written over, but on "member" (作答的成员) a reply still didn't name the routing group's member that answered. Cause: replyNamingOf turned the "member" setting into the model asked for whenever the agent was Claude Code, Claude Desktop or Codex (vendorNamed, kept from #822's memberModel). ZoeCats's agent is Claude Code, so the setting did nothing for them, while "vendor" was already for every agent. The setting was saved and read as it should be (the vendor choice worked through the same path), and an absent X-Magpie-Response-Model falls through to the setting. Fix: the user's pick is for every agent. Those three already take a provider/model id back under the default (the group or provider/model they asked for), so the member's provider/model id is no new shape for them. vendorNamed, replyNamingOf's unused agent argument and the dead namesMember are gone. The menu's note for "member" says "for every agent, groups included" in en, zh, zh-TW, ja and de; settings.go's comment and gateway-routing.md say the same. Tests (fake upstreams, no network): - TestReplyNamesMember: "on, codex", "on, claude code", "old file on, codex" now want the member, plus "on, claude desktop" and "on, codex, name asked" (the header still wins), on 6 paths x streamed or not, each after a failover in a group. - TestPluginReplyNamesMember (new): a group served by the fake plugin, Chat and Messages, streamed and whole, with no token and Claude Code's, member and default. - TestGeminiReplyNamesAskedModel: also with replyModel member and vendor. - reply-model-setting.test.cjs: the member note says every agent and names no Claude Code. Red on origin/main |
||
|
|
db7c576706 |
update: a list of the newest 40 says how many releases there are in all
sujingshen on X, v0.1.2606 to v0.1.2762: the update sheet read "40 个版本" for about 156 releases. The app keeps only the newest update.MostNotes (40) and counted the list it kept, so the line named the cap, not the gap. update.NotesBetweenTotal returns the count of every release in the range beside the capped list. /api/update/notes and /api/whatsnew send it as `total` when it is more than the list, and mergedNotes then reads "156 releases · the newest 40 shown, v… – v…" (en, zh, zh-TW, ja, de). Settings' What's new, where withWaiting puts pending releases first and cuts again, sends no total, since that count was of the installed ones. Run on mote at this tree: gofmt -l internal clean; GOOS=windows go vet and GOOS=linux go vet -tags nogui of internal/gui and internal/update ok (the cgo Linux vet needs gtk4/webkitgtk dev packages neither mote nor magpie-desktop has); go test ./internal/update ok (new TestNotesBetweenTotalPastTheCap: 56 releases keep 40 with total 56, 6 keep 6 with total 6); go test ./internal/gui ok except TestMainWindowCorners, the macOS 27 red of #3949. GUI files in chromium and webkit: update-notes-ask 16/16 (new: a list cut short says how many, en and zh), whats-new 4/4 (new case: 156 in all), whats-new-range 12/12, whats-new-failed 4/4, i18n-keys 4/4. Not tried: a real update from an install 156 releases back. |
||
|
|
cb7d7f9aa6 |
routing, usage: a request names who answered with the provider's logo (Jiabubu)
Jiabubu on Discord asked for the provider's icon before the answering provider or account in the request lists. Routing's Requests rows now draw icon(logoOf(member)) for the try's member (tried(r, tr)), the same logo the request's story uses, between the dot and the name, at 14px. A request nobody answered has no try and no logo. In Usage → Requests, the "Provider · account" cell holds the ledger's provider icon (l.providers) before .where-name, inside a new .where-line. A row read from a session file (source "log") names no provider for sure and gets none. .where-name's text is unchanged. No new strings, no new icons. Test: request-provider-icon.test.cjs. Routing has codex-color and deepseek-color, none on the failed row, a 14px logo before and level with the name. Usage has openai and zhipu-color, none on the log row, the name alone in .where-name, the logo inside the cell. Chromium and WebKit, en zh zh-TW ja de, at 1100 and 420px. Run at the pushed head on mote: see the head run below. Also routing-log-icons, routing-row-reuse, routing-live-patch, usage-ledger, usage-ledger-search, usage-ledger-fit, usage-ledger-agent-middle, session-identity, i18n-keys, phone-rows. Budget tests ok: app.js is untouched, and the plugin files are outside the script budget. Broken by hand: dropping the Routing logo makes 22 of 22 red; dropping the Usage logo makes the Usage checks red in every case. Not tried: the whole GUI suite (mote was busy with two other whole suites); the real Windows app. Head run (mote, 1e6a29337 on |
||
|
|
51dcb67383 |
routing: in a narrow window the accounts and keys sit several to a line (Jiabubu)
Jiabubu on Discord (Windows, 0.1.2738): with the window narrow, Requests and Accounts and keys go one under the other, and every account or key then took a whole line, so a page of many accounts ran far down. The cause is routing.css: under 1150px .rt-acts stays a one-column block list. Now, when the columns stack (not .min1150, or .solo), .rt-acts is a grid of auto-fill columns of at least 168px. Each provider's heading and an open "N accounts" summary row span the whole line. Beside the requests (1150px and wider) the column holds one to a line, as before. No collapse arrows and no other change to the page: once the list is compact the page is no longer long. Test: routing-accounts-narrow.test.cjs. At 700, 560 and 420px, four accounts with two of them sharing a line, side by side; headings and the summary row across the list; no sideways scroll; names inside their box; one to a line at 1440. Chromium and WebKit, en zh zh-TW ja de. Run at the pushed head on mote: that file 10/10. Also routing-columns, routing-keys-fold, routing-group-fold, routing-compact and the rest of the head run in the next commit's body; TestCoreScriptBudget and other Budget tests ok (no script grew). Earlier, at |
||
|
|
173b7e2742 |
routing: the group being edited reads as selected, its Save in reach (Jiabubu)
Jiabubu (Discord, #feedback): on Routing, the group being edited looked like the groups above it, and Save was a small text button at the editor's foot, a long scroll down. The editor in the groups list now reads as the selected row: a soft accent tint (4% over the card) and a 1.5px accent ring all round, its corners following the list's when it is first or last. No stripe down one side. Its bar (Remove, Cancel, Save) is sticky at the bottom of the view while the editor's rows scroll by, on the editor's own tint, and sits where it always was once its foot is reached. Cancel and Save are 28px tall at 13px (were 23px at 12px); the web's 44px touch size still wins on a phone. The list clips its overflow instead of hiding it (overflow: clip, with hidden as the fallback), so the bar can stick. Nothing else on the page moves (#1354). Measured, editing the third of four groups (a ten-member group) with its head near the top of a 760px window: Save was at y 1845 (1000 wide) and 3013 (420 wide), out of sight; now at 714 and 694, in sight, in Chromium and WebKit. group-editor-selected.test.cjs, in Chromium and WebKit, desktop and web, 1100/770/420 wide, en/zh/zh-TW/ja/de (and dark in zh): the editor is tinted apart from the other rows and has a ring, both sides alike; scrolled by the reader to its head, Save and Cancel are in the window, uncovered, 28px and 13px or more; scrolled to its foot, the bar follows the last row inside the editor. Broken by hand: with origin/main's routing.css it fails at "light desktop 1100 en: the editor is tinted apart from the other groups"; with only the list's overflow: clip taken out, at "Save is in the window (1353-1381)". Run on mote at this tree (on origin/main |
||
|
|
95a61a5d18 |
usage: a card's captions read at 4.5:1 on the card (Jiabubu)
Jiabubu (Discord, #feedback) found the Usage Overview cards' captions, "重置于 …", "本周期" and a curve's dates, small and hard to read in both themes. They were --faint: 1.95:1 on a light card, 2.16:1 on a dark one, under WCAG AA's 4.5:1. Every caption on a card is --muted now: a window's reset line, the curve's range and axis dates, "Last reading", a balance curve's pace, a credit day's note, the all-accounts head and its unknown, a card's error line, and on the tray panel's allowance card .pq-sub, .pq-rn, "until …" and an auto-reset's used line. Light's --muted is 3.66:1 on white, so a card (and its tinted all-accounts box) takes --ctl-fg, the token documented as a control's quiet text at 4.5:1 on every surface; dark keeps its --muted. The reset line's "held" reason lost its 0.75 opacity (it read under 4.5:1); it keeps the caption colour. Sizes are unchanged; the figures keep --fg-2 at 600. Measured in the page (Chromium and WebKit, same numbers): Usage card, light: captions 1.95 -> 5.95:1; figures 8.64:1 Usage card, dark: captions 2.16 -> 4.64:1; figures 8.03:1 Panel card, light: .pq-sub 2.79 -> 5.95:1 Panel card, dark: .pq-sub 3.66 -> 5.54:1 (computed from the tokens) quota-caption-contrast.test.cjs checks every caption on a Usage card at 4.5:1 or better, each below the card's figure by 1.5 or more, and the panel card's captions at 4.5:1, in Chromium and WebKit, light and dark, en/zh/zh-TW/ja/de, at 900 and 420 wide. Broken by hand: with origin/main's app.css it fails at "light en 900: .quota-reset reads at 1.95:1"; with only .pq-sub put back on --faint it fails at "light en panel: .pq-sub reads at 2.79:1". Run on mote at this tree (on origin/main |
||
|
|
1851ead1a7 |
library: Pi and omp lock ~/.agents/skills from their versions; Put skills in links every skill there
usrname1833 on Discord asked for two things.
Pi reads ~/.agents/skills itself, so a skill kept there is Pi's whatever
is ticked, with the lock as Codex and OpenCode have. Pi started to in
0.54.0, not 0.19 (its CHANGELOG; userAgentsSkillsDir in
package-manager.js), and omp in 11.0.0 (src/discovery/agents.ts; 10.6.2
doesn't). Target.SharedToo says so from the version, and every reader of
readsShared goes through Target.readsSharedDir: Always (the lock),
syncSkills' inShared (no second link) and a handover's readsSharedHere.
OmO's senpi reads it in every npm version (0.74.0 up), so omo joins
readsShared. A Pi or omp of no known version is taken as older, as
before.
The second ask is a switch: Library > Skills > "Put skills in": each
agent's own folder (the default, today's behaviour) or ~/.agents/skills
(Library.SharedSkills; POST /api/library/skills/where {how};
magpie library skill where agents|shared). On, every library skill on
here gets magpie's link in ~/.agents/skills (syncShared, after
sweepShared), so every agent and tool reading that folder has it and
shows it locked. The files stay in the library rather than moving, so
updates, edit tracking and Off here keep working; existing skills just
get links when it is turned on, nothing is moved. A user's own entry by
the same name is never written over. Off takes out magpie's links there
and nothing else, and agents' own links come back. Per computer:
Collect doesn't carry it. docs/subsystems/library.md says all this.
Not covered, filed: on Windows without link rights the shared entry is
a marked copy, and takeEdits doesn't take edits made in it (#4958).
Run on mote rebased on
|
||
|
|
91379b9339 |
settings: a reply's model can be the vendor's own name again, the member, or the model asked for (ZoeCats)
ZoeCats (Discord #general): since v0.1.2473 a reply's model says the name the client asked for (a group or provider/model id), groups that aren't aggregates included, and the only way back to the vendor's own text was the X-Magpie-Response-Model header, which their client can't send. Settings › Models › Replies › Model name in replies (replyModel), picked from the app's menu, in en, zh, zh-TW, ja and de: - "" the model asked for (the default, as now); - member: magpie's provider/model that answered (what memberModel did; Claude Code, Claude Desktop and Codex still get the name asked for); - vendor: the vendor's own text, for every agent, the vendorNamed three included, as every agent got before v0.1.2473 and as the header's "vendor" already gave them. X-Magpie-Response-Model (asked, member or vendor) still picks for its request; an unknown value falls through to the setting, as before. memberModel is folded in without changing anyone's choice: a file with memberModel on reads as replyModel member, an explicit replyModel wins, and memberModel is written beside it as a mirror so an older magpie reads the same. An older page sending only memberModel changes the setting only when its switch moved (a vendor choice survives its saves). The CLI's set/reset goes through Keys/Choices (replyModel in place of memberModel). app.js's row is paid for by five comments in Settings' code cut down: app.js is 145 bytes under its base, no budget raise. Run on mote at this head (rebased on origin/main |
||
|
|
39f83063ce |
provider: WorkBuddy's mover min is 0.2.16, Extra credits beside the plan's (Jiabubu)
Jiabubu (Discord, magpie 0.1.2738, Windows): a WorkBuddy account's quota line under Routing → Accounts and keys showed the plan's Credits only, with no extra credits (gifted, promo, bought). Fixed in the plugin, magpie-community/plugins 52fff4d (workbuddy 0.2.16): "Extra credits" is every kind but the plan's base, as WorkBuddy's own usage panel and the summary's CreditGroups say (plan_bonus, addon, benefit), so a Pro account's plan bonus no longer sits inside "Credits". This raises the min so keepMovedCurrent brings every moved user to it. npm view --prefer-online @magpie-community/opencode-workbuddy-auth version: 0.2.16, before this commit. Run on mote at this tree: gofmt -l internal/provider clean; go vet and go test ./internal/provider -count=1: ok. The plugin's own run is in its commit (whole plugins repo 4872 pass, 0 fail). Not tried: a real account with extra credits on screen. The owner's WorkBuddy AI account has plan base credits only (its card reads "0.19 / 100", unchanged), and the China account's meter answered 401. |
||
|
|
f3681b90c3 |
gui: the Agents page says a model's load by the picked model and in its picker (axelburks on Discord)
axelburks (Discord #feedback) could see a model's load only on its provider's page, too deep to judge which model to pick on the Agents page. A plugin's reported load (magpie.load) now shows there too, as the same quiet grey badge the provider page uses: - by the picked model in each agent's model row, before the chevron; - on each row of that row's model picker, after the speed. GET /api/model-loads (speeds.go) answers every fresh load (LoadFresh, 5 minutes) by "provider/model" lowercased, the ref /api/model-speeds uses: plugin.FreshLoads copies the fresh entries under one lock, and provider.ModelLoads keys them by magpie's provider id, the user's own listed id too (ModelIDs), with model@size falling back to its model as ModelLoad does. With no plugin reporting it is one lock and an empty map. The page reads it when a model picker opens and with the Agents page's 15s drift check, each throttled to once per 30s, and the drift read only while a row shows a magpie model. No new poll; /api/state and Option are unchanged. The core script stays under its budget (1,533,802) by shortening comments in the picker and agent-row code; no budget raised. The route is named in the CLI's route list (read-only, U) like model-speeds. Run at this head (rebased on origin/main b4073c06a; the rebase onto |
||
|
|
dcc84dbc04 |
usage: the Overview says each account's credits, and the period's (lcyksp)
lcyksp (Discord #feedback) asked to see the WorkBuddy credits (积分) the
calls spent, per account too, not only tokens. The summary already summed
each reply's usage.credit into every group's Totals, and the Requests
page's ranking showed it, but the Overview's Accounts, Models and Agents
rows and its tiles never said it. Each row's line now says "{n} credits"
when a reply said any, and the calls tile says the period's sum. No tile
is added, so the four-tile grid is as it was; the text was translated
already.
Run on mote:
- go test ./internal/usage ./internal/usageapi: ok. TestPlanCreditsByAccount
(new) checks each account's sum in the summary and the Requests page;
with Totals.count not adding credits it is red (summary a@x: 0 of 0).
- GUI, every usage*, i18n*, ledger and credits file (both engines):
1322 pass, 31 fail. plan-credits' new Overview test (5 languages, 420px)
is red with page.js as before ("WorkBuddy · 70 calls"). The reds are
usage-agents-hide (#2276, #3414), usage-fold "most on one screen"
(#4790) and usage-ledger's return-to-live (#3104, #4078, #4626). Run
alone at
|
||
|
|
3a74cd92e8 |
claude: /usage waits for its figures, and a read without them is unknown
Seagull fries (haioushutiao, Discord #help; magpie 0.1.2704, Claude Code
2.1.316, Windows 11, Claude Pro): the Claude card said 暂时无法获取额度,
"Claude Code's /usage told no allowance: ❯ /usage ─── Settin s Status
Config Usage …". Reproduced with a real Claude Code 2.1.316 under
Windows' pseudo console in a sandbox: /usage's panel is drawn first with
"Loading usage data…" while Claude Code asks Anthropic for the figures
(5s timeout, retried only on a 401), and the helper took 3s of a still
screen as the panel drawn whole. On a slow answer it told the panel's
frame as the result, and parseClaudeUsage called any text with no window
"told no allowance". A failed load ("Error: Failed to load usage data",
"r to retry") went the same way.
claudetui:
- screen.go: a small terminal grid (CUP/CUU..CHA/VPA, EL, ED, ECH, CR/LF
with scrolling, OSC/DCS skipped, an escape or UTF-8 character cut
between reads kept), 200x50 on Windows as the pseudo console is made,
80x24 elsewhere. The pseudo console sends only the cells that changed,
skipping a cell that holds the same letter ("Settin\x1b[1Cs"), so the
stream read split words and kept a redrawn digit beside the old one.
While /usage is read, each look of the screen with a window is kept
(panel), and usageText reads that before the stream.
- command(), built on b4073c06a's wait for the panel (ikunbots; its
usageDrawn and "hadn't drawn" error kept, now also judged on the grid,
since the pseudo console's split "Settin s" never matched its tabs):
"Loading usage data" on screen is waited out (to
commandWait, s.doing "was still loading /usage's figures" for the
deadline message); "Failed to load usage data" gets one "r"; a panel
still with no figure and loading or failed on screen is an
error_during_execution result, "/usage couldn't load the plan's usage:
<screen>".
- the fake draws the panel a frame at a time (fakeFrames), as Claude Code
does: with one write, the pseudo console passed on only the last
frame, which no longer shows the windows. TestShimReadsUsage now passes
on Windows (#4820, the fake's side; a real panel with figures was not
seen on Windows, see below).
provider:
- parseClaudeUsage: a panel with no figure is "Claude Code's /usage
showed no usage figures: …", not "told no allowance" (kept for
claudeUsageDenied's refusals).
- claudeUsageUnknown: Claude Code's "temporarily unavailable" and the
helper's "couldn't load the plan's usage" keep the account's reported
reading (quota_last), as the first did alone before. Other no-figure
text is still shown as an error (TestClaudeHeaderSurvivesUnclassified-
UsageFailure, TestClaudeUsageReadingAloneDoesNotHideUnclassifiedFailure
hold that).
Fixtures are the reporter's case as the pseudo console passed it on for
the real 2.1.316 (a temporary dump of the helper's screen bytes, sandbox config,
proxy that never answers / refuses): testdata/usage-loading-win-2.1.316.bin
and usage-failed-win-2.1.316.bin.
Run at the pushed head:
- mote: go test ./internal/claudetui ./internal/provider ok; go test
-run 'Claude|Usage|TUI' ./internal/gateway ok; GOOS=darwin/linux/
windows go vet ./internal/claudetui ./internal/provider ok; gofmt -l
clean.
- xiaomi-gpu (win-run): go test ./internal/claudetui: all pass except
TestShimFirstMessageWaitsForTools, red on Windows at main (#4810).
- xiaomi-gpu, real Claude Code 2.1.316 (npm), sandbox CLAUDE_CONFIG_DIR
with a fake token, magpie.exe built from this tree, helper run as the
gateway runs it: a proxy that never answers gives is_error "/usage
couldn't load the plan's usage: … Settings Status … Loading usage data…"
after the 20s wait (was a success with the chrome); a refused proxy
shows "Failed to load usage data", "r" is pressed, and the same error
comes back in 6.6s. "Settings" is whole now.
Broken by hand (before the rebase onto b4073c06a; the merged loop is
re-checked below):
- old tui.go: TestShimWaitsForUsageFigures slow, retried and failed again
all red, each telling the reporter's chrome as success.
- the "r" not written: TestShimWaitsForUsageFigures/retried red.
- old parse message: TestClaudeUsageWithoutFiguresIsUnknown red ("told
no allowance"); old quota_last check: its couldn't-load cases red.
- after the rebase, on the merged loop: the "r" not written,
TestShimWaitsForUsageFigures/retried red; the old "anything still 3s"
in place of usageDrawn on the grid, TestShimWaitsPastTheBanner red.
Not tried: a real account (the box has none of the owner's), so a real
2.1.316 panel with figures was never seen through the pseudo console;
whether Claude Code's frames that show the windows reach the pseudo
console's output before it renders the next one is shown only by the
fake. Not taken: asking Anthropic's /api/oauth/usage, which the owner
ruled out (
|
||
|
|
b328a7790b |
gui tests: balance-fix types the account token into its own box, not the proxy's password (#4683)
|
||
|
|
311ec2ac0c |
provider: the Command Code mover installs opencode-commandcode-auth 0.1.22 (EDwinpzy)
0.1.22 sends reflection/beam each earlier assistant message's reasoning back as reasoning_content, "." where the history has none, so Beam's second turn is no longer turned away with 400 "Missing required parameter: 'messages[N].reasoning_content'" (EDwinpzy on Discord, #feedback, magpie 0.1.2717). A model the Provider API asks the same of is asked once more with it and filled from then on; other models' requests go as they came. keepMovedCurrent updates every moved user. npm view --prefer-online --registry https://registry.npmjs.org @magpie-community/opencode-commandcode-auth version: 0.1.22 (plugins 38ef050; publish run 41498900393 is red only for think-tags, plugins#180). Run on mote: go test -count=1 ./internal/provider ok. Not tried: a real Beam request; the Command Code key here answers 401. The plugin's bun tests cover the reporter's two-turn shape as the chat-completions and responses routes hand it to the plugin. |
||
|
|
6c08ee13b0 |
gateway: a model asking for earlier reasoning back goes on to the group's next member
EDwinpzy (Discord #feedback, magpie 0.1.2717): Command Code's reflection/beam:free answered a second turn with 400 "Missing required parameter: 'messages[N].reasoning_content'". The 400 wasn't retryable, so a routing group of Beam then Glyph ended at Beam and never asked Glyph. The client's request is whole; it is that model's demand for history it doesn't have, and another member's model may not make it. reasoningBackRefused (thinking_back.go) reads the demand: DeepSeek's "must be passed back" (thinkingBackRefusal) and words that name reasoning_content as missing or required. shapeRefused and retryable take it, so the member fails as a shape refusal (failShape): no rest, the next member is asked once. refuseThinkingBack's refill still runs first, inside forwardOnce. A 400 for a missing 'messages' or 'model' still stops at the first member. The plugin side (commandcode 0.1.22 fills Beam's earlier replies with reasoning_content) ships separately. Tests: TestGroupFailsOverAMissingReasoning (chat and responses routes, the reporter's two-turn shape, his words in the Provider API's error JSON) and TestMissingReasoningIsNotABadRequest. Run on mote: go test -count=1 -timeout 45m ./internal/gateway: every test passes except TestCodexPoolSaysTheClientsVersion, red in a full package run and green alone, already filed as #4807 (another test's Codex identity reaches it); go test ./internal/provider ok; GOOS=linux and GOOS=windows go vet ./internal/gateway ok; gofmt -l clean. After a rebase on |
||
|
|
d76c4b23a4 |
sessions: Grok Build's own calls reach Usage, its turns through magpie left to the gateway (#4423)
liubing0806: with Local session selected, Usage lists Kimi's, Claude's, Codex's and DeepSeek Harness's models and no Grok Build one, while Usage → Sessions shows the same sessions' grok-4.7-build tokens. Grok Build had no call reader. From ggbdpq's patch (via gua2100): calls_grok.go reads the updates.jsonl the Sessions page reads, as parseGrok counts it. Each turn_completed is a call per model in its modelUsage (input without what the cache held), at the line's time; an empty modelUsage falls back to the session's model. A subagent's folder is its own session; a fork counts lines from its created_at on. It is a line source (lineCallReaders): a grown file is read on from where the last read stopped, its carry kept in the disk shard as Pi's is. Added here: the patch left a turn asked through magpie's gateway to gatewayMatches, and said such a turn may land in both ledgers. It does: a turn_completed sums every request of the turn per model (modelCalls 7 and 17 in liubing0806's report) under the model the reply named (moonshotai/Kimi-K3 for magpie's group/auto-kimi-k3), so no gateway row matches it one to one. The model a turn was asked on is in its prompt's user_message_chunk (_meta.modelId), and a turn asked on one of the [model."magpie/…"] tables magpie writes in Grok Build's config.toml (by table name, its model, or the magpie/ prefix) is the gateway's and left out here. With no prompt line read, the session's model decides. The carry keeps the asked model (Asked) across reads. Run at this tree on mote: go test ./internal/sessions ./internal/usage ./internal/otlp ./internal/tune ./internal/davsync -count=1: ok; go test ./internal/sessions -run Grok -race: ok; gofmt clean; go vet GOOS=linux and GOOS=windows ./internal/sessions: ok. Broken by hand: grokCallLine returning at once: TestGrokCalls, TestGrokCallsForkKeepsItsOwnTurns, TestGrokCallsLeaveTheGatewaysTurnsOut red; the gateway check off: TestGrokCallsLeaveTheGatewaysTurnsOut red (e counted 26124 in). Not tried: a live Grok Build session read by the GUI's Usage page; the fixture lines are a real session's of each kind with the prompt cut. Co-authored-by: ggbdpq <ggbdpq@gmail.com> |
||
|
|
fbbdf6e056 |
claude: a turn Anthropic refuses as a third-party app's says why, and isn't asked again (#4503)
Anthropic answers some Claude subscription turns with "API Error: 400
Third-party apps now draw from your extra usage, not your plan limits.
Add more at claude.ai/settings/usage and keep going." isjiajia01's
controlled tests show when: Claude Code's interactive mode (the cli
entrypoint) carrying a client agent's own system prompt, such as Pi's,
gets the 400, and claude -p is served the same prompt. sounfury saw the
same thing on 0.1.2586 (Pi refused, Eta served, same Pro account). Until
now the client got that bare 400, which says "keep going" and doesn't
say why, and the log said only "exit status 1".
The client still gets the 400, followed now by magpie's explanation:
Anthropic counted the turn as a third-party app's and answered nothing.
It ran in the interactive mode with the agent's own system prompt.
Asking again the same way may draw from the Claude account's extra
usage, so magpie doesn't ask again on its own. claude -p is served such
prompts: turn off "Claude Code's interactive mode" in Settings › Models
› Replies or in the provider's editor. The plan counts a -p request at
about twice the interactive mode's. A claude -p run that gets the same
refusal says so, without the advice to turn the mode off. The log names
the refusal and its mode, and every run's start and end lines now say
"interactive mode" or "claude -p".
The owner decided this on #4503. ggbdpq's patch redid such a turn once
as claude -p, at about twice the plan's count, without asking. This
commit keeps the patch's detection (thirdPartyWords) and its fake
interactive Claude Code harness, and drops the automatic redo. The
explanation stays clear of quotaWords, so the refusal remains a 400
about the request: no account rests for it, and the next account isn't
asked.
Run on mote at
|
||
|
|
b9a45f59e0 |
claude: the run works in the caller's own folder, not one a turn quotes, and a --bare CWD: line is read (#4449)
clientNamedWorkPlace took the last working-directory line anywhere in
the request, so a user turn that merely quoted one ("Primary working
directory: /x", alone or inside a longer line) overrode the caller's
own, or broke the capture and fell back to magpie's shared folder; and
claude --bare states its folder as "CWD: /x", which was never matched,
so a --bare caller always worked in the shared folder while being told
it was theirs (WardLu).
From ggbdpq's patch (via gua2100): the caller's own word wins. Its
instructions and system messages are read first (every form, "CWD:"
included, on a line of its own); a turn is read only when the caller
named nothing, and only in the forms a caller states its folder in
(Codex's <environment_context>, OpenCode's <env>). "Primary working
directory: /y (was /x)" is read as /y, as the routing rules read it.
Not taken from the patch: it unmasked a folder whose word the redact
rules had masked and ran Claude Code there. Claude Code tells Anthropic
the folder it runs in (" - Primary working directory:" in its own
environment; the bridge goes straight to Anthropic), so the masked word
would have left the machine as written. A folder not on disk, masked or
not, falls back to magpie's folder as before, envElsewhere tells the
model its tools run in the caller's environment, and its paths are put
back on their way to the caller. TestClaudeNeverRunsInAMaskedFolder
Unmasked holds that.
Run on mote at this tree: gofmt -l internal/gateway clean; GOOS=linux
and GOOS=windows go vet ./internal/gateway ok; go test ./internal/gateway
-run 'TestClaude|TestWorkDir' -count=1 ok.
Broken by hand: the unmask put back: the masked test red (ran in
.../someuser-libs/proj); claude_subscription.go back to main: 6 of 9
subtests of TestClaudeRunsWhereTheCallerRunsNotWhereATurnQuotes red; the
layer split alone dropped: 3 red.
Not tried: a real claude --bare caller; a real redact plugin's masker
(the test masks through maskTextHits with RedactWords). Sibling:
workDirIn (workdir.go) still takes a quoted line in a user turn for
routing rules and the plugin folder header: #4940.
Co-authored-by: ggbdpq <ggbdpq@gmail.com>
|
||
|
|
4bac5eed26 |
usage: a request's row says what went up to the vendor, tries summed (#4456)
RunMintOn asked how much a long session sends upstream: a proxy counted ~900 MB up in 45 minutes, and no ledger row said what a request sent. A row now has up_bytes, the bytes that went on the wire, every try and every second ask summed (zstd's size for a ChatGPT turn), and plain_bytes, the last try's body before compression. They are summed in the request's context on its own goroutine, set in serve and, for Codex's own turns that come from the mux and not through serve, in codexUpstreamOn. Handed-on rows carry neither; rows from before carry neither. From ggbdpq's patch (via gua2100), two changes: - the patch counted in codexUpstreamOn but set the context only in serve, so a Codex turn on its ChatGPT sign-in, the zstd case the issue is about, wrote 0 and 0 (TestCodexOwnTurnKeepsUpBytes); - a second request inside one try (RetryOneAuth, RetryZhipuCoding, RetryOpenCodeFreeOnZen) went up uncounted; it counts now (TestLedgerCountsATrysSecondAsk). Request bodies to other vendors stay as their client sent them; zstd stays Codex's (the owner's call, on the issue). Run at this tree on mote: go test ./internal/gateway -run 'UpBytes|TrysSecondAsk|OneAuth|Codex|Draw|Relay' -count=1: ok; go test ./internal/usage ./internal/redact -count=1: ok. gofmt clean. Broken by hand: no context in serve: TestLedgerKeepsUpBytes and TestLedgerCountsATrysSecondAsk red; none in codexUpstreamOn: TestCodexOwnTurnKeepsUpBytes red (row 0/0, backend got 79 of 8444); the second ask not counted: TestLedgerCountsATrysSecondAsk red. Not tried: a real session's numbers against a proxy's; the GUI shows neither field yet. Co-authored-by: ggbdpq <ggbdpq@gmail.com> |
||
|
|
e737dff447 |
redact: a dotted name a call is made on is no secret to the masking model (#4444)
kewab's redaction shot: gctx.GetInt64("user_id") went out with
gctx.GetInt64 replaced by a made-up key. No rule reaches such a span;
the local model called it a SECRET, and modelFits let it through.
modelFits's SECRET case now turns away an identifier path (identPath)
that a '(' touches: the name a call is made on. ggbdpq's patch (via
gua2100) asked notCode there, the rules' check, which also skips a name
with a space before its '(' and one after a colon that a comma follows.
The model is asked about prose too, and there those are secrets: with
notCode, "tell Bob it is Pw7nK4xQ9rTe (rotated today)" and "note:
hunterTwoThree, keep it" went out as written. Only the touching '(' is
taken.
Run at this tree on mote: go test ./internal/redact ./internal/usage
-count=1: ok. gofmt -l clean.
Broken by hand: the guard gone: TestModelMisreadsNotMasked red on
gctx.GetInt64; the patch's notCode in its place: TestModelFindsStill
Masked red on the three prose secrets above.
Not tried: the real local masking model (the tests use the stand-in
model the suite's other model finds use).
Co-authored-by: ggbdpq <ggbdpq@gmail.com>
|
||
|
|
d5fea7f02e |
gateway: a relay whose list names gpt-image-2 under a namespace draws it (#4432)
loscoy's retest (v0.1.2670) still got 404 "magpie knows no model
"gpt-image-2" to draw with" for the bare name a Codex harness asks for:
the relay's cached list names the family under a namespace
(openai/gpt-image-1, openai/gpt-image-2 …), and drawsFamily, which
|
||
|
|
8abdf53a88 |
cli: Check in now for one account is named in notYet, beside the per-vendor check-ins (#4826)
TestEveryRouteHasACommandOrIsNamed was red on main since |
||
|
|
8f128877ae |
provider: the ZCode mover installs opencode-zcode-auth 0.1.43 (plugins#649, frank6com)
0.1.43: when zcode.z.ai's edge firewall (Aliyun) answers a Start Plan
request (POST /api/v1/zcode-plan/anthropic/v1/messages) with its 405
block page, every account of the plugin holds off zcode.z.ai for three
minutes. The Start Plan and -Trial requests are answered locally with
the same 405 and provider.BlockedHint, so EdgeBlocked and retryable still
fall back. Free first stays on the coding plan. frank6com's two Start
Plan accounts and three sessions with subagents went on knocking from
both accounts after the block, and ZCode's own app got the same 405, so
the address was blocked, not the account. npm --prefer-online had 0.1.43
when this landed.
Run on mote: go test ./internal/provider ok, gofmt -l clean, GOOS=linux
and GOOS=windows go vet ./internal/provider clean. That run was on
|
||
|
|
b4073c06a0 |
claude-tui: /usage waits for its panel, never takes Claude Code's banner as it (ikunbots on X)
ikunbots (v0.1.2738) showed a Claude card saying "Claude Code's /usage told no allowance: ▘▘ ▝▝ /private/var/folders/…/magpie-claude-work-501 ────". After /usage is typed, Claude Code draws itself again (banner, folder, the prompt's rules) before the panel. A slow /usage leaves that still, and the helper took any screen still for 3s as the panel, so the banner was told as /usage's answer and parsed as an error. Now a screen without "NN% used" counts as drawn only when the panel's Settings tabs show and nothing says loading (usageDrawn). With no panel by commandWait (or the caller's deadline), the result is an error naming what was last drawn, never a success carrying the banner. Run (on mote): - go test ./internal/claudetui/: ok (new TestShimWaitsPastTheBanner: the fake draws the reporter's banner, then the 2.1.316 panel 4.5s later; TestUsageDrawn; a "banner, no /usage panel" case in TestShimEndsAtItsCallersDeadline). - Broken by hand (old "anything still 3s" condition back): TestShimWaitsPastTheBanner red, told the banner as the result, as in the report. - go test -run 'Usage|TUI' ./internal/gateway/ ./internal/provider/: ok. - GOOS=darwin/linux/windows go vet ./internal/claudetui/ ./internal/gateway/: clean; gofmt clean. Not tried: a real slow /usage on a real account; the "loading" word is a guess at the panel's loading text, which only keeps waiting longer. |
||
|
|
dfd3b720bd |
docs: the gateway's OpenAI images and videos routes, and what each vendor is sent
A table of POST /v1/images/generations, /v1/images/edits, POST /v1/videos, GET /v1/videos/{id} and /content, what each takes and answers, and each vendor's translation, checked against draw.go, draw_volcengine.go and video.go. Asked for by axelburks on Discord. Docs only; nothing run.
|
||
|
|
5bd1aee637 |
video: Seedance takes a last frame and Ark's own fields through /v1/videos
/v1/videos read OpenAI's request into Ark's content-generation body but left out the last frame (last_frame, which magpie reads for MiniMax), and dropped every field OpenAI's API doesn't have, so a caller in OpenAI's shape couldn't turn off Seedance's audio, fix a seed or ask for an adaptive ratio (axelburks on Discord asked that the OpenAI shape be converted to the vendor's). volcengineVideoBody now sends last_frame as an image_url item with role last_frame, and passes the request's other fields on as sent (masked as the prompt is, as for a provider's own videos API). A multipart form's "false" or "42" goes as false or 42, as Ark takes them. Run (mote): at a7f31ef46 (this stack on |
||
|
|
93060c98d0 |
video: an Ark key's Seedance models make videos at Ark's tasks (axelburks on Discord)
axelburks asked for image and video APIs on the gateway that convert OpenAI's request shape into the real vendor's, Volcengine's in particular. /v1/videos already did that for the Volcengine preset's Agent Plan, but any other Ark key (pay-as-you-go /api/v3, or an Ark endpoint added by hand) had no video models, and one marked a Video model was sent to an OpenAI-shaped <base>/videos that Ark doesn't have (404). Now an Ark key's Seedance models (listed or picked, named seedance) are its video makers, started at <base>/contents/generations/tasks with volcengineVideoBody, polled at .../tasks/<id> and downloaded from content.video_url, as the Agent Plan's are. The id names the key that started the video, and its poll and download go on that key. Docs: docs/subsystems/gateway-routing.md. Run (mote): at a7f31ef46 (this stack on |
||
|
|
253aee08b4 |
provider: an AI Studio key's Gemini URL is filled in once, and stays empty when the user clears it
|
||
|
|
1490045f59 |
claude bridge: an unloaded deferred magpie MCP tool is handed over by its full name
packinggoods (#feedback, 11-02): every first MCP call in Claude Code failed with "Error: No such tool available: magpie-web-search__web_search" and the retry worked. Claude Code with tool search on names a deferred MCP tool in a reminder and leaves it out of tools until ToolSearch loads it. Through the Claude subscription bridge the run's model reads that name and calls it, mcp__magpie__magpie-web-search__web_search; toolStart cut mcp__magpie__ and, the tool not being one the client sent, handed the client the bare magpie-web-search__web_search, which it has no tool of. After a ToolSearch the tool is in tools, the cut name maps back, and the call works: the retry. |
||
|
|
2ff93ffd64 |
provider: the Qoder movers install opencode-qoder-auth 0.2.55 (plugins#643)
0.2.55 has a request that names no effort and a max_tokens of 1024 or less think at none (the lowest level for a model that always thinks) rather than at the model's default. This is WorkBuddy's #643 rule applied to the same default in qoderBody. npm --prefer-online had 0.2.55 when this landed. Run on mote at this head plus the next commits' one-line Qoder/ZCode mover mins: go test ./internal/provider ok, gofmt -l clean, GOOS=linux and GOOS=windows go vet ./internal/provider clean (TestQoderMoversSendTheClientsModelConfig still holds). The plugin's own run record is in plugins 58adead. |
||
|
|
a2837c1f50 |
provider: the WorkBuddy mover installs opencode-workbuddy-auth 0.2.15 (plugins#643, itspig)
0.2.15 gives a chat whose max_tokens (or max_completion_tokens) is 1024 or less no default reasoning effort. On 0.2.14, a 64-token session title on deepseek-v4.1-flash-sg ended "length" with 64 reasoning tokens and no text. npm --prefer-online had 0.2.15 when this landed. Run on mote at this head plus the next commits' one-line Qoder/ZCode mover mins: go test ./internal/provider ok, gofmt -l clean, GOOS=linux and GOOS=windows go vet ./internal/provider clean. The plugin's own run record is in plugins d51bd50. |