e5994a0159e88dbcfbb04f8b587b8b7fee3a9c19
2331
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
f5553d7103 |
sessions: a Pi subagent's calls are its lead session's, on its own model (nzvzbmz78932 on X)
nzvzbmz78932 on X: "在pi子代理中使用了deepseek 但是不显示用量". pi-subagents (npm 0.88.1) runs each subagent as a Pi of its own, its session in <lead file's folder>/<run id>/run-<n>/session.jsonl (async and parallel runs a level deeper), or under extensions/subagent/config.json's defaultSessionDir, its header's parentSession naming the lead's file. magpie read only sessions/*/*.jsonl, so those files were never read. The lead's `subagent` tool result carries the subagents' usage summed, and piParse counted it on the lead's model and provider: a lead on magpie's entry made it the gateway's (piGateway), so DeepSeek's calls were on no page, Usage or Sessions. - piFilesIn reads every session file under a lead's folder as the lead's (non-main, like omp's), and the defaultSessionDir ones through their headers' parentSession, up to 8 levels. - piSubagentsRead: a tool result whose every sessionFile is one of those counts nothing, in piParse and piCall; one naming a file not read still counts as before. - The scout's header id is in Session.Subs (pi is idInFile), so a subagent on magpie's entry is the lead's row to the gateway too. - state.codexPath is parsePath, the file read, for piLeadID: a new field took state past its 416-byte class (TestStateFitsItsSizeClass). - parseVersions and callParseVersions pi/raft/cindy raised. The fixture is a real run: Pi 1.4.0 with pi-subagents 0.88.1 in a sandbox PI_CODING_AGENT_DIR, a lead and one scout on a relay's deepseek/deepseek-flash; system prompts dropped, paths rewritten. Run (mica, at this head): - go test ./internal/sessions: ok (119s) - GOOS=linux and GOOS=windows go vet ./internal/sessions: ok; gofmt clean. - Linux (wsl-run, magpie-desktop): TestPi*, TestOmp*, TestCodex*, TestStateFits*: ok TestPiSubagentCalls: beside the lead and in defaultSessionDir, each with the lead on the relay and on magpie's entry (the reporter's case). Broken by hand: without the walk, 3 of 5 calls and 0 of 2 with the lead on magpie (red); without the tool-result skip, 6 calls, the sum counted again (red); the Subs check was red while it named the run id. Not tried: the reporter's own files; a subagent nesting subagents; a subagent run on magpie's entry against a live gateway. With f0fb22c6b and 5bc816c1a below it, at this head (mica): go test ./internal/sessions ./internal/agent ./internal/claudecode ok, ./internal/gateway -run TestClaude ok, GOOS=linux and windows go vet of the four ok, gofmt clean. |
||
|
|
9205ee109c |
agent: the Claude Code magpie downloaded keeps ~/.claude from reading as "CLI not found"
Wing8Aqua on X runs magpie as a systemd service on Ubuntu, where the Claude subscription runs the Claude Code magpie downloaded (claudecode.Install, in its cache folder, off PATH). Magpie's own runs make ~/.claude, and the Agents page took that folder, with no `claude` on PATH, for an uninstall's leftover: Claude showed "CLI not found" while that Claude Code answered every request, and `magpie claude` starts it. cliHeld now counts claudecode.Downloaded() for Claude Code. Run: TestCLIMissing* in internal/agent on Linux (wsl-run): ok, with a case for a download and one for a version folder without its binary. Broken by hand (the download not counted): case 5 red. |
||
|
|
6fad0d0465 |
gateway: a run waiting a minute on its subagents gives its Claude Code place to one that needs it
Wing8Aqua on X (0.1.4026, Ubuntu, magpie.service with memory.high 768M): "4 Claude Code processes are running, as many as may run at once (768 MiB of memory (cgroup /system.slice/magpie.service/memory.high) holds 4); none ended within 2m0s". An ask that finds the room full lets go of an idle run, else of a run parked on tool results, but only one parked parkLongest (5 minutes), while it waits claudeRoomWait (2 minutes). A lead conversation waits on its parallel subagents' Task calls for as long as they work, and every subagent is a conversation needing its own Claude Code: the lead held a place, doing nothing, while a subagent waited the 2 minutes and was answered 503. letGoForRoom now takes a parked run once it has waited roomParkLongest (1 minute), well inside claudeRoomWait. Its results go to a new run told the whole conversation, as past parkLongest; a tool answered within the minute keeps its run, and busy runs are never let go. Run: TestClaudeRoomLetsALeadWaitingOnSubagentsGo, with the room tests (TestClaudeRoom*, TestClaudeRunsHeld*, TestClaudeOneOffs*, TestClaudeParked*, TestClaudeNoRoom*, TestClaudeMem*) on Linux (wsl-run, magpie-desktop): ok. Broken by hand (parkMost back to parkLongest): the subagent got the 503 after 30s, red. Not tried: the reporter's machine; whether their 4 were busy rather than parked is not known (their `magpie claude-code runs` would say). |
||
|
|
880da8c17e |
agent: ZCode is told a model takes video, so a video it attaches reaches it (Flandern1211 on X, #5098)
A model whose source lists video input (antigravity/gemini-4-argon, say) reached ZCode as text and image only, in config.json's modalities.input and in provider_config.json's inputFormat, so ZCode never attached a video to it. buildModels left the catalog's kinds out of the agent model, and zcode.go rebuilt the list from m.Images. - buildModels carries Entry.Modalities() into InputModalities and OutputModalities. - zcodeInputs adds "video" when the model lists it and the provider's format is Messages or Chat. ZCode's own built-in rules (3.14.3's zcode-builtin.json) use inputFormat.supportsVideo, so the key is one its strict schema takes; it is written only when true. Ported from Flandern1211's fork branch (fix/zcode-video-input, e955d3c24), with these differences after review: - Its gateway half (Messages video block and Chat video_url as a file part) is on main already, since |
||
|
|
7758da0770 |
agent: Crush is told which models take images (Novello42 on X, #6515)
Crush's view tool answered "This model (…) does not support image data", its file picker (ctrl+f) was hidden and a pasted image was left out, for every model through magpie. magpie wrote Crush's providers.magpie.models without catwalk's supports_attachments, so each model decoded with SupportsImages false (capabilities.vision false once Crush 0.99 migrates the file: migrateCatwalkV2Model, internal/config/load.go). Each model now carries supports_attachments from m.Images, as OpenCode's modalities do. Checked against catwalk and Crush main: Crush's load.go moves supports_attachments to capabilities.vision; catwalk v3 reads vision. Report and root cause: #6515 by DaVinci42. Not changed: magpie still writes Catwalk v2 keys, which Crush 0.99+ rewrites to v3 on load; filed as #6521. Test: TestCrushModelsSayTheyTakeImages, red on origin/main |
||
|
|
456b5c6c74 |
alibaba: a RAM user's NotAuthorised names the grants Token Plan needs (#6506)
hkxhkxhkx on X (#6506, v0.1.4026, gateway on OpenCloudOS): the Token
Plan personal edition's usage, read with a RAM user's AccessKey, fails
with BailianGateway.Team.NotAuthorised. The RAM user had the
AliyunBailian* and AliyunModelStudio* policies.
magpie calls the right API: GenerateCLIAccessToken, then the console
gateway's zeldaHttp.apikeyMgr./tokenplan/personal/api/v2/usage, the same
call Alibaba's own CLI (modelstudioai/cli, `bl usage token-plan`) makes;
its only other parameter, switchAgent, is for delegated access, not RAM
users. Alibaba's Token Plan docs (personal FAQ; permissions and usage)
list what a RAM user needs, and none of it is a Bailian/ModelStudio
policy:
- the AliyunTokenPlanReadOnlyAccess (or FullAccess) system policy,
- AliyunBSSReadOnlyAccess for the personal edition,
- the Administrator or Subscribe Plan permission for the RAM user on
Model Studio's Account Management page.
The NotAuthorised error now says those three and where, or to use the
main account's AccessKey. Any other refusal now carries the console's
errorMsg (read as raw JSON, so an odd type doesn't hide the code).
Tests: TestAliGatewayRAMNotAuthorised answers the call with the
console's NotAuthorised envelope and checks each grant is named, and
that another code shows its errorMsg. Broken by hand: the old message
makes it red on five checks.
Run on mica (and again after the rebase onto
|
||
|
|
80c22eecba |
agents: Codex leaves a model unchecked in its provider's list (JNDliuliuM on X)
JNDliuliuM: after picking new models for a provider, Codex CLI didn't change, and after a restart it was still on the old model. magpie wrote the new list, but Codex's `model` (config.toml, or magpie.config.toml for `codex -p magpie`) stayed on the model the user had unchecked. Resolve still takes any provider/model, so Codex kept starting on it and asking the vendor for it. Tried with the real codex-cli 0.165.0 in a sandbox CODEX_HOME, profile wiring: the list was swapped from sub/old-a, sub/old-b to sub/new-x, sub/new-y. After a restart, /model listed only the new ones, but the status line still read sub/old-a, as the profile named it. What changed: - provider.Unpicked(id) reports a model the user has since unchecked: the provider has picks, its served models lack the model, and it isn't a decision model. This is the same rule ResolveRoute already applies to routing groups (#3911). - agent.pickedInstead moves such a model to the first model of that provider that magpie lists for the agent now. - Codex's Sync calls it before its other model branches, through set, as picking the model does. The profile's Sync calls it through put. The Codex app reads the same config.toml, so it follows too. - Left alone: - a provider with no picks, whose list is the vendor's and may lack the model (#2642); - a provider with none of its models listed any more. Run on mote: - TestCodexLeavesAModelUncheckedInItsProvider (as provider, beside a ChatGPT sign-in, profile) and TestCodexKeepsAModelOfAProviderWithNoPicks; - go test ./internal/agent/ ./internal/provider/; - go vet for darwin, linux and windows on both packages; - gofmt. Result: internal/agent ok (470s). internal/provider is red only on TestHostBuildsNoList (a Gemini provider's Host allocates 5 times), which is #6479 and was already red on main. Broken by hand: with the Codex Sync call disabled, the "as its provider" and "beside the sign-in" subtests are red ("model = sub/old after sub/old was unchecked"). With the profile call disabled, the "by its profile" subtest is red. Not tried: - the fixed magpie with a real Codex; - the Codex app. Not changed, filed as #6504: other agents' model fields, and Codex's subagent and compaction models. |
||
|
|
f4a73672ef |
routing: a ChatGPT API account is weighed by its Codex twin's reading, and its story lines wear its own logo
tmr11235 on X (v0.1.3924): a routing group of two ChatGPT accounts, each
added both as Codex and as ChatGPT API (chatgpt-api). The Codex rows read
their week and reset; the story below said "剩余额度未知,排在已知的之后"
next to the Codex logo, so it read as the Codex rows being unknown.
Two causes, both still on main:
- The story's lines were about the ChatGPT API accounts, but a line
named only an account's name, and logoed() put the logo of the first
member of that name in the order: the Codex twin. asides() now says
which member each line is about (by its place, as two lines may say
the same words), and renderSteps hands it to logoed(), as it did for
a skipped member's line only.
- OpenAI tells a ChatGPT API account's plan usage nowhere magpie can
ask, so Smart weighed it as unknown and put it after every known
account, though it spends the same plan as its Codex twin.
Allowances("chatgpt-api") now gives such an account the Codex
account's allowance (samePlanAllowances), matched as
SamePlanAccounts matches them: both tokens' chatgpt_account_id and
chatgpt_user_id, never the name, so two Team seats of one email stay
apart. One with no Codex twin stays unknown. The Routing card reads
the same figure, as it reads the gateway's.
What was run (GUI on the Linux box through wsl-run, mote over its load
then; Go on mote):
- go test ./internal/provider -run 'TestChatGPTAPIAllowanceIsTheSameAccountsCodexReading|TestRenewedAccountForgetsItsAllowance|SamePlan': ok
- node --test routing-twin-logo (new; chromium and webkit; en, zh,
zh-TW, ja, de; 1100 and 420): 20 of 20 ok.
- Every GUI file that opens the Routing page (199) plus i18n-keys and
i18n-en-no-cjk: 3533 ok, 61 red in 13 files (click-scroll,
ctx-head-narrow, ctx-route-align, ctx-session-line,
inner-scroll-contain, mobile-web, routing-ctx-sessions,
routing-many-keys, routing-pin-away, routing-pulse-composited,
routing-row-swap, routing-sky-under, routing-story-shrinks). The same
13 files at origin/main
|
||
|
|
cc42ec1d7e |
agent: an api set by hand in Pi's models.json stays (xiaomanweiman on X)
T3 Code's Pi puts all 71 of its tools into the context on openai-completions and only 3 on openai-responses, loading the rest when asked. The reporter set providers.magpie.api to openai-responses in ~/.pi/agent/models.json, and the next catalog sync wrote openai-completions back. piAPIsKept (pi_api_kept.go), called from piBlockKept (Pi, its forks and Aside), keeps an api the user set for magpie's provider or for one of its models. As with a maxTokens typed by hand (output_kept.go), the stash records the APIs magpie wanted per file (api:<path>:wanted), and an api in the file that is none of them is the user's. A model's keeps its baseUrl and compat with it. With no record yet, the provider's is taken as openai-completions, the only value magpie ever wrote there, so a file edited before this release keeps the user's value on its first sync. An api the file lacks is magpie's. A Chat model left on a provider the user put on Responses gets compat.supportsStrictMode, as magpie's own Responses models have it (#3055). magpie's default is unchanged: a model whose provider speaks Chat stays on Chat, relayed as Pi sent it, and no setting was added. Run (mote): go test -count=1 ./internal/agent/ ok (322s); go vet ./internal/agent/ for darwin, GOOS=linux and GOOS=windows; gofmt -l clean. TestPiKeepsAnAPISetByHand covers a value set before any record, set back by hand, a model's api with its baseUrl, and one taken out. Broken by hand: with the piAPIsKept call commented out the test goes red ("provider api = openai-completions, want the user's openai-responses"). Not tried: a real Pi or T3 Code (neither is installed here); the full suite runs after the push. |
||
|
|
5d54a990d4 |
usage: switched-off providers' accounts can be checked in, and Check in all (wxkwxk666 on X)
wxkwxk666 asked for two things on the Usage page. First, a provider switched off should still show its accounts, at the bottom and folded, so they can still be checked in each day. Second, one button should check in every account at once. - provider.OffCheckins (off_checkins.go) lists every account a checkiner reaches whose provider is switched off (Off, not Hidden). Each is a card with no windows. Nothing is read or asked for it. Its check-in result is matched by its own key, not by its name, since two sign-ins can share a name (plugins#254). GET /api/usage/checkins/off serves the list. - The Usage page (plugins/usage) adds a "Switched off · n" line after the cards and the hidden line. It is folded until clicked. Each account shows today's check-in, and a Check in button when it isn't checked in yet. The button uses checkinnow.js's ciNowSend, which POSTs /api/usage/checkin-account. - Check in all, at the head of the allowances, presses every account not checked in today, from the cards and from the switched-off line. It sends one checkin-account request per account, three at a time, shows "Checking in i/n…", then gives the counts (checkinPressSaid). When no account is due, it says so and sends nothing. - Nothing switches a provider back on. The new strings are in zh, zh-TW, ja and de. Plugin files only: app.js is unchanged. - docs/subsystems/provider-plugins.md says all of this. Run, on mote: - TestOffCheckinsListsSwitchedOffAccounts, in the fakeco plugin sandbox: - nothing is listed before the switch-off; - after it, two cards with distinct keys; - a press on one checks in exactly that account; - the provider stays off; - only the pressed card carries a result; - nothing is listed once the provider is switched on. - go test ./internal/provider ./internal/gui, at this commit on origin/main |
||
|
|
0fda3a1c12 |
cli: provider set resolve.<host>=…, the editor's Connect to from the CLI (quantum_lsfc on X)
v0.1.4012 added Advanced › Connect to (Provider.Resolve) in the GUI
only; the reporter asked for it from the CLI. `magpie provider set <id>
resolve.<host>=<IP or dns:name>[,…]` sets a host's connect addresses,
an empty value takes the host out, and `resolve=` clears them all (any
other resolve= value is refused, never saved). provider.Save checks
them as the GUI's do (netproxy.CheckResolve, TakesResolve), so a bad
place or a vendor's own host is refused with nothing written. `magpie
provider <id>` lists them as "connect". Usage and docs/reference.md say
how.
Run on mote: go test -count=1 ./internal/cli ok (166s);
TestProviderSetResolve ok; go vet ./internal/cli for darwin, linux
(-tags nogui) and windows ok; gofmt -l clean. A nogui build in a
sandbox HOME on mote: provider add + set resolve.api.corp.example=
10.0.0.5,dns:gw.corp.example saved and shown as connect; resolve=oops
and a bad place refused; resolve= cleared it; provider set --help
printed usage.
Broken by hand: not deleting the host on an empty value, and taking a
non-empty resolve=, each turn TestProviderSetResolve red.
Rebased on origin/main
|
||
|
|
a4cd61f77f |
claude: a turn refused for the account's limit keeps its session till the reset (#6292)
A Claude subscription turn refused for the 5-hour limit before any reply (429) ended its run through relay's abort, and the conversation's native session went with it. After the reset the turn was told whole to a new Claude Code: 354,900 tokens written to the cache again (recih). Now relay's abort is told the status and words (relayFailing); on a 429 keepForReset shelves a copy of the session cut before the refused turn (no user line, no synthetic error line), under the turn's key. Cut at backLine/backMsg for a resumed idle run, or at fromLen (the saved file's length at start) for a run started from a saved session that has answered nothing, so a turn refused again while still limited is kept again. It waits until the reset the refusal names, else the account's used-up window's reset from the rate_limit_event (KeptClaudeLimits), else 5h; plus 1h, at least idleLongest, at most longestQuota (8d). until goes into claude-shelf.json, so the entry survives a restart. Shelf still capped at shelfMost. Run (on mica; mote was over its cores): - go test -tags nogui ./internal/gateway/ -run 'Claude|Shelf|Relay|Bridge|Subscription': ok 93s - new TestClaudeTurnRefusedForTheLimitKeepsItsSessionTillTheReset (print and interactive: two refusals, restart, then --resume of the cut session told the turn alone) and TestQuotaShelfFor: ok - GOOS=linux and GOOS=windows go vet ./internal/gateway/: ok; gofmt clean Broken by hand, each red: - keepForReset call removed: "try 1: no session kept" - fromLen forced to 0: "try 2: no session kept" - fromLen cut at the file's end (refused turn kept): "try 2: the kept session isn't the conversation before the refused turn" Not tried: a real account hitting its real 5-hour limit; Claude's "resets 9pm" text is still not parsed by resetsAt (the rate_limit_event's resetsAt covers it). The full suite runs after the push. |
||
|
|
a95a7a1cd8 |
providers: each API key can bill at a price rate of its own (tnt12231 on X)
A relay sells keys in groups that bill at different rates against the
official price (0.5x on one, 1.2x on another) under one endpoint, and
magpie had only the provider's price rate. Now a key can have its own:
- provider.KeyPriceRates, keyed by key id like KeySpendCaps: cloned,
normalized on save, carried when a key is replaced. A key without one
bills at the provider's PriceRate. A price the user set for a model
stands as set, as it does under the provider's rate.
- Usage prices each call at its key's rate (usage.Pricer memoizes per
key id, BaseKeyPriceIn), so the Usage page, a key's spend cap and its
typed balance follow it. PriceAt, used to route by price, takes the
rate of the key the provider holds.
- GUI: the provider editor's Advanced has "Price rate per key" under
Price rate, shown only with two or more keys, folded past 8 keys like
the per-key proxies. An empty line shows the provider's rate as its
placeholder. Save sends keyPriceRates ({} clears, left out keeps).
The lines, the check and the placeholder live in keyrates.js,
imported when a provider with two or more keys opens. The core's
budget goes up 397 for what is left in app.js (the import, the
draft's copy, Advanced opening for it, the save's line, proxyLines
drawing another kind of line); app.js stays under its own.
- CLI: magpie provider key-rate <id> [key [rate|default]].
- docs/subsystems/providers-accounts.md: a Key price rates row.
Run, at this head (rebased on
|
||
|
|
287a1ffa26 |
gui: Hermes's other profiles are picked on the one Hermes row again (Norethcy on X)
Norethcy on X, v0.1.4022: "Hermes 其他 profile 的配置消失了,只有默认的 Hermes Agent". |
||
|
|
5a2d0ff478 |
claude-desktop: Use Claude Magpie, a twin on magpie in one click (xMopf7RF on X)
xMopf7RF asked for the Separate app to be reached like a phone's app twin: one button that makes a second Claude Desktop on magpie and leaves their own Claude Desktop as it is. Claude Desktop's row, while it isn't on magpie and Desktop can run so (macOS), now has "Use Claude Magpie": it turns the Separate app on (settings/desktop-isolated) and then connects Desktop, so only Claude-Magpie-3p is wired, and says to open Claude Magpie from Applications. The order matters: connecting first would wire the user's own Desktop. The button is drawn by claudemagpie.js with the fold; app.js keeps the one line that places it, so the core budget goes up by 81. Run, at this commit: - TestCoreScriptBudget; gofmt clean. - GUI on mote, Chromium and WebKit: desktop-twin (five languages, 1100 and 640px: the posts in order, the status, the button gone after, no scroll, no native select; no button without the Separate app), desktop-isolated-claude, desktop-isolated, i18n-keys, i18n-en-no-cjk, old-webkit (its two reds are on origin/main, #6467, #5919), and every agent*/desktop*/claude* GUI file; its reds are all on origin/main (#6467, #5919, #6373, #5925, #6179, #6371, #6475). Broken by hand: connecting before turning the Separate app on turns desktop-twin red (the post order). Not tried: clicking the button in a real Desktop; the two calls it makes are the ones the commit before ran for real (launcher add, then claude- desktop magpie, in a sandbox HOME on mote). |
||
|
|
6bc0d1e203 |
claude-desktop: Claude Magpie's Code tab on a Claude Code folder of its own (#6459)
The Separate app (Claude Magpie.app, #5671) kept its own Desktop
userData, but its Code tab's bundled Claude Code still read and wrote
the user's ~/.claude: their CLAUDE.md, skills, plugins and history went
into the twin, and the twin's sessions into theirs (xMopf7RF on X).
An opt-in, macOS-only switch under the Separate app's Advanced fold
(settings.DesktopIsolatedClaude, POST /api/settings/desktop-isolated-
claude, `magpie claude-desktop launcher claude-dir on|off`) gives it
~/.claude-magpie-desktop:
- desktopiso.Script exports CLAUDE_CONFIG_DIR in the app's launch
script; turning the option on or off remakes the app, and the hint
says to quit and reopen Claude Magpie, since a running one keeps its
environment.
- desktopOn writes Desktop's model windows, caps and explore entries
into that folder's settings.json instead of ~/.claude's while it is on
(desktopCodeDir, desktopClaudeSync); off moves them back. The folder
is kept when it is turned off, and shows as the claude# row "Claude
Code · Claude Magpie".
- The fold is drawn by claudemagpie.js, imported the first time it
shows; what stays in app.js is the import (isoLazy) and the fold's
place, 216 bytes, so the core budget goes up by 180 (the 36 of room
there was taken first).
Run:
- gofmt -l clean; go vet ./internal/... on darwin, GOOS=windows and
GOOS=linux -tags nogui vet of agent, cli, desktopiso, gui, settings,
settingsapi (mote).
- go test agent, cli, desktopiso, desktopdir, settings, settingsapi,
gui, library on mote: all ok except cli's three healthcheck/update
tests, which ask the gateway mote's own magpie serves on :3425
(#6223, the same with or without this change).
- TestCoreScriptBudget and TestSettingsSaveKeepsWhatItDoesNotSend at
this commit and the next.
- GUI on mote, Chromium and WebKit: desktop-isolated-claude (five
languages, 1100 and 640px), desktop-isolated, i18n-keys,
i18n-en-no-cjk, old-webkit, and every agent*/desktop*/claude* file
(98 files, 1,595 of 1,662 pass). Every red is the same on origin/main
|
||
|
|
1c6dc247ed |
codex: the Codex app restarts once for magpie's list named after it started (not_4O4 on X)
not_4O4 (X, magpie 0.1.4012, Windows): the ChatGPT app's Work tab
listed GPT alone, in a new window and in a new project on D: too.
The app-server reads model_catalog_json only as it starts. codex-rs
app-server model_catalog.rs reloads only when needs_reload is set,
which happens on an account change alone. The app keeps one
app-server for all its windows, and on Windows it runs from login
(StartupTask). So a list magpie named after the app-server started
never reached the picker. That happens when the list first becomes
known (the backend answering, or the models_cache stand-in from
|
||
|
|
16b8c300fe |
provider: a Gemini compatible URL saved as a bare host is asked at its /v1beta (equinox0253 on X)
|
||
|
|
92bce5c724 |
remote magpie: a request under way takes the address saved now
le13ure on X: after the LAN address of a magpie used as a Remote magpie provider changed and the user edited it in the provider, requests already under way kept retrying the old address instead of switching. Each request held the Provider it started with, and its retries (the same-one pauses up to 8s, a group's and a provider's patience up to 30s) asked that copy's address again. The look for a moved magpie (SeekMoved, v0.1.3177) ran at most once a minute, so other requests within the minute got nothing from it and kept the stale address. And a dial to a LAN address no one holds now waited on the OS (~75s macOS, ~127s Linux) per try. - provider.Readdressed: a Remote magpie copy moved onto the address saved now. The gateway's try loop asks it before each try; SeekMoved returns it when another look or the user saved one. - provider.Edited: store() signals every save; a pause between tries (pauseAlive, new pauseUntilReaddressed) ends when the waiting Remote magpie's address changed, so the next try goes at once. - netproxy: Dispatch's transports give a dial to a private or link-local IP literal 5s (lanDialCap). Names, public, CGNAT/Tailscale untouched. - docs: providers-accounts "A remote magpie that moved". Run (mote, nogui, at this tree): go test ./internal/netproxy ./internal/provider ./internal/gateway -run 'TestLANDial|TestLAN|TestDispatch|TestRemoteMagpie|TestPauseEnds|Patience|Replan' ok; go vet of the three packages for darwin, linux and windows ok; gofmt -l clean. mote was at load ~28 over its 18 cores (mica's disk is full), so timings ran slow. Broken by hand, each red: lanDialCap off (TestLANDialGivesUp, "no deadline"); Readdressed out of SeekMoved (TestRemoteMagpieSavedElsewhereIsTaken); the loop-head Readdressed off (TestRemoteMagpieRetryGoesToTheSavedAddress, 503 from the old address); the Edited wake out of pauseUntilReaddressed (TestPauseEndsWhenReaddressed, the pause ran its full 30s). Not tried: a real two-computer LAN move; the full suite before the push (started after it). |
||
|
|
db9a5ec7c4 |
gateway: Claude Code's advisor runs in magpie for a model whose upstream can't (Awad_Yoo on X)
Claude Code 2.1.316 sends its advisor (/advisor, settings.json's
advisorModel) for any model when CLAUDE_CODE_ENABLE_EXPERIMENTAL_ADVISOR_TOOL
is set: an advisor_20260301 server tool, which only Anthropic's server
runs. Until now magpie left it out for every other upstream (
|
||
|
|
18b46f5c25 |
sessions: the Kimi desktop app's Work calls reach Usage
CNSA0422 on X: magpie didn't count local usage from the Kimi desktop
app. Its Work agent is Daimon, which runs the Kimi Code runtime it
vendors with its own home under the app's share folder, so its calls
are written as Kimi Code's usage.record lines in a folder magpie never
looked in.
Read from Kimi 3.2.27's own bundle (com.moonshot.kimichat, Daimon
1.0.10, Kimi Code runtime 0.5.1): the app passes KIMI_SHARE_DIR, which
is <userData>/daimon-share or the absolute shareDir in
<userData>/daimon-storage.json; Daimon alone falls back to ~/.kimi.
The sessions are <share>/daimon/runtime/kimi-code/home/sessions/<slug>/
<id>/agents/<agent>/wire.jsonl. userData is kimi-desktop under
~/Library/Application Support, %APPDATA% or ~/.config.
- kimi_work.go finds the shares and adds their wire files to Kimi
Code's ("kimi"), as MiniMax Code Desktop's count as MiniMax Code's.
Found() lists kimi when only Work sessions exist.
- A record's model is Daimon's alias (daimon-kimi-code). It is read
as the alias's model in the runtime's config.toml (k2p6-agent).
- magpie's kimi-desktop plugin points the alias's provider at a bridge
on 127.0.0.1 that forwards to the gateway, which logs those calls.
A call whose alias's base_url is a loopback address is skipped, so
it is not counted twice. config.toml is the current setting only,
so history read for the first time is judged by it.
- docs/subsystems/gateway-sessions.md says so.
Run (mote): go test ./internal/sessions -count=1, ok;
go vet ./internal/sessions for darwin, windows, linux -tags nogui, ok.
Windows (xiaomi-gpu, win-run): go test ./internal/sessions
-run 'KimiWork|Loopback|KimiCode', ok. gofmt clean.
Broken by hand: kimiCallFiles without the Work files made
TestKimiWorkCalls red (no calls), and so did dropping the loopback skip
(the bridged call counted). Restored, green.
Not tried: a real Kimi Work session. This computer has no Kimi desktop
data, so the fixture's records are the Kimi Code format the bundle's
UsageRecord writes and its config.toml is what modelToToml builds. The
Windows installer was not unpacked: the Windows path is Electron's
userData as the bundle's code reads it. k2p6-agent has no price in the
catalog, so these calls show tokens and no cost.
|
||
|
|
51c3ecc573 |
vertex: Gemini 4 Carbon and Hydrogen in the preset, and Gemini 4 at us and eu (#6452)
Google Vertex AI's model list lacked gemini-4-carbon (released 2026-11-10)
and gemini-4-hydrogen (2026-11-12); SunsetBirdW and T_t__biu on X, #6452.
Google's model-versions page lists both ids, and each model's page lists
PayGo at global, us and eu, as Argon's now does too, so the us/eu list
gains all three Gemini 4 models.
Their window, output, prices and thinking levels come from models.dev's
google-vertex entry as for every Vertex model, which matches Google's own
pages today: Hydrogen 1,048,576 in / 65,536 out, $1.50 / $0.075 cached /
$7.50 at global, levels low to xhigh; Carbon 1M / 65,536, $2 / $0.10 / $10,
levels low to high. The provider test asks both at thinkingLevel low.
Run (mote): go test -tags nogui ./internal/provider ./internal/gateway
./internal/catalog -run 'Vertex|GeminiEffort|Preset|Effort'; go vet ./...,
GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./...; gofmt -l.
Broken by hand: presets.go reverted, TestVertexProviderListed red (no
gemini-4-carbon/hydrogen at global); vertex.go's us/eu list reverted, red
at us and eu.
Not tried: a real Vertex project (no Google credentials here). Carbon and
Argon go to $4 / $0.20 / $20 on 2026-12-01 (Google's pricing page); the
price comes from models.dev and follows it when it changes. The bundled
offline catalog (2026-11-10) has neither model until it is refreshed.
Rerun after rebasing onto origin/main
|
||
|
|
96558cfde6 |
agent: Codex thread tables are written only for ids magpie can own
JsonParser (X) found [model_providers.openai_token_sharing] in
~/.codex/config.toml, written by magpie, and Codex refusing to start:
"provider auth cannot be combined with experimental_bearer_token". The
id is T3 Code's: T3 starts Codex with -c model_providers.
openai_token_sharing={..., auth={command=...}}, its threads name that
id, and putThreadTables (#1372) wrote a magpie table (name, base_url,
wire_api, experimental_bearer_token) for every provider a thread named
that config.toml lacked. Codex merges T3's -c over it, and the merged
table has both auth and a bearer token.
putThreadTables now writes a table only for a CC Switch id
(ccSwitchProvider) or an id config.toml itself once held, recorded per
Codex home in the stash (codex.filed_tables) whenever magpie reads the
file. A table an older magpie wrote for any other id, recognised by its
exact shape (four keys, name == id, wire_api responses, magpie's own
gateway key), is taken out at Sync, at Disconnect (uninstall and quit
restore) and in TakeLeftovers, unless a profile or model_provider names
it or it has sub-tables. The user's own tables, other apps' tables and
tables with any other key are left alone.
Known tradeoff: a magpie-written table for a card-named CC Switch id
that config.toml lost before this release, and magpie never recorded,
is removed once and not written again. CC Switch's own ids still are.
Run (mote): go test ./internal/agent -count=1 -timeout 45m ok (421s);
gofmt -l clean; go vet ./internal/agent for darwin, linux and windows
ok. Real codex 0.165.0 in a sandbox CODEX_HOME: magpie's stray table
plus T3's -c override reproduces the exact error; without the table
Codex loads.
Tests: TestCodexLeavesOtherAppsProviders (threads name
openai_token_sharing, custom and a relay config.toml once held: no table
for T3's id, the other two written back), TestCodexDropsStrayThreadTables
(wired and unwired; another app's table, a profile-named one and the
user's own key stay), TestCodexSyncDropsStrayThreadTable.
Broken by hand: without the threadTableFor guard and the tidy calls,
TestCodexLeavesOtherAppsProviders and TestCodexDropsStrayThreadTables
went red; without only the Disconnect tidy, TestCodexDropsStrayThreadTables
went red; without only the Sync tidy, TestCodexSyncDropsStrayThreadTable
went red.
Not tried: the TakeLeftovers tidy was not broken by hand on its own;
T3 Code itself was not run, only codex with its -c override.
|
||
|
|
4af0f05cff |
gateway: a tool_reference an Anthropic-compatible endpoint refuses goes as text (emilochen on X)
Claude Code through magpie to DeepSeek V4.1 on an Anthropic-compatible URL
got 400 "DeepSeek V4.1 supports text and image content only; got
'tool_reference'": ToolSearch's answer is a tool_result holding
tool_reference blocks, which magpie relayed as written to every Messages
upstream (only a references-only result got a text block beside them,
#2124; DeepSeek's own API and Kimi lose only the top-level deferred blocks).
A 400/422 that refuses tool_reference in words (refsRefused: a refusal word
in the same clause, no brace between, so an echoed request doesn't count,
and DeepSeek's "expected `tool_reference`" doesn't either) while the request
as sent holds one in a tool_result marks shapeRefs. That request is asked
again at once, and every later one to that provider goes, with each
reference as "Tool <name> is loaded and can be called now." (the words
stringOrText already gives Chat, Responses and Gemini upstreams) and the
named tools without defer_loading; other deferred tools stay deferred, and
the tool_use/tool_result pairing stays (withRefsAsText). It sits in forward's
shape loop, so /v1/messages, count_tokens and group members all get it.
deferredOutUpFront names forwardOnce's existing up-front strip (Kimi,
DeepSeek's own API, OpenCode DeepSeek) so refuseShapes judges the body as
sent. Translated routes already carried the references as text
(TestToolSearchReferenceIsTold), so only the Messages passthrough changed.
Run (mote, -tags nogui, at origin/main
|
||
|
|
c49c04241d |
docs: providers-accounts: connect addresses (Resolve)
Docs only: how Provider.Resolve reaches the dial, where it is taken and where not (a proxy, a plugin), and the tests that hold it. |
||
|
|
a96d88effa |
claude-desktop: a model picked for two tiers no longer shows twice in the menu (yanghonghang on X)
v0.1.3997 showed "Gemini 4 Hydrogen · haiku" beside "Gemini 4 Hydrogen"
in Claude Desktop's model menu.
|
||
|
|
a65dade2e3 |
gui: an accent colour of your own and a picture behind the pages (CHENGJIAHEGOXIS on X)
CHENGJIAHEGOXIS asked for colours beyond the three themes and for a local picture. Settings › General gains two rows under Appearance: - Accent color: magpie's own, six quiet presets (Blue, Teal, Green, Orange, Pink, Graphite) and a swatch that opens the system's colour picker. Saved as settings.accent (#rrggbb only, checked in saveOwn; `magpie settings set accent "#0d9488"` works through settingsapi.Keys). The server draws it (appearance.go accentVars): darkened on the light theme and lightened on the dark one until it reads as text at 4.5:1 on the background and cards, with white or near-black text on it, whichever reads better. Never under Omarchy, whose theme is the look. - Background image: Choose… takes a PNG, JPEG, GIF or WebP of 16 MB at most, sent as base64 JSON to POST /api/appearance/wallpaper, saved as `wallpaper` in magpie's folder (edit.WriteAtomic); settings.Wallpaper is its stamp. A thumbnail, Change and Remove show; Remove deletes the file. It is drawn behind the window's pages (never the tray panel) under a veil of the theme's background at 84%, so text reads as on the plain page; the cards stay opaque, and body's colour stays the theme's, which Windows' title bar tint reads. boot.js puts the look's stylesheet in before the first paint and says which look it drew (bootPrefs.look); applyPrefs asks /api/appearance/css only when the settings' look differs. The rows, with the Colorblind, Reduce motion and Loading bird rows, are drawn by appearance.js, imported when Settings draws, so the core scripts stay under their budgets with no raise (app.js 2,393 under, the core 503 under). A save of Settings that doesn't send accent keeps it (Merge guard), and the wallpaper stamp is kept by every Settings save. fonts.test.cjs: the two new rows push the font row to the foot of its 560×620 window, where Playwright's click scrolled it in by a pixel and the test read that as the page moving; the reader now scrolls it in first with the wheel. settings_keep_test sets Wallpaper; the three /api/appearance routes are named in the CLI parity test's notYet. Run (mote, at this change on origin/main 406ad72f1; after the rebase on |
||
|
|
741d502d2a |
library: a synced MCP server can run its own command on this computer (jinpwng on X, #6426)
jinpwng runs one MCP server on a Mac and in WSL. Each needs its own program path, and the only ways around it were two servers with two names or keeping the server to one computer, which loses the sync of its agents and note (#3836). A command server now has an optional `shared` start. When it is set, command, args and env are this computer's, and every reader (the agents' files, projects, the router, the check) runs them with no change of its own. Collect carries the shared start in their place and never the field, so the other computers get exactly what they had. Put keeps this computer's start, and what comes in for the server becomes the shared start, so a note, agents or the other computer's own command change still comes in. A server that comes in as a URL, one kept to this computer, and the editor sending no shared start each end it. - GUI: a saved synced command server's editor has "Use another command on this computer" under Command. With it on, the hint names what the other computers run, and "Use the synced command" goes back. Nothing else on the page moves; a new server and a local one have no button. - CLI: `magpie library mcp here <name> <command args…>` and `… here <name> off`; the listing names a server that has one. - TUI: an edit keeps the shared start. - Docs: docs/subsystems/library.md, site docs (en, zh, ja). Run (mote, at the tree pushed but before the rebase): - go test ./internal/library/... ./internal/cli/... ./internal/tui/... ./internal/backup/... ./internal/gui/: ok - gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows: clean - GUI, chromium and webkit: mcp-server-here (new: en, zh, zh-TW, ja, de at 1100 and 390, the payload, no button on a local server, no sideways scroll), library-mcp-json, library-mcp-spaced-path, library-mcp-win-line, market-address, mcp-home-health, mcp-startup-timeout, market-have, mcp-editor-cancel, mcp-local-server, i18n-en-no-cjk, i18n-keys and the other library MCP files: 235 of 238. The reds: - i18n-keys "a plugin's words are its own": the same at origin/main |
||
|
|
04776ec6cb |
providers: a plugin subscription imports accounts from a file through its own auth.import, WorkBuddy's from 0.2.32 (marchen_cc on X)
marchen_cc on X: 「从文件导入账号」 took no WorkBuddy sign-in file. The cause
was not WorkBuddy's: magpie's import reached only built-ins (Codex,
Claude, Antigravity, Factory), and a plugin had no way to say it could
read a file. This adds that for every plugin subscription:
- A plugin's auth may have import(texts, {signal}), returning sign-in
results, with importFrom (and importFroms by language) saying which
file to choose. The host's importFiles op keeps each one as a sign-in
is kept (keptAs, saved under signInKey, settled), so an account
already there comes back "updated"; it is cancellable (signInSteps)
and takes at most 100.
- /api/signin/import and `magpie accounts import <plugin> <files>` go
to provider.ImportPluginFiles when PluginImportable(id); the editor's
「从文件导入账号…」 row and the import sheet show for such a plugin, in
its own words (importSay), moved subscriptions included (subOf).
- docs/subsystems/provider-plugins.md: "Accounts from a file".
- WorkBuddy's mover min goes to 0.2.32, which reads the desktop app's
.info sign-in or a JSON credential, and sends a cloud-hosted
enterprise account (*.sso.copilot.tencent.com, *.copilot.qq.com,
*.sso.codebuddy.cn, iOA apart) to its enterprise's address (emilochen
on X), published and checked with npm view --prefer-online.
- TestCoreScriptBudget +468 for the import branch, packed to one
statement. importSay is read as the Providers rows draw, so it has
no lazy page; nothing else was moved out (#2710). The budget's
arithmetic was checked over this tree: 1,267,762, at the new cap.
Run on mote (mica's disk is full; mote over its cores) at this change
on 3f6b1b0c9;
|
||
|
|
ac1702c330 |
library: the first part of a skill group opens below its heading, not over it (jinpwng on X)
jinpwng on X (macOS, Chinese UI): in Library > Skills, opening the first group made the page jump, and what was clicked went off the screen; the others opened downwards. The group was the first part of a big group (a repository split by folder, drawn in the group's windowed list). A click on a part's heading draws it anew, and the first part's only neighbour above it is the list's zero-height pad, which the click's hold passes over. So the page held the next part's heading, the rows opened pushed it down, and the view scrolled by the whole part: the clicked heading went from 152 to -920. A part's heading is now data-unrolls, so the hold keeps its list, whose top doesn't move. Top-level groups, projects and the Instructions agents already held still; the new test guards them too. library-group-steady.test.cjs opens and folds, at the top and scrolled: the Skills groups and the big group's parts (first and second, and the first with the second open), the projects in Skills, MCP and Subagents (first and third), and two Instructions agents. Each heading must stay within 1.5px of where it was clicked. Clicks and scrolls go through page.mouse, since Playwright's own scroll before a click reads as the reader's. Run (mica, mica-run), at base |
||
|
|
3f6b1b0c94 |
agent: omp's advisor turns on with its model, and its review, wait and call-back are set in magpie (#6408, Awad_Yoo on X)
Awad_Yoo wants omp's advisor gated: one model executes, another reviews
only at key points. omp's advisor (src/advisor, advisor/settings.ts) runs
only while advisor.enabled is true, and omp leaves it off, so a model
picked for the advisor role in magpie reviewed nothing.
- A model picked for the advisor role writes advisor.enabled: true when
the user hasn't set it. The role's reset takes back only what that pick
wrote (a stash mark); the user's own on or off stays.
- Three Quiet fields write the rest of config.yml's advisor block, as omp
reads it (omp_advisor.go):
- advisor_review: off, turn, agent-end (enabled + reviewMode; off keeps
the mode);
- advisor_wait: syncBacklog off, "1", "3", "5", strict, written as
strings, since omp's enum settings take only strings;
- advisor_wake: continueSeverity nit, concern, blocker.
- GUI: omp's opened row and its panel sheet get three rows (Advisor; Waits
for its review; Calls a finished agent back on). The last two show only
while it reviews, and the rows redraw in place. They live in
ompadvisor.js, imported the first time. The roles square's advisor line
says " · off" when the advisor is off. Strings in zh, zh-TW, ja and de.
- Core script budget: +717 for what is left in app.js, after the rows
moved out.
- docs/subsystems/agent-wiring.md has an "omp's advisor" row.
Not magpie's: taking over from the executor after repeated failures of
the same kind. omp has no such setting; "escalate" in its source is only a
note's severity. An omp extension can do it (pi.on("tool_result") with
pi.setModel), and that keeps the session's trace and completed tool
results. Said on the issue.
Run:
- mica-run go test -count=1 ./internal/agent/: ok.
- go vet ./internal/agent/ ./internal/gui/ for darwin, linux (nogui) and
windows: clean. gofmt -l: nothing.
- internal/gui Go tests: on mote (below).
- GUI, on mote and mica: omp-advisor.test.cjs (new: chromium + webkit;
1100 and 390px; en, zh, zh-TW, ja, de; panel sheet at 360) passes, as do
agent-prefs, old-webkit's own check, i18n-en-no-cjk,
omp-profile-connect and agent-row-disclose.
- Reds that fail the same on a clean worktree at origin/main
|
||
|
|
7693cf2634 |
agent: a folder holding only magpie's sign-in file is no agent (jiangshangmuyun on X)
Codex, never installed, was listed on the Agents page as "not connected" once a ChatGPT account was added in Providers. With Codex signed in to nothing, addLogin hands it that account and saveCodexLogin writes ~/.codex/auth.json, which makes ~/.codex; Detected took any non-empty Dir for the agent. Claude Code is the sibling off the Mac: putClaudeLogin writes ~/.claude/.credentials.json when Claude Code has none. Agent.signIn names that file (auth.json for both Codex agents, .credentials.json for Claude Code), and agentDir passes over it. A folder with anything else of the agent's beside it (config.toml, sessions/, settings.json, projects/, history.jsonl), its binary, or its app still lists it. Run: - gofmt -l; go vet on darwin, linux (-tags nogui) and windows, on mote. - go test -count=1 ./internal/agent ./internal/gui on mote: ok. - win-run on xiaomi-gpu: TestSignInFileAloneIsNoAgent, TestClaude*Windows*, TestDetected*: ok. Broken by hand: agentDir not passing over the sign-in file: TestSignInFileAloneIsNoAgent red for codex and claude (../tray-jump-scratch/break.log). Not tried: a real ChatGPT sign-in in a sandbox HOME with no Codex. A Codex app installed but never opened, with only magpie's auth.json in ~/.codex, is not listed until it is opened (it then writes its own files there). |
||
|
|
870a9e0fe1 |
gui: the Windows tray panel stays where it opened, no jump left (jiangshangmuyun on X)
On Windows the panel opened flush against the right edge and, a moment later, moved a fair way left. The tray placed it as it opened (ToggleWindow -> PositionWindow), and every refit after that placed it by the icon again: fitPanel, each glidePanel step (stepGlide in glide_other.go) and zoomWindows all called tray.PositionWindow. Wails centres the panel on the icon only when Shell_NotifyIconGetRect's rect is inside the taskbar, and flush right otherwise. An icon clicked in Windows 11's overflow flyout isn't in the taskbar as the panel opens, so it went flush right; the page's first fit, once the flyout had closed, read the flyout's arrow and centred the panel over that. Now every refit of the open panel goes through sizeOpenPanel. On Windows it keeps the place the tray gave it as it opened: the centre and the edge by the taskbar held, kept inside the work area (panelRefit, one SetBounds). The Mac and Linux keep SetSize then PositionWindow, as before, in the same order. Run: - gofmt -l; go vet ./internal/gui ./internal/agent on darwin, linux (-tags nogui) and windows, on mote. - go test -count=1 ./internal/gui ./internal/agent on mote: ok (145s, 250s). - win-run on xiaomi-gpu: TestPanel*, TestOpenPanel*: ok. Broken by hand (win-run, ../tray-jump-scratch/break.log): - panelRefit holding the top edge in place of the taskbar's: TestPanelRefitKeepsItsPlace red in 4 cases. - sizeOpenPanel taking the old path on Windows too, and app.go at its base (PositionWindow in fitPanel and zoomWindows): TestOpenPanelRefitsInPlaceOnWindows red each time. Not tried: the real tray click on xiaomi-gpu. Nobody is signed in there (query user: no users, LogonUI up, no explorer), so no tray exists to click and the panel's moves couldn't be watched; the cause above is read from Wails beta.24's systemtray_windows.go positionWindow. No GUI (Playwright) file reaches this: the change is in Go, not the page. |
||
|
|
cbc9dd7f00 |
gateway: Mistral's num_cached_tokens counts as the cache it read (daoche_wuzui on X)
Mistral documents its cache hits in usage.prompt_tokens_details.cached_tokens (docs.mistral.ai prompt-caching), which was already read. Its API also sends an older top-level num_cached_tokens: a Mistral engineer's client-python PR #452 reads it as "the legacy top-level cached token count" with a streaming fixture carrying it, and counts it inside prompt_tokens, as OpenAI's is. Its current SDKs (TS 3.5.0, Python 3.7.0) name neither in UsageInfo. A usage telling the cache only there was read as no hit: magpie's cost and cache-hit rate showed 0% for Mistral. cUsage now reads num_cached_tokens after prompt_tokens_details, DeepSeek's and Moonshot's names, as a fallback. otherCacheFields names it, so openAIUsage tells it again in prompt_tokens_details for clients that read only that, streamed (chatTidy) and whole. The translations to Messages and Responses are built from cUsage's Usage, so they follow. Every chat usage decoder (chatDecoder, the whole reply, continuation, sniff) goes through cUsage. Tests: chat-mistral (num_cached_tokens alone) and chat-mistral-zero-details (beside a 0 in prompt_tokens_details) in TestUsageRecordsCacheTokensOnEveryRoute and TestAgentReadsCacheTokensOnEveryRoute, every agent route, whole and streamed; TestMayMendUsageOnlyOtherNames and TestOpenAIUsageLeavesOpenAIsAlone (num_cached_tokens 0 stays byte for byte). The other vendors' cases (OpenAI, DeepSeek, Moonshot, Anthropic names, Responses, Gemini) are unchanged and pass. Run (mica-run, mote over its cores): gofmt -l clean; go vet, GOOS=linux go vet -tags nogui, GOOS=windows go vet of internal/gateway; go test -count=1 ./internal/gateway ok (900s). Broken by hand: without NumCachedTokens in cUsage's fallback, 30 mistral subtests fail and no other; without num_cached_tokens in otherCacheFields, the passthrough chat and chat-stream Mistral cases and TestMayMendUsageOnlyOtherNames fail. Not tried: a real Mistral API reply (no Mistral key on this machine). |
||
|
|
b942a872ba |
caps: a lone capped Codex account says its turns go to the fallbacks (not_4O4 on X)
not_4O4 asked for a way to switch to non-official models once a set share of the ChatGPT quota is used. magpie already does this: a usage cap on the Codex account (or a cap on the 5-hour / weekly window alone) plus the provider's Fallback. When Codex is connected to magpie beside its ChatGPT sign-in, or fails over through it, codexAccounts sends a capped lone account's own-model turn through serve, so the fallbacks answer it. The GUI said otherwise. The account row of a lone Codex account said "Codex still uses it" past the cap even when Codex was connected, and the cap note said requests are refused when the provider has fallbacks. Now: - the direct-use note shows for Codex only when it isn't connected or failing over (an agent row with wired or failover); - the held note says the requests go to this provider's fallbacks when it has some and Stop at the caps is off, in en, zh, zh-TW, ja, de. - TestCoreScriptBudget: +236 bytes for this, packed to its shortest form with no page to move it to (the account rows are core). The 11-04 grey Send default and the takeover are untouched: a cap never takes Codex off ChatGPT. New tests: - internal/gateway TestCappedLoneCodexAccountGoesToItsFallback: a lone account capped at 80% with usage at 85 is not tried and the fallback answers (stream and not); at 50 the account is tried. - account-cap.test.cjs: Codex connected, the lone capped row's note ends with the fallback line and has no direct note; not connected, the direct note stays. Chromium and WebKit, every language. Run (mica, mote was over its load), at the rebased head (origin/main |
||
|
|
f1ac93aa54 |
codex: Ultra on every other vendor's model that reasons (pingqipai3 on X)
pingqipai3 asked for Codex's Ultra effort on every model, so Codex uses subagents more. Codex offers a level only where the model's catalog entry lists it, and magpie listed Ultra only on OpenAI's own models. What Codex does with it (openai/codex 553c764): Ultra is never sent. ModelInfo::resolve_reasoning_effort sends the entry's multi_agent_reasoning_effort, else max, else its highest other level; and under MultiAgent V2, Ultra is what makes subagents proactive (effective_multi_agent_mode). So Ultra on another vendor's model asks it its own top level, which is honest, and turns on V2's proactive subagents. codexcat.entriesAt now ends the levels of a model that lists some, from a vendor other than OpenAI, with "ultra" and says multi_agent_version v2 (ultraHere). Left alone: GPT, o-series and Codex models (their Ultra is provider.OffersUltra's), a model with no levels, Fast and Seals entries (V1 stays theirs), a vendor's own Codex entry (listedEntry). The default level is never Ultra. catalogFormat goes to v3, so Codex fetches the list again. Only Codex's catalog changes; other agents' level lists don't. docs/subsystems/agent-wiring.md has a row for it. Run: at origin/main |
||
|
|
15e1d65bcd |
gateway: Cherry Studio's model list has magpie's image and video models (pingqipai3 on X)
pingqipai3 on X: with magpie as a provider in Cherry Studio, its image
generation models weren't read. /v1/models lists chat models alone unless
the caller asks ?kind=image,video, and Cherry can't ask, so its list had
no image model at all, and its Paintings page none of magpie's.
What Cherry reads (CherryHQ/cherry-studio v2.2.1, c74990c): a custom
OpenAI-type provider (the type magpie's Cherry link gives it) is fetched
by listOpenAICompatibleModels, which keeps only id, name and owned_by.
The renderer then resolves each id against Cherry's model registry
(provider-registry models.json, normalizeModelId: the id's last "/"
segment, lower-cased), which carries image-generation for gpt-image-2,
dall-e-3, Gemini's image models, Imagen, Seedream, grok-imagine-image and
~130 more, and video-generation for grok-imagine-video and Seedance. Those
go to Paintings (supportsImageGenerationEndpoint), not the chat picker
(isNonChatModel), so the chat-picker worry behind ?kind= doesn't hold for
Cherry. Its new-api fetcher (new-api, CherryIN, AIOnly presets) reads
supported_endpoint_types instead.
Fix: a request of Cherry Studio's, by the key magpie's link gives it or
by its User-Agent (Electron's default with "CherryStudio/<ver>" in it,
read from Cherry Studio 2.1.2's Electron Framework), gets the image and
video models in its plain list, as ?kind=all would; ?format=text stays
chat. Each image model says supported_endpoint_types ["image-generation"]
(plus "image-edit" when it takes images), each video model
["openai-video"], new-api's words, for every caller. Docs: Cherry
Studio's page (en, zh, ja) and the integration page (md, en, zh).
Run (mote, at
|
||
|
|
d6a6865b1f |
update: a file from usemagpie.ai has its attestation from usemagpie.ai, GitHub's API after (ArcticLampyrid on X)
The site's cron keeps each release's SLSA bundles on R2 as /files/<tag>/attestations.jsonl ( |
||
|
|
436d507f0e |
usage: a ChatGPT card's image row tells the window its replies' headers say, not a 15-minute guess (#6412, Green14964 on X)
ChatGPT's images API answers every drawing, a 200 too, with the image allowance it counted: x-codex-active-limit: imagegen_premium and the window in x-codex-primary-* (window-minutes 1440, reset-at), as the reporter captured on a Pro account; Codex 0.160.1 also reads it from a family named for the limit (x-imagegen-premium-primary-*, parse_all_rate_limits). magpie read none of it on the image path: the row said "Unknown" until a refusal, and a refusal whose body names no resets_at rested the image model for quotaRest's 15 minutes, so the card said "2 minutes" of a 24-hour window. - gateway/codex_image_limits.go: codexImageHeaderLimit reads the image window from the limit's own family or, when x-codex-active-limit names an image limit, from x-codex-*; heardCodexImage keeps it per account (in memory), handed to provider.ImageHeard. - Both drawing routes hear it: magpie's own (sendWith in draw.go) and Codex's relayed /images/generations and /images/edits (codex_backend.go). - codexHeaderLimits tells no chat window when the active limit is an image one, so the 1440-minute window never lands on the 5-hour or weekly row. - restDrawer: a 429 with the heard window at 100% counts as the quota (ChatGPT's "image limit reached" read as a rate limit), and with no resets_at in the body it rests until the heard reset, capped at longestQuota. - provider.WithImageLane: the row says Available (or Used up at 100%) with that reset; a rest still says Used up. "Available" translated (zh, zh-TW, ja, de). - docs/subsystems/providers-accounts.md updated. Run (mote): at base |
||
|
|
72facf72e2 |
memory: a search or save can name its project, and every answer says whose and where (Norethcy on X, #6392)
The memory tools had no target-project argument and no way to see the caller context they resolved, so a scoped migration run from one project couldn't keep memories for another or check where they went. - memory_search and memory_save take `project`: a folder on this computer (absolute, or relative to the caller's own folder), or the key of a project memory knows (github.com/owner/repo, with or without project:, or a project's one name). A project named goes with scope project (a save's default then) or a search's all; global or agent with a project is refused, and an unknown project says which ones memory knows. - Answers name what was used: a memory reads "this project (<key>)" and "only for you (<agent>)", and a search ends "(looked in: everywhere, project <key>, agent <id>)". - New read-only memory_context: the agent the server takes the caller for and how it was found (router _meta, magpie mcp memory's initialize, key/User-Agent, the session's initialize), the project with its folder and source, the scopes a search looks in and the server version, as text and structuredContent. Given `project`, it shows that one. - HTTP and stdio are the same server (magpie mcp memory relays), and OwnMCPTools lists memory_context with the others. Run (mote, -tags nogui unless noted): - TestMemoryMCPProjectArgumentAndContext (new): folder, key and relative folder; the caller's own project untouched; refusals; memory_context's text and structuredContent; tools/list. Red with the project argument ignored by hand. - TestMemoryBridgeContextAndProject (new): the real gateway behind magpie mcp memory over stdio, initialized as codex as in the report. - go test ./internal/browsermcp ./internal/cli ./internal/library: ok; go test -run 'Memory|OwnMCP|Hub|RootDirs|Tool' ./internal/gateway: ok. - Windows (xiaomi-gpu, win-run): the new gateway, browsermcp and cli tests ok (a test's own unquoted Windows path was fixed on the way). - go vet darwin, linux nogui, windows for the four packages; gofmt. Not tried: Codex desktop itself over /mcp/run/magpie-memory; the full suite runs after the tag. |
||
|
|
c2fd48782b |
Put back what 1f05c311d took out of main by mistake
|
||
|
|
1f05c311d9 |
library: an open memory holds still while the Memory tab polls (Nietzsche_Li on X)
"资源库-记忆中,被展开的记忆的表单会定时抖动". While search by meaning
still has memories to read (read < of, which can last up to a minute
between memembed.Keep's reads) or a learn-from-conversations run goes,
the Memory tab reads its row again every 2s, and each read drew the
whole page anew. The open editor was a new .lib-detail each time and
played its content-in entrance (opacity .5, 2px slide) every 2s.
- semWatch/distWatch draw nothing when the read changed nothing, and
redraw only their own row (redrawRow) when it did; the whole tab only
when the memories changed.
- render() marks a .lib-detail open before it (same data-detail) as kept,
so it doesn't replay its entrance. This covers every render of an
open editor in the Library: memories, instruction sets and agents'
files (the siblings; no other Library tab polls into render()).
- A new memory's text no longer takes the focus back on every render.
Run (mote): library-memory-steady.test.cjs, all 5 languages, 980/420,
chromium + webkit: green 4 of 4 whole-file runs after the last change
(webkit alone 2 of 2 before it). Broken by hand: the same test against
origin/main's client.js and library.css: 22 of 22 red ("the editor
played its entrance again"). One webkit de 420 red was the test's own
first row click intercepted by the header at 420px while the page
settled; the test now opens rows with a DOM click.
Also run, both engines, every language, 980/420: library-memory, library-memory-select, library-memory-suggest, memory-icon, library-instr-busy, library-instr-sets, library-linked-set, library-follow-server: all green. No Go code changed, so no go test or vet.
Not tried: the real app on a real memory store mid-read.
|
||
|
|
70f4593e62 |
provider: a key's typed balance can refill each day (Kelen_Yc on X)
A key's balance typed by hand refilled each month or each week. A relay
key with a daily allowance had no way to say so. Now it can refill each
day, at local midnight, like the others:
- provider: Refill{Every: "day", Day: 0} (RefillDay). Last is today's
midnight in now's location, Next tomorrow's. check takes it with day 0
only; ParseRefill reads daily/day/d (daily:1 refused); String is
"daily". A magpie before this drops such a refill on read, as one
written by hand that isn't one, and counts from when it was typed.
- CLI: `magpie provider key-balance <id> <key> --refill daily`; usage
lines updated.
- GUI: the pill's menu has "Refills each day" after "Refills each
week…", posting {every: day, day: 0} at once (no day to pick, so no
ellipsis), with its toast; en, zh, zh-TW, ja, de.
- docs/subsystems/providers-accounts.md names it.
Tests: TestRefillDays gains daily rows (midday, exactly midnight, a
month's and a year's end, Asia/Shanghai). New
TestTypedBalanceRefillsDaily holds the clock in Pacific/Kiritimati
(UTC+14), Pacific/Pago_Pago (UTC-11) and UTC: a minute before local
midnight the spend counts from when it was typed, a minute after it
counts from local midnight and the next refill is the following one.
TestOwnBalanceParsedInYuanAndRefill and TestTypedBalanceRefills cover
parsing, the bad {day, 1}, and read-back; TestKeyBalanceCmd sets
--refill daily. key-own-balance.test.cjs picks Refills each day in
every language, both engines, 900 and 400px, checks the post and that
the menu then shows it picked.
Run on mica at
|
||
|
|
4431e31f7c |
library: a project gets subagents of its own, per agent (jinpwng on X)
The Subagents tab now lists the projects as Skills and MCP do. Opening
a project shows each library subagent with chips for the agents that
read a project's own subagent folder: Claude Code (.claude/agents),
Codex (.codex/agents, TOML), OpenCode, Gemini CLI, Qwen Code, Droid
(.factory/droids), Cursor and Copilot (.github/agents/*.agent.md). A
tick writes the subagent into that project only, in the agent's own
format; the agent's global folder and other projects are untouched.
Each file is recorded by its hash and rewritten or removed only while
it is exactly as magpie wrote it, so a same-name file of the user's is
left alone. A rename in the library follows into each project. The
files are kept out of git by the project's info/exclude block, and
follow the repository's other worktrees (syncTrees now copies
Subagents, and clears it for a worktree let go).
POST /api/library/projects/subagents {dir, name|names, agents}. No CLI
yet, like project servers. Hooks, instructions and Claude plugins have
no project scope yet (filed separately).
Run (mica / mote via mica-run, mote-run):
- go test -count=1 ./internal/library ./internal/gui: ok
- node --test, chromium + webkit: project-subagents, project-scope,
project-servers, project-skills-pick, project-skills-groups,
project-remove-keep, library-subagents, library-all, library-items,
i18n-keys, i18n-en-no-cjk, claude-subagents-pick,
codex-subagents-lead, subagent-effort: 150/150 pass
- gofmt -l clean; go vet darwin, linux -tags nogui, windows on
internal/library and internal/gui: ok
Broken by hand: dropping Subagents from syncTrees' copy made
TestProjectSubagentsFollowWorktrees red ("the worktree hasn't the
project's subagent"); the earlier session broke the fix by hand and
saw the new library tests go red.
Not tried: a real Claude Code/Codex session picking up the project
subagent; the full go suite (started after the tag); Windows/Linux
runs of the GUI.
|
||
|
|
610ae1f541 |
library: handing skills over turns off the all-in-~/.agents/skills setting and takes magpie's links out (ConatusMoon2222 on X)
Put skills in "~/.agents/skills" (SharedSkills) gives every agent that reads
that folder every skill, so it cannot go with choosing agents per skill,
which is what "Manage in magpie" (HandOverSkills) is for. With the setting
on, a handed-over skill's entry was taken away and the next sync linked it
back there, so the link stayed (reproduced in a sandbox HOME). Handing over
now turns the setting off in the same write; the sync then removes magpie's
own links there (sweepShared: only ours, never the user's entries). The
confirm sheet says so, only while the setting is on. The Put skills in note
says the skill router lists nothing while every skill is in
~/.agents/skills (the "none" the reporter met), only when both are on.
Strings in zh, zh-TW, ja, de.
Run (on mote, at this tree):
- TestHandOverWithSharedSetting: red with the l.SharedSkills = false line
commented out ("a link is left in ~/.agents/skills"), green with it.
- go test ./internal/library ok; go vet darwin, GOOS=windows, linux nogui
on internal/library ok; gofmt -l clean.
- GUI: skill-handover, shared-skills, i18n-keys, i18n-en-no-cjk in chromium
and webkit, 23/23 each.
Not run: the full GUI suite and go test ./... before the tag; a real
account's Library; WebKitGTK.
|
||
|
|
52830b077b |
site: the build attestations are kept on R2 beside the release files (ArcticLampyrid on X)
The SLSA attestations live behind GitHub's API only, so with GitHub down they could not be fetched while the mirrored files could. The five-minute cron now also asks api.github.com/.../attestations/sha256:<digest> for every file of a release from v0.1.3891 on and, once every file has one, writes <tag>/attestations.jsonl to R2 (a Sigstore bundle per line, deduped), served at usemagpie.ai/files/<tag>/attestations.jsonl. It is written only whole, so a file with no attestation yet is asked again next run, and it is pruned with its tag. `gh attestation verify <file> -R yetone/magpie-releases --bundle attestations.jsonl` checks a download with it. It is not a release asset: the GitHub release keeps its 17 assets and release CI is unchanged. start (en, zh, ja), llms-full.txt and reference.md say where it is and how to verify. The updater does not read it yet. Run (mote): node --test site/*.test.mjs 118/118; gofmt n/a. New tests: bundles land once and only whole; pre-0.1.3891 release not asked. Broken by hand: ATTESTED set to 9.9.9 turns the bundles test red. Not tried yet: the real cron run and the file on R2 (after deploy), the updater reading it from R2, gh --bundle on a real downloaded file. |
||
|
|
861a0442c1 |
agent: Codex in a running WSL distro is connected once Codex on Windows is (@not_4O4 on X)
The Codex app's work mode on a project whose run environment is WSL starts
its app-server inside the distro, on the distro's ~/.codex (the app resolves
CODEX_HOME there with `bash -lc 'printf %s "${CODEX_HOME:-$HOME/.codex}"'`).
magpie wired Codex on Windows and, as a separate Agents row, the distro's
twin (codex@wsl:<distro>) only when the user connected that too, so the
picker listed OpenAI's models alone there.
ConnectCodexTwins, run at the start of each SyncCatalog, connects the twin
of each running distro once while Windows' Codex is connected. It leaves a
twin alone that is connected or disconnected already, whose config names a
provider or base URL of the user's own, or whose distro is stopped (asking
one starts it). A stash mark (<id>.autoconnected) keeps it to once, so a
later Disconnect stands. docs/subsystems/agent-wiring.md says so.
Run: TestConnectCodexTwins and TestConnectCodexTwinsKeepsOwnProvider; go
test ./internal/agent on mote (ok, 305s); TestWSL* and the new tests on the
Windows box (ok); gofmt; go vet darwin, linux and windows (nogui).
Broken by hand: Windows-connected check removed (red), own-provider check
removed (red). The Disconnected check is covered by the mark alone.
Not tried: the Codex app itself with a WSL project (read its bundle for the
CODEX_HOME resolution only); the reporter's distro and networking.
|
||
|
|
cba704d5f0 |
library: with the skill router on, the page says when no skill is listed for an agent and when its own skills stay in its prompt (ConatusMoon2222 on X)
ConatusMoon2222 turned the Skill router on and reported it "does not take
effect". Reproduced in a sandbox HOME: the router lists only the library's
skills ticked for an agent. An agent with nothing ticked, or each skill kept
direct, got no magpie-skills, yet its row said "on"; and skills in an
agent's own folder that the library lacks stay in its prompt with no word
on the page.
AgentView.SkillRouter is now "none" for an agent whose folder takes the
router but has nothing listed (Applied.Router false), and the Skills tab
names those agents, and the agents that have skills of their own the
library lacks, under the switch (.lib-hub-why data-why none / found). Four
languages (zh, zh-TW, ja, de). docs/subsystems/skill-router.md updated.
Run on mote: go test -tags nogui ./internal/library (ok, 260s);
skill-router.test.cjs in chromium and webkit, all four languages, narrow
and wide (22 pass, with the new found line asserted); go test ./internal/gui
Asset/Budget/Script ok; gofmt clean; go vet nogui darwin/linux/windows clean.
Broken by hand: sync.go back to the parent, TestSkillRouterLastSkillUnticked
goes red ("nothing listed, the view says on").
GUI i18n-*, library-*, skill-* files: all green except skill-fold-all and
skill-manual, red on origin/main from the window's /api/update/using POST
(#5982, not this change).
Not tried: a real agent on Windows; the reporter gave no agent, OS or
version, so the cause for their machine is inferred, not confirmed.
|
||
|
|
648cd3fdbb |
gateway: the management API leaves other keys that manage magpie alone
|
||
|
|
5f1a642b42 |
docs: a commit's tree is origin/main plus its own change, in the code standards
Seen a third day: |