382c8c0bdfdcedadbfa35ce1df7bd34f583ec17b
974
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
ac15036ab4 |
provider: a catalog entry points at its provider instead of copying it
Entry.Provider was a Provider value, 1,328 of an Entry's 1,760 bytes, copied into every model of every provider each time a catalog, an agent's list or a routing group's entries were built. It is now a *Provider: entriesOf and decide's list give every model of one provider the same one (sharedEntry), and a group's entry points at its first member's. It is read only; every place that hands it on as a value (Resolve, CanFast, ownAgent, modelAllowed, …) dereferences it, so what they get is a copy as before. entryFor keeps its signature for the one model ServedEntryOf builds; offEntries' entries now carry their provider too. Measured on mote with the owner's real accounts (acctp sandbox, page open for 2m32s, w40 = before, w41 = this, alternating): - catalogOf's allocations 106 MB -> 67 MB, providerEntries' 88 -> 78 MB - CPU at the page's settle mark 3.42/3.33 s -> 3.18/3.30 s - live heap unchanged (76.3/76.1 -> 76.7/75.9 MB): the lists are rebuilt, not kept, so the copies were churn for the GC, not held Run: go build and go vet ./... and the tests compiled (go test -run ^$) on mote; the full suite at this tree (d1e823d5f) on mica: 99 packages ok, 0 FAIL (agent 317s, gateway 972s, gui 188s, provider 220s, usage 56s). |
||
|
|
3d4c8edcea |
gui: Open the Codex app is in Codex's row menu, not a button on its row
|
||
|
|
32d6be0d05 |
gui: Memory has a brain of its own, in the sidebar and on its requests
The owner (11-12): Memory should have its own icon, a brain. The Library's Memory tab had a bookmark, and Memory's own requests (the conversations it reads into memories, made as memdistill.Agent "memory") were drawn in Routing's graph, Usage and Sessions with the generic cube under their raw id, since "memory" was no client. - icons/memory.svg: a brain, 16-grid, stroke 1.4 with round caps and joins, as the sidebar's marks are; drawn as a one-tone mask. - navicons.js: the Library's Memory tab draws the same path. - agent.others: a client "memory", named Memory, with that icon, so /api/state's clients and agent.Looks (Usage, Sessions) name and draw it. It has no User-Agent: its requests are known by their token. - TestEveryClientHasNameAndIcon: memdistill.Agent is among the ids the gateway records, so it must be a client with a real icon. - tests/memory-icon.test.cjs: the sidebar's Memory tab draws the path icons/memory.svg has (and no other tab does), and a request from "memory" in Routing is drawn with the memory mask, not the cube. Chromium and WebKit, en/zh/zh-TW/ja/de, 1100 and 420px (no sidebar at 420px, so there the request only). Run on the tree rebased onto |
||
|
|
6acf5ee5c3 |
providers: StepFun's logo is the current mark, five squares in a circle (zzstar101 on X)
magpie drew StepFun's old stepped-S in blue. StepFun's own sources show
the new mark: stepfun.com's favicon (step_favicon.svg), the Hugging Face
org avatar of stepfun-ai (the step-5-preview card), and lobe-icons'
`stepfun` (mono). lobe's `stepfun-color` is still the old mark, so there is
no colour one to take; the mark is one tone, so it is stored as the mono
icons are (icons/stepfun.svg, currentColor, drawn as a mask that follows
light and dark). The presets (StepFun, StepFun China), the "step" model-maker
rule (IconForCatalog's table) and Step Code use "stepfun". A provider saved
with "stepfun-color" keeps working: that file now holds the same new mark
in black, which the one-tone check draws as a mask too.
Run (mote): go test of internal/provider and internal/agent ok; go test
-tags nogui ./internal/gui ok; GUI files stepfun-per-provider, icon-one-tone,
mono-icon-redraw, models-add-and-icons, icon-tile, nav-sub-icons ok in
chromium and webkit; a screenshot of the Providers list in chromium and
webkit, light and dark, shows the new mark for both icon names.
usage-cards-hide's "de 560" sideways scroll is red in chromium and
webkit, and the same on origin/main
|
||
|
|
ee1553913d |
gui: Codex's Agents row has an Open button, for the app or the terminal by a setting (Yink88564391 on X)
The Codex row on the Agents page now has an Open button beside the start button. It opens the Codex desktop app (mac and Windows) when it is installed, else Codex's CLI in a terminal. "Open Codex with" in Codex's details (Automatic, Codex app, Terminal) picks which; it is this computer's own setting (settings.CodexOpen, kept across a sync and a Settings save). The row menu's Open in terminal still opens the terminal. The web build has no button. Run (mica): go test internal/gui, agent, settings, settingsapi, provider ok; gofmt clean; GOOS=windows vet and GOOS=linux -tags nogui vet clean; GUI codex-open-button (62), agent-open-terminal (24), i18n-keys, codex-service-tier in chromium and webkit, en/zh/zh-TW/ja/de, narrow. agent-prefs lists the new row. Broken by hand: codexOpensApp always false turns TestCodexOpenButton red. Budget: coreScriptBudget +1,112 for this code, packed small, no page to move it to. Reds on main before this change, same count at |
||
|
|
e18aca1038 |
agents: an agent's own context window, and a routing group's own Compact at (ul3140773077392, NovaStudiosss on X)
ul3140773077392 on X: dsh compacts earlier than other harnesses at the same
window, so one global size per model fits none. An agent's sheet (Agents,
the agent's Settings line) now holds "Context window": a size for every
model, or model=size pairs (provider/model, group/<id>, provider/*, a bare
model id, *). Empty follows each model's own window. It is applied in
provider.CatalogFor, the choke point every agent's model list goes through,
so dsh's contextWindow, Codex's catalog and Claude Code's window all read
it, and a window set this way makes Codex/Claude compact at that window
(Entry.WindowSet). Stored in settings.AgentContexts, kept by a general
save (settingsapi); POST /api/settings/agent-contexts and
`magpie model window <agent> [model=size...|off]`.
NovaStudiosss on X: Routing, a group's Edit, Advanced already had "Context"
(the window agents are told). It now has "Compact at" beside it
(Group.Compact; compactSet reads it before the members' smallest), also
`magpie group ... compact=`.
GUI: agentwindow.js, loaded on demand through agentcompact.js so app.js
stays inside its budget (TestCoreScriptBudget passes; the "Context window
in {agent}" label reuses the existing "Context window" key). Every agent
with fields now has a sheet; agent-prefs' Pi expectation says so.
Run at the pushed head, on mote: go vet (darwin; linux -tags nogui;
windows) on provider, agent, cli, gui, settings, settingsapi; gofmt clean;
go test provider, cli, settings, settingsapi, gui (TestCoreScriptBudget
and cli's route table fixed here), agent -run Dsh; node --test agent-window
and group-compact (chromium and webkit, en zh zh-TW ja de, 900 and 420px),
agent-compact, agent-prefs, compact-at. Reds seen identically on a
detached origin/main
|
||
|
|
7dbfc9f2fe |
usage: FlowDown and Bob are clients drawn with their own app icons (shannnnnks on X)
Their requests were unnamed in Usage and Routing. FlowDown (wiki.qaq.flow) sets no User-Agent in its sources (checked Lakr233/FlowDown), so the system's "FlowDown/<build> CFNetwork/..." is what arrives; Bob (com.hezongyidev.Bob) is closed source and is matched the same way, by "bob/". Icons are the apps' own App Store icons at 64px, as color SVGs wrapping the PNG, so app.js's size budget is untouched. Run: TestFlowDownAndBobAreClients (agent), see push notes for the rest. Not tried: real traffic from Bob (its UA is the CFNetwork default for its executable name, not captured); FlowDown/Bob are not wired as agents, since neither reads a config file magpie can write. |
||
|
|
c96f33d659 |
agent: Hermes is one entry in the Agents list and the model pickers; its profiles are not rows (geekbb on X)
|
||
|
|
a687f6b040 |
agent: a Hermes profile named in Chinese reads as its name, not u64cd-u4f5c (geekbb on X)
Hermes makes a profile's id from a non-ASCII name with slugifyProfileName (apps/desktop hermes-bots/labels.ts): each non-ASCII letter becomes -u<hex>-, so 个人数据管理 is u4e2a-u4eba-u6570-u636e-u7ba1-u7406. The Agents list drew that id: "Hermes · u81ea-u52a8-u5316-u673a-u5668-u4eba". A Hermes profile row (hermes#<id>, and the profile:<id> model field of the connected Hermes) now reads the name Hermes keeps in the profile's profile.yaml (ui_meta.hermes-bots.title, then display_name, the order its Bots roster uses), else the id with those runs decoded: excel--u64cd-u4f5c-u5458 is excel操作员, test-u673a-u5668-u4eba is test机器人. A token below U+0080 or not a letter or digit is left as written. The id (agent id, folder, `hermes -p`) is unchanged; the row keeps its "Hermes · " prefix and layout. Every place the name shows (GUI rows and subtitles, TUI, usage/sessions) takes Agent.Name, so one change covers them. Run: TestHermesProfileRowsReadAsNames with the reporter's six ids (red on the old code: names stay the raw ids, broken by hand); go test ./internal/agent ./internal/library ./internal/usageapi ./internal/tui; vet darwin, linux nogui, windows. Not tried: a profile created in the real Hermes app (its source was read, not run). A hand-named ASCII profile like "uface" (u + 4 hex) would also decode. |
||
|
|
5a13482682 |
agent: dsh's settings section is compared as a tree, not as two Marshals
dshSettingsRoute marshalled the pi section before and after putting magpie's routes in, to tell whether anything changed. On a real account's sandbox (mote, ~/r2278) that was 12.75 MB of the first 45 s's allocations, every start. The section is now copied, and the copy and the edited tree compared field by field (yamlSame: every field Marshal reads, not line and column). Only when the trees differ are both marshalled, so a tag spelled out on one side still reads as no change. Run: - real-account sandbox, alloc profile at 45 s: w28 yaml.Marshal from dshSettingsRoute 12.75 MB, w30 none; total 547 -> 503 MB. settings.yaml's mtime unchanged (Nov 10) after the w30 start. - mica: go test ./internal/agent ok (333s), go vet, GOOS=linux and windows vet; new TestYamlSameReadsWhatMarshalWrites. Not tried: a settings.yaml whose section magpie does change, beyond the existing dsh tests. |
||
|
|
17345f684f |
agent: Spotlight is asked once for every desktop app, and a stale answer never waits
After the Sessions caches dropped (five idle minutes), the next
/api/sessions/stats on `magpie web` took 2.3–4.1s on the real account
on mote while its handler ran ~220ms of CPU. Two goroutine dumps taken
1.2s and 1.8s into the ask both sat in ownSessionsOff → agentsHere →
agent.Detected → HasApp → desktopApp.version → spotlightBundles: one
mdfind per bundle id (13 of them, ~50ms each idle, far more under
load), serial under one lock, asked again whenever the 5-minute answer
expired. Every other agent.Detected caller (Providers, quit ask, gateway
pause, Sessions) paid the same.
- spotlightBundles asks one `mdfind -attr kMDItemCFBundleIdentifier`
for every id desktopApps names, and keeps the answer by id. Past
spotlightFresh a caller gets the kept answer at once while one
goroutine asks again; only the first ask after start waits, once for
every caller. A failed mdfind keeps the answer before it.
- agentsHere stops at the first detected agent instead of checking all.
Measured with the real account's data on mote, the Sessions stats ask
at 370s, after the drops (`magpie web`, sandbox HOME):
main (w27) 2.3–4.1s in three runs earlier today; 1.34s in this run,
while mote's load fell from ~180 to ~10
this (w28) 0.77s at load ~170, then 0.046s
The rest of the 0.77s is the stats themselves being read again.
Tests: TestSpotlightParse; TestSpotlightOneAskStaleNeverWaits (10 reads
are one ask; a stale read returns while the refresh is held; two stale
reads are one refresh). On mica: go vet ./internal/agent ./internal/gui,
go test -count=1 -timeout 45m ./internal/agent ./internal/gui ok
(280s, 186s).
Not tried: Spotlight off on the Mac (mdfind fails; the answer is none,
as before); Intel Mac.
|
||
|
|
5e933e153a |
agent: ZCode gets a Restart when magpie's models change while it runs (Flandern1211 on X, #5662)
ZCode reads its providers at start. Its Agents row now offers Restart for a
model list magpie changed while the app runs, as Claude Desktop's, WorkBuddy's
and OpenMausBot's do: restartApps has ZCode.app (dev.zcode.app) and
ZCode.exe, appReads covers config.json and provider_config.json, and
zcodePart hashes only magpie's provider, provider rule and model rules,
without the key or another provider's rules.
Patch by Flandern1211 (fork branch fix/zcode-restart-5662, 7b663fea9), read
line by line: three files in internal/agent, no network, credential, dependency
or .github change. Kept as written; this commit only adds the Restart line to
docs/subsystems/agent-wiring.md.
Run (mote, at this tree on origin/main
|
||
|
|
900d1673d3 |
claude-desktop: a model listed by its 1M id runs to 1M, not the 272K working window (henglu486729 on X)
With Only each model's largest window (DesktopLongest) a 1M model is listed by its "[1m]" id, but Full window off still gave it the working window as its autoCompactWindow, so Desktop's Code tab compacted and showed it at 272K. desktopPlan's work() now leaves such a model at its whole window. A threshold typed in magpie (CompactAt, per model or provider), the user's own autoCompactWindow and a typed window still win. Listing and inferenceModels already carried the 1M (supports1m/prefer1m, max_input_tokens). Run (mote): TestClaudeDesktop* in internal/agent and Desktop|Claude in internal/gateway ok; go vet darwin, GOOS=windows, linux nogui ok; gofmt clean. New TestClaudeDesktopLongestRunsTo1M red on the old claude.go (glm entry ""), green after. Not tried: the Windows Desktop 5.1231.2 app itself (only 2.7032's bundle read); full suite is run after the tag. |
||
|
|
e0b67f342b |
gui: times follow the system's 12 or 24 hour clock (iXerol on X)
An en-US Mac set to 24-Hour Time showed Routing's request times in 12
hours: no webview hands the page the system's clock, and navigator.language
carries only the region. boot.js now says it as hourCycle ("h23" or "h12",
left out when the system names none, and for a browser tab, which keeps its
own): macOS from AppleICUForce24HourTime / AppleICUForce12HourTime, Windows
from Control Panel\International sTimeFormat, Linux from gsettings
clock-format. intlLang() adds -u-hc-<cycle> to its tag, so every formatter
that takes it follows, and the places that forced 24 hours (hour12: false,
hourCycle h23) spread hourClock() instead: 24 unless the system says 12.
Read once per 30s, so a change in System Settings shows at the next load.
Run on mote: new hc-clock.test.cjs (en-US on a 24h system, en-GB on a 12h
one, a silent system), chromium and webkit; Go tests for the three readers
and boot.js; gofmt; go vet darwin, windows and linux nogui; internal/gui
tests; GUI files of gui-*, i18n-*, panel-*, quota-*, reset-*, routing-*,
usage-* in chromium and webkit. TestCoreScriptBudget was over by 77 bytes
and passes with two app.js comments cut, no raise.
Broken by hand: hc-clock is red without the intlLang suffix.
Not tried: a real Windows or Linux session's setting (the readers are
unit-tested on their formats), a live Mac.
|
||
|
|
c1a91b5a52 |
agents: Mistral Vibe is an agent, and a Library target (alterxyz4 on X)
Vibe (mistralai/mistral-vibe, the `vibe` CLI) keeps its settings in config.toml in $VIBE_HOME, else ~/.vibe. magpie now connects it: a [[providers]] entry named magpie (the gateway's /v1, api_style openai, backend generic), one [[models]] entry per catalog model aliased magpie/<provider>/<model>, and active_model set to the alias, with the previous value stashed and put back on Disconnect. Vibe reads keys only from the environment, the keyring or ~/.vibe/.env, so the key naming Vibe goes in the provider's extra_headers as an Authorization header; nothing is put in the user's environment. Avibe's `vibe` command is turned away by binNot. Library (#5595): instructions are $VIBE_HOME/AGENTS.md and skills $VIBE_HOME/skills (vibe/core/system_prompt.py, vibe/core/config/harness_files/_paths.py, read at 3.1.2). VIBE_HOME is in appdir's usable list and agentenv. README (en, zh), docs/reference.md and docs/subsystems/agent-wiring.md list it; the restart notice is in zh, zh-TW, ja, de. Run (mica, sandbox HOME): - go test -count=1 ./internal/agent ./internal/library ./internal/appdir ./internal/agentenv ./internal/gateway ./internal/gui: ok. - gofmt -l clean; go vet darwin, linux -tags nogui, windows on the touched packages: clean. - Real vibe 3.1.2 (uv tool install mistral-vibe) with the file shape magpie writes, against a fake OpenAI upstream: the alias with slashes resolves as active_model, the request goes to /v1/chat/completions with model kimi/k2, Authorization: Bearer <key> from extra_headers and user-agent Mistral-Vibe/3.1.2. - GUI: agent-notice-lang, i18n-keys, i18n-en-no-cjk, gui-zh-tw pass. - Broken by hand: vibeMine returning false fails TestVibe, TestVibeOwnModelTakesMagpieOut and TestVibeSyncKeepsTheirs. Not tried: the file written by the built magpie binary itself (the unit tests write it through the same code), Windows runs of the new tests, a Vibe signed in to Mistral with its own models alongside. gui-de and gui-ja "every zh string" were red on the base for the "{agent} isn't installed here" string, not for this change. |
||
|
|
1b884225ad |
gateway: agy's own /effort or --effort level beats the Agents row's pick (haohaolee on X)
Antigravity CLI on a Google model through an API provider: the row's effort field was there and applied (TestAgyAgentEffort), but agy's own /effort (works on the Google names agy knows, which the gateway serves by bare name) and --effort low|medium|high (any model) send a thinkingLevel that the row's pick then rewrote, so the session's choice seemed to do nothing. A request naming a level is now left as asked (agyLevelAsked); a request with thinkingBudget -1 still gets the row's. "/effort" stays "not adjustable" for "magpie/..." model keys: agy 1.5.5 and 1.5.6 have no settings or ModelInfo key that enables it (tried thinkingLevel, thinkingBudget, displayName, vertexModelId). Run: TestAgyAgentEffort, TestWithGeminiEffort on mote; the new case is red (sent "low" for an asked HIGH) with the condition removed by hand and green with it. Real agy 1.5.5/1.5.6 against a fake Gemini upstream in a sandbox HOME showed the levels reaching the gateway. Not tried: a real Gemini API key, agy against the real gateway end to end. |
||
|
|
b4b82e5857 |
agents: Codex's profile list drops a deleted provider's models (JNDliuliuM on X)
Codex wired by its profile alone (codex -p magpie) kept offering the models of a provider that was deleted. The profile's model was one of that provider's, so it no longer resolved as a magpie model, wired() was false, and the profile's Sync returned before it wrote magpie-models.json again. The old list stayed, new providers' models never reached it. The Sync now writes the list again whenever the profile names magpie as provider and its list, even when the model it was set to is gone. All-of-Codex scope already did this (asProvider and ownCatalog), as did the models_cache.json staling. Found by syncing a sandbox HOME in both scopes after a provider edit and a provider delete: only profile scope plus delete left the old list. TestCodexProfileListDropsADeletedProvider is red on the old code (listed added/m2 and added/m3 after the delete) and green now. Run on mote: internal/agent package, go vet darwin, linux nogui, windows. Not tried: a real Codex CLI reading the list; the viaBase models_cache.json path (covered by existing tests, not changed). |
||
|
|
52b516da6d |
agents: a model of no known window is told the default under the longest context too (ul3140773077392 on X, #6259)
settings.ContextCap held every window magpie knew, but fourteen agents write a default of their own (128000 or 200000) for a model whose window magpie doesn't know, and that default went out past the cap: Crush, ZCode, VS Code and its forks (Copilot, Zoo Code, Air), Copilot for JetBrains, Zed, jcode, Pencil, AtomCode, Kimi, OpenClaw, Snow, WorkBuddy and CodeBuddy. unknownWindow holds each default to the cap. AtomCode's output clamp used the constant and now uses the window it is told. BaoCode (a Claude Code front end) keeps its own context per model and reads no window from magpie; Claude Code gets the cap through CLAUDE_CODE_MAX_CONTEXT_TOKENS, which it does follow. Not changed. Guard: TestEveryAgentFollowsContextCap connects every agent that can be here to a provider with a 987654 model and a model of no window, under a cap of 99999, and fails on any agent file holding either window or a default. Red on the old code in 14 agents' files (checked on mote), green after. Run on mote: go test ./internal/agent ./internal/provider ok; go vet darwin, GOOS=windows, GOOS=linux -tags nogui ok; gofmt clean. Not tried: a live BaoCode, the full suite (started after the tag), GUI. |
||
|
|
138d806f7a |
codex: "applies to" waits while Codex is routed through magpie by the base URL too (kakzyanaba on X)
80dcd3472's "applies to" field (All of Codex / codex -p magpie only) was refused only while Codex was Wired(). Codex routed through magpie by openai_base_url alone (beside its ChatGPT sign-in, or for failover) reads as not wired, yet magpie keeps config.toml and its list there. Moving the choice to the profile then made codexIn read magpie.config.toml (nothing in it): the row showed disconnected, config.toml's wiring stayed behind unmanaged, and Codex went on with its own default list, magpie's models gone from the picker. The choice now also waits while Codex is Routed() or FailingOver(). Someone already switched stays switched: disconnect, then choose All of Codex. Run (mote): go test ./internal/agent ./internal/gui ok; gofmt clean; go vet darwin, linux nogui, windows ok. TestCodexScopeWaitsForBaseURLRouteToo is red with the guard back to Wired() alone (scope changed while Codex is routed), green with it. Not tried: a real Codex app, the GUI row in a live window; I could not confirm the reporter's exact state, only that this path produces it. A cache poisoned by a timed-out refresh (#6142) is a separate cause and not changed. |
||
|
|
80dcd34729 |
codex: connect Codex through codex -p magpie alone (hpnjstar on X)
The Codex agent gets an "applies to" field: All of Codex (as before) or "codex -p magpie only". In the second mode magpie writes <CODEX_HOME>/magpie.config.toml (model_provider, model, effort, model_catalog_json, its own [model_providers.magpie]) and a catalog beside it, and never touches config.toml: its top-level model_provider, model and openai_base_url stay the user's. Disconnect deletes that file and magpie's catalog (kept if the user added to it). Plain `codex` keeps its own provider. Codex 0.165 reads `--profile NAME` from NAME.config.toml and refuses -p while config.toml holds a legacy [profiles.NAME] or profile = "NAME", so this is the file form, not a [profiles.magpie] table. Codex without profile files (older than the May 2026 removal of legacy profiles) isn't served in this mode. The choice changes only while Codex is disconnected, so the two wirings never share a config. Only magpie's models are offered in this mode; no joining, failover or subagent fields. Run (mote, at the rebased head): go test ./internal/agent ./internal/gui ok; gofmt clean; go vet darwin, linux nogui, windows ok; GUI i18n-keys, i18n-en-no-cjk, gui-zh-tw, codex-signin-always, agent-connect, agent-disconnect in Chromium and WebKit. Real codex 0.165.0 in a sandbox CODEX_HOME against a fake server: `codex -p magpie` sent one request (Bearer magpie, model fake/m1); plain `codex` sent none; config.toml was byte-identical after connect, effort change, sync and disconnect. Broken by hand: letting scope change while connected turns two TestCodexProfileOnly tests red. Not tried: a real account, the Codex app, the GUI row in a live window, an older Codex without profile files. gui-de and gui-ja "has every zh string" are red on main without this change (#6234). |
||
|
|
972f69fdc7 |
dsh: a start's first round goes by the last magpie's record (#2278)
A start's first dsh round read every profile through the yaml emitter to
find what the last magpie's round had found: nothing to write. On a real
account that was ~60 MB of the first minute's 523 MB.
The round's key (dsh's files, the gateway, the models) is now summed with
sha256, the same in every process, and a round that ends with nothing to
write records it in the cache folder (dsh-rounds.json, temp + rename).
A start's first round goes by that record when it is this magpie
version's; a dev build never does. A file, the models or the version
changed has the round run as before.
Run:
- go test ./internal/agent (mica): ok 188s.
- GOOS=darwin/linux/windows go vet ./internal/agent ./internal/gateway
./internal/appdir: ok.
- Broken by hand: with the record not read, TestDshFirstRoundGoesByTheLastMagpies
is red ("read and wrote dsh's files 1 times").
- Real account, mote sandbox HOME, a start after one start (pprof
alloc_space at 50s): dshRounds.once 101 MB -> 38 MB (the catalog
only), yaml emitter 43 MB -> none, total 522 MB -> 463 MB. Footprint
peak 168 MB (w11) -> 165 MB.
Not tried: Windows and Linux real starts; the record is plain JSON in
appdir.Cache() there too.
|
||
|
|
e0a1ab0a47 |
agent: RenameLegacy reads no thinking level as a model
RenameLegacy looks for model fields still holding a legacy provider id.
It read every field's value, Pi's defaultThinkingLevel too, and Pi's
effort Get checks the level against the models Pi offers: the whole
catalog built for Pi at every start, though no thinking level is ever a
model id. A field whose key ends in "effort" is now skipped.
Measured on mote with a real account (its providers, Codex and dsh
homes), the profile 8s after start, two runs each:
- before (w5): RenameLegacy 67 MB allocated, piOffered/sharedModels
46-48 MB of it
- after (w6): RenameLegacy 25 MB, piOffered gone from the profile;
the diff of the two profiles: sharedModels -47 MB, but the dsh round
now builds its own list (+27 MB) where it used the one Pi built, so
~20 MB less allocated at start. liveHeap 104.5 MB both, footprint
134-137 MB both: this is garbage saved, not memory kept.
Run: TestRenameLegacyBuildsNoModels (new) passes; with the old
legacy.go it fails ("RenameLegacy built pi's models"). gofmt, go vet
and go test ./internal/agent on mica at
|
||
|
|
c75a1a0f83 |
agent: dsh's bili route asks sharedModels for the catalog, as every reader of the list does (TestModelReadersShareTheList)
The previous commit read len(magpieModels(...)) in dshThrough; the guard test that lists readers of the shared catalog went red. Run (mica): go test -tags nogui ./internal/agent: ok (202s); ./internal/library: ok (139s); go vet darwin, GOOS=linux -tags nogui, GOOS=windows on agent and library: clean; GUI library-bili, library-all, i18n-keys, i18n-en-no-cjk and site node --test: exit 0 at the commit before. |
||
|
|
a1a3b6fadb |
library: DeepSeek Harness folds its context with billion-context through its /bili/ prefix (VantH_off on X)
VantH_off asked for DeepSeek Harness in billion-context's support.
Library's billion-context tab offered Pi, omp, OpenCode, Claude Code, Hermes
and Zed. bili's dsh route is `dsh plugin add billion-context` (billion-context
0.1.213 README), which loads in dsh's process and takes traffic by proxy
settings; magpie's dsh route is baseURL http://127.0.0.1:3425/v1, plain http
on loopback, so that never sees it and the plugin would add tools and fold
nothing (the Hermes case,
|
||
|
|
a6d84e13a9 |
agent: Claude Desktop can use this computer's LAN HTTPS address for SSH remote sessions (zyc-bit on X, #4546)
Desktop's built-in SSH remote sessions hand the profile's gateway address
and key to the remote host. magpie wrote 127.0.0.1 and this computer's own
key there, so the host refused it (provider_loopback; a non-loopback address
must be https), the gateway turned the key away from another machine, and
3p mode's sshHostAllowlist (empty) allowed no host.
Desktop's row gets a "gateway" picker, drawn only while LAN sharing is on
and an address of this computer is https (gateway.LANURLs: HTTPS on, or
MAGPIE_PUBLIC_URL): "This computer" (default, loopback) or that address.
The pick is settings.DesktopGateway (carried by the settings save, kept by
KeepOwn). desktopOn / desktopCheck / desktopKeyApplied write and compare
desktopGateway() and the key at it (agentKeyAt: the sharing key). On a
non-loopback address sshHostAllowlist is seeded once with ["*"]
(desktopSeedOnce; the user may narrow it, never rewritten). The pick holds
only while it is still one of the https addresses; Agent.Gateway is
desktopGateway, so Rekey (after the sharing toggle, and now after the HTTPS
toggle) sets Desktop again, back to loopback when sharing goes off.
desktopIsOurGateway takes this computer's LAN addresses; realReachProbe no
longer verifies the certificate (magpie's CA is not trusted on this
computer), which read a LAN https address as unreachable.
Run (mica, sandbox HOME): go test ./internal/agent ./internal/settings
./internal/settingsapi ok; ./internal/gui ok except
TestPanelHiddenByWailsMarksPageOutOfSight, flaky the same on origin/main
|
||
|
|
7e3e0fec4f |
gui: put agents back as they were when magpie quits, connect them again at start (tudjam17795 on X)
New Settings > General switch, "Put agents back when quitting" (zh: 退出时还原 Agent 配置),
default off. With it on, quitting the GUI app runs the same restore Disconnect does
for every agent magpie has connected (*.before-magpie files back byte for byte), and the
next start connects those agents again. Off keeps today's behaviour: a connected agent
keeps magpie as it quits.
- agent.RestoreOnQuit disconnects each wired agent that the user did not disconnect, then
forgets the <id>.disconnected mark, so the quit leaves no mark; it stashes the list of ids.
agent.RewireOnStart takes that list once and connects those still unwired and not
disconnected since. An agent the user disconnected stays disconnected.
- gui: OnShutdown restores only when the setting is on and this process served the
gateway; start re-wires in the background (not while the gateway is paused). A restore
on quit also quits at once without the ask.
- settings.RestoreOnQuit, settingsapi key kept unless sent, row in index.html, i18n for
zh, zh-TW, ja, de, docs in gui-shell.md and agent-wiring.md.
- app.js: the repeated Off/On settings rows go through one helper (segsOO), 422 bytes
smaller overall, so TestCoreScriptBudget passes without raising the budget.
Run (sandbox HOME, mica because mote was loaded):
- go test internal/agent, internal/gui, internal/settings, internal/settingsapi, internal/cli
at the rebased head: the new tests and the budget test pass.
- GUI, chromium and webkit, five languages, widths 1100 and 420: restore-on-quit (new),
quit-ask-setting, quit-ask, settings-general, settings-sections, settings-places,
i18n-keys, i18n-en-no-cjk, gui-de, gui-ja, gui-zh-tw, and for the rows moved to
segsOO: reduce-motion, skeleton-bird, lightweight, keep-login, checkin-at,
update-auto, update-hide, update-restart, update-download, tray-bird, tray-logos,
tray-cost, wsl-agents-setting, login-allow. All 0 fail.
- gofmt -l clean; go vet darwin, windows, linux -tags nogui clean.
Broken by hand: not forgetting the disconnected mark turns
TestRestoreOnQuitAndRewireOnStart and TestRestoreOnQuitLeavesUserDisconnected red;
dropping the Disconnected() checks turns TestRestoreOnQuitLeavesUserDisconnected red;
dropping the setting gate turns TestRestoreAgentsOnQuit red.
Known reds, not from this change (same on the base
|
||
|
|
7b9ae7cf9c |
agent tests: Pi's group entry counts the group look-ups, not the process's bytes (#6178)
TestPiGroupEntryKeepsItsMembers (
|
||
|
|
85e6ec5406 |
agent: Paseo's Claude model picker lists magpie's models (@TheMist016 on X)
Paseo (getpaseo/paseo) starts the same Claude Code, but builds its own model
list: first-party models plus settings.json's `model` and a few
ANTHROPIC_*_MODEL variables (providers/claude/models.ts). It never reads
Claude Code's modelPicker, where magpie writes every model, so the rest were
not selectable in Paseo. Paseo's own ~/.paseo/config.json takes
agents.providers.claude.additionalModels ([{id,label,description}], checked
against protocol/src/provider-config.ts) and passes each id to Claude Code as
written.
New agent "Paseo" (detected by ~/.paseo or PASEO_HOME): its switch writes the
models Claude Code's /model lists (same ids, [1m] marks, names; only the ones
picked for it) there, marked "via magpie" in the description; the user's own
entries and keys stay, off takes out only magpie's, a sync refreshes when on.
Claude Code must be connected to magpie as well.
Run (mote-run, sandbox HOME in tests): TestPaseoAdditionalModels,
TestStateListsPaseo, internal/agentenv, internal/gui full package ok;
internal/agent full run red only on TestPiGroupEntryKeepsItsMembers, which is
red the same on origin/main
|
||
|
|
efdca11be3 |
agent: Pi's group entry keeps whether a member speaks Messages across polls
Pi's Drift is asked on every /api/drift poll, about every 12s on every page. Each poll wrote the entry of the model the agent is set to. For a routing group, piModelJSON found all of the group's members again (GroupFinder, membersFound, resolveIn) only to see whether one speaks Anthropic's Messages API, for #5037's short promptCache. With the real-account copy on mote, an alloc_space diff of 55s with the Sessions page open showed 21.7MB allocated, 17.1MB of it under Drift (5 polls, ~3.4MB each), 16.1MB of that in this look-up. provider.GroupHasNative answers it through keptOf: kept across requests while the files' stamp stays the same, a minute at most, as the catalog's other kept builds are. Outside a request it is found afresh, as before. The entry is the same. Test: TestPiGroupEntryKeepsItsMembers. Over successive requests, a group's entry allocates under half of one provider.FindGroup: 3,600 bytes against 71,040 for a 40-member group. With the old agents.go it is red: 72,672 against 71,040. TestPiGroupPromptCache and TestPiGroupThinkingIsWhatPiRuns pass. |
||
|
|
f3cdb03c8a |
agents: a Claude Code kept in another config folder is a row of its own (BieJian21872 on X)
Only the folder CLAUDE_CONFIG_DIR (else ~/.claude) names was found. Every
other ~/.claude… folder holding Claude Code's files (settings.json,
.credentials.json or projects/) is now claude#<name>, "Claude Code · <name>",
made by claudeIn at that folder (place.dir, as claude#launch is): connected,
model picked and checked in its own settings.json. With the variable
elsewhere, ~/.claude is claude#default. ~/.claude.json, another tool's
.claude-… folder and the launch file's folder are not rows. A folder
outside the home folder is not found (documented in agent-wiring.md).
Run at the pushed head's parent
|
||
|
|
19782923c5 |
codex: the compaction magpie makes can go on a model of its own (0neB1aze on X)
Codex's memories had a model of their own, its compaction did not. Codex's row has a compaction model square (compact_model, settings.CodexCompactModel), read by the gateway on each compaction (codexCompactTo, before codexCompact). Only a compaction magpie makes is moved: it asks for a plain-text summary any model reads back. One a ChatGPT account seals, or a pick that compacts natively, is left, since only the writing account reads it (#1099); a disabled, unserved or key-barred pick is left with a log line. The text sent to the model is unchanged. Run on mote: TestCodexCompactOnItsOwnModel (red with the move taken out) and TestCodexCompactToLeavesNative; go test for gui, settings, settingsapi, agent, provider, gateway; darwin, linux and windows vet; the GUI files in both engines. Not tried: a real Codex session compacting on the chosen model. |
||
|
|
80e4856803 |
agent: an agent's command in ~/.local/bin is found on Linux and macOS too (Xuanwo on X)
Detected asked only magpie's own PATH off Windows. A magpie started from a desktop launcher has no ~/.local/bin on it, where the official Antigravity CLI installer puts agy, so the Plugins page said "Antigravity CLI isn't in Agents: magpie doesn't find it in ~/.gemini/antigravity-cli". binAt now asks proc.FindTool on every OS (PATH, then ~/.local/bin, npm, bun, Volta, cargo and the other folders a user's tools live in), as Windows already did and as CLIMissing already did. Run: TestDetectedFindsBinInLocalBin on Linux (wsl-run, magpie-desktop): red with binAt put back to LookPath only, green with the change. On mote: go test ./internal/agent ./internal/proc ./internal/gui ok, gofmt clean, go vet for darwin, windows and linux nogui clean. Not tried: a real agy install on the Linux VM, and the GUI Plugins page. |
||
|
|
e3e774be7a |
agents: Claude Code's Co-Authored-By commit signature on or off from its settings (9_bishi on X)
Claude Code's row in Agents > Settings gets a "Commit signature" On/Off menu. Off writes Claude Code's own key attribution.commit = "" in settings.json; On takes out only what hid it (attribution.commit "" , attribution false, includeCoAuthoredBy false), so the default comes back. A custom attribution text is the user's own: the row shows "Your own text", is disabled, and is never written over. attribution.pr is untouched. Route POST /api/settings/claude-attribution, S2 in the settings parity test. Run at the rebased head (on |
||
|
|
7050da0a4c |
hermes: each other profile is an agent row with its own skills and MCP servers (Norethcy on X)
Hermes reads skills/ and mcp_servers from each profile's own home, but the
Library only reached the connected profile. Every other profile is now an
agent row hermes#<name> ("Hermes · <name>"), like omp#<name>: its model pick
stays, and the Library target points at that profile's config.yaml and
skills/. No row is listed while Hermes itself is gone (CLIMissing). Tool
off-lists (tools.exclude) work on the rows too. The GUI says "starts on the
model picked here" for them as for Hermes.
Run: wsl-run go test ./internal/agent ./internal/library (ok, full packages);
GUI hermes-profile-row, hermes-profiles, omp-profile-connect, i18n-keys in
chromium and webkit, five languages; gofmt; go vet GOOS=darwin and windows
for agent and library.
Broken by hand: without hermesProfileAgents in onMachine,
TestHermesProfilesAreAgents is red; without the hermes# branch in targetOf,
TestHermesProfilesGetTheirOwnLibrary is red; without the app.js change the new
GUI test is red (10 of 10).
Not tried: a real Hermes with real profiles, Windows via win-run, the full
GUI suite, the internal/gui Go package (wsl lacks gtk4, build fails there).
|
||
|
|
164826d8b6 |
agent tests: a settled dsh round's allocations are held to the same round over fewer models (#6118)
TestDshRoundWithNothingChangedBuildsNothing held the round to a fixed 300
allocations, and Windows CI read 421 with the skip working. It now settles
the route over 2 models and over 402, and fails when the larger is over
1.5x the smaller + 50: reading the files differs by system, building the
catalog grows with the models.
Broken by hand (`if false && r.done && key == r.last` in dshRounds.once):
red on Windows, 78375 allocations over 402 models against 1780 over 2.
Run at
|
||
|
|
5c02be05b8 |
agent: agy moves onto the community agent-agy plugin
The built-in agy agent (Antigravity CLI) is the first built-in agent a community agent plugin serves, as the retired subscriptions moved onto provider plugins. While @magpie-community/agent-agy is installed and on, magpie's agy is the plugin's: the built-in leaves the list (here and in WSL), its id and aliases are the plugin's, and what the built-in wired is handed over. Turned off or removed, the built-in is back. Nothing is forced yet; the forced install and the built-in's retirement come once the plugin is on npm and a real run with it is on record. The plugin (plugins ebcff866, 0.2.0) follows the built-in since |
||
|
|
fe8c05e0c8 |
agent: Claude's model variables hold Anthropic's own ids on Claude Code's own subscription, so Desktop's Code tab stops failing WebFetch (iryan_sun on X)
ANTHROPIC_DEFAULT_<TIER>_MODEL, ANTHROPIC_SMALL_FAST_MODEL, CLAUDE_CODE_SUBAGENT_MODEL and the auto mode model stayed "claude/claude-haiku-4-5[1m]" after the main model became an alias. A tier variable can't be an alias of itself, so on this computer's own file a Claude model of Claude Code's own subscription is now written as Anthropic's bare id (provider.ClaudeBare): through magpie that id goes to the same subscription (OwnRoute), and Anthropic knows it. Haiku has no 1M window, so its [1m] mark is taken off. Read back, a bare Claude id is the subscription's ref (ClaudeUnbare), so every field, the tiers' follow logic and the gateway's stand-in read it as before. Old files: a settings.json written with the prefixed ids is rewritten by the next Sync (the check that already brought dashed spellings up to date), for every user. Models of other vendors or a relay keep their ref: Anthropic has no id for them. A distro's file and the claude-magpie launch file keep refs. Run (wsl-run, Ubuntu, at the pushed head after rebasing on origin/main): internal/agent -run "Claude|Tier|Folder" ok; internal/provider ok; gofmt -l clean; go vet -tags nogui for linux, darwin and windows clean. Before the rebase, the whole internal/agent package had two reds: TestFolderVarsAreListed (BUN_INSTALL, fixed on main since) and TestGrokInstalled (WSL2 binfmt, already #3548). Neither touches this change. Real claude 2.1.316 with a fake upstream showed Desktop's PROVIDER_MANAGED_BY_HOST sends the tier env as written, so prefixed ids go to Anthropic. Broken by hand: with ClaudeBare turned into a no-op, TestClaudeModelVariablesAreAnthropicsOwnIDs fails on the bare ids and on the Sync rewrite. Not tried: the real Claude Desktop Code tab, a WSL distro user, real accounts through magpie end to end. A non-Claude model or a relay-served Claude model still has no Anthropic id, so its tier variable keeps the ref and Desktop's Code tab still can't use it. |
||
|
|
6c95722da6 |
agents: OpenMausBot's row draws its real logo, not a black square (HulaSup on X)
The Agents row showed a plain black square for OpenMausBot. Its icon file (OpenMausBot's build/icon.svg, a black tile with a silver cursor, Apache-2.0, byte-identical to upstream at main) was named openmausbot.svg, and app.js draws an SVG without the -color suffix as a one-tone mask: the black tile became a black square. Renamed to openmausbot-color.svg, which app.js loads as an image (as Antigravity, Cherry Studio). TestEveryClientHasNameAndIcon now fails a client whose SVG holds gradients but isn't named -color; it is red on the old name (checked by hand), green now. Run (wsl-run, magpie-desktop, nogui tag; mote's disk is full): - go test ./internal/agent: ok. go test -run 'Icon|Client' ./internal/gui: ok. The full ./internal/gui run hung 600s in TestGatewayMode (gatewaymode_test.go:63) on WSL, a test this change doesn't reach; not filed or investigated. - go vet on linux (nogui) ./internal/agent ./internal/gui and windows ./internal/agent: ok. - gofmt -l: clean. Not tried: the live GUI in chromium/webkit; the full suite. Protocol (HulaSup's question): magpie writes OpenMausBot an engine of its own as a Claude endpoint (driver claudeAgent, ANTHROPIC_BASE_URL), Anthropic messages. |
||
|
|
612dc1956f |
agent: BUN_INSTALL is an agent folder variable; TestGrokInstalled's fake is not an MZ file (#3548)
Both were red on origin/main
|
||
|
|
d78d853a4e |
agent: telemetry off for Crush, Kimi Code, Goose, Pi and Cline too (daoche_wuzui on X)
Settings > Privacy "Turn off telemetry for all agents" and each agent's own Telemetry row now also cover Crush (options.disable_metrics), Kimi Code (top-level telemetry in config.toml), Goose (GOOSE_TELEMETRY_ENABLED in config.yaml), Pi (enableInstallTelemetry; Pi itself, not its forks) and Cline CLI (telemetryOptOut in data/settings/global-settings.json). Each key was read from that app's source, docs or binary. Same rules as before: only missing keys are written, a user's own value is never overwritten, an unreadable file is unknown (TOML and YAML are parsed strictly). Antigravity (app and agy) has no local key: agy's EnableTelemetry is json:"-" and the setting lives on the Google account. Droid (org-set), OpenCode/omp (OTel is opt-in), Cursor CLI (account privacy mode) and Hermes (sends none) have none either. Grok Build, Kiro, CodeBuddy, Command Code and Amp were not looked at. Run (wsl-run, mote's disk is full): telemetry_more_test.go green; broken by hand twice (wrong off test: crush and cline red; lenient unreadable read: kimi and goose red). go vet for windows, darwin and linux nogui clean. internal/agent whole package: only TestGrokInstalled red, a WSL exec "Invalid argument" in a /tmp stand-in, not touched here; the one red this change caused (TestFolderVarsAreListed, CLINE_GLOBAL_SETTINGS_PATH) is fixed in agentenv.Vars. Real goose and crush binaries read the sandbox paths; not tried: that any of the five honours the written key at run time, Windows run. |
||
|
|
0c44b9ece4 |
agent: a dsh round builds the provider catalog once
keepDshWired's round ran outside any provider.Hold, so every PublicRef, RenamedRef and Exposed it asked built every provider's models again. With a real account, 158 MB of what magpie allocated in its first minute was this round, 72.55 MB of it dshStartOnItsRoute's four refs, all worked out before the first was looked up. The round now holds the catalog for its whole run, and the start's refs are worked out only when the one before isn't listed. provider.EntriesBuilt exposes the build count for the test. Test: TestDshRoundBuildsTheCatalogOnce gives the start an auto ref no model has and counts catalog builds in a writing round. On the old dsh.go it is red with 3 builds; with the change, 1. |
||
|
|
1ccacad632 |
agent: Obsidian is listed only when a vault has Copilot (iEthan333 on X)
detect was "obsidian's config folder exists", so every Obsidian user got a
row whose provider field could only fail ("no Obsidian vault here has
Copilot"). It now needs a vault in obsidian.json with Copilot installed
(.obsidian/plugins/copilot/manifest.json) or magpie's provider already in
its data.json, so a wired vault can still be disconnected. Every OS's config
folder (mac, Windows, Linux, Flatpak, Snap) is already read by obsidianDirs.
Siblings checked: Zoo Code and Copilot (JetBrains) already require the
plugin installed; VS Code forks and Raycast are the apps that hold the
setting themselves. None changed.
Run: go test ./internal/agent -run Obsidian (wsl-run); the new no-Copilot
vault assertion is red on the old detect (checked by hand). Full agent
package, gofmt, linux and windows vet: see push notes. Not tried: a real
Obsidian install.
|
||
|
|
0052c860e0 |
library: billion-context installed with bun is found on Windows (Zerenjie on X)
biliPath looked for bili.cmd on PATH and in %APPDATA%\npm only. bun add -g puts bili.exe (with a bili.bunx) in the bin of BUN_INSTALL or ~\.bun\bin, so a bun install was never found. It now asks proc.FindTool, which tries .exe and .cmd in every folder a user's tools are installed in. proc's UserBinDirs also takes BUN_INSTALL's bin (Windows and elsewhere), and Kiro Crew's adapter search gets ~/.bun/bin, BUN_INSTALL's bin and, on Windows, %APPDATA%\npm, its siblings that had the same hole. Run: on xiaomi-gpu (Windows 11) really `bun add -g billion-context` into a sandbox BUN_INSTALL with PATH holding no bun bin. Before the fix biliPath was "" ; after, it was bili.exe and `bili --version` answered 0.1.213. go vet and go test -run Bili|KiroCrew|ToolIn|UserPath for library, agent and proc passed on Windows and in WSL (magpie-desktop). The three new tests fail on the old code in WSL (broken by hand with the sources stashed). Not run: the full suite, a darwin vet and a mote run (mote's disk was full, 226Mi free), the GUI suites (no GUI file touched). |
||
|
|
aa2ea5c906 |
agent: Claude's main model is written as a tier alias, so Claude Desktop on a subscription no longer sends magpie's prefixed id (iryan_sun on X)
Claude Desktop's Code tab sets CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST=1. Claude
Code then ignores the env block of settings.json (base URL, token, tier model
vars) but still honours the top-level `model`. magpie wrote `model` as the
provider-prefixed id (anth/claude-opus-4-7), so the official API rejected it
and WebFetch failed.
writeTiers now writes `model` as the tier alias (opus/sonnet/haiku/fable, with
[1m]) whose ANTHROPIC_DEFAULT_<TIER>_MODEL already maps to the main model, on
this machine's ~/.claude only. A distro file, the claude-magpie launch file and
a main with no tier keep the id. The model field reads the alias back through
the tier env, also while the gateway is unreachable (drift). Unwire drops
`model` when magpie wrote the alias.
What happens to old values: a settings.json an older magpie wrote with the
prefixed id (model "up/big-x") is rewritten to the alias at the next catalog
sync, for every user, with no step on their side; the tier env already maps it
to the same model. A prefixed id picked from the modelPicker rows is brought to
the alias the same way. A model the user set themselves (claude-haiku-9,
own/xyz, opusplan) is never rewritten.
Ran:
- Real Claude Code CLI (~/.local/bin/claude) in a sandbox HOME and
CLAUDE_CONFIG_DIR, wired by a magpie built from this tree (gateway :38760)
to a scripted upstream that logs each request's model: main -> big-x,
`--model haiku` -> fast-x, a subagent (Agent tool) -> sub-x, WebFetch's
extraction of https://example.com -> fast-x (haiku's). Old prefixed file
migrated to "sonnet" by a catalog sync; the three user models above stayed.
- TestClaudeMainModelIsAnAlias: red on the old code, red again with mainWord
broken by hand, green with the fix; it also covers the user's own models.
- 11 existing tests read the raw `model` as an id; they read it through
writtenModel now. TestWSLClaudePick compares the distro's file with the
native one after normalising `model` (the distro keeps the id by design).
- go test ./internal/agent ok at the pushed head; gofmt; go vet darwin, linux
nogui, windows for internal/agent.
- internal/cli: TestGatewayKeyLimitCLI is red on origin/main
|
||
|
|
d7978141bb |
sessions: WSL sessions go when the last agent in a distro is uninstalled (_SekiBetu_ on X)
wslList kept every distro's listing, cold, whenever WSLHomes named no distro. That is also what it names once the last agent in WSL is taken away, so the sessions of a removed agent stayed listed for good, unopenable and undeletable. internal/agent now says whether wsl.exe answered the list of distros (sessions.WSLListed); an answer with no distro an agent is in drops the listings, no answer keeps them as before. Run (win-run, xiaomi-gpu; mote refused SSH all session): the new TestWSLAgentsGoneListingDrops and TestGoneAgentLeavesNoSession (native Claude and Codex folders deleted: nothing listed, no parse kept; green on the old code, so macOS/Linux/Windows native lists were already right), go test ./internal/sessions ./internal/agent, go vet on both. Broken by hand: with the WSLListed check turned off the new test is red (7 sessions listed after the agents were taken away). Not tried: a real WSL distro with a real uninstall; GUI; full suite. |
||
|
|
245f07b19e |
agent: the pages that poll name rows from a list built once a while
The Sessions page polls its list and its stats every 15s, the Usage page its clients, and each asked agent.Clients() only for each agent's id, name and icon. Clients() builds every agent (30+ constructors): 2.5 ms, 378 KB and 3411 allocations a call on the Windows box with discovery's real 2s look window, mostly os.Stat, filepath.Join and Getenv. On the real-account run (t69, 4 min) agent.All under the sessions handler was 22 MB of 210 MB allocated. agent.Looks keeps that id/name/shared-name/icon list for 30s, built again at once when the plugins' agents change (agentplug's set) or the Agents page's refresh (Rescan). A new omp or QwenPaw profile shows by its id for up to 30s. Nothing is kept in a test binary unless a test says, so tests that add an agent read it at once. The GUI's sessions list, stats, one session, markdown export, trash, manage and reads views, and usageapi.Clients, read Looks. Tests: TestLooksBuiltOnceAWhile — six asks build once, the list equals Clients(), a plugin agent switched on and off shows at once, Rescan builds again. Broken by hand (memo check made false): "six asks built the agents 6 times; want once". Run on the Windows box: go test ./internal/agent ./internal/gui ./internal/usageapi at the pre-rebase base |
||
|
|
d1b4eff5aa |
agent: version detection and updates for agents installed in WSL distros (mewcoder on X)
A WSL twin row (<kind>@wsl:<distro>) showed no CLI version and no Update button; the host path's cliupdate machinery only knew host binaries. Now a twin in a running distro is read and updated inside the distro, for every cliSpecs kind that has a command (cliupdate_wsl.go): - one `wsl.exe -d <distro> -e sh` probe prints the command's real path, --version and exit code, with its own folder, npm prefix, ~/.local/bin and ~/.bun/bin first on PATH (wsl.exe -e has no login PATH, node CLIs exit 127); kept 10 min in wslProbes, dropped by Rescan and after an update. - wslHowInstalled applies the host rules to the Linux path: own updater (spec.self), Homebrew, npm, bun, pnpm; volta, yarn and unwritable prefixes are left alone. - the update runs in the distro through wsl.exe (wslRunUpdate); a Linux brew's newest is asked in the distro too. - a stopped distro is never started: no version, and an update says to start it. CLIs() lists twins, so Update all takes them in. No GUI change: the Agents row is keyed by agent id. Run: gofmt clean; go vet darwin, linux, windows on internal/agent; go test ./internal/agent ok on mote. TestWSLAgentCLIVersionAndUpdate (fake registry + fakeWSL distro with an nvm prefix) goes red with the CLI hook removed from CLI(). Real: win-run on xiaomi-gpu, magpie-desktop's own codex read 0.162.1, Update true, updated to 0.167.1. internal/gui on mote: only TestPanelHiddenByWailsMarksPageOutOfSight failed (AppKit test killed at 120s, mote load ~80; no GUI file touched). Not tried: real brew in a distro, proxy env inside the distro, sudo-owned npm folders, kinds without a bin (Goose, mu), starting a stopped distro. Host's proxy settings are not carried into the distro. |
||
|
|
0cc91af3db |
agy: magpie's models go in a settings file of its own, so agy's remote control works (baysonfox on X)
magpie wrote modelProvider gemini, the model and its custom models into agy's settings.json. That made every agy an API-key session: no Google account, so no remote control (needs the sign-in plus Google's server-side flag), and a plain agy asked for GEMINI_API_KEY too. Now they go in ~/.gemini/antigravity-cli/magpie-settings.json, handed to agy as --settings for the one session (the launch command, magpie agy run, and the function in a shell or a WSL distro). settings.json stays the user's. An older wiring is given back (stashed model and provider) at the next Sync or pick. agy remote-control and --remote-control run plain, on the sign-in. Run (mote): go vet, GOOS=windows and linux nogui vet, agent/cli/sessions/update packages (see push note). Real agy 1.5.3 in a sandbox HOME: plain agy with the user's untouched settings.json now asks for sign-in (no GEMINI_API_KEY error); the new launch reached a stub gateway at /v1beta/models/<m>:streamGenerateContent. Broken by hand: remote-control bypass removed, TestAgyRun red; TestAgy red on the old code (settings.json written). Not tried: real remote control (needs a Google sign-in, none in the sandbox); signed-in BYOM custom models; Windows PowerShell function run. |
||
|
|
90a028d2c1 |
air: JetBrains IDEs get a Magpie agent for each running WSL distro (yanghonghang on X)
IDEA 2026.3 starts a WSL project's ACP agent inside the distro through EEL.
An absolute Windows command whose environment differs from the project's is
refused ("ACP executable belongs to a different environment"), which the AI
Assistant shows as "Magpie does not run". The host entry in ~/.jetbrains/acp.json
therefore never worked for a WSL project.
Now each running distro that has opencode gets its own "Magpie (WSL <distro>)"
entry: command is the distro's opencode as a \\wsl.localhost UNC path (the
WSL descriptor, accepted), env OPENCODE_CONFIG points at a magpie-opencode.json
written in the distro's ~/.jetbrains. Set, Sync, Check and the uninstall path
all reach the entries; a stopped distro is never started. The probe now
records the binary paths (distro.Paths).
Ran: mote-run go test -run 'TestAir|TestWSLProbeKeepsPaths' ./internal/agent
(ok), the same on win-run and wsl-run (ok), gofmt, GOOS darwin/linux/windows
go vet ./internal/agent. Broke by hand: turning the WSL branch off in airAt
turns TestAirIDEAddsMagpieAgentForWSLProjects red.
Not tried: a real JetBrains IDE (none on the Windows box); the EEL rule was
read from the IDE's bytecode.
|
||
|
|
92c798aac5 |
agent: dsh's models are built again every 30 minutes at rest, not 5
With a real-account HOME, an idle magpie allocated ~53 MB per 4 minutes, and ~42 MB of it was dsh's wiring round building magpie's models again because dshModelsFor (5 minutes) had passed, with provider.StampNow unchanged. The forced build is only for what the stamp can't see: another app rewriting an account's file, and models retired by date. Now it runs every 30 minutes, and once more when the local day changes, so a dated retirement still reaches dsh's lists that day. Run on mote: - go test -count=1 ./internal/agent: ok (244s) - GOOS=windows go vet, GOOS=linux go vet -tags nogui ./internal/agent: ok - gofmt -l: clean Broken by hand: dshModelsFor back at 5 minutes, TestDshModelsStale is red (10 and 29 minutes counted stale). The existing "unseen" subtest still rebuilds models dshModelsFor old. Not tried: a measured idle allocation on a real binary; that comes with the next release's acrss/ad run. |