3eba174fd90eca4fe1622fa8e16bfa076281ac32
8819
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
3eba174fd9 |
sessions: a restart no longer opens each Claude Code subagent's file again (shangyuan0818 on X)
Every list built each session's subagents, and ccTask and ccMeta keep what they read in memory only. After a start, each of a few thousand subagent files was opened for its first user line (or its meta file), under Defender's per-open scan. The parse already read that file; its task and meta now stay in its state (StateMore Task, TaskRead, SubMeta) and the list uses them, falling back to ccTask/ccMeta when a parse has none. A subagent's parse made before this (no TaskRead) is read again once (ccStale), then not. Windows (xiaomi-gpu, Defender on, sandbox HOME, Claude-only reads), fixture of 12k files / 9.3 GB with 9k subagent files, three requests together: - warm restart: 2.2 s -> 1.0 s - restart after one session grew: 2.4 s -> 1.1 s - restart after one new session: 2.3 s -> 1.1 s - grow or new session while running: 0.55 s -> 0.4 s on the next list - cold, no cache: 21 s -> 15.8 s (the subagent read is no longer done twice) The plain 100-session fixture (6.6 GB) was 0.3 to 0.8 s warm before and stays there: it has no subagent files to open, and I did not reproduce "15 s after an agent used". The 5 s cold figure the reporter gives matches. Run: go test ./internal/sessions at this head (mote), gofmt, go vet for linux, windows and darwin. TestSubagentTaskAndMetaComeBackFromTheSavedParse is red on the old code (the list read the subagent's file once with its meta gone); TestSubagentParseWithoutItsTaskIsReadOnce guards the one-time reread. Not tried: a real Claude Code subagent's meta.json on Windows (the fixture has none, the meta path is covered by the test); the full suite and the GUI files are run after the push. A task past a subagent's 16th line is now found where ccTask gave none. |
||
|
|
03ae057b8e |
library: a native list that is not a list draws the tab without it
|
||
|
|
75d0b9feac |
gui: an icon button at work shows the spinner, not its glyph turning
wiirhan on X (tweet 2123287273043378671): "资源库--技能--更新技能的loading
状态为啥是直接转箭头?" A Library skill's Update turned its own up arrow
while the fetch ran (.lib-icon.busy svg { animation: lib-spin }), so the
busy state looked like a broken arrow, not like work.
glyphBusy (app.js) puts the spinner's arc, CLI_SPIN, the one saving() and
a CLI's update pill turn, in place of the button's glyph while it works,
and puts the glyph back when it is done or fails. The arc turns at .8s,
and under prefers-reduced-motion it stands still.
Siblings: an agent row's Apply again and Restart (.ag-fix) turned their
reapply arrow the same way, and now take glyphBusy too. Kept as they are:
the refresh arrows that re-read data (quota-refresh, usage-refresh,
rt-read, #sync, pu-again). Their glyph is a turning arrow, so turning it
says what it does, and the owner tuned them in #16.
TestCoreScriptBudget: app and core budgets +228. glyphBusy is packed to
its shortest form, and renderAgents and the Library rows draw it on every
window, so there is no page to move it to.
skill-update-feedback.test.cjs waited for the svg itself to animate. It
now waits for the arc's path, with the row's actions still in view.
Run (mote, via mote-run):
- busy-glyph-spinner.test.cjs (new): chromium + webkit, en/zh/zh-TW/ja/de,
1100px and 420px (reduced motion at 420). Green 22/22. Red 22/22 on
origin/main f534245f1's assets. Restart's glyphBusy broken by hand:
chromium 11/11 red.
- go test ./internal/gui: ok at the rebased head (budget included).
- Whole GUI suite at 59e0421f4, beside other sessions' runs (load 20-60):
29713 tests, 28689 pass, 1024 fail in 122 files. One red was this
change's: skill-update-feedback, fixed above. The other 121 files were
run again at head 0f0827c28: 118 still red (2300 tests, 1021 fail). The
same 118 files at origin/main
|
||
|
|
ddfc9b17d9 |
gui: Claude Code's max effort says /effort can't change it (daix91 on X)
@daix91 asked on X whether Claude Code's effort can no longer be changed. Max is fixed in Claude Code's environment (CLAUDE_CODE_EFFORT_LEVEL=max, the design since |
||
|
|
82611c3c9e |
library: a project turns on a plugin Claude Code installed, in its own settings (#7254)
Plugins Claude Code has installed itself (installed_plugins.json) are listed on a project's Claude plugins tab, each with one Claude chip. On writes enabledPlugins.<id> = true into the project's .claude/settings.local.json through the format-preserving JSON edit (comments and the user's keys stay); off takes out only a key magpie wrote that is still true. A key the user already had is neither written nor taken out; a file magpie made goes once the skill offs, hooks and plugin keys sharing it are all gone. Worktrees follow through syncTrees; RemoveProject lets go. Written fresh, not ported. Run (mote-run): go vet library/gui/cli; go test ./internal/library -run TestProjectClaudePlugin (new, two tests); project-claude-plugins, project-plugins and i18n-keys GUI files in chromium and webkit, en and zh; go test ./internal/gui reds only on testenv's docs-index guard (routing-groups pages newer than the search index, not from this change). Not tried: a real Claude Code reading the project's enabledPlugins; the whole GUI suite; a CLI for it; "off" for a plugin the user turned on user-wide. |
||
|
|
834700c185 |
site: regenerate the docs index after the routing-groups pages changed
|
||
|
|
ab342fa40d |
library: magpie library project server and subagent add, rm and agents (#7248)
The CLI had project skills and instructions only. `server` and `subagent` now list, add (agents= or the agents already used, else every agent here that reads a project's MCP file or subagents folder), take out and re-point a project's library servers and subagents through ProjectServer and ProjectSubagents, the calls the Library page makes. A name the project doesn't have is refused, as is an unknown agent or flag; a part magpie couldn't place exits 1 with why. The command shape follows the reference commit in the reporter's fork (0d3a6de55), rewritten over this tree's calls rather than ported. Run: mote-run go test ./internal/cli -run TestLibraryProject (the new TestLibraryProjectServerAndSubagentCmd: the user's own .mcp.json server survives an add and an rm, Codex's file gets the server, Claude's and Codex's subagent files come and go with their agents). gofmt and go vet ./internal/cli clean. Not tried: the whole Go suite; the package run also prints testenv's docs-index guard (routing-groups pages newer than the search index), which is not about this change; a real agent reading the files. Co-authored-by: Arobotmaster <50254754+Arobotmaster@users.noreply.github.com> |
||
|
|
6d153bffca |
library: list the skills, MCP servers and hooks of plugins installed natively in Codex and Pi (#7244)
The Library now reads Codex's plugin cache (plugins/cache/<marketplace>/<plugin>/<version>,
manifests under .codex-plugin, .claude-plugin or .cursor-plugin; config.toml's
enabled flag) and Pi's packages (settings.json packages, package.json pi.skills,
user and project scope) and lists what they bring on the skills, MCP and hooks
tabs under "Installed in the agents themselves", with origin and scope.
Read-only: nothing is copied, linked or registered; the agent keeps loading it,
load status stays unknown. Paths stay inside the plugin; an unreadable file
means unknown. New GET /api/library/native (lazy, not on the polled
/api/library) and `magpie library native`. Docs row in library.md.
Run (mica, sandbox HOME, nothing of the live ~/.codex or ~/.pi touched):
- go vet darwin; internal/library native tests (6) and the new GUI test
library-native.test.cjs in chromium and webkit, 5 languages, 980 and 380 px.
- Built binary against a sandbox copy of the real Codex cache manifests (74 files).
- Not tried: Claude native plugins, subagents, Pi MCP and hooks, a live Codex
or Pi, Windows and WSL Pi. The whole GUI suite and the full Go suite run after the push.
- Not mine: every package using testenv is red on origin/main
|
||
|
|
9ec023a46b |
routing: the default routing is called Quota first, not Smart (@canlee886)
The groups magpie finds on its own (auto/<model>) hold one model served by
several providers, and with no rules they follow their Routing, whose
default was labelled Smart / 智能. @canlee886 read that as "judges how hard
the task is and sends easy ones to a cheap model". It does not: the member
whose allowance renews soonest goes first, ties in list order, the next takes
over on a failure.
A cheap-model rule cannot be a built-in default for these groups: their
members are the same model, so there is no cheaper member to send an easy
request to. The mechanism for hard-to-strong, easy-to-cheap exists (the
"Hard to strong, easy to cheap" template and rules with an intent) but it
needs members of different strength, which the user picks. So the honest fix
is the label.
- The mode is "Quota first" (额度优先, 額度優先, 枠優先, Kontingent zuerst) in
every picker, chip, tooltip and hint, in all five languages (the English
key text and each translation).
- The no-rules line now says it does not judge how hard a task is.
- docs/reference.md, gateway-routing.md and the routing-groups site pages
(en, zh, ja) name it the same. The stored value ("") is unchanged, so no
saved group or provider changes behaviour and nothing needs migrating.
Run (mica, node --test, chromium and webkit, five languages): 19 GUI files
(routing-rule-example, routing-save, routing-group-strategy, routing-manual,
routing-weight-chip, rotate-figure, account-weight, routing-key-windows,
routing-free-expiring, builtins, i18n-keys, i18n-en-no-cjk and the routing
Smart-text files): 440 of 446 pass. The 6 reds (account-arrange 1 and 2,
key-weight 17 to 20) fail identically on origin/main
|
||
|
|
87a933e500 |
memory learning reads WorkBuddy, WorkBuddy AI and CodeBuddy Code conversations (@bxgz233 on X)
"Learn from conversations" (memdistill) reads a session only when the
Sessions list marks it Transcript, which is HasTranscript(agent). The
WorkBuddy family had a summary reader (workbuddyLine) for the Sessions
page and the usage ledger but no transcript reader, so its sessions were
listed and never learned from.
Add wbTranscript (transcript_workbuddy.go), over the same
projects/<cwd>/<id>.jsonl lines: a message's input_text/output_text
blocks (WorkBuddy's own <system-reminder> blocks stay context and its
@scene: blocks are dropped, so the typed words still count as said), a
function_call with its arguments, and its function_call_result by callId.
workbuddy, workbuddy-ai and codebuddy join HasTranscript.
Guard: TestEveryListedAgentHasATranscriptOrIsNamed reads the agent ids
Session.Agent lists and fails for any with no transcript that is not in
noTranscriptYet, and for any in that list that now has one. Siblings still
without a transcript, named there: zcode, dsh, cline, grok, droid, hermes,
alma (issues filed).
Run (mote): go vet ./internal/sessions ./internal/memdistill; go test
./internal/sessions ./internal/memdistill ./internal/memory ./internal/gui.
The new tests fail on the old transcript.go (workbuddy, workbuddy-ai and
codebuddy named, codebuddy not marked readable). internal/gui has one red
that is also red on origin/main
|
||
|
|
99cc8fa5d5 |
gui: a failed endpoint test's error can be selected and copied (imwritingbugs on X)
The provider editor's endpoint Test result (.res.bad) was ellipsized under body's user-select: none, so a vendor's error could not be picked up to hand to an agent. The selectable :where() list in app.css now takes the error and warning classes (.bad, .warn, .warnbox, *-warn, *-bad, *-fail, .res, .bal-res), so those texts select; controls keep none. A failed endpoint row and a failed Detect APIs row get the small copyBtn other values have; a passing row has none, and a new Test clears the old button. Run (mote): provider-error-copy.test.cjs, 16 of 16 green in chromium and webkit, en/zh/ja/de, 1000 and 420 px; 16 of 16 red with app.js and app.css at the merge-base. go test ./internal/gui ok; gofmt -l clean; GOOS=linux go vet -tags nogui and GOOS=windows go vet of internal/gui ok. GUI files the change reaches (provider*, i18n*, model-test*, *select*, *copy*, balance*): 70 fail, and the same 10 files fail with the same counts with app.js and app.css at the merge-base (group-editor-selected 2, model-copy-id 4, provider-fetch-again 14, provider-many-keys 6, provider-max-output 20, provider-models-rest 4, provider-picks-stay 4, provider-proxy 4, provider-remove 4, provider-typed 4), so they are on main already; filed separately. Not run: the whole GUI suite and the full Go suite (both Macs were busy with other sessions' full suites). Not tried: the reporter's screenshot was never seen; the endpoint Test result is the likeliest error they meant. Siblings are covered through the class list, not each page. |
||
|
|
f534245f1c |
routing: a group with no rules says how it routes (@canlee886 on X)
The editor said nothing of what a group does with no rules. Without rules the group goes by its Routing (Smart unless set): the member whose allowance renews soonest first, ties in the listed order, the next taking over when one fails. One line under Rules now says so (and names the routing when another is set); with one model or Manual the existing line stays. Added in zh, zh-TW, ja, de. Layout unchanged. Run on mote at the change: routing-rule-example (extended: the line in every language, Smart and In order, gone once a rule is added; Chromium and WebKit, 1100 and 390 wide), routing-advanced, routing-rule-ops/ remove/drag/columns/models/effort, routing-entry, routing-intent-entry, group-editor-fits/align, group-template, i18n-keys: all pass. Not run: the whole GUI suite, Go (no Go changed), the real app. |
||
|
|
228da69efd |
claudetui: a dialog is recognised by its option rows, not by its words in the history (@alisenray on X)
A resumed conversation that discussed "Bypass Permissions mode" made every
--resume fail at 45s ("asked to accept running in Bypass Permissions mode,
not answered") with the prompt box showing: ready() took the words anywhere
in the restored history for the dialog.
The trust and Bypass Permissions dialogs are now recognised by structure
(optionDialog): the heading, then the No row and the Yes row, with only the
dialog's footer under them. The Claude in Chrome offer, the text-style
screen, sign-in and the two first-run screens must have their words at the
foot of the screen (headingDialog, lastMatchNear), not far up in history.
The "doing" text of a late run uses the same rules.
Run: TestShimIgnoresDialogWordsInHistory (history with the phrase, option
rows, and every other dialog's words above the prompt) is red on the old
tui.go (0 of 3 lines in 30s, "asks whether to trust the folder") and green
now. mica-run go test ./internal/claudetui ok (191s), go vet and
GOOS=windows go vet clean, gofmt -l clean. A first version matched the
heading by its last occurrence and broke the trust dialog (its Yes row
holds "trust this folder"); the existing trust and bypass tests caught it.
Not run: the full suite (queued after the push), a real Claude Code
--resume. The heading-only screens (Chrome, text style, sign-in) are bounded
by distance from the foot, not by option rows, so a history that ends
within 1500 characters of those words with no prompt box could still match;
not seen in the report.
|
||
|
|
b17d9e3fca |
routing: with motion reduced, the magpie fades in and out at the dot instead of being gone (iryan_sun on X)
iryan_sun on X: the Routing page's magpie animation between agent and provider is gone. The same report as vantiboolean's on 11-08 ( |
||
|
|
f7173c79a3 |
codexcat: another magpie's ChatGPT model is Codex's own, given this Codex's entry for it
A remote with no Codex cache of its own (a server) builds its entry from the bundled instructions, so office/codex/gpt-6-astra still lacked the backend's model_messages and fields. OwnSlug takes an id ending in the entry's codex/<slug> as Codex's own: entriesAt gives it this computer's models_cache.json entry, as a local account's codex/<slug> gets, and OwnIn keeps it in the Codex app's first list (gateway catalog too). A relay's plain gpt-6-astra is not taken. Run (mote-run, rebased head): TestRemoteChatGPTModelIsCodexOwn red with OwnSlug turned off (description "GPT-6-Astra via magpie", OwnIn false), green now; the codexcat, provider, gateway and gui runs, gofmt and the three vets in the commit before. e2e with a models_cache.json in the local CODEX_HOME: description "Frontier intelligence for the most demanding work." and model_messages present, codex exec FAKE-OK. Not run: the full suite (next, at the pushed head); a real ChatGPT account behind a real remote. |
||
|
|
c3836b4eeb |
remote magpie: Codex is handed the entries that magpie gives its own Codex (Darkf1ames on X)
A remote magpie's models reached Codex as entries this magpie made up for
a third party's model (its description "· Remote magpie via magpie",
no model_messages, no service tiers), so a ChatGPT subscription the remote
holds wasn't the Codex it is when the account is local. codexEntries
skipped every preset provider, the remote magpie included. It now asks
the remote's /v1/codex/models (#1281) with Codex's client_version and the
remote's key, and listedEntry says " via magpie" once.
Run (mote-run, at the rebased head on
|
||
|
|
958d4fcaf1 |
pii: the local models' folder is chosen under Advanced, and Move… moves them (MetalHqa on X)
On Windows both models (Privacy Filter 1.6 GB, AstrLink Guard 39 MB) went onto the C: drive with no way to choose. Settings > Privacy now has Advanced > Models folder: Move… picks a folder in the system's picker and moves what is downloaded there; Move back returns it to magpie's cache. The default is unchanged. - settings.RedactModelDir is this computer's own (kept by KeepOwn, never set by a settings save). - pii.Root() is the one place every path is made from (dir, guardRoot, so the model, its cache files, pf-serve, the CoreML program). - pii.MoveTo: a rename on one disk, else a copy checked by sha256 read back; the setting switches after it and the old subfolders are deleted last (never the picked folder); a failure puts back what it moved and keeps the old copy. Refuses a relative path, an unwritable folder and one inside what is moved. A picked folder that has gone (disk unplugged) is not recreated by a download. Download and Remove wait out a move. - GUI: pmfolder.js, loaded on first draw so the core script is no bigger; strings in zh, zh-TW, ja, de. Docs: gateway-routing.md, masking.html (en, zh, ja), site index regenerated with docs-index.mjs. Run (mica; mote had no room, load 35/18 and 29/12): - go test of internal/pii folder tests, internal/gui TestPrivacyModel*, internal/settings and settingsapi keep tests: ok. Each broken by hand and red: guardRoot ignoring the folder, no rollback, no missing-folder check, KeepOwn line removed, settingsapi line removed, folder action not calling MoveTo. - Windows box (win-run): the move tests ok, TestMoveAcrossDisks on a real C: to D: move ok. - GUI privacy-model.test.cjs, Chromium and WebKit, 5 languages, 1100 and 640px: 104 of 104. - go vet on pii, gui, settings, settingsapi for linux (nogui), windows and darwin: clean. node --test site/*.test.mjs: 135 of 135. Not run before this push: the whole GUI suite, go test ./... (both follow at the pushed head), the size-budget and i18n tests (run after the rebase), gofmt over the whole tree (touched files only), and a real Privacy Filter download into a picked folder on a real account. |
||
|
|
83bb079dee |
gui: the scroll capsule sits above Plugins' install box and the Library's save and pick bars, not over Install (WaiooT on X)
scrollends.js lifted the capsule above only .after-list and .view-foot. Plugins > Discover's .pm-manual (and the Library's .lib-savebar, .lib-pickbar) are held at the window's foot too, so the capsule covered the Install button's right end. They are now in the list it steps over. No layout change. Run (mica, copy of this tree): new view-ends-install-bar.test.cjs red on the old scrollends.js (390px: capsule over pm-browse, pm-minput and Install, all 12 subtests) and green on the new one (12 of 12: chromium and webkit, en/zh/zh-TW/ja/de, 390/560/980/1280 wide); with only the Library classes removed it is red at lib-savebar. go vet ./internal/gui/... and GOOS=windows go vet, gofmt -l clean. view-ends, view-ends-relayout, routing-editor-foot, plugin-manual-float and i18n-keys: 78 of 80 together; the 2 are webkit view-ends' first subtest (en 440 light) timing out at 8s in that batch, twice, while view-ends.test.cjs alone under BROWSER=webkit is 16 of 16 on this tree and on origin/main. Not run: the whole GUI suite and go test ./... (mica held by another session's full GUI suite, mote at load 46; to be run at the pushed head), the Library's own bars with real fixtures (stand-in sticky bars of each class are used), the real Linux app. |
||
|
|
f288cc61af |
sessions: a deleted Grok Build session's index rows come back with its restore (#4595)
Follow-up to crayonlu's commit (Grok Build sessions deletable, their session_search.sqlite rows dropped first). Review of that commit: Sound: the delete is scoped to the session's own folders (updates.jsonl's dir, plus its subagents' sibling folders grokFiles already folds in); the cwd's prompt_history.jsonl and other sessions stay. The index is opened by a normal connection with a 5 s busy timeout and BEGIN IMMEDIATE, so it works beside a running Grok Build (WAL, the file's journal mode is left as it is); a file that can't be opened or read stops the delete before anything moves (failed read = unknown); no index or no tables deletes as before. Nothing touches the network, no new dependency, no .github/site. Checked against Grok Build 1.0.67 itself (its binary's SQL and the index it wrote on this machine, copied, never opened live): session_docs has session_id, cwd, updated_at, title, content, content_hash, over session_docs_fts with the _ai/_ad/_au triggers; there is no DELETE FROM session_docs in the binary, so Grok has no delete of its own to match. Wrong or thin: Restore did not put the index row back, and Grok Build's bootstrap is stamped in meta.last_bootstrap_at, so nothing says it indexes a restored folder again; a move that failed after the rows were gone left the session whole but unindexed. Now grokSearchRowsDrop returns the rows, every column by name (so a Grok Build that adds a column keeps it), and Delete keeps them in the trash entry's grok_search.json (not in the note the Trash page lists). Restore INSERT OR IGNOREs them (a row Grok wrote again meanwhile wins; an unwritable index doesn't stop a restore), and a delete that stops after dropping them puts them back. TestGrokDeleteRestore now checks the rows and FTS entries are back; TestGrokSearchRowsComeBackWhole checks every column and the kept row. Broken by hand: Restore without the put is red on "after the restore: 0 rows and 0 found". Run (mote, worktree of this branch; full suite at rebased |
||
|
|
6671091676 |
sessions: Grok Build's sessions are deletable, its search index's rows going with them (#3003, #4595)
#3003 (acsfreerun) asked for a Delete on Grok Build's sessions; #4595 kept them listed with no Delete, because a session is a folder but Grok Build copies each session's text into $GROK_HOME/sessions/session_search.sqlite, which a folder delete would leave behind: its search would go on finding a session Grok Build no longer lists. Deletable("grok") now says yes, and sessionPaths' "grok" branch moves the whole folder (updates.jsonl, summary.json, the locks, prompt_context.json, terminal/, everything else it kept) and its subagents' folders, which grokFiles folds into the session it ran in. What the cwd's folder holds for every session there (prompt_history.jsonl), another session's folder and the index stay. The trash, Restore, Purge, the recent-write ErrActive guard and WSL handling are the ones Delete already has. grokSearchRowsDrop (grok_search.go) deletes the deleted session's row in session_docs, and its subagents', inside one BEGIN IMMEDIATE with a 5 s busy timeout, so it waits for Grok Build's own write instead of failing; the session_docs_ad trigger takes the row out of session_docs_fts. It runs before the first file is moved: a row that can't be taken out (a database that isn't one, a lock held past the timeout) stops the delete and the session stays whole, rather than a folder gone from the list and still found by search. No index file, or one without those tables, deletes as before. Restore brings the folder back; the index row is not put back, so Grok Build's search finds a restored session only if Grok Build indexes the folder again. Tests, in-repo and on fixtures, never on a real ~/.grok: the sessions package's fixture tree gained a lock file per session, a subagents/ entry, a terminal/ file and the cwd's prompt_history.jsonl, and a small session_search.sqlite is built in-test from the real file's schema (v4, session_docs over FTS5 session_docs_fts with the three triggers). TestGrokDeleteRestore (delete, folder and row and FTS entry gone, another session's row kept, ErrActive, Restore, Purge), TestGrokDeleteLeavesTheSessionWhenItsIndexRowCantGo and TestGrokSearchRowsDrop; TestGrokSessionDeleteOnThePage drives the page's own handlers (GET /api/sessions/manage?agent=grok says deletable, POST /api/sessions/delete moves it, the trash lists it, POST /api/sessions/restore puts it back). docs/subsystems/gateway-sessions.md: the delete paragraph, and Grok Build out of the "sessions magpie cannot delete" list. Run (mote, this tree, on origin/main |
||
|
|
04e62892eb |
library: Pi's package search installs a package or repository named outright
eachg0 on X: the skills and MCP searches take a repository or package named
outright, but Pi's (Library → Pi packages → Discover) only searched, so a
package found elsewhere couldn't be installed from it.
Now, like the MCP market's `custom` card, GET /api/library/market/pi answers
`direct` (library.PiDirectAt) when the text names a package, and the GUI
draws it first, even when npm's search finds nothing. The forms are Pi
1.5.2's own (parseSource, parseGitUrl, parseNpmSpec), read from the npm
tarball:
- npm: `name`, `name@ver`, `npm:name[@spec]`, `@scope/name[@ver]`, and an
npmjs.com package page (…/v/<ver> becomes the pin);
- git: `git:` with any shorthand (`git:o/r`, `git:github:o/r`,
`git:git@host:path`, `git:host/path`), `https://`, `ssh://`, `git://`,
`git@host:path`, `host.tld/o/r` and `o/r` (GitHub); a GitHub, GitLab or
Bitbucket page loses #readme and /tree/<ref> becomes @ref.
Each is installed as one of Pi's own forms. A bare word is offered only
when the registry has it with the pi-package keyword ("web" exists on npm
without it and stays a search); a form named with npm:, a scope or a git
address is always offered, with the registry's version, publisher and
description when it answers. The registry asked is the one in use
(npmmirror), then npm's own. Local folders aren't offered. piSourceOK
refuses a flag, `..`, a backslash, ?#%, whitespace, a host that isn't
dot-separated labels, a part starting with ~, and a ref or pin that starts
with -. InstallPiPackage takes git sources (it forced npm: before), and a
Pi's packages carry an id (piSourceID), so "In <Pi>" matches a git package
under another ref, too. Placeholder in en, zh, zh-TW, ja, de.
Tests:
- TestPiSourceFor: every form above, canonical output, and the refusals.
- TestPiDirectAt: npmmirror's real /pi-rename/latest bytes
(testdata/npmmirror/pi-rename-latest.json, 2026-11-19), a pin, "web"
without the keyword, a 404, npm: and a scope on a 404, a found one not
offered twice, git forms not asking the registry. No network: registry
fakes only.
- TestPiInstallNamedOutright, and TestPiInstallAndRemove's bad list.
- library-pi-direct.test.cjs: pi-rename typed, offered first, installed
into Pi; its GitHub page installed into WSL Ubuntu by its address; the
placeholder; en zh zh-TW ja de, 980px and 380px, Chromium and WebKit, no
sideways scroll.
Red on the old code: the Go tests don't compile there (piSourceFor,
PiDirectAt undefined); the GUI file is 22/22 red on old assets (the
placeholder, and with that check removed, no direct card, 20/20).
Broken by hand: PiDirectAt returning nil turns TestPiDirectAt red;
piSourceOK refusing git turns TestPiInstallNamedOutright and
TestPiInstallAndRemove red. The first run also found evil..com and
~/pi-tools let through; both are refused now.
Run (mote unless said):
- gofmt -l: nothing.
- go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet
./..., go build: ok at 2b2d4bf54; Windows go vet ./... on xiaomi-gpu and
go vet -tags nogui ./... in WSL magpie-desktop: ok.
- go test -count=1 -timeout 45m ./... at 2b2d4bf54 (base
|
||
|
|
d245951c9f |
gateway: Antigravity and agy get the hub's tools whole, not find_tools/call_tool
/hub/antigravity wrapped a big tool list in find_tools/call_tool, a second
lazy load on top of Antigravity's own (izhidigua on X, 11-19). agy 1.5.12
loads MCP tools lazily itself: its binary carries "Call a lazy-loaded MCP
tool. Read the tool's schema file", McpToolConfig.enable_lazy_load,
SplitEnabledToolsByEagerLazy and per-tool schema files under
~/.gemini/antigravity-cli/mcp/<server>/. So agy and antigravity join
hubSearchers, like claude, codex, pi, droid and omp. mcp-router.md says so.
enable_lazy_load is a config flag that may be set by the server, not by the
client; an account where it is off would list every tool whole.
Run: TestHubMCPToolsWhole now covers agy and antigravity; with both removed
from hubSearchers it fails ("agy listed [find_tools call_tool]"), with them
it passes. go test -run 'Hub|MCP' ./internal/gateway ./internal/gui ok on
mote; gofmt -l clean; GOOS=linux go vet -tags nogui and GOOS=windows go vet
of internal/gateway ok.
Not run: the full Go suite (mote and mica were both busy with other
sessions' full suites), a real agy session. The Library's agy
mcp_config.json handling is another session's and is untouched.
|
||
|
|
0417417e57 |
library: a project takes a whole Claude plugin, and gives it back (jinpwng on X)
A project can now have a library Claude plugin for chosen agents (projects/plugin). Its skills, MCP servers and subagents go where the project's own do (withPlugins adds them for a sync and puts the project's own sets back after), and its hooks are written entry by entry into .claude/settings.local.json and .codex/hooks.json (HookRecs). Taking the plugin out deletes it from Plugins, and only what magpie placed or wrote comes out; an entry the user changed stays. Removing a plugin from the library drops it from every project. The Library plugins tab gets a Project plugins section with per-agent chips, in en, zh, zh-TW, ja, de. Run, on mote at the pushed head (rebased on origin/main |
||
|
|
0a37c93682 |
library: a skill linked in from ~/.agents/skills whose folder is gone is shown as gone and given to no agent (#7226)
"Bring in all" links a skill of the skills CLI's folder into the library. After `npx skills remove` its folder is gone: the library entry stayed listed and every sync linked each ticked agent to the dead link. markDangling (skill_dangling.go, each read and sync) finds a linked-in skill whose folder is absent or has no SKILL.md, marks it Gone (the page already offers to take such a skill out; RemoveGoneSkills only removes the link) and sets Skill.Dangling, which gives() reads, so no agent, project or shared folder is given it and magpie's own links to it are taken away. It is cleared when the source returns. A stat error other than not-exist is unknown and keeps the entry. Nothing the user owns is deleted. The library's own folders are never judged. Run (sandbox HOME, tests only): - New TestLinkedInSkillWhoseSourceIsGone and TestSourceGoneKinds: red on the old code (no Gone, agents keep the link), green after (mica-run). - Windows junction case TestJunctionToARemovedFolderIsGone, plus the two above, via win-run on xiaomi-gpu: ok. - gofmt -l clean; go vet -tags nogui ./internal/library for GOOS=linux and windows: clean. - Full `go test -tags nogui -timeout 45m ./...` on mote at this head was still running when pushed (the first 39 packages ok, no red); shipped on the coordinator's word with these targeted runs. No reds named. Not tried: a real `npx skills remove`, the GUI (no GUI files changed, so the GUI suite was not run). |
||
|
|
5d4f9862ca |
library: an agent that is not installed is listed only for what magpie gave it here, not for a synced tick (izhidigua on X)
A library synced from another computer carries each item's agent ticks. held() counted a tick as a reason to list a not-installed agent, so on a computer without Claude, Claude Code or Pi the MCP switches (and any row withGone widens) listed them, while Skills showed only the installed four. Take-it-out (Target.Gone) is for what magpie wrote into the agent on this computer, which Applied records and sync never carries; a tick alone gave it nothing to take out. held() now counts only Applied (skills, MCP, hooks, env, router, router rules). Run, on mote at this tree: TestGoneAgentWithOnlySyncedTicksIsNotListed (new; claude-desktop, claude and pi ticked from a sync, none installed, nothing Applied), red on the old code (all three listed), green now; TestGoneAgentListedToTakeOut still passes (an Applied agent is listed); go test ./internal/library; gofmt -l; go vet of internal/library for linux, windows and host. Not tried: the reporter's two computers; the whole GUI suite (no page file changed). Full suite, mote, at 7bb2f5ac0 (this change on |
||
|
|
7f3b272726 |
library: the Antigravity app and agy share one MCP file, and magpie's entry in it is magpie's (izhidigua on X)
Antigravity and agy read and write the same ~/.gemini/config/mcp_config.json. With both ticked and MCP routing switched on, the first one's sync wrote the "magpie" entry; the second one's hubFor then found a "magpie" entry it had not written itself and judged it the user's own server by that name (hubOwn): it kept a direct connection and offered to import it, and switching off left that side's servers behind. hubFor now asks sharerWrote: an entry by the hub's name in a file that another target reading the same path has Applied is magpie's own. Run, on mote at this tree: TestAntigravitySharedMCPFile (new; two rounds of on then off, with fs stdio and web http ticked for both, then Read shows no server direct), red on the old code (the second agent kept its servers direct and the file kept the foreign entry), green now; go test ./internal/library; gofmt -l; go vet of internal/library for linux, windows and host. Not tried: real Antigravity or agy (sandbox HOME only). Full suite, mote, at 7bb2f5ac0 (this change on |
||
|
|
6aab35abdf |
provider: Factory's mover min 0.1.52 (harness read as runtime, Claude Code's tool search sent in full)
Factory answered content_policy_rejected for Claude Code, Pi and Codex since 11-17, and Claude Code's deferred tools failed (@DennisYan4 on X). Plugin 0.1.52 (npm has it) reads "harness" as runtime in a client's prompt and tool descriptions, and sends defer_loading / DeferredToolPlaceholder as tools declared in full. keepMovedCurrent now brings every moved user to it. Run at |
||
|
|
fa52741ebc |
agent: omp 18.1.6 and later name themselves; magpie's User-Agent only for an older omp (Zyvaletta on X)
magpie wrote `headers: {User-Agent: omp}` into omp's models.yml for every
omp. A newer omp sends `omp/<version>` itself, and the header put that
version out of sight.
From omp's own source: pi-ai 18.1.6 (CHANGELOG 2026-09-03, "Inference
requests now identify as omp by default") wraps fetch in
withInferenceUserAgent, later transportFetch, which sets User-Agent
omp/<VERSION> only when none is set. Real omp runs against a stand-in
gateway on mote, sandbox HOME, `bun add @oh-my-pi/pi-coding-agent@<v>`,
every API (Chat, Responses, Messages, Gemini):
16.3.5 and 18.1.5: Bun/1.4.2
18.1.6 and 18.4.4: omp/<version>
18.15+ needs Bun >= 1.4.4 (mote has 1.4.2); its source (18.15.0,
18.22.2) has the same transportFetch.
Now (ompUserAgent): no header from 18.1.6 on; omp/<installed version>
before; plain omp when the version isn't known. The version comes from
the installed package.json (InstalledVersion), never the network.
ompKept takes a User-Agent of magpie's own (omp, or omp/<version>) for
magpie's, so an old `User-Agent: omp` is replaced or removed on the next
sync, and any other value, under any casing, is the user's and stays
alone. usage.AgentOf cuts at "/", so omp, omp/16.3.5 and omp/18.4.4 all
count as omp; nothing reads omp's version from the UA.
Tests (internal/agent/omp_useragent_test.go): TestOmpUserAgentByVersion,
TestOmpOldMagpieUserAgentSynced, TestOmpUsersOwnUserAgentStays.
Broken by hand: origin's omp.go with a stub ompOwnUserAgent, all three
red; ompKept returning yamlKept's result unchanged, the last two red.
Real omp with the new header (mica, same stand-in): 16.3.5 and 18.1.5
with `User-Agent: omp/<v>` send omp/<v> on all four APIs.
Docs: docs/subsystems/agent-wiring.md row "omp's User-Agent"; site
omp.html en/zh/ja.
Run at this tree (base
|
||
|
|
be400389ba |
provider: Antigravity counts Gemini 4 Carbon and Argon at their original price, $4 / $20 / $0.20
ZhouYimingsjtu on X: with an Ultra 20x plan, ~$200 of real use gave
Carbon:Neon:Hydrogen = 1.64:1:0.39. magpie priced them 2:3:1.5 by input
(0.67:1:0.5), so Carbon read cheaper than Neon while Antigravity counts it
above. Google's pricing page (ai.google.dev/gemini-api/docs/pricing, read
2026-11-19) lists Carbon and Argon at $2/$10/$0.10 through 2026-11-30 and
$4/$20/$0.20 from 12-01; Neon $3/$15/$0.15 and Hydrogen $1.50/$7.50/$0.075
have no promotion. models.dev (google, vertex, openrouter, copilot) carries
the promo. With the original the ratio is 1.33:1:0.5.
Only the Antigravity route changes: role ids (gemini-pro-orchestrator-*),
agy-cli/ and antigravity/ ids, providers served by Antigravity, and usage
calls from the agy/antigravity agents (priceAsk gains Agy). The price is
the field-wise max of the catalog's and the original, so once models.dev
moves to the original nothing is raised twice. Gemini API, Vertex and
OpenRouter prices are unchanged; Neon and Hydrogen unchanged. Argon is the
sibling with the same promo on Google's page; the reporter did not name it.
Not covered: the Sessions page prices by model name alone, so a bare
gemini-4-carbon in an agy session stays at the promo there; only role and
route-prefixed ids are scoped.
Run (mote, origin/main
|
||
|
|
bb9c5ae154 |
gateway: an inline image is counted in the context map by its vendor's rule, from its size (paiven_x on X)
@paiven_x on X: a Codex session (gpt-6.1-terra) of a few hundred small
screenshots sent ~42 MB a request, and the context map showed 764K
tokens, 413K of them images, while Codex's own count was about 371K.
Every inline image was taken at a flat 1600 tokens (imageTokens), so
~258 small screenshots read as 413K where OpenAI counts an 800x500
one at 480.
Now an image's width and height are read from its header alone
(image.DecodeConfig over a streaming base64 decoder: a few KB of a PNG,
a JPEG up to its frame header, a lean body's imageRef through
keptImageOf), and counted by the rule of the protocol's vendor
(prompt_image.go):
- Anthropic: 28 px patches, ceil(w/28)*ceil(h/28), after the reference
resizedSize; 2576 px / 4784 tokens for Claude 4.7 and later, 1568 /
1568 before.
- OpenAI patch models (GPT-5.2 and after, the minis): 32 px patches
times the model's multiplier, in the side and patch budget each
detail sets (low/high/original/auto per model, as the vision guide
lists them).
- OpenAI tile models (gpt-4o, gpt-4.1, o1/o3, gpt-5/5.1): base plus
512 px tiles after 2048 and 768 fitting; low is the base.
A link, a file, a document, an unreadable image and a Gemini request
stay at 1600; the vendor's count still scales them all (calibrate).
The 475K Codex never reached is Codex's own: 95% (its
effective_context_window_percent) of the 500K its bundled catalog gives
gpt-6.1-terra. magpie writes no auto_compact_token_limit for Terra
unless the user set one (Working keeps its own 500K). Codex compares
the usage the vendor reported (~381K), which was under it, so nothing
compacted until /compact. No workaround added.
Tests: TestPromptImageTokensByVendor builds real PNG and JPEG bytes
(image/png, image/jpeg Encode) and checks each vendor's own doc
numbers: Terra 800x500 auto 480, 2880x1800 high 2949, gpt-5.5 low 192,
gpt-4o 1024x1024 high 765 and low 85, Claude 1920x1080 2691 (high
tier) and 1560 (Sonnet 4.5), 3840x2160 4784, a JPEG behind a 40 KB
APP1 330, \/-escaped base64 480. TestPromptImageSizeReadsHeaderOnly
reads 2880x1800 from the first 4 KB of the base64 and falls back to
1600 for a link, a file and undecodable bytes.
Broken by hand: imageTokensOf replaced by the constant, all 10 cases
of TestPromptImageTokensByVendor red at 1600.
Run at this head (e67b0f4fa, rebased on origin/main
|
||
|
|
352b124b39 |
site: APIKEY.FAN renewed, in-app seat runs to 12-24
The owner confirmed 11-19 that APIKEY.FAN paid the renewal. Its
in-app entry would have gone off at 11-24 00:00; until now reads
2026-12-24. The README banners carry no date and stay.
Run: node --test site/*.test.mjs on mote, 135/135 at base
|
||
|
|
289184a409 |
provider: agy's Orchestrator (Neon), gemini-pro-orchestrator-neon, is priced as Gemini 4 Neon (mu33410 on X)
mu33410 on X: Gemini 4 Neon through agy had no price, as Orchestrator (Argon) had before |
||
|
|
ed405d1d78 |
gateway: an Azure key that answered before, refused 401, rests suspended till it answers (canlee886 on X)
An Azure subscription with a spending limit (a student's $100 a month, a trial's) is disabled by Azure when its credit runs out and enabled again on its own when the credit renews. Meanwhile every request 401s "Access denied due to invalid subscription key or wrong API endpoint", the words a wrong key gets. magpie read that as any 401: failOther on the 1-minute backoff climbing to 10 minutes, never asked in the background, so the key was asked again by requests for weeks, and the reporter turned the provider off and on by hand around the reset day. Now restAfterMarked reads a failOther 401 as failSuspended when azureSuspended holds: no account, Provider.IsAzure, and the key has answered a request before (provider.LastServed at provider.ServedID, served.json, 30 days) or is resting suspended already. It rests suspendedRest (a day) by "suspended", and probeable takes it whatever its status: keepProbingRests asks the resource's deployments list with the key at 1, 2, 5 and then every 10 minutes (refused the same while the subscription is off) and lifts the rest as soon as the list answers, or when a request does. Its group's requests go to the next member meanwhile, Azure not asked. Product calls (mine to make, delegated): - One 401 is enough, not "repeated" ones: a 401 is about the credential, never the model or the request content. On a key that worked, a transient 401 is lifted by the first ask a minute in, the same as the old one-minute backoff let it back. - A bad key stays a bad key: a key 401 from its first request (new, mistyped, or edited, its KeyID then another) has no answer on record and rests as before, failOther/backoff, shown "401 · failed", never asked in the background. served.json unreadable is no answer on record too (a failed read is unknown, not "it worked"). - Azure only: a 401 says nothing of why on other vendors, and a list that answers without the key (OpenRouter's is public) would lift a key its vendor still refuses. - No "back on day N" setting: the probe finds the day Azure enables the subscription, so there is nothing for the user to type in, and no Advanced field. GUI: the key list says "Resting · 401 suspended by the vendor · back at … · checked in the background, back as soon as it answers"; Routing's restHow says its key answered before, so the vendor has most likely suspended it (an Azure subscription out of credit). KEY_FAIL and the routing plugin's FAIL gain "suspended", in en, zh, zh-TW, ja and de. keyDead is unchanged, so "Remove failing" doesn't offer a suspended key. docs/subsystems/gateway-routing.md has the rule beside the rest probe. Not covered: a 403; a key whose last answer is over 30 days old after a restart (rests are in memory); the last candidate of a request, which rests only for quota, credit or a timed rate limit, so a lone Azure provider is asked again by each request, as before, and answers as soon as Azure does. Run on mica (mote had other sessions' full suites), at b4c88d44e unless named, rebased on |
||
|
|
9fc1114d84 |
provider: Factory's mover takes opencode-factory-auth 0.1.51
@a1pha1nthefog on X (2026-11-19): dsh on Factory's claude-opus-5-5 was
still refused (content_policy_rejected) on v0.1.4532, which installs 0.1.50.
0.1.50 left dsh's web_search under its own name, and Factory refuses it
(two real accounts saw web_search, read_file and execute_command refused
the same day, and listed names behind leading underscores). 0.1.51 renames
those, and a request refused while it declares tools goes once more with
every tool renamed, so a name Factory adds next refuses it once, not for
good (magpie-community/plugins e6c45711). keepMovedCurrent updates every
moved user's plugin to the new min, and the plugin host restarts on it.
0.1.51 is what `npm view --prefer-online` gives at landing.
Run (mote, at origin/main
|
||
|
|
aeca7ae074 |
usage: a Claude Enterprise seat's 5 hours come from Claude Code's usage rows; a plan with none says so
@andy_chen1997 on X signed a Claude Enterprise account in, and the Usage
card said "Allowance unavailable", with the reason "Claude Code's /usage
is temporarily unavailable". magpie reads Claude usage only from `claude
-p /usage`. Claude Code 2.1.328 draws that text from the usage endpoint's
five_hour, seven_day, seven_day_sonnet and model-scoped weekly rows. When
it draws none of them, the text is just the subscription line, and
parseClaudeUsage read that as a failed read. An Enterprise seat gets there
in two ways:
- its 5 hours come only as a limits[] row (kind "session") in the JSON
usage_report, with five_hour null. The gateway now adds each session,
weekly_all and model weekly_scoped row as /usage's own line, and only
when the text drew no window of its own. The ISO reset is parsed
(RFC3339Nano). A row of another shape is skipped, and it never loses
the extra usage line.
- its plan has no meters: limits is [], or the seat is usage-based
(Claude Code's vmr/fD: oauthAccount seatTier "enterprise_usage_based"
or billingType "usage_based" in .claude.json). The card now shows
"5-hour and weekly limits: None on this plan" as a text row, set aside,
beside its usage credits. This is not an error, so it isn't used up and
routing holds nothing against it.
A real fetch failure (rate_limits null, or limits null) still says
temporarily unavailable. magpie still never calls /api/oauth/usage
itself.
Our earlier reply ("Enterprise shows only the 5-hour window") holds for
seat-based Enterprise. It was wrong for usage-based seats, which have no
5-hour or weekly limit at all.
The marker line is "Usage report: no meters on this plan", because a
first wording with "usage limits" was read by claudeUsageDenied as an
account error. The new test caught it.
Run on mote. At the pushed head (on origin/main
|
||
|
|
71718b277a |
prompt: Pi's <available_skills> and its context files count as skills and memory, not system prompt
Reported on X by @JinJieBeWater: Pi's skills showed up as system prompt
in the context breakdown. Pi (pi-coding-agent 0.73.1, read from the npm
tarball: formatSkillsForPrompt in dist/core/skills.js, buildSystemPrompt
in dist/core/system-prompt.js) builds one system prompt: its own text,
then "# Project Context" with each AGENTS.md/CLAUDE.md under
"## <path>", then a paragraph on loading skills ("The following skills
provide specialized instructions for specific tasks. ...") and an
<available_skills> block of <skill> entries (the Agent Skills standard's
format), then "Current date:" and "Current working directory:" lines.
splitSkills knew only Claude Code's "The following skills are available
for use with the Skill tool:" list, systemText only a leading
<skills_instructions> (Codex), and splitMemory only Claude Code's,
OpenCode's and Codex's headings, so all of Pi's prompt was one System
prompt item.
- splitSkills also takes an <available_skills> block out, with Pi's
lead paragraph before it, on every protocol and in a reminder too.
The tag must open a line and the block must close, so prose naming
the tag stays put. Any agent listing skills in the standard's block
is read the same way.
- splitMemory reads Pi's "## /path/AGENTS.md" files as memory, only
under Pi's "# Project Context" header, and ends the last one at Pi's
skills or its closing lines. A file under ~/.pi/ is the user's.
Prompts recorded before keep only token counts per item, so they stay
as they were; new requests are split.
testdata/context/pi-0.73.1-system.txt is Pi's default system prompt
assembled by hand from 0.73.1's source (not run): its tool snippets and
guidelines, two context files and two skills, one description with
Pi's & escaping.
Run on mote at this tree (rebased on
|
||
|
|
d7796bf409 |
usage: a day card's switch builds one page, not one per agent
WaiooT on X: "每日用量卡,切换日期的时候,账单计算很卡". The day-card
page's usage:day read is usageapi.SpanOf. For each date it built the
day's page, then one more page of the same day for every agent (up to
12) only to read that agent's By["modelAt"], and every one of those
builds listed and stat'd every agent session file again
(readRequestState). A switch to an older day misses the request-page
cache (16 pages), so it paid all of them each time.
- RequestPage.AgentModels: each agent's By["modelAt"], counted in the
same cell pass as By (cellGroup bit of modelAt, keyed by ReportedAs as
a filter's Agent is), and from the ledger's rows on the LogCalls path.
SpanOf reads it in place of a page per agent. The calls that named no
agent are still listed by model only when they are all there are.
- SpanOf holds sessions.OneListing() for its reads, as the sessions
overview and stats handlers do, so the session folders are listed once
a read.
Measured on mote (a throwaway test, not committed: 401,502 gateway
records over 365 days in 6 agents x 6 providers, plus 20 Claude Code
session files a day of 60 calls each, half mirrored by gateway records),
origin/main
|
||
|
|
6ac19f4bc3 |
netproxy: Windows' "actively refused" is a refused connection too
Explain and sshWhy matched only "connection refused", so on Windows a
proxy or SSH server with nothing listening got no reason, only the raw
dial error. TestSSHProxySaysWhyItFailed was red on Windows at
origin/main
|
||
|
|
a4bf1a039e |
netproxy: Auto goes direct while the system's loopback proxy isn't running (@bitssly on X)
@bitssly (X, magpie 0.1.4519, Windows 11 amd64): with the proxy on Auto,
every model failed with 502 "proxy not reachable" once their VPN app was
off, a restart of magpie too, until they set the proxy Off. A VPN or
proxy app that quits without clearing Internet Options leaves
ProxyEnable=1 and ProxyServer=127.0.0.1:port in HKCU, and Auto took the
system proxy as it was: every request went to a port nothing listens on.
Auto now takes a system proxy on loopback only while its port accepts a
connection (liveSystem, through the same listening check the login
shell's proxy already had: 300ms dial, kept 15s while up, 2s while down,
so the VPN coming back is followed within 2 seconds). Every route that
asks Auto goes through it: For (netproxy.Func for the gateway and every
transport, and http.DefaultClient through Install), EnvWith (the CLIs
magpie starts, Bun, and the plugin host, whose proxy check every 15s/2s
restarts it on a change) and Describe. Settings › Network says it:
source "down" reads "Nothing answers at the proxy found, {proxy};
requests go direct until it runs again", in every language.
Not changed, on purpose:
- A proxy set in magpie is never gone around: a dead one still fails.
- The environment's *_PROXY, set for this process by whoever started
it, is taken as it is, dead or not.
- A system proxy elsewhere than loopback isn't probed: a proxy that is
down can't be told from a network that drops a probe.
- internal/agent/codex_proxy.go reads the raw System(): it predicts what
Codex itself does.
- Going direct while the VPN is off means vendors see the computer's own
address. A user who needs to fail closed sets the proxy in magpie.
Run:
- win-run (xiaomi-gpu, Windows 11) go test ./internal/netproxy: ok.
TestWindowsDeadSystemProxyGoesDirect writes ProxyEnable/ProxyServer to
a scratch key that RegOverridePredefKey puts in place of HKCU, so the
box's own Internet Options are untouched. It reads them through the
real system() and the real 300ms dial: direct while nothing listens,
the proxy again once a listener runs.
- win-run go test ./internal/plugin: TestPiPackage,
TestCachedReadsSavedProvidersOnce (#7197), TestDistReadFailedIsntMissing
(#6075) and TestPluginLeavesTheUserNetworkDirect (#4115) are red on
Windows at origin/main
|
||
|
|
e4e9eb0928 |
usage: a ZCode call to a provider added by hand at magpie's address is not a local session's (jiangshangmuyun on X)
The Usage page listed one ZCode call as "new-provider · 本地会话" among the
gateway's own rows for the same Trae CN DeepSeek calls. The reporter has one
ZCode window and routes everything through magpie.
Cause: the user added magpie to ZCode by hand as a provider of their own
("new-provider", base URL magpie's gateway), not through magpie's connect,
which writes the id "magpie". ZCode records that id beside each reply, and
readZCodeCalls left out only "magpie"/"dial" (ocGatewayProvider). Its calls
were read from ZCode's database as well as logged by the gateway, and only
hidden again where pairing by session, tokens and end time matched; a call
whose counts didn't agree was listed twice as a "local session".
Fix: zcodeGateway also takes any provider whose base URL, in ZCode's
config.json or provider_config.json, is this machine (loopback, localhost,
0.0.0.0, one of its own addresses) on the gateway's port (MAGPIE_ADDR or the
saved port). Such calls are left out before pairing, as "magpie" ones are.
zcode's call parse version is 4, so cached shards are read again. Like
workbuddyGateway it reads the configuration as it is now. The label itself
is unchanged: a call that did go straight to a vendor is still a local
session's.
Siblings filed, not changed: OpenCode/MiMo (ocGatewayProvider), Pi
(piGateway) and dsh still match the gateway by provider name only (#7193).
Go run on mote at this change on base
|
||
|
|
992f88d634 |
usage: a stand-in reading says why the read behind it failed
@tmr11235 on X (tweet 2123334817991520577, magpie v0.1.4520): agy-cli's card showed "截至 2026/11/15 14:19:19,暂时无法获取最新额度" days later, with nothing to say why. keepLast stands the last good reading in for a read that fails with a passing error (timeout, 429, 5xx, network) and dropped that error, so a stand-in that lasted four days read the same as one a minute old. The reading now carries the error as readError (SubscriptionQuota, and Quota for `magpie quota --json` and the gateway report), and asOfText puts it after the date: "… 暂时无法获取最新额度 · agy usage query timed out." A deferred read (not asked) has none, and the short "As of" line on cards stays short. Every provider's stand-in gets it, not only agy-cli's. Run (mote, at origin/main |
||
|
|
c01988e439 |
routing: a group's Small context first sends a request to the smallest window that holds it
yg6888 on X (tweet 2123308968848379920): in a group routed Smart, Cursor Plus's Composer and Grok 4.7 were never used. Not a bug: Smart orders by allowance tier, then soonest renewal, then listed order, and never weighs the context window, so the 1M members listed ahead always answered. The small ones were only ever reached as a fallback. Smart itself is unchanged; changing its order would move every Smart user's traffic. A group gets a new routing instead, `fit` (Small context first; 小上下文优先, 小上下文優先, 小さいコンテキスト優先, Kleiner Kontext zuerst): - routes.SmallFirst takes Smart's order and sorts it stably by band (a provider set to be used first, the rest with room, the all but used up) and then by window, the smaller known first, an unknown one last. - Its strategy sets ByWindow, so weighRouted fills Seat.Window from windowIn (the provider's own Contexts, else the catalog's). - roomy already leaves out every member the request is estimated past, so the first left is the smallest that holds it: a small model is never asked for a request too long for it, and keeps its last-resort place as under every routing. - The trace's rows carry `context`; the Routing page says "its 200K context window is the smallest that holds this request". - A group's only: provider.normalize already drops it from a provider and the CLI refuses it there. GUI menu, hint, why-lines, TUI and CLI (`routing=fit`, small-first) carry it; docs/reference.md, the gateway-routing and plugin-runtime pages and the en/zh/ja start pages say it, with the search index rebuilt (via docs-index.mjs; #7065). Run first at the tree rebased on origin/main |
||
|
|
8564238065 |
remote magpie: a model is asked on the API the remote asks it on best (OoopsHh on X)
With another magpie as the provider, Pi's models.json had only codex/* on openai-responses; an OpenAI key's openai/* and a routing group's auto/* went on openai-completions, and effort max was turned away there while Responses takes it. Cause: the remote's /v1/models gives native_endpoints, every API the model goes on as it is, in its provider's speaking order (Chat first), and nothing for a routing group. Here Provider.Native took the first one the remote magpie provider speaks: Chat, for every model but a ChatGPT sign-in's (listed on /v1/responses alone). The remote's own choice (Native: ResponsesFirst or the Base URL's API; a group's GroupAPI) was lost on the wire. Now the remote's list (X-Magpie-Drawers) says magpie_prefers, the path it asks the model on best (provider.PreferredEndpoint). The local magpie keeps it as catalog.Model.Prefers and Native takes it first for a remote magpie (RemotePrefers), so every agent wired one API per model (Pi, omp, droid, dsh, grok, hermes, liveagent through catalog.Model.APIs) asks it there, and the gateway's usable translates another API's request to it once instead of to Chat. A user's own API set on the model still wins; a remote from before says nothing and stays as it was. Not changed: a Chat request a client sends itself for such a model is still relayed as Chat to the remote, which decides as it does for its own clients. Run (mote, at this tree): - TestRemoteMagpiePrefersResponses (gateway: two magpies on one gateway, a fake vendor that turns away reasoning_effort max on Chat) and TestPiAsksARemoteMagpiesModelWhereItPrefers (agent): green; both red with the RemotePrefers check in Native and usable turned off (openai/* and group/auto on chat, Pi's api nil, a Messages request relayed as Chat). - Two real magpie serve processes in sandbox HOMEs, a fake vendor, an OpenAI key there with its Base URL given as Responses, a group auto and the first magpie as the second's Remote magpie: Pi's models.json has office/openai/gpt-6.2-astra and office/group/auto on openai-responses with max, and /v1/responses effort max reaches the vendor's /v1/responses for both. The same script at the base commit wrote both with no api (the provider's openai-completions). - At base |
||
|
|
e2e8ea253b |
gateway tests: a flipped byte in the kept-body test is one that changes the body
TestKeptBodyIsOnlyItsCallers flipped the byte at the middle of a dcz body and expected a 400. Which byte that is depends on the package's .go files newAgentChat reads as the conversation, and with plugin_credits_last_test.go added the middle byte fell on bits zstd doesn't read: the body decoded to the same request, matched its digest and was rightly passed on (200, reached 2, 3 of 3 on mote; 0 of 3 on origin/main |
||
|
|
504db2206e |
kiro: the docs say what the Routing page shows, and the min names the ACTIVE, outlasting trial
The ported change said the Routing page shows "on credits · after the others"; nothing in the GUI renders Weighed.CreditsLast, so the docs now say the mark is read by affinity only. The plugin (0.1.41, review follow-up on plugins#1352) says credits only while an ACTIVE bonus has credits left that outlast the month's reset; the docs and the mover's note say so. |
||
|
|
5a83f0ae6c |
gateway: a plugin's account on its trial credits is asked after the accounts with plan credits left
A plugin window may say credits: used up, the account goes on past it on credits its vendor spends after the window's. Kiro spends a month's plan credits before a trial's, and the plan's are lost at the month's reset while a trial's last a year, so such an account goes after the provider's accounts with room and before those used up, under every routing but Pick account by hand.
Ported from StringKe's branch (StringKe/magpie kiro-trial-last, 23e084262;
yetone/magpie#7179, with plugins#1352, kiro 0.1.41). Kiro's billing docs
say "Kiro uses your plan credits first, then your trial credits" and that
trial credits last 12 months. Opt-in per plugin window (credits), so a key
or a Codex account routes as before: creditsLast and CodexCreditsFirst
stay Codex-only, behindOthers moves only plugin: accounts, and no other
plugin package sends credits. The Kiro mover's min goes to 0.1.41, on npm
(gitHead 0ae116db1).
Run at this stack's head on mote: go test -timeout 45m ./... with go vet
./...: every package ok but internal/gateway, red on
TestOpenCodeGoOwnFreeModelGetsNothingOfOpenCodes (red 3 of 3 alone on
origin/main
|
||
|
|
975799a069 |
gui: Settings' search finds what the words are about (canlee886 on X)
canlee886 (X, 2123329450502938656) searched Settings for "可访问性",
"监控" and "自动选择模型" and each said no setting matched: "缺少搜索时
的智能联想". The search only found settings whose text had every word.
What it does now, all in finder.js, in the page, nothing sent anywhere:
- A table of ~30 concepts, each with the words a reader may type in
en, zh, zh-TW, ja and de (accessibility, monitoring, picking a model
by itself, theme, proxy, notifications, startup, privacy, LAN, cost,
quota, hotkey, ...), leading to the English names of the settings it
covers (a setting's English is its data-en in every language). Those
settings are listed with the ones that have the words themselves,
for rows, built-ins and other pages' places alike.
- When nothing has the words: a long run of Chinese or Japanese is read
by its two-character words ("文字大小调整" finds Text size), and a
Latin word over 3 letters may be one edit off ("currancy").
- When no setting has the words themselves but some are related, the
line over the parts says "Settings related to “…”" (start-aligned,
in every language) instead of "No setting matches".
- The finders count first (setFeatsFind/elseFind take a dry flag), so
a search renders once and the view's MutationObserver doesn't loop.
Not done, on purpose: pinyin (a large table, and readers type Chinese
through an IME), a recent-searches list and "did you mean" chips (a
layout that jumps on focus; the owner has said no to UI churn).
Run (WSL magpie-desktop: mote's load was 26 to 34 on 18 cores, mica's
disk is full):
- settings-search-related.test.cjs (new), Chromium and WebKit, en, zh,
zh-TW, ja, de at 560x420, plus magpie web at 390x760: 16 of 16.
Against origin/main 9bf5848c1's assets (SEARCH_ASSETS): 0 of 16, "無
障礙"/"accessibility"/"barrierefreiheit" show no Text size.
- 37 nearby GUI files (settings-*, search-*, find-*, i18n*, menu-scroll,
click-scroll, builtins): 636 pass, 34 fail. The six files with reds,
run again at origin/main
|
||
|
|
239da9991d |
provider: Factory's mover takes opencode-factory-auth 0.1.50
dsh (DeepSeek Harness) on Factory got "This request was blocked by
Factory's usage policy check" (content_policy_rejected) on its first turn
(a1pha1nthefog on X). It wasn't its prompt or skills. Since 2026-11-18
Factory refuses a request that declares a tool under certain exact names,
and dsh declares bash, read, write, edit, glob and grep. 0.1.50 declares
such tools under droid's own names (Execute, Read, Create, Edit, Glob, Grep,
Task), or suffixed, and gives the agent its own names back in every reply
(magpie-community/plugins bb849910, porting heggria's #1314).
keepMovedCurrent updates every moved user to it.
npm view --registry=https://registry.npmjs.org --prefer-online
@magpie-community/opencode-factory-auth version gives 0.1.50
(published 2026-11-19T09:02:51Z); its tarball has tool-names.mjs.
Run (mote, at origin/main
|
||
|
|
9bf5848c1f |
gateway: a Kubernetes rolling update runs two pods on one volume safely
@justforlxz on X asked for a RollingUpdate (maxSurge 1, maxUnavailable 0) with no request dropped. The docs said strategy: Recreate, because the work only the serving magpie may do (renewing sign-ins, check-ins, moves, plugin updates, WhileServing) was kept to one magpie only by the gateway's port: a second couldn't bind it. Two pods each bind their own network namespace, so in an overlap both did it, and two renewals of one refresh token can spend it (a single-use token rotates). Design: both pods answer requests at once (each refresh and file write is already locked across processes: filelock, host.js lockRenew); the serving work is held to whichever gateway holds gateway.serving.lock (flock on the config folder, serving.go). The new pod retries every second and takes the work over as the old pod's gateway ends (its drain lets go first). A file system without locks is read as no other magpie, as before. Pods share the volume but not a pid namespace (both run magpie as pid 1), so the locks that judged a holder by its pid now judge it by host: - host.js lockRenew records host (hostname + pid namespace); a lock of another host is stale by age only, never by "pid 1 is alive here". - lockMoves (migrate.go) the same. - gateway.json records Host; forgetListening removes only its own, so the old pod's end no longer removes the new pod's file (same pid, same Started second was enough before). - temp and run-mark names get a random part (writeDurable, Claude run marks, gateway.json's temp file). While draining (SIGTERM), every reply says Connection: close, on the gateway and on magpie web's page port, so an agent that kept its connection to the old pod alive dials the Service again for its next request. Without it, the real rollout below had one broken pipe per kept-alive connection, ~5.8s after each SIGTERM, when the drain's end closed them. Docs (en/zh/ja docker, reference.md): RollingUpdate maxSurge 1 / maxUnavailable 0, the readiness probe, a required podAffinity on kubernetes.io/hostname (a ReadWriteOnce volume mounts on one node), and one Recreate update from a version before this one, whose old pod doesn't take the lock. Run: - Real overlap, podman 4.9.3 in WSL magpie-desktop: three pods (pa -> pb -> pc) on one volume, each its own container (pid 1, own hostname and network), a Service proxy over a readiness-probed endpoint list (1s probe, endpoint removed 1s after SIGTERM as kube-proxy does), 12 agents streaming 3s SSE turns through it, half keeping connections alive, no retries. Before Connection: close: 226 ok, 10 failed (broken pipe, kept-alive). After: 209 ok, 0 failed; second run 207 ok, 0 failed. Each new pod logged "another magpie serves", then "let go" as the old pod's gateway ended; gateway.json named the last pod. - Broken by hand, each red then green: TestServingWorkWaitsForTheOther- Magpie, TestServingWaitEndsWithItsGateway, TestForgetListeningKeeps- AnotherPods, TestMoveLockOfAnotherPod, TestRenewLockOfAnotherPodIs- WaitedFor, TestDrainingRepliesCloseTheirConnection, TestPagePortClosesWhileDraining. - Full suite, go test -count=1 -timeout 45m ./..., at 85305a82d (this change on |
||
|
|
6e58821092 |
provider: WorkBuddy's mover min is 0.2.37, kimi-k3.1-pro's call-only turn
opencode-workbuddy-auth 0.2.37 sends kimi-k3.1-pro (and -highspeed) an assistant turn with tool_calls and no text with one space as its content. The model answered such a turn 400 "Invalid request parameters", so dsh, which records a call-only turn as "content": null, failed on it from the first tool call on (Gloria335056 on X; the same model on QwenWork, plugins #1213). keepMovedCurrent brings every moved user's plugin up. npm view --prefer-online: 0.2.37 is latest. |