4794de398ea8337d223a91e207181c56fcf4ad76
3181
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
cf10394527 |
agent: alma-server on Linux is found and wired as Alma, so its requests show as Alma, not "ai-sdk" (Lutra.x on Discord)
alma-server (Alma without a desktop, Linux x64/arm64) keeps its data in
$ALMA_DATA_DIR, else $XDG_DATA_HOME/alma, else ~/.local/share/alma
(Alma's electron/headless/electron-shim.ts getDefaultUserDataPath), and
answers on the same localhost:23001. magpie looked only in the desktop's
folder (os.UserConfigDir()/alma), so on such a machine Alma's Sync never
ran, its magpie provider kept the old shared key, and the gateway read its
requests by their User-Agent alone, the AI SDK's
("ai-sdk/openai/4.0.15 ai-sdk/provider-utils/5.0.10 runtime/node.js/22",
@ai-sdk/openai 4.0.15 and provider-utils 5.0.10 as alma-server bundles
them; Alma sends no header of its own). almaDir now also looks in
alma-server's folders on systems other than macOS and Windows, the
desktop's first; ALMA_DATA_DIR is in agentenv's Vars.
Verified: TestAlmaServerKeyed (a Linux home with only
~/.local/share/alma and a fake Alma whose magpie provider has the old
key): Sync re-keys it to magpie-alma; XDG_DATA_HOME and ALMA_DATA_DIR are
followed, the desktop's folder wins, and macOS/Windows look only in the
desktop's. It fails without the change ("Alma's folder:
.../.config/alma, want alma-server's .../.local/share/alma").
TestAgentOf has alma-server's real User-Agent bytes: Alma with magpie's
Alma key, "ai-sdk" without. Go tests ran on Linux (golang:1.26 in Docker;
this Mac's syspolicyd held every new test binary at launch).
Not tried with a real alma-server, and an alma-server on another
computer, reaching magpie with a gateway key, still reads as the AI SDK:
its User-Agent says nothing of Alma.
|
||
|
|
577a0e4377 |
gateway: every upstream's call ids reach an Anthropic client as [A-Za-z0-9_-] only and go back to the upstream as it gave them, not only Devin's (#1304, StarMoonCity)
|
||
|
|
56d1665251 |
library: a skill an agent has of its own is removed from every agent that has it, from its row under "In your agents" (trash) or with d twice in the TUI, without bringing it into the library first (#1303, sxwedo)
Until now the only action on such a row was Bring in: removing it meant bringing it in and then removing it from the library. RemoveFoundSkill (skills/remove-found) takes out of each agent that has it its folder, or its copy of the very same files, and its links; its entry in the shared ~/.agents/skills, which agents read too, and a folder of it in the library's own folder go as well. Nothing is deleted: folders go to the backups (setAside), links are taken away, and a folder elsewhere that the agents only linked to stays where it is. Another skill by that name (Others) is a different skill and stays. The page asks first and says which agents it leaves and what stays. TestRemoveFoundSkill (library), TestLibraryPage's new part (TUI) and remove-found-skill.test.cjs (GUI) fail without the change. The GUI test fails 4 of 4 with library.js from before it, and passes in Chromium and WebKit, in en, zh, ja and de, and at 440px wide. Run: go test -tags nogui ./internal/library ./internal/tui ./internal/gui, and go vet for linux, windows and darwin with -tags nogui, in Docker (golang:1.26.8, a temporary HOME). The Mac's syspolicyd held test binaries at launch. On the Mac, in Chromium and WebKit: remove-found-skill, gui-ja, gui-de, i18n-keys, import-all-skills, own-skill, shared-skills, library-own-folder, library-items, remove-all-skills, library-desktop-skills, skill-name-many-agents and mobile-web, 133 of 133. In one earlier run of that set at load ~40, mobile-web's WebKit "idle scripts cannot scroll" failed once. It passed 3 of 3 alone with this change, and passed in the full rerun. Not tried: the reporter's own agents, and a WSL agent's folder. |
||
|
|
2da80009b0 |
gateway tests: TestClaudeOldSessionsAreSwept waits for the old session's folder as well as its file (red on ubuntu CI -race at 9275abcd: "the old session's folder stayed"). The sweep runs in a goroutine and removes <sid>.jsonl, then the <sid> folder; the test waited only for the file to go and then looked at the folder at once, so a goroutine preempted between the two removals failed it. The app is right, the test was wrong. Red before: with a 50 ms sleep put between the two removals in removeSession, the old test fails 5 of 5 with CI's message; the new one passes 5 of 5. Without the sleep, go test -race -count=50 -run 'TestClaudeOldSessionsAreSwept$|TestClaudeSessionFilesAreRemoved$' ./internal/gateway and gofmt -l pass (linux, golang:1.26.8 in Docker: this Mac's syspolicyd is pegged and new binaries hang at launch).
|
||
|
|
02ecc4ccf6 |
provider: moved Devin users get plugin 0.1.13, whose call ids Claude Code takes, going back to Devin as Devin gave them (#1304, StarMoonCity)
SWE-2's call ids ("Bash:0#a65b…") went to the agent as Devin gave them, and Claude Code dropped each call: "The model's tool call could not be parsed". Plugin 0.1.13 (magpie-community/plugins d33df7e) sends such an id as "dv_" and its base64url and turns it back for Devin. Raising the mover's min makes keepMovedCurrent update every moved user's plugin.
npm view @magpie-community/opencode-devin-auth version prints 0.1.13; the plugin's publish run had 973 pass, 0 fail. go vet for darwin, GOOS=linux and GOOS=windows pass; go test -tags nogui ./internal/provider passes on Linux (Docker; this Mac can't exec new test binaries right now).
|
||
|
|
d358107766 |
gateway: Devin's call ids reach the agent as [A-Za-z0-9_-] only and go back to Devin as Devin gave them, so Claude Code runs SWE-2's tool calls (#1304, StarMoonCity)
SWE-2 names a call after its tool and turn ("Bash:0#a65b6a5e02194b87bbc796c4428c946d"). Claude Code takes a tool_use id only of [A-Za-z0-9_-], dropped every such call and failed the turn with "The model's tool call could not be parsed (retry also failed)"; Codex and pi take any id. decodeDevin now sends an id with another character, or one beginning "dv_", as "dv_" and its base64url (devinOutID), and buildDevin turns it back (devinInID) on the assistant's call and on the result that answers it, so Devin sees its own id. A safe id goes both ways as it came. It is stateless, and the same mapping the Devin plugin makes in 0.1.13 (outID/inID).
TestDevinCallIDsSafeBothWays takes Devin's reply with the reporter's literal id through serveDevin on Anthropic, Chat and Responses, and answers the call in the next request of each: with devinOutID and devinInID made to return the id as it came (the old behavior) it fails "anthropic: call id \"Bash:0#a65b6a5e02194b87bbc796c4428c946d\", want one of [A-Za-z0-9_-] only"; with only devinInID taken out (a one-way clean, as the issue proposed) it fails too, Devin getting the cleaned id. TestDevinSafeCallIDsUnchanged keeps safe ids, and a caller's own "dv_…", as they came.
go test -tags nogui ./internal/provider ./internal/gateway pass on Linux (golang:1.26.8 in Docker, temp HOME, module cache mounted read-only): on this Mac every freshly built test binary hangs at exec (syspolicyd at 100% CPU), so no darwin test run. go vet -tags nogui for darwin, GOOS=linux and GOOS=windows and gofmt -l pass. Not tried against a real Devin account.
|
||
|
|
169c23c18e | stats: the day's event says which agents, providers and models magpie is used with, by magpie's own ids (a provider of the user's own, and its models, only "custom"), with how many of each and of routing groups: one "magpie uses" event per id in the same PostHog batch, so unique users break down by agent, provider and model. Settings → Privacy → Share the agents, providers and models I use turns it off (on by default; gone while Count me as a user is off); no names, URLs, accounts, keys or usage. go test ./internal/stats (payload, off switch, labels), the Privacy switch in Chromium and WebKit (en, zh), go test -tags nogui ./... in a temp HOME, go vet, GOOS=linux/windows builds pass; read against the real config: 9 agents, 24 providers, 25 groups in 0.75 s | ||
|
|
78d90571cf |
agent: each named omp profile is an agent of its own, on Windows and in each WSL distro (#1233)
* agent: each named omp profile is an agent of its own, on Windows and in each WSL distro (#1187) The Agents tab's omp row only ever wrote the one folder ompDir picks, so a profile started with omp --profile kept the model it had. ~/.omp/profiles/* is now listed per location: omp#<name> on Windows, omp#<name>@wsl:<distro> in a distro, each with the omp row's model, role and thinking controls writing that profile's own config.yml and models.yml. The profile the default row already points at (OMP_PROFILE) is not listed twice, and a stopped distro is not started to list its profiles: the names come from the probe and stay in wsl.json. * gui: an omp profile's id is encoded in the Agents page's requests (#1187) omp#<name> went into /api/agents/connect and the rest raw, so a browser read #work as the fragment and connected, disconnected or previewed the default omp row instead. api() now encodes each path segment, which is what agent-models and agents/cli already did for the id alone. * agent, gui: an omp profile name is one omp takes, and only its # is encoded (#1187) api() encoded every character of a path, so a query's ? = & became part of the path and Usage, quotas and Sessions 404ed. Only # is encoded now, which is what omp#<name> needs; a query stays a query. ompProfileOK also refuses the Windows device names omp refuses on every platform (aux, nul, com1, lpt9.x, con.work), and work. is checked through that rule rather than by making the folder, which Windows would turn into work. |
||
|
|
9275abcddb |
gateway: Codex's compaction on a CC Switch relay table that magpie points at /v1 completes, with a summary magpie makes, instead of failing "remote compaction v2 expected exactly one compaction output item, got 0 from 1 output items" (#1301, ylacmilan)
Codex compacts remotely (compaction v2: a compaction_trigger item on /responses, and exactly one compaction item back) for any provider table named "OpenAI" (codex-rs ProviderCapabilities::from_config, is_openai), and CC Switch names its relay tables so. While a magpie model is on, magpie points those tables at /v1 (takeTables). /v1/responses relayed the trigger as it came; the relay answered with a message, and Codex counted 0 compaction items out of 1. Only CodexPath turned the trigger into a summary request (codexInput, codexCompact). handle now does the same for a Responses request on /v1 that carries a compaction_trigger: the model summarises, and the summary goes back as magpie's compaction item. A later turn's magpie1: compaction item reaches the model as the summary's text, not as an item the relay can't open. TestCodexCompactionTriggerOnV1 fails without the change (one output_item.done of type "message", the relay's reply, where Codex needs one "compaction") and passes with it. Real use: codex-cli 0.160.1 in a sandbox CODEX_HOME with [model_providers.custom] name = "OpenAI", base_url = magpie's /v1 (built from this tree, `magpie serve` in a sandbox HOME on 127.0.0.1:3592), model token/gpt-6.1-sol on a fake Responses relay that reports 90K tokens and model_auto_compact_token_limit = 1000. Old build: `codex exec resume` printed the reporter's exact error, and the relay got the compaction_trigger. New build: "context compacted", the relay got Codex's compaction prompt, and the next two turns went on with the summary as a message. go test ./internal/gateway, go vet (darwin, GOOS=linux, GOOS=windows) pass. Not tried: the reporter's own relay and CC Switch version. |
||
|
|
0d55d9f6c2 | provider, gateway: a Codex account at its usage cap is held from the next turn on: each ChatGPT reply's codex.rate_limits event and x-codex-* headers update the account's reading, and routing's reading ages from when it was made, not when routing took it (up to two minutes old before); the cap's tooltip says a turn under way can still pass it (#1295) | ||
|
|
b927e09a10 |
gui tests: panel-arrange brings Done out from under the sticky tabs with the wheel, as the reader does, not Playwright's own scroll, which the page puts back as code's
Under load in WebKit Playwright's scroll into view left Done under #ptabs
("nav#ptabs intercepts pointer events") and the click timed out at :147
(25 of 28 parallel runs). After this, 28 parallel WebKit runs: 0 at :147.
|
||
|
|
d9d59435f4 |
gui: a wheel or touch scroll the page is told of only after the view scrolled stays the reader's, not put back as code's (a busy Mac lost the wheel step; panel-arrange's wheel to the foot went back to 0 in WebKit under load)
WebKit scrolls off the main thread, and under load the view's scroll event fires before the wheel that caused it (probe: scroll at 518ms, wheel dispatched at 521ms with timeStamp 517ms). The scroll guard took the scroll as no one's and put it back. Each put-back is now kept for a second, and a trusted wheel or touchmove made before it was put back, going the same way, gives it back. A scroll by code put back before the input was made stays put back. click-scroll.test.cjs "a wheel the page hears of after its scroll is still the reader's" delays the app's own wheel listener by 60ms (the trusted event kept), with nothing clicked and with a click held, and checks a code scroll before the wheel stays put back. Without the fix it fails in Chromium and WebKit: "the late-heard wheel must scroll the view". Run: click-scroll, context-scroll-end, tray-cell-click, panel-arrange in Chromium and WebKit, all green. panel-arrange 28 parallel WebKit runs (load avg ~150-200): origin/main 20/28 runs failed (:89 wheel undone x4, :147 Done x25); old app.js plus the test fix, 5/28 runs failed (:89 x6); both fixes, 27/28 and 28/28 (the one failure a page.goto load timeout), Chromium 28/28. Full GUI suite, both engines: the remaining failures are login-import, routing-sessions and plugin-market, which fail or pass the same way alone on origin/main. go test -tags nogui ./internal/gui ok. |
||
|
|
c8001d37da |
test: gofmt TestDescriptionSaysWhyTheModelCantSee's image source, which e7de897f left on one line (gofmt -l named it)
|
||
|
|
d5f434f308 |
gateway, gui: an Image recognition or Image generation model picked in Settings that magpie can't find any more is no longer replaced in silence: Settings › Models marks it missing and says what describes or draws in its place, and the description's row in Routing names it beside the automatic model that described instead (found on #1287)
Before, if the picked model didn't resolve (its provider removed or turned off, or the model gone), seer() and drawer() quietly fell back to AutoVision/AutoDrawer. Settings still showed the gone id as the pick, and Routing showed only the automatic model. The turn still goes ahead with the automatic model, so nothing the user sends breaks. What changed is that magpie now says so:
- VisionMissing and DrawerMissing (pickedMissing) name the pick that doesn't resolve. /api/settings carries them as visionMissing and imageGenMissing.
- CallFor.Missing is set on every description (withDescribeFor). This covers the single-model and group paths and every protocol. routing.js tells that story first.
- With no automatic describer either, the 400 and 502 a turn is refused with name the missing pick and where to change it. So does a draw request that names no model.
- renderImages and renderImageGen show "<id> · missing" in the picker and a red line under the row. The line names what stands in, or says nothing does, and asks the user to pick another model.
- zh, zh-TW, ja and de are translated.
Verified:
- New internal/gateway/vision_missing_test.go. I took out the behaviour (Missing on the row, the notes, the draw message) but kept the helpers so it compiles. Both tests then FAIL:
vision_missing_test.go:80: probe/text anthropic: the description's row is for {Agent:other Model:probe/text Unknown:false Missing:}, want it to name the missing gone/bigeye
(the same on responses, codex and chat, and for group/mixed)
vision_missing_test.go:116: probe/text with no describer: 400 ... "model \"probe/text\" does not support image input"
vision_missing_test.go:135: no drawer: 400 ... "no model to draw with: pick one in magpie's Settings → Images → Image generation, or name one"
- New internal/gui/tests/images-missing.test.cjs checks Settings › Models in en and zh at 1000px and 360px: the picker text, the line inside its row, and no page overflow. A pick that is found shows as before. routing-vision-why.test.cjs gains the missing row. With app.js and routing.js from before this change (Chromium): pass 2, fail 7.
- node --test images-missing, routing-vision-why, routing-side-calls, settings-sections, gui-ja, gui-de, gui-zh-tw and i18n-keys in Chromium and WebKit: 42 pass, 0 fail.
- go vet -tags nogui ./internal/gateway ./internal/gui passes on darwin, GOOS=linux and GOOS=windows. go build -tags nogui ./... passes.
- HOME=<tmp> go test -tags nogui ./internal/gateway ./internal/gui: ok (208.5s, 36.9s).
Not verified: no real magpie instance with a provider actually removed. The gateway was exercised through Handler with fake upstreams, and the GUI with a faked /api/settings. Drawing's own Routing row still doesn't say its model fell back: drawing calls have no story in kindWhy. Only the Settings row and the refusal say it.
|
||
|
|
f0a431651e | site: the Agents screenshots show today's page: eight agents on magpie (Claude Code, Codex, Gemini CLI, Antigravity CLI, OpenCode, Zed, Hermes Agent, Kimi Code), Show 21 more, the Sessions and Plugins tabs; en, zh and ja, light and dark; the docs give their new heights | ||
|
|
79f9b3752b |
sessions: a Codex archived copy rewritten at the same size in the clock tick of its last comparison is compared again, not taken from the cache, on Windows too (#1299, wizzy-yang)
The copy cache trusted a change time it had seen as proof the file had not changed. NTFS stamps ChangeTime from Windows' clock tick, not the precise clock: on the Windows box, 300 ms of back-to-back same-size writes got a new ChangeTime only every ~0.5 ms (2147 of 2691 writes kept the previous stamp; diffs 0.5/1.0/1.5 ms). A rewrite in the tick of the comparison kept the stamp the cache saw, so the cached relation was reused. That, not write merging, is why TestCodexArchivedSameSizeRewriteInvalidatesDiscovery failed 19 of 300 runs on Windows, alone as well as in the full package. A comparison is now cached only when both files' change times are more than a second older than the moment it started (codexStampSettle); a file changed more recently is compared again next time. A later rewrite then lands in a later tick and changes the stamp. Change times are compared as times (Windows FILETIME converted). TestCodexSameTickRewriteIsNotCached gives every write one change time and a clock 10 ms into that tick. With the settle rule taken out (cacheable = both stamps present), it fails: "a rewrite in the tick of the comparison reused its stale relation". With it, it passes, and the second half checks settled copies are still compared once, not every time. TestCodexArchivedDiscoveryCacheAndAppend moves its clock a minute on so the just-written copies count as settled. The Windows CI step now runs the Codex copy tests (CodexArchived, CodexSameTick, CodexPlainTwin), which it had never run. Run: Windows 11 box (cross-built sessions.test.exe, sandbox USERPROFILE/ APPDATA/TEMP): old binary 19/300 failures of the reported test; new binary 0/1000 for the three Codex copy tests, and the Windows CI regex x5 with testdata passes. macOS: go test -race ./internal/sessions, -race -count=30 of the Codex copy tests, go vet (darwin, GOOS=linux, GOOS=windows), gofmt -l. Not run: Linux with a coarse ctime clock (kernels before 6.13); the rule covers it the same way. |
||
|
|
6ab4c16f68 |
gateway tests: TestRestingKeyReadAgainInAnOrderedGroup has the relay hold a reading made after the key refused until the test has raised its limit (red on ubuntu CI -race at d7bdb076: "its limit raised: still rests by window till …, its windows read 3 times") — the third order 3e38bd76 didn't cover. The planning's reading, still out as the key refused, came back between the refusal and the test raising the limit; ee2588c2's re-read that follows it at once reached the relay first too, read the week still used up, and was trusted for its minute, so the planning after the raise didn't ask again and nothing lifted the rest within the test's 5 s. That is the app as designed (a key's windows are read at most once a minute; a reading made after the refusal is a true one), so the test was wrong: it assumed no reading could land between restAfter and the raise. It now models the owner raising the limit before magpie reads again: a reading that reaches the relay after the refusal waits until the limit is raised. Red before: with the first reading held 100 ms and 300 ms between the refusal and the raise (a preempted test goroutine), the old test fails 3 of 5 with CI's message ("… its windows read 3 times"); the new one passes 10 of 10, and 10 of 10 with each delay alone. Still guards ee2588c2: with the planning's reading held until after the refusal and the re-read taken out of readKeyAllowance, the new test fails 3 of 3 ("still rests by window …, read 2 times"), and passes 3 of 3 with it. go test -race -count=40 -cpu 1,2,4 -run 'TestRestingKey|TestKey|Lone|Allowance' ./internal/gateway at load average ~124, go test -race ./internal/provider, go test -race ./internal/gateway, go vet (darwin, GOOS=linux, GOOS=windows) and gofmt -l pass.
|
||
|
|
4b8bfd4676 |
gui: Routing's By session heads a Claude Code (and every other agent's) session with its own name, not its UUID (#1293, luzhuang)
Only Codex sessions were named (from Codex's index). The page now also asks POST /api/gateway/session-titles for the other agents' sessions it lists, as agent:id keys, and sessions.Titles reads each from the agent's own files the way the Sessions page does: the name given in magpie, else the agent's own title (Claude Code's ai-title / custom-title), else the first prompt. Each key is asked once; the names are kept on the page, so a live update that replaces the rows keeps them. A session with no file here keeps its id. TestSessionTitlesNameOtherAgents fails without the change (titles = map[]), and routing-sessions' "other agents' sessions show their own names" times out waiting for the name without the routing.js change. Run: HOME=<temp> go test -tags nogui ./internal/gui ./internal/sessions; go vet for darwin, linux and windows; the 72 routing GUI test files in Chromium and WebKit (491 pass, 0 fail). No new t() strings. |
||
|
|
fe405b23e2 |
gateway: a Codex on another computer reads magpie's models with a gateway key from GET /v1/codex/models, in Codex's own catalog shape, as its model_catalog_url; /v1/models stays OpenAI's list (#1281, jskorlol)
Codex decodes a model_catalog_url as ModelsResponse {models:[ModelInfo]}
(codex-rs model-provider/src/models_endpoint.rs), which /v1/models' OpenAI
list isn't, and /backend-api/codex/models relays to the ChatGPT backend,
which answers a gateway key (replaced by magpie's token) with 401. The new
route lists the models magpie shows Codex, as codexcat writes them for
model_catalog_json, kept to the key's models (keyAllowed, as /v1/models),
the ChatGPT account's own included (provider.CodexCatalog). Codex reads at
most 1 MiB of such a catalog (MAX_MODEL_CATALOG_BYTES); entries past it are
left out and counted in X-Magpie-Left-Out rather than failing the list.
Verified:
- TestCodexCatalogForAGatewayKey through lanGuard(Handler) from a LAN
address: required ModelInfo fields, unique slugs, held key sees only its
models, no key / wrong key 401, /v1/models unchanged. Without the route it
fails "404 ... magpie serves /v1/chat/completions ..."; with keyAllowed
removed it fails "held key: [plan/m1 spare/m2]".
- TestCodexCatalogFitsCodexsLimit: 300 models -> 127 in 1047147 bytes, 173
left out. Fails 404 without the route.
- Real Codex CLI 0.161.0 (npm) and 0.160.1 in sandbox CODEX_HOMEs against a
sandbox `magpie serve` (0.0.0.0:3591, LAN on, two gateway keys) over
10.0.0.111 with a fake chat upstream: models_cache.json holds the catalog
(held key: fake/fake-coder only; free key: both), no "Unknown model"
fallback warning, codex exec answered PONG-1281 through /v1/responses,
also with the reporter's requires_openai_auth = true. 0.160.1 needs
[features] api_key_model_discovery = true.
- go test -tags nogui ./internal/gateway ./internal/provider in a temp HOME:
ok. Full ./...: 44 packages ok (internal/agent had timed out once
under load; alone it passes in 45s). go vet; GOOS=linux and
GOOS=windows vet of gateway+provider and nogui builds.
Not verified: Codex's TUI /model picker driven by hand.
|
||
|
|
e387c5a2ed |
library: Alma takes the Library's MCP servers, in ~/.config/alma/mcp.json as its own MCP settings write them (#1292)
Alma 0.4.164 (read from a copy of its app.asar, out/main/index.js) reads
its servers from <home>/.config/alma/mcp.json on every system, as
{mcpServers:{name:{command,args,env} | {url,headers,transport?}}}: a
server with a url is streamable HTTP falling back to SSE, and SSE only
when transport is "sse". It has no ${VAR} expansion, so a server naming
a variable is refused for Alma as for Kimi or Devin. Alma reads the file
as it starts and when its MCP settings refresh; there is no watcher.
The user's own servers (the real file's computer-use entry with
ELECTRON_RUN_AS_NODE) are kept: TestAgentMCP's alma case writes one
first. Without the change TestAgentMCP/alma fails ("alma has no MCP
target") and TestTakesRefusesAlma refuses mcp.
Run: HOME=<temp> go test -tags nogui ./internal/library ./internal/agent;
go vet for darwin, linux and windows. Not tried with a running Alma.
|
||
|
|
5f0490a4ad | provider, catalog: a prompt cap above a model's window is held to the window (#1286) — a catalog row with limit.input over limit.context (opencode/hy3-free's 192K over 190K, Cloudflare AI Gateway's gpt-5 at 272K over 128K, venice/openai-gpt-52) was served past its window, to the gateway's /v1/models and to every agent compacting at it. The input limit still wins wherever it sits under the window (gpt-5's 272K of its 400K, a real prompt cap; OpenCode's own client compacts at input too), and a row naming only one number keeps it. TestPluginCatalogClampsInputAboveWindow and TestWindowClampsInputAboveContext fail without the change. go vet, go build -tags nogui and go test -tags nogui ./internal/provider ./internal/catalog under a temp HOME pass. (#1288) | ||
|
|
e7de897f93 |
gateway, gui: Routing now says why an image was described for a model. Either nothing magpie knows says the model sees images, so it is counted as text only, or its provider's list or the user's own setting says text only. It names the fix for each: tick "Accepts images" in the provider's models, or pick the describing model in Settings › Models › Image recognition (#1287, Admin123456-check)
The reporter set Codex to deepseek-v4.1-flash and saw a row "codex/gpt-6.1-sol · 图片描述" in Routing. The model was counted as unable to see images. With no Image recognition model set, magpie had a Codex account's model describe the image (AutoVision). The row said only "which can't see images", so it gave no reason and no way to change it.
CallFor gains Unknown. It is set when blindTo counted the model as text-only only because nothing says it sees (the request has no imageInput of its own). This holds on both the single-model path and the group candidate path. routing.js's kindWhy gives each case its own story. zh, zh-TW, ja and de are translated.
Verified:
- New TestDescriptionSaysWhyTheModelCantSee sends an image on the responses, codex, chat and anthropic routes. It covers an unknown model, a model whose list says text only, and a group of each. Without the gateway change it FAILs, e.g.
vision_unknown_test.go:182: probe/text responses: the description's row is for {Agent:other Model:probe/text Unknown:false}, want unknown true
with the same failure on codex, chat, anthropic and group/unknown.
- internal/gui/tests/routing-vision-why.test.cjs checks the vision row's tag and story in en and zh, in Chromium and WebKit. With routing.js from before this change it gives pass 0, fail 2.
- node --test routing-vision-why, routing-side-calls, gui-ja, gui-de, gui-zh-tw and i18n-keys: 18 pass, 0 fail.
- go vet -tags nogui ./internal/gateway ./internal/gui passes on darwin, GOOS=linux and GOOS=windows.
- HOME=<tmp> go test -tags nogui ./...: all ok except the root package and internal/plugin (TestHostRunsAsMagpieBun context deadline). Those fail only in the full run under load. Run alone, both pass (34.9s, 122.7s).
Not verified: the reporter's real provider. A throwaway test against the real models.dev data found no preset where deepseek-v4.1-flash counts as unable to see. So their case is one of: their provider's list says text only, a model setting, a stale models.dev cache, or a plugin. That is asked on the issue.
|
||
|
|
77f76ba203 |
test: TestPluginLoginTakesTheLapseOff no longer waits out macOS's first-run check of a fake browser it wrote, which ate its minute under a full go test run (#1284)
noBrowser put do-nothing open and xdg-open scripts first on PATH through testenv.Program. On a test binary's first run the program pool is empty, so warmAt ran each new script once and waited: macOS checks a newly written executable before its first run, and with other test binaries starting that took 26-55s a script (timed by hand; syspolicyd busy). It ran after fakeCoHome had started the test's one-minute context, so LoginUsage had no time left, the plugin's "expired" never came back, and the account wasn't marked (63.7s, line 63). Later runs in one process had a warm pool, so -count=3 alone passed from the second run. openInBrowser is now a variable; noBrowser swaps in a no-op and starts no program. It covers TestPluginLoginReadsUsageAfresh too (the only other caller). Verified, with two copies of a loader that runs freshly written scripts (a new script's first run: 31.9s): - old code, -count=1: FAIL TestPluginLoginTakesTheLapseOff (98.84s) "plugin_login_cli_test.go:63: the vendor's refusal didn't mark the account: [... Lapsed: ...]" - new code, -count=1: PASS (2.06s); -count=20: 20/20 PASS for both TestPluginLogin tests (1.65-2.63s) Without the loader: -race -count=10 of the root package's plugin login tests ok; root package ok; go test -tags nogui ./... 44 ok, 0 FAIL; go vet, GOOS=linux and GOOS=windows go vet -tags nogui . clean. |
||
|
|
1f14004676 |
provider: a CLI that fails to say who is signed in, or takes 5s or more, is asked again after 1, 2, 4… minutes up to 30, not every minute: a cursor-agent that calls itself no longer runs for 10s every minute (#1278, JJ-Lin)
Cursor's and Devin's sign-in is read from their CLIs (cliIdentity), asked again behind what is served once the last answer is a minute old. A cursor-agent that calls itself (an old ~/.local/bin wrapper running `cursor agent`) never answers: each ask ran its 10s timeout and started hundreds of processes, every minute magpie's pages or gateway read the accounts. With no Cursor token kept, it still counted as an answer (nobody signed in), so a "failed asks back off" rule alone would not have reached JJ-Lin's case: an ask that takes slowAsk (5s) or longer backs off too. A quick answer, or a sign-in or out (forget), has the CLI asked every minute again. What is served is unchanged: a failed ask keeps it, a slow answer is taken as before. Verified: - red without the change: TestCLIIdentityFailingAskedLessOften/fails and /slow both fail with "asked again a minute after the second"; pass with it (-race -count=3 with the other TestCLIIdentity tests). - go test -tags nogui ./internal/provider/ in a sandbox HOME; go vet -tags nogui of provider for darwin, linux and windows. |
||
|
|
1831ac4b63 |
proc: a CLI probe or agent run that is killed leaves nothing of itself running on Mac and Linux, even a launcher that keeps calling itself: its process group is signalled until it is empty, not once (#1278, JJ-Lin)
An old ~/.local/bin/cursor-agent that runs `cursor agent`, which (Cursor's own bin/cursor) first runs ~/.local/bin/cursor-agent --min-version=... status, calls itself without end. magpie asks cursor-agent who is signed in (about, 10s timeout) and kills the probe's session on the timeout with one SIGKILL to the group. On macOS that one signal can miss a process being forked as it goes out; the miss lives on, in the same group, adopted by init, and keeps calling itself until the user can start no process (JJ-Lin: ~4800 bash processes in one chain whose root's parent is PID 1). group.kill now sends SIGKILL to the group again every 5ms, behind the caller, until the group is gone (ESRCH) or 10s pass. The group keeps its id while any of it lives, so nothing else is signalled. It covers ProbeContext's timeout and EndProbes, and StartTree's Kill and sweep. Verified: - red without the change: TestProbeKillEndsWhatTheSignalMissed (the first group signal is made to miss, as the race does) fails with "what the probe started (pid 95576) outlived a kill that missed it once"; passes with it (-count=5). - reproduced the leak with the real Cursor 3.12.6 launcher script (/Applications/Cursor.app/.../bin/cursor, read only) and JJ-Lin's 87-byte wrapper in a sandbox HOME, under ulimit -u: ProbeContext(cursor-agent about) with a 10s timeout peaked at 311-700 processes; before the change 1 of 3 runs left a chain behind (root ppid 1, same pgid, args "agent --min-version=2025.10.01 status"), after it 0 of 6. A fake launcher (60 parallel self-calling chains, killed at 500ms) left survivors 4 of 30 runs before, 0 of 30 after. - the same through provider.askCursorStatus with the real launcher, 5 runs: no cursor process left after each. - go test -tags nogui ./internal/proc/ in a sandbox HOME; go vet -tags nogui of proc for darwin, linux and windows. |
||
|
|
14ed370e54 |
gateway: a temperature or top_p of 0 on the built-in Devin goes as 1e-6, so a greedy request isn't a 400 "an internal error occurred" for users not moved to the plugin (magpie-community/plugins#50, versun)
The same fix plugin 0.1.12 makes, for the built-in's buildDevin: Devin
answers every request with temperature or top_p exactly 0 with 400 "an
internal error occurred (trace ID …)", on every model; 1e-6 goes through.
Any other value goes as it came, and none still as Devin's defaults
(1, 0.95).
Verified: TestDevinSamplingZero fails on the old devin.go ("temperature
0: temperature 0 top_p 0.95, want 1e-06 0.95", likewise top_p 0 and -0)
and passes with the change. It also catches top_p left unchanged and
every value under 0.5 sent as 1e-6. Devin's behaviour was checked live
on a real account through the plugin's request, which carries the same
field 8 (0 → 400 on swe-2 and claude-sonnet-5-5, 1e-6 → 200); the
built-in path itself wasn't run against Devin. go vet (darwin, linux,
windows) and go test -tags nogui ./internal/gateway pass in a sandbox
HOME.
|
||
|
|
d226f87e4c |
gui: on KDE Plasma's Wayland session the quick panel has no KWin title bar or frame, as the main window has none (#1283)
GTK 3, which the Linux builds link, announces server-side decorations over org_kde_kwin_server_decoration for every window that isn't client-decorated, an undecorated (frameless) one too (gtkwindow.c realize: announce_ssd), and KWin then draws its title bar on it. The main window escapes it through plainTitlebar's hidden titlebar widget. The panel now announces client-side decorations after each realize (ownFrame: gdk_wayland_window_announce_csd), at start and when lightweight mode makes it again. GTK 4 already asks for none, X11 and compositors without the protocol never see it. Run: on real KWin 6.3.6 Wayland (kwin_wayland --virtual with Breeze, Debian trixie arm64 container, -tags gtk3 test binary): WAYLAND_DEBUG shows request_mode(1) and KWin answers mode(1); a KWin script reads the panel's frame 440x520 = its client 440x520. With ownFrame skipped: request_mode(2), frame 442x557 over client 440x520 (KWin's title bar and borders, the reporter's picture). go vet -tags gtk3 ./internal/gui ok there; macOS go vet/go build ok; GOOS=linux/windows go vet -tags nogui ./internal/gui ok. Not tried: the reporter's Manjaro Plasma session, a GTK 4 build, GNOME/Hyprland (no KDE protocol there, so unchanged). |
||
|
|
23cd1bb609 |
gui: closing the quick panel from its title bar (or Alt+F4, a window manager's close key) hides it as Escape does, so the tray icon opens it again; it was closed for good and the icon did nothing until a restart (#1283, KDE Wayland)
The system's close reaches Wails as WindowClosing, which destroyed the panel while h.panel and the tray still held it. makePanel now hooks WindowClosing: the panel cancels and hides; one lightweight mode let go (h.panel no longer it) still closes. Run: TestPanelCloseHidesIt (AppKit, new) passes; with the hook's check forced to let the close through it fails "panel close: the panel closed for good; the tray icon can't open it again". On real KWin 6.3.6 Wayland (kwin_wayland --virtual, Debian trixie container, GTK 3 build) a KWin script closeWindow() on the panel (what its title bar X does): with the hook alive=true and a second Show is visible; without it alive=false and Show shows nothing. go test ./internal/gui ok (darwin, GUI tag); go vet, go build ok; GOOS=linux/windows go vet -tags nogui ./internal/gui ok, GOOS=windows go vet ./internal/gui ok. go test -tags nogui ./...: all ok but internal/agent (11m timeout) and internal/plugin TestHostRunsAsMagpieBun under load average ~110; neither imports internal/gui, and TestHostRunsAsMagpieBun passes alone. Not tried: the reporter's own Manjaro Plasma session; Windows' Alt+F4 on the box. |
||
|
|
b66481a953 | provider, gateway: Volcengine plans expose their own models by kind (#1265) | ||
|
|
ad4361fb93 |
cli: magpie models and magpie provider <id> name the models a provider's list has that it doesn't expose, and why (not picked, or only the first ones with none picked); a group's member that is one of them says "not exposed · magpie provider models <id> +<model>" rather than only "not served" (MOMO on Discord: 35 exposed of 37, opencode-go/deepseek-flash missing from magpie models)
Verified: TestModelsSayWhatIsNotExposed and TestGroupMemberNotExposedSaysHow fail on the old code (magpie models and magpie provider og never name deepseek-flash; magpie groups says only "(not served)") and pass with it. |
||
|
|
c28a819a8e |
library: an agent that can't be given instructions, skills or MCP servers says where they go instead and lists the agents here that take them: OpenChamber has OpenCode's (give them to opencode), Claude Desktop keeps its instructions in its own settings and its Code tab reads Claude Code's (MOMO on Discord)
OpenChamber's server reads the global AGENTS.md, skills folder and opencode.json from OpenCode's config folder (openchamber/openchamber packages/web/server/lib/opencode/shared.js at 866dffd), so no path of its own is added; a second target on the same files would write them twice. Verified: TestTakesSaysWhereInstead fails on the old Takes with "Claude Desktop has no user-wide place for instructions that magpie knows of"; internal/library passes in a sandbox HOME. |
||
|
|
7712ef8e7c |
gateway: a routing group is served by its name too, so a client the user typed a renamed group's name into (ZCode) reaches it rather than 404 "magpie knows no model"; magpie group set <id> name=… says the id stays and what agents ask for (MOMO on Discord)
provider.GroupFor tries the group's id and the model's spellings first, as before, then the one group whose name (by its slug) is the id asked. A name two groups share names neither, and a model a provider serves by that id stays the provider's. Verified: TestGroupAskedByItsName fails on the old GroupFor with 404 "magpie knows no model \"DS Flash\""; TestGroupRenameSaysTheIDStays fails without the message. internal/provider and internal/gateway pass in a sandbox HOME. |
||
|
|
3d5b212f6a |
cli: magpie provider models <id> +model adds a model to those exposed and -model takes one out, the rest kept; the whole-list form still replaces, and now says so with the count before and after and how to add one instead (MOMO on Discord: 35 exposed became 8 with nothing said)
provider set models= says the same. Taking out a model that isn't
exposed, mixing +/- with plain ids, or leaving none exposed (which would
mean the default list) is an error that saves nothing.
Verified: TestProviderModelsAddsRemovesAndSaysWhatItReplaced fails on
the old code ("+deepseek-flash left [+deepseek-flash]") and passes with it.
|
||
|
|
d2241a5798 | agent: Copilot in JetBrains IDEs takes magpie's models as a Bring Your Own Key custom endpoint provider, written into the Copilot language server's byok.json beside the user's own (KamToHung on Discord) | ||
|
|
a2a7fb1123 |
gateway, gui: Claude Desktop can list a model of 1M or more once, as its 1M entry (#1272)
Claude Desktop reads magpie's gateway models and, for every row whose
max_input_tokens is 1,000,000 or more and whose id has no [1m] suffix,
adds a second "1M context window" entry; an id that already ends in [1m]
gets one entry (BIt/PIt/JLt in Desktop's index chunk). So every 1M model
showed twice. A new switch under Agents → Claude Desktop, "Only each
model's largest window" (settings desktopLongest, off by default), lists
such a model by its [1m] id. Models under 1M keep their real window;
fast/non-fast, providers and groups stay separate rows. The base id still
resolves (aliased, Resolve and SwitchedOff trim [1m]), so sessions saved
on it keep working. Desktop needs a restart to re-read the list.
Verified:
- TestClaudeDesktopLongestOnly fails without the change ("on: 6 entries
of 4 rows") and passes with it; the [1m] and old plain ids reach
upstream as the same model.
- Desktop's own discovery and menu code, extracted from a copy of
app.asar, run over magpie's output: off 4 rows → 6 entries, on 4 rows
→ 4 entries.
- desktop-longest.test.cjs (Chromium and WebKit, en/zh, 1100/640px)
times out on origin/main's app.js and passes 8/8; gui-ja, gui-de,
gui-zh-tw, i18n-keys, desktop-model-menu, desktop-tiers,
agent-models-redraw and click-scroll pass 44/44.
- go test (sandbox HOME, nogui) gateway, gui, settings, agent pass;
go vet for darwin, linux and windows.
- Full GUI suite: 3802/3809. agent-expand-steady, panel-arrange,
redact-rule-row, remote-magpie and signin-again pass alone;
context-window fails alone with origin/main's assets too.
Not verified: the real Desktop menu after a restart (its live config was
not touched).
|
||
|
|
6030fe88ca |
provider: moved Devin users get plugin 0.1.12, where a temperature or top_p of 0 reaches Devin as 1e-6 instead of a 400 "an internal error occurred" (magpie-community/plugins#50, versun)
Devin answers every request whose temperature or top_p is exactly 0 with 400 "an internal error occurred (trace ID …)". Callers asking for greedy output (Hermes Agent's command approvals send temperature 0) failed on every devin/* model. Plugin 0.1.12 sends a 0 as 1e-6; the mover's min raises moved users to it through keepMovedCurrent. Verified: against a real Devin account, the plugin's complete() on 0.1.11 gives 400 for temperature 0 and top_p 0 on swe-2 and claude-sonnet-5-5, and 200 for 1e-6; 0.1.12 gives 200 for all of them. 0.1.12 is on registry.npmjs.org. go vet (darwin, linux, windows) and go test -tags nogui ./internal/provider pass in a sandbox HOME. |
||
|
|
21a5cf0894 |
provider: moved WorkBuddy users get plugin 0.1.12, where a chat's tools get shapes WorkBuddy AI's models take, so ZCode's and DeepSeek Harness's chats on deepseek-v4.1-flash aren't 400 "Invalid request parameters" (wyh on Discord)
WorkBuddy AI answers 11133 "Invalid request parameters" to a tool whose parameters have no type, are empty or a root union, hold a pattern's \0 or a tuple's items, or whose name holds . : / a space or CJK; DeepSeek's models refuse each, others some. Plugin 0.1.12 (magpie-community/plugins 17e7532) mends them and names the model's calls back. Run: through a sandbox gateway (temp HOME, port 3486) with the plugin and the owner's WorkBuddy AI account, deepseek-v4.1-flash, -sg, glm-5.3, gpt-5.4, gemini-3.5-flash and kimi-k3 answer 200 to each shape (400 before), on Chat; a fs.read tool called over Messages comes back as fs.read, streamed and not. go test -tags nogui ./internal/provider/ ok; GOOS=linux/windows go vet ./internal/provider/ ok; npm view (npmjs) shows 0.1.12. Not done: the built-in WorkBuddy path, for users who haven't moved; wyh's own ZCode/DeepSeek Harness tools were not seen. |
||
|
|
0f8e4ebc48 |
gateway: TestRestingKeyReadAgainInAnOrderedGroup reads the key's card before planning, so its windows aren't read unraised before the limit goes up
Red on main's Race (run 37754525077,
|
||
|
|
67329b8d9c |
sessions, gui: a session's conversation is exported as Markdown from its details on the Sessions page (#1276)
Beside Show conversation, Export Markdown saves the whole conversation (Claude Code, Qoder, Codex, Pi, oh-my-pi: every agent whose transcript the page can show) as a Markdown file: a heading with the session's agent, id, folder, times, models and file, then each turn under User / Assistant, a tool's call by its name and arguments, its result, thinking and the agent's own notes folded in <details>. Parts are kept whole (the page's 8000-char cut doesn't apply), fences grow past any backticks in the text. In the app it goes to Downloads (never over an earlier export) and the status says where; in magpie web the browser downloads /api/sessions/markdown. The session is found as listed, never a path from the page; the file is only read. Verified: TestMarkdownClaude, TestMarkdownCodexAndPi, TestMarkdownUnsupported (sessions) and TestSessionExportMarkdown (gui) under a temp HOME. Without the routes TestSessionExportMarkdown fails "export: 404 404 page not found"; with the page's per-part cut TestMarkdownClaude fails on the long part. sessions-export.test.cjs (Chromium+WebKit, en/zh, app and web, 560px) fails on origin/main's sessions.js waiting for .sess-export; passes with it, as do sessions-talk, gui-ja, gui-de, gui-zh-tw and i18n-keys. Exported real Claude Code, Codex and Pi session copies: fences balanced, turns in order. go vet (darwin, GOOS=linux, GOOS=windows) -tags nogui on both packages. |
||
|
|
f7cf98ee3a |
update: a magpie off the Mac that can't write to the folder it runs from (a magpie.exe kept at C:\) says so, naming the folder, beside "a new version is out" and on the Update pill, instead of opening the release page with no reason (#1277, baymax0306)
Before, a binary in a folder magpie may not write to, on a system that
can't ask for the administrator's password (Windows; Linux without
pkexec), was left with no exe to replace and shown only "{v} is out";
Download opened GitHub. The reporter found the cause themselves: the exe
was at C:\. updater.placeExe now marks it stuck "not-writable" with the
folder, and updateStuck says to move it to a folder the user can write
to; zh, zh-TW, ja and de strings added.
Verified:
- TestUpdateNotWritableSaysWhy (internal/gui) fails without the fix:
"a binary in a folder magpie can't write to: {State:available ...
Stuck: StuckDir: ...}"; passes with it.
- update-stuck.test.cjs, Chromium and WebKit, en/zh/ja/de at 1000px and
440px: 18/18 pass; without the app.js change it fails (the reason text
never appears, waitForFunction timeout).
- gui-ja, gui-de, gui-zh-tw, i18n-keys, update-*.test.cjs, cli-path:
136/136 pass in both engines.
- go vet ./internal/gui, go build, GOOS=linux/windows go vet -tags nogui
./internal/gui, GOOS=windows go build; sandbox HOME go test -tags nogui
./... all ok.
- On the Windows box, update.Writable (a windows/amd64 build, over ssh)
is false for a folder whose ACL denies the user write. Over ssh the
token is High integrity, so C:\ itself reads writable there; a
standard user's C:\ and the GUI on Windows weren't tried.
|
||
|
|
0b7a740ee6 |
gui: Usage's Context tab names its agents when the state answers after the routing history, not by their ids until the history changes
context.js draws each agent card and session row with the agent's name and
icon from the state (agentLabel, agentIcon). When /api/context answered
before /api/state, the cards were drawn by the agents' ids ("claude", a
generic icon). The state's arrival calls loadContext again, but a read that
brought the same history returned early ("the same answer keeps the pane"),
so the ids stayed until the history itself changed.
The "same answer" key now holds what the pane is drawn with besides the
history: each agent's id, name and icon from the state. Once the state is in
the pane is drawn again (still, without its entrance animations); a refresh
with the same history and the same agents still keeps the pane.
This is one of context-window.test.cjs's failures under load and alone: its
Claude Code card is found by hasText "Claude Code", which the card titled
"claude" never matches (":129 locator.innerText: Timeout 5000ms ...
.ctx-agent hasText 'Claude Code' .ctx-grade-word"). "codex" matched "Codex"
since hasText ignores case, which hid it on the other card.
New test in context-window.test.cjs: /api/state is held until the two cards
are drawn, then they must read "Codex, Claude Code".
Run:
- New test on origin/main
|
||
|
|
ceccd0e17f |
gui tests: panel-arrange records the menu bar cell's flash as it is lit, not by a poll that can miss its one frame under reduced motion
panel-arrange's last part calls panelQuotaFocus("deepseek") and waited for
the card to have the `flash` class. The test emulates reduced motion, and
app.css's reduced-motion rule makes every animation .01ms long, so the
flash's animationend comes within the same frame: logged, the class was on
for one frame (animationend at elapsedTime 0.00001) in every run, passing
or failing. A rAF poll sees it only if it lands in that frame; under load
it often didn't (4 of 12 parallel runs red on origin/main, all at :156).
The app is right: the card is drawn, scrolled to and flashed. The test now
records each card given the class through a MutationObserver installed
before the call, and waits for "deepseek" to be among them.
Run (Chromium and WebKit, en/zh/ja/de):
- 12 parallel copies on origin/main
|
||
|
|
d1fca72f69 |
library: the Library's MCP servers go to WorkBuddy and CodeBuddy Code (#1266)
WorkBuddy had skills only, and CodeBuddy Code had no library target at all,
so their MCP chips could not be switched on.
WorkBuddy 5.5.6 (app.asar) reads ConnectorService.customMcpConfigPath:
$WORKBUDDY_CONFIG_DIR, then $CODEBUDDY_CONFIG_DIR, then ~/.workbuddy, plus
mcp.json, as {"mcpServers": {...}} in Claude's shape. It connects a server
only once the user has switched it on in its MCP settings
(mcp-approvals.json, module.app-server.js). magpie doesn't write that
approval. Instead, the servers page tells the user to switch it on once,
in en/zh/zh-TW/ja/de.
CodeBuddy Code 2.162.0 (PathUtils.resolveMcpFilePath) reads the first of
<dir>/.mcp.json, <dir>/mcp.json and <base>/.codebuddy.json that exists.
<dir> is $CODEBUDDY_CONFIG_DIR or ~/.codebuddy. The file holds mcpServers
in Claude's shape, and ${NAME} is expanded (McpConfigEnvExpandService).
User scope needs no approval. Skills go in <dir>/skills.
Verified: the real CodeBuddy Code 2.162.0 CLI, in a sandbox HOME, read
SaveServer's file back with `mcp get` and `mcp list`. That covered stdio
with ${MY_TOKEN} expanded, http and sse, and the user's own entry and
disabledMcpServers were kept. WorkBuddy.app was not run; its side is
from its code.
Tests: TestAgentMCPFiles (4 new cases) and TestCodeBuddyMCPFile fail
without targets.go. library-workbuddy-trust fails without library.js.
Run: go test ./internal/library ./internal/gui; go vet for darwin, linux
and windows; in Chromium and WebKit: gui-ja, gui-de, gui-zh-tw, i18n-keys,
click-scroll and all library-* GUI tests.
|
||
|
|
d7bdb0765f |
agent: with magpie Codex's provider, Codex's own models on the Agents page say what picking them does: one magpie serves on a ChatGPT account is picked as magpie serves it and Codex stays on magpie; any other reads "direct, not via magpie" and asks before taking Codex off magpie (#1269, shenghsi)
Picking Codex's own gpt-5.5 tagged "via magpie" while magpie was Codex's provider took Codex off magpie at once, with no question: the tag came from routed(), but set() unroutes for a model of Codex's own unless it is joined beside a ChatGPT sign-in or on magpie API. Verified: TestCodexProviderOwnModelSaysItsPath fails without the change (gpt-a reads Via:true with no ChatGPT account; Value gpt-a, not codex/gpt-a, with one), passes with it. Reproduced and checked in a sandbox HOME with Playwright against `magpie web`, on macOS and on Linux (WSL2 Ubuntu 24.04, codex-cli 0.161.0): before, picking gpt-5.5 left Codex "Not connected"; after, it reads direct and opens "Take Codex off magpie?". go test -tags nogui ./... green; go vet for darwin, linux, windows on internal/agent. |
||
|
|
8bbc03ac78 |
provider: moved Cursor and Devin users get plugin 0.1.11, whose split parallel tool calls keep their results (#1275)
cursor 0.1.11 and devin 0.1.11 (magpie-community/plugins 78780b8, 994d580)
join an assistant message onto an assistant message before it that made
tool calls, as joinSplitCalls does in the built-ins since
|
||
|
|
716c8c9544 |
provider: moved Grok and Devin users get plugin 0.1.10, whose tool schemas with a root union go folded with nested branches kept (#1271)
grok 0.1.10 (magpie-community/plugins a6910fd) folds a function's root-union parameters, which it sent as they came; devin 0.1.10 (fbee8a0) keeps the fields of branches that are unions themselves. Both are on npm (npm view, 2026-10-08). |
||
|
|
c8ac18a2ca |
gateway: Grok on a relay's key or xAI's own API gets a tool's root-union parameters folded to an object, so Codex's turns aren't refused (#1271)
Only the Grok subscription's requests were folded (grokBody). Grok
anywhere else refused Codex desktop's automation_update the same way:
AiHubMix's grok-4.7 on its Chat API answered the real schema 400
"Failed to start sampling: [invalid_client_tool_schema] ... tool parameter
root must be an object type" (2026-10-08) and 200 once folded; xAI's API
(api.x.ai) had no fold at all. OpenRouter's x-ai/grok-4.7 takes the union.
xAI's API now gets such tools folded from the first request. Any other
upstream that refuses one for its root ("tool parameter root must be an
object type", or Anthropic's "does not support oneOf, allOf, or anyOf at
the top level" behind a relay's Chat API) is asked once more with them
folded, passed through or translated, and that model is folded from then
on. An upstream that takes the union gets it as sent.
TestRootUnionFoldedWhereRefused (Responses passed through, and Codex's
Responses translated to a Chat-only relay, with AiHubMix's bytes) fails
without the gateway.go change: the client gets the 400. TestRootUnionFoldedForXAI
checks xAI's host is folded and another isn't. go test -tags nogui ./...
in a temp HOME: all pass but the root package and internal/gui under load,
which pass rerun alone; vet for darwin, linux and windows; builds for all three.
|
||
|
|
faab600e50 |
provider: a tool's root union whose branches are unions themselves folds with their fields kept, so Grok can create a Codex automation (#1271)
xiaocui12: Codex on Grok, "[invalid_client_tool_schema]
mcp__codex_app__automation_update: tool parameter root must be an object
type (root schema is an anyOf/oneOf union with a non-object branch)".
Codex desktop's automation_update (ChatGPT.app 26.930, zod 4's
toJSONSchema with $defs) is a root anyOf of view, delete, create and
update, and create and update are unions on kind themselves. ObjectRoot
dropped those nested branches: the fold kept only mode (const "view") and
id, both required. Grok took the tool but could only view.
A branch that is itself a union is now folded first (on a copy, up to 8
deep); a field the root doesn't define takes each distinct schema the
branches give it, as anyOf when they differ; a field every branch
requires stays required (here only mode).
Verified with the real Grok subscription and the real schema
(testdata, rebuilt with zod 4.1.8 from ChatGPT.app's app.asar): raw, 400
with the reporter's exact message; the old fold, 200 but no tool call when
asked to create an automation; the new fold, 200 and
{"mode":"create","kind":"heartbeat","name":"CI watch","prompt":"check CI",
"status":"ACTIVE","destination":"thread","rrule":"FREQ=MINUTELY;INTERVAL=30"}.
TestObjectRootNestedUnion fails without the change ("no name among
[id mode]", "required = [mode id]", mode leaves out "delete", kind null).
|
||
|
|
e5e87d980a |
支持 Ante:把 magpie 作为 provider 写进 ~/.ante/catalog.json (#1210)
* agent: Ante takes magpie as a provider in ~/.ante/catalog.json Ante (antigma.ai, AntigmaLabs/ante) is asked for in #1179. Its catalog is ~/.ante/catalog.json ($ANTE_HOME moves the folder), merged on top of the providers it ships: a providers map keyed by the id --provider takes, each with base_url, wire_style (AnthropicMessage, OpenAiCompatible, OpenAiResponse or Gemini), an optional auth, and preferred_models, the ids its model picker shows (docs.antigma.ai, reference/catalog-reference). magpie adds the entry "magpie" at the gateway's /v1 on OpenAiCompatible, which is the wire style Ante speaks Chat Completions with and what the gateway takes every model on, and lists magpie's models in its preferred_models. The user's own providers and the models section are left as they are, and magpie's entry goes again when magpie steps out; a file magpie made goes with it. No auth block is written. The gateway listens on loopback and lets any token in from this machine (gateway.Token's own comment, lan.go's identifyCaller: "Loopback takes any token"), and Ante counts a provider with no auth as authenticated. A bearer env_key would mean putting the gateway's key into Ante's environment, which the user would have to do themselves -- the same decision Empryo's entry makes, which sends no key of the user's either. A gateway shared on the local network is another matter, and the same one every agent magpie wires has. Two things are deliberately left off a model's entry. A routing group is not told what it reasons at: which member answers, and what that member takes, is the group's own to decide per turn, and magpieModels sets no APIs for a group for the same reason. And support_vision is never written: Ante takes a model as seeing images unless told otherwise, and what magpie knows is only as good as a provider's own list -- a relay's models are often not described at all, so writing false would have Ante drop the reader's images before the gateway, which describes them to a model that can't see them itself (provider.Described). No other agent magpie wires declares it either. Ante ships macOS and Linux builds alone and suggests WSL on Windows, so the Windows machine's Ante is usually the one in a distro: wslKinds gains it beside Empryo, which also means the gateway address Ante is pointed at is the one that distro reaches magpie on (place.base), and a distro not known to be in mirrored networking gets the notice it already gets for the others. TestAnte covers a user's own providers and models section kept as they are, magpie's entry added and taken away, Sync repointing it, and a file magpie made going again. TestAnteKeepsTheUsersFile covers a catalog magpie can't parse costing magpie's provider and not the user's. TestAnteGroupSaysNoCapab ilities covers a group declaring neither effort nor support_vision. TestAnteEfforts covers the ladder: Ante's has no "none" or "minimal", its two lowest, so both are its "min", and the rungs come out in Ante's order whatever order magpie lists them in. Tried with a real Ante 0.2.9 in WSL Ubuntu: magpie wrote the catalog, and `ante catalog` then read 16 providers with magpie's among them, 39 models, and Ante filled in support_vision: true for each itself. Ante then ran a real turn through the gateway — `ante --provider magpie --model group/auto-deepseek-v4-1-flash -p …` answered, and magpie's own usage log has the request (ep /v1/chat/completions, req the group's id, served by one of its members, out 10) — and so did a second model on another provider. The gateway was reached over the Windows host's address from the distro (172.17.128.1), this machine's own being on 127.0.0.1 alone, which is what notMirrored tells the user about. go vet, gofmt -l and go build (linux nogui, windows) pass. go test -tags nogui ./internal/agent: 12 failures here, the same 12 on unmodified main (the Windows ones AGENTS.md lists). ./internal/gui and ./internal/provider: TestGatewayFixQuitsOnlyAMagpie, TestPurposeAssetMatchesUsage, TestUpdateThatWontStart and TestLoginUsageClaudeAskedMeanwhile, all four on unmodified main here too. docs/reference.md's adapter table gains Ante. * agent: Ante keeps the user's own keys, reads ANTE_HOME, sends no effort it wasn't told to, and starts Ante on magpie (#1210) Seven points from the review, each with a test that fails without it. 1. ANTE_HOME was in the file's own comment and in docs/reference.md but never read: the path was fixed to $HOME/.ante, so a user who set it had magpie write a catalog Ante does not look at. anteDir reads it through place.getenv, the way MiniMax Code reads MINIMAX_DATA_DIR, so a distro's own ANTE_HOME - which magpie can't read - still means ~/.ante there. "ANTE_HOME" joins agentenv.Vars so a sandbox clears it. 2. providers.magpie was written whole, so every key of the user's that magpie doesn't write - the auth block a gateway shared on the LAN or reached from WSL needs to send a key, http_headers, extra_body, stream_idle_timeout_secs, thinking_display - went at the next sync, and an unchanged catalog was rewritten every round. It goes through theirsKept and syncJSON now, as #1103 did for the others: the user's keys in magpie's entry stay, preferred_models is magpie's list alone, and a file that says the same as it does is left as it is. 3. The two files were written in separate steps, so a change that failed halfway left Ante's catalog without magpie's entry and its settings still naming magpie. Each field's Set and its Sync are wrapped in atomic(), as empryo, minimax and kimi do. 4. The comment said Ante's "min" was the rung it sends no effort at, and folded both magpie's "none" and its "minimal" into it. Ante's reference says what min is: "OpenAI-compatible providers send the selected level as the same-named reasoning_effort (min is sent as minimal)" - so min is a sent level, and magpie's "none" has no rung of Ante's to fold into. Ante's "min" is magpie's "minimal"; a model magpie knows only "none" of comes out as the empty list, which is Ante's own way of saying it takes no effort setting at all. 5. The default was the highest rung the model takes, so every model magpie listed ran at Ante's slowest and dearest level. No effort is written: "Omit for models with no reasoning knob (Ante then sends no effort parameter and hides the effort slider)". 6. Having magpie in the catalog never meant Ante used it. What a session starts on is the provider and the model of ~/.ante/settings.json; with neither set Ante "uses the first authenticated provider in catalog order", and Ante's own presets come before magpie's entry - so while the user has any of those signed in, that is the one picked and magpie is not. (Measured: nothing named in settings, two keyless providers ordered aaa_other then magpie, and the request went to aaa_other's port; settings provider=magpie and it went to magpie's.) magpie sets that pair now and saves what it found there, so Disconnect hands it back; a provider the user picks in Ante's own /providers while magpie is wired is theirs and stands, and Check says so instead of keeping quiet. Ante's settings name the model apart from the provider, so magpie writes the catalog id it put in preferred_models, un-prefixed, and reads a bare id as magpie's only beside magpie's provider. Tests lean on the package's own testenv, not a real ~/.ante. TestAnteSyncKeepsTheUsersKeys is modelled on ad3b7fe5's TestAirProviderWritesKeepCustomFields and goes both ways - sync and pick - and wants an unchanged file to keep its mtime. Tried with a real Ante 0.2.9 in WSL Ubuntu on this machine (Ante ships macOS and Linux builds alone; there is no Windows Ante here). The strongest of these is the whole of it: magpie's own Go code - ante(home).Connect(), then the model field - wrote a catalog.json and settings.json into a temp folder, that folder was handed to the real Ante as ANTE_HOME, and Ante ran a turn through it with no --provider, no --model and nothing typed by hand. - `ante doctor` read `home ok /tmp/ante-e2e` and `16 providers (1 authed), 108 models` from ANTE_HOME, and magpie's entry came back with the base_url it was given: ANTE_HOME really moves the folder, and a base_url already ending in /v1 is not doubled (the request went to /v1/chat/completions). - What a session starts on is settings.json's provider, measured against two keyless providers each answering on its own port, so the logged port names the one Ante asked. Catalog ordered aaa_other then magpie, nothing named in settings: Ante asked 44331, aaa_other - the first authenticated in catalog order, exactly the review's "很可能选不到 magpie". settings provider=magpie: it asked 44220, magpie. settings provider=aaa_other: 44331 again, so a pick the user makes in Ante's own /providers overrules what magpie wrote, which is why stepping out leaves it rather than handing back the one magpie found. And with magpie the only authenticated provider, auto-detection does reach it - so the catalog entry is not useless, it is simply not enough while the user has any other provider signed in, which is every real install. - What Ante sends for effort, from the same files: no reasoning_effort at all for a model with no effort written (item 5, as its reference says omitting it sends none); `--effort min` on a model sent `reasoning_effort: "minimal"` - Ante's min is magpie's minimal, exactly item 4; and a model Ante was told `"supported_efforts": []` for sent no reasoning_effort even when asked `--effort low`, which is what a none-only model now gets instead of a level that refuses it. - The user's own keys inside magpie's entry are ones Ante reads, not decoration: `ante catalog` hands back the entry's auth, http_headers, extra_body, stream_idle_timeout_secs and thinking_display unchanged, and a bearer env_key there makes `ante doctor` count the provider as the one authed. That is item 2. - The no-auth decision holds on Ante's side, isolated by doctor's counts: Ante's own presets alone read `15 providers (0 authed)`; a magpie with no auth block reads `(1 authed)`; the same magpie given a bearer env_key that isn't set drops back to `(0 authed)`; with the key set, `(1 authed)`. So an entry with no auth is authenticated and one that asks for a key the user doesn't have is not - writing an env_key, which the first version's comment considered, would have made magpie the one provider Ante refuses to auto-detect. - Ante fills `support_vision: true` in for itself, as the PR's own note said, and a routing group declared with no capabilities at all still worked. Not covered by that run: the stand-in server answered inside the distro, so this proves Ante's config handling end to end, not a live magpie gateway relay (the first commit's message records a real turn through one). Every probe used ANTE_HOME into a temp folder; this machine's real ~/.ante gained no catalog.json or settings.json. What each fix failed without it, one test each: taking ANTE_HOME out -> TestAnteHome "$ANTE_HOME ignored"; theirsKept out -> "the user's auth lost or changed"; syncJSON out -> "an unchanged catalog was rewritten"; atomic out -> "settings.json kept half of a change that failed"; the old min mapping -> "anteEfforts([minimal high]) = [high], want [min high]"; a written default -> "deepseek/pro: effort written"; settings never pointed at magpie -> TestAnte; a model never written -> TestAnteModelField; Check left quiet -> "moved off magpie: \"\""; handing magpie back over a pick the user made while wired -> TestAnteKeepsWhatTheUserPickedWhileWired; never restoring the model -> TestAnteConnectDisconnect "not put back"; Connect picking the model field instead of magpie as provider -> "Connect left the user's model beside magpie's provider"; ANTE_HOME kept out of agentenv.Vars -> TestFolderVarsAreListed. Taking preferred_models out of the whole list is the one mutation no test turns red on: mergeTheirs cannot merge a JSON array (sync.go returns want for it), so the file behaves the same either way and the argument is there for intent and for the other keys, not for behaviour. go vet ./... and go build ./... pass, as do GOOS=linux go build -tags nogui ./... and GOOS=windows go build ./..., and gofmt is clean on LF content (this clone has core.autocrlf and no .gitattributes, so gofmt -l reports every file). go test -tags nogui ./internal/agent fails twelve tests, and an untouched worktree of origin/main run the same command on this machine fails the same twelve, test for test; ./internal/agentenv, ./internal/appdir and ./internal/edit pass, and every Ante test passes at -count=5. The whole ./... was run on both: the failing sets are alike, origin/main having one more, TestLoginUsageClaudeAskedMeanwhile, already filed as #1228. None of those twelve is this change's, and none is fixed here. * docs: agent-wiring records that Ante keeps the user's keys in magpie's entry and starts on settings.json's provider (#1210) The two rules the review asked for, written where the repo keeps them - the same lines |
||
|
|
1b29cb81a2 |
agent, wslrun, sessions, gui: Settings → General has Detect agents in WSL; off, magpie asks wsl.exe nothing and shows no WSL agents or sessions (#1264)
On Windows magpie lists the running distros and probes each one for agents, their sessions and Claude Code. Etsuya233 asked for a way to turn that off. settings.NoWSLAgents (per machine, kept by KeepOwn) now gates every auto-discovery path: agent.wslAgents/wslHomes/WSLRunning, sessions' wslFiles/wslDirs (via the new sessions.WSLOff hook), and wslrun.Find, which the Claude subscription uses to run Claude Code in WSL. The toggle is shown on Windows only and is on by default. Verified: - red without the change: TestWSLDetectionOff (1 WSL agent with detection off; with only sessions reverted, a distro's session is listed), TestFindWithDetectionOff (Find returned Ubuntu after asking wsl.exe). - go test -tags nogui ./... in a sandbox HOME: every package ok except TestPluginLoginTakesTheLapseOff, which timed out at 63.7s under the full run and passes alone (-count=3) and with its package (-count=1); it doesn't reach WSL. - go vet -tags nogui on agent, wslrun, sessions, settings and gui for darwin, linux and windows. - GUI: wsl-agents-setting (en/zh/zh-TW/ja/de, 900 and 440px) 30/30; gui-ja, gui-de, gui-zh-tw, i18n-keys, keep-awake, lightweight, settings-sections, settings-groups 44/44 in Chromium and 44/44 in WebKit. - Windows box (10.0.0.132), nogui magpie.exe in a sandbox profile with a logging wsl.exe first on PATH: on, `magpie agents` listed Claude Code · WSL magpie-desktop after 3 wsl.exe calls; off, `agents`, `ls` and `sessions` made no wsl.exe call and wrote no wsl.json. Not tried: the toggle in the real Windows GUI window, and Claude Code in WSL through the Claude subscription with the setting off (unit-tested only). |