e5994a0159e88dbcfbb04f8b587b8b7fee3a9c19
994
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
9205ee109c |
agent: the Claude Code magpie downloaded keeps ~/.claude from reading as "CLI not found"
Wing8Aqua on X runs magpie as a systemd service on Ubuntu, where the Claude subscription runs the Claude Code magpie downloaded (claudecode.Install, in its cache folder, off PATH). Magpie's own runs make ~/.claude, and the Agents page took that folder, with no `claude` on PATH, for an uninstall's leftover: Claude showed "CLI not found" while that Claude Code answered every request, and `magpie claude` starts it. cliHeld now counts claudecode.Downloaded() for Claude Code. Run: TestCLIMissing* in internal/agent on Linux (wsl-run): ok, with a case for a download and one for a version folder without its binary. Broken by hand (the download not counted): case 5 red. |
||
|
|
880da8c17e |
agent: ZCode is told a model takes video, so a video it attaches reaches it (Flandern1211 on X, #5098)
A model whose source lists video input (antigravity/gemini-4-argon, say) reached ZCode as text and image only, in config.json's modalities.input and in provider_config.json's inputFormat, so ZCode never attached a video to it. buildModels left the catalog's kinds out of the agent model, and zcode.go rebuilt the list from m.Images. - buildModels carries Entry.Modalities() into InputModalities and OutputModalities. - zcodeInputs adds "video" when the model lists it and the provider's format is Messages or Chat. ZCode's own built-in rules (3.14.3's zcode-builtin.json) use inputFormat.supportsVideo, so the key is one its strict schema takes; it is written only when true. Ported from Flandern1211's fork branch (fix/zcode-video-input, e955d3c24), with these differences after review: - Its gateway half (Messages video block and Chat video_url as a file part) is on main already, since |
||
|
|
7758da0770 |
agent: Crush is told which models take images (Novello42 on X, #6515)
Crush's view tool answered "This model (…) does not support image data", its file picker (ctrl+f) was hidden and a pasted image was left out, for every model through magpie. magpie wrote Crush's providers.magpie.models without catwalk's supports_attachments, so each model decoded with SupportsImages false (capabilities.vision false once Crush 0.99 migrates the file: migrateCatwalkV2Model, internal/config/load.go). Each model now carries supports_attachments from m.Images, as OpenCode's modalities do. Checked against catwalk and Crush main: Crush's load.go moves supports_attachments to capabilities.vision; catwalk v3 reads vision. Report and root cause: #6515 by DaVinci42. Not changed: magpie still writes Catwalk v2 keys, which Crush 0.99+ rewrites to v3 on load; filed as #6521. Test: TestCrushModelsSayTheyTakeImages, red on origin/main |
||
|
|
f07c5de1f0 |
wsl: a distro whose vEthernet path to Windows is firewalled reaches magpie at Windows' LAN address (H1_B1_K1 on X)
H1_B1_K1 on X: a company firewall (火绒企业版) that the user can't open blocks a NAT distro's path to Windows' address on vEthernet (WSL), the 172.x one magpie wires agents in WSL to. Windows' LAN address answers from WSL. Nothing told magpie to try it, and nothing should have to: - When the reach check from inside a NAT distro finds the gateway's WSL address shut (reachFrom's probe, told and not ok), wslFindVia asks the gateway (gateway.SetWSLVia, kept in settings.Dir()/wsl-via) to listen at each of Windows' other IPv4 addresses too. The LAN's addresses come first and Hyper-V's other vEthernets last. It then asks from the distro which one answers, keeps the first that does as the via and lets the others go. - A via listener lets in only Windows itself (peer == local address, which is how a NAT distro's connection to the LAN address arrives) and the WSL networks. A LAN peer is reset before HTTP. fromWSL takes the WSL key there as it does on vEthernet. - distro.host() is the via under NAT, so base(), the Claude Science relay and keptaway's wslHost use it. Every NAT distro's wired agents are set again (Rewire). WSL Codex now moves its own two URLs (codexMoveGateway), as on Windows, because openai_base_url wasn't moved by a rewire. The address left behind goes into the distro's Was, and the unreachable line offers "Use" for a config still on the old one (wslMovedFrom). - When the via shuts later and the WSL address answers again, the via is dropped and agents go back. Not changed: wslrun.Tool.proxy still turns a user's 127.0.0.1 proxy into the distro's vEthernet host (Tool.Host). That is the user's own proxy, which magpie can't make listen elsewhere. Filed as an issue. Run: - go vet for darwin, windows and linux of internal/agent, gateway and wslrun: ok (mica). - go test internal/gateway and internal/wslrun -run "WSL|Via": ok, on mica and on Windows (xiaomi-gpu). - go test internal/agent -run "WSL|Kept|Reach|Unreach|Codex| ClaudeScience": ok (mica, 104s). On Windows, -run "WSL|ClaudeScience|Kept|Reach|Unreach": every WSL test ok. Its first run was red in three WSL tests: a distro found shut searched the box's real addresses, 15s each, under wslViaMu, so the next test's probes waited. TestMain now gives the package no candidates. The four "kept" allocation reds there are red at base too (#4786). - Real, on xiaomi-gpu with the magpie-desktop distro (NAT, Windows at 172.17.32.1, LAN 10.0.0.132). A firewall rule blocked inbound on 172.17.32.1 at the test's port. A throwaway Windows test (not committed) started gateway.New().ListenAndServe and called wslFindVia with the real wsl.exe: - curl from the distro to 172.17.32.1: no; - candidates [10.0.0.132 192.168.77.1 172.28.224.1]; - via [10.0.0.132] kept in 0.66s, and the distro reaches magpie there; - curl to 10.0.0.132 from mote and from this Mac: reset by peer; - from the distro: an HTTP answer. The rules were removed afterwards. Broken by hand, each red: - dropping the wslFindVia call in reachFrom: TestWSLFirewalledFindsAnotherWay; - dropping fromWSL's via clause: TestWSLViaCallerServed; - dropping the peer == local check in viaPeer: TestWSLViaListenerLetsInWindowsAndWSLOnly. reach_test's reachForget now waits for a probe still out before it clears the answers. TestWSLFirewalledFindsAnotherWay's last driftSettled starts a probe for the address the agent was just set at, and clearing under it panicked (assignment to entry in nil map). That was once in 1 and once in 3 runs at -count=3 on mica, and 0 in 5 after the change. At the rebased head ( |
||
|
|
80c22eecba |
agents: Codex leaves a model unchecked in its provider's list (JNDliuliuM on X)
JNDliuliuM: after picking new models for a provider, Codex CLI didn't change, and after a restart it was still on the old model. magpie wrote the new list, but Codex's `model` (config.toml, or magpie.config.toml for `codex -p magpie`) stayed on the model the user had unchecked. Resolve still takes any provider/model, so Codex kept starting on it and asking the vendor for it. Tried with the real codex-cli 0.165.0 in a sandbox CODEX_HOME, profile wiring: the list was swapped from sub/old-a, sub/old-b to sub/new-x, sub/new-y. After a restart, /model listed only the new ones, but the status line still read sub/old-a, as the profile named it. What changed: - provider.Unpicked(id) reports a model the user has since unchecked: the provider has picks, its served models lack the model, and it isn't a decision model. This is the same rule ResolveRoute already applies to routing groups (#3911). - agent.pickedInstead moves such a model to the first model of that provider that magpie lists for the agent now. - Codex's Sync calls it before its other model branches, through set, as picking the model does. The profile's Sync calls it through put. The Codex app reads the same config.toml, so it follows too. - Left alone: - a provider with no picks, whose list is the vendor's and may lack the model (#2642); - a provider with none of its models listed any more. Run on mote: - TestCodexLeavesAModelUncheckedInItsProvider (as provider, beside a ChatGPT sign-in, profile) and TestCodexKeepsAModelOfAProviderWithNoPicks; - go test ./internal/agent/ ./internal/provider/; - go vet for darwin, linux and windows on both packages; - gofmt. Result: internal/agent ok (470s). internal/provider is red only on TestHostBuildsNoList (a Gemini provider's Host allocates 5 times), which is #6479 and was already red on main. Broken by hand: with the Codex Sync call disabled, the "as its provider" and "beside the sign-in" subtests are red ("model = sub/old after sub/old was unchecked"). With the profile call disabled, the "by its profile" subtest is red. Not tried: - the fixed magpie with a real Codex; - the Codex app. Not changed, filed as #6504: other agents' model fields, and Codex's subagent and compaction models. |
||
|
|
cc42ec1d7e |
agent: an api set by hand in Pi's models.json stays (xiaomanweiman on X)
T3 Code's Pi puts all 71 of its tools into the context on openai-completions and only 3 on openai-responses, loading the rest when asked. The reporter set providers.magpie.api to openai-responses in ~/.pi/agent/models.json, and the next catalog sync wrote openai-completions back. piAPIsKept (pi_api_kept.go), called from piBlockKept (Pi, its forks and Aside), keeps an api the user set for magpie's provider or for one of its models. As with a maxTokens typed by hand (output_kept.go), the stash records the APIs magpie wanted per file (api:<path>:wanted), and an api in the file that is none of them is the user's. A model's keeps its baseUrl and compat with it. With no record yet, the provider's is taken as openai-completions, the only value magpie ever wrote there, so a file edited before this release keeps the user's value on its first sync. An api the file lacks is magpie's. A Chat model left on a provider the user put on Responses gets compat.supportsStrictMode, as magpie's own Responses models have it (#3055). magpie's default is unchanged: a model whose provider speaks Chat stays on Chat, relayed as Pi sent it, and no setting was added. Run (mote): go test -count=1 ./internal/agent/ ok (322s); go vet ./internal/agent/ for darwin, GOOS=linux and GOOS=windows; gofmt -l clean. TestPiKeepsAnAPISetByHand covers a value set before any record, set back by hand, a model's api with its baseUrl, and one taken out. Broken by hand: with the piAPIsKept call commented out the test goes red ("provider api = openai-completions, want the user's openai-responses"). Not tried: a real Pi or T3 Code (neither is installed here); the full suite runs after the push. |
||
|
|
6bc0d1e203 |
claude-desktop: Claude Magpie's Code tab on a Claude Code folder of its own (#6459)
The Separate app (Claude Magpie.app, #5671) kept its own Desktop
userData, but its Code tab's bundled Claude Code still read and wrote
the user's ~/.claude: their CLAUDE.md, skills, plugins and history went
into the twin, and the twin's sessions into theirs (xMopf7RF on X).
An opt-in, macOS-only switch under the Separate app's Advanced fold
(settings.DesktopIsolatedClaude, POST /api/settings/desktop-isolated-
claude, `magpie claude-desktop launcher claude-dir on|off`) gives it
~/.claude-magpie-desktop:
- desktopiso.Script exports CLAUDE_CONFIG_DIR in the app's launch
script; turning the option on or off remakes the app, and the hint
says to quit and reopen Claude Magpie, since a running one keeps its
environment.
- desktopOn writes Desktop's model windows, caps and explore entries
into that folder's settings.json instead of ~/.claude's while it is on
(desktopCodeDir, desktopClaudeSync); off moves them back. The folder
is kept when it is turned off, and shows as the claude# row "Claude
Code · Claude Magpie".
- The fold is drawn by claudemagpie.js, imported the first time it
shows; what stays in app.js is the import (isoLazy) and the fold's
place, 216 bytes, so the core budget goes up by 180 (the 36 of room
there was taken first).
Run:
- gofmt -l clean; go vet ./internal/... on darwin, GOOS=windows and
GOOS=linux -tags nogui vet of agent, cli, desktopiso, gui, settings,
settingsapi (mote).
- go test agent, cli, desktopiso, desktopdir, settings, settingsapi,
gui, library on mote: all ok except cli's three healthcheck/update
tests, which ask the gateway mote's own magpie serves on :3425
(#6223, the same with or without this change).
- TestCoreScriptBudget and TestSettingsSaveKeepsWhatItDoesNotSend at
this commit and the next.
- GUI on mote, Chromium and WebKit: desktop-isolated-claude (five
languages, 1100 and 640px), desktop-isolated, i18n-keys,
i18n-en-no-cjk, old-webkit, and every agent*/desktop*/claude* file
(98 files, 1,595 of 1,662 pass). Every red is the same on origin/main
|
||
|
|
1c6dc247ed |
codex: the Codex app restarts once for magpie's list named after it started (not_4O4 on X)
not_4O4 (X, magpie 0.1.4012, Windows): the ChatGPT app's Work tab
listed GPT alone, in a new window and in a new project on D: too.
The app-server reads model_catalog_json only as it starts. codex-rs
app-server model_catalog.rs reloads only when needs_reload is set,
which happens on an account change alone. The app keeps one
app-server for all its windows, and on Windows it runs from login
(StartupTask). So a list magpie named after the app-server started
never reached the picker. That happens when the list first becomes
known (the backend answering, or the models_cache stand-in from
|
||
|
|
db9a5ec7c4 |
gateway: Claude Code's advisor runs in magpie for a model whose upstream can't (Awad_Yoo on X)
Claude Code 2.1.316 sends its advisor (/advisor, settings.json's
advisorModel) for any model when CLAUDE_CODE_ENABLE_EXPERIMENTAL_ADVISOR_TOOL
is set: an advisor_20260301 server tool, which only Anthropic's server
runs. Until now magpie left it out for every other upstream (
|
||
|
|
96558cfde6 |
agent: Codex thread tables are written only for ids magpie can own
JsonParser (X) found [model_providers.openai_token_sharing] in
~/.codex/config.toml, written by magpie, and Codex refusing to start:
"provider auth cannot be combined with experimental_bearer_token". The
id is T3 Code's: T3 starts Codex with -c model_providers.
openai_token_sharing={..., auth={command=...}}, its threads name that
id, and putThreadTables (#1372) wrote a magpie table (name, base_url,
wire_api, experimental_bearer_token) for every provider a thread named
that config.toml lacked. Codex merges T3's -c over it, and the merged
table has both auth and a bearer token.
putThreadTables now writes a table only for a CC Switch id
(ccSwitchProvider) or an id config.toml itself once held, recorded per
Codex home in the stash (codex.filed_tables) whenever magpie reads the
file. A table an older magpie wrote for any other id, recognised by its
exact shape (four keys, name == id, wire_api responses, magpie's own
gateway key), is taken out at Sync, at Disconnect (uninstall and quit
restore) and in TakeLeftovers, unless a profile or model_provider names
it or it has sub-tables. The user's own tables, other apps' tables and
tables with any other key are left alone.
Known tradeoff: a magpie-written table for a card-named CC Switch id
that config.toml lost before this release, and magpie never recorded,
is removed once and not written again. CC Switch's own ids still are.
Run (mote): go test ./internal/agent -count=1 -timeout 45m ok (421s);
gofmt -l clean; go vet ./internal/agent for darwin, linux and windows
ok. Real codex 0.165.0 in a sandbox CODEX_HOME: magpie's stray table
plus T3's -c override reproduces the exact error; without the table
Codex loads.
Tests: TestCodexLeavesOtherAppsProviders (threads name
openai_token_sharing, custom and a relay config.toml once held: no table
for T3's id, the other two written back), TestCodexDropsStrayThreadTables
(wired and unwired; another app's table, a profile-named one and the
user's own key stay), TestCodexSyncDropsStrayThreadTable.
Broken by hand: without the threadTableFor guard and the tidy calls,
TestCodexLeavesOtherAppsProviders and TestCodexDropsStrayThreadTables
went red; without only the Disconnect tidy, TestCodexDropsStrayThreadTables
went red; without only the Sync tidy, TestCodexSyncDropsStrayThreadTable
went red.
Not tried: the TakeLeftovers tidy was not broken by hand on its own;
T3 Code itself was not run, only codex with its -c override.
|
||
|
|
a96d88effa |
claude-desktop: a model picked for two tiers no longer shows twice in the menu (yanghonghang on X)
v0.1.3997 showed "Gemini 4 Hydrogen · haiku" beside "Gemini 4 Hydrogen"
in Claude Desktop's model menu.
|
||
|
|
3f6b1b0c94 |
agent: omp's advisor turns on with its model, and its review, wait and call-back are set in magpie (#6408, Awad_Yoo on X)
Awad_Yoo wants omp's advisor gated: one model executes, another reviews
only at key points. omp's advisor (src/advisor, advisor/settings.ts) runs
only while advisor.enabled is true, and omp leaves it off, so a model
picked for the advisor role in magpie reviewed nothing.
- A model picked for the advisor role writes advisor.enabled: true when
the user hasn't set it. The role's reset takes back only what that pick
wrote (a stash mark); the user's own on or off stays.
- Three Quiet fields write the rest of config.yml's advisor block, as omp
reads it (omp_advisor.go):
- advisor_review: off, turn, agent-end (enabled + reviewMode; off keeps
the mode);
- advisor_wait: syncBacklog off, "1", "3", "5", strict, written as
strings, since omp's enum settings take only strings;
- advisor_wake: continueSeverity nit, concern, blocker.
- GUI: omp's opened row and its panel sheet get three rows (Advisor; Waits
for its review; Calls a finished agent back on). The last two show only
while it reviews, and the rows redraw in place. They live in
ompadvisor.js, imported the first time. The roles square's advisor line
says " · off" when the advisor is off. Strings in zh, zh-TW, ja and de.
- Core script budget: +717 for what is left in app.js, after the rows
moved out.
- docs/subsystems/agent-wiring.md has an "omp's advisor" row.
Not magpie's: taking over from the executor after repeated failures of
the same kind. omp has no such setting; "escalate" in its source is only a
note's severity. An omp extension can do it (pi.on("tool_result") with
pi.setModel), and that keeps the session's trace and completed tool
results. Said on the issue.
Run:
- mica-run go test -count=1 ./internal/agent/: ok.
- go vet ./internal/agent/ ./internal/gui/ for darwin, linux (nogui) and
windows: clean. gofmt -l: nothing.
- internal/gui Go tests: on mote (below).
- GUI, on mote and mica: omp-advisor.test.cjs (new: chromium + webkit;
1100 and 390px; en, zh, zh-TW, ja, de; panel sheet at 360) passes, as do
agent-prefs, old-webkit's own check, i18n-en-no-cjk,
omp-profile-connect and agent-row-disclose.
- Reds that fail the same on a clean worktree at origin/main
|
||
|
|
7693cf2634 |
agent: a folder holding only magpie's sign-in file is no agent (jiangshangmuyun on X)
Codex, never installed, was listed on the Agents page as "not connected" once a ChatGPT account was added in Providers. With Codex signed in to nothing, addLogin hands it that account and saveCodexLogin writes ~/.codex/auth.json, which makes ~/.codex; Detected took any non-empty Dir for the agent. Claude Code is the sibling off the Mac: putClaudeLogin writes ~/.claude/.credentials.json when Claude Code has none. Agent.signIn names that file (auth.json for both Codex agents, .credentials.json for Claude Code), and agentDir passes over it. A folder with anything else of the agent's beside it (config.toml, sessions/, settings.json, projects/, history.jsonl), its binary, or its app still lists it. Run: - gofmt -l; go vet on darwin, linux (-tags nogui) and windows, on mote. - go test -count=1 ./internal/agent ./internal/gui on mote: ok. - win-run on xiaomi-gpu: TestSignInFileAloneIsNoAgent, TestClaude*Windows*, TestDetected*: ok. Broken by hand: agentDir not passing over the sign-in file: TestSignInFileAloneIsNoAgent red for codex and claude (../tray-jump-scratch/break.log). Not tried: a real ChatGPT sign-in in a sandbox HOME with no Codex. A Codex app installed but never opened, with only magpie's auth.json in ~/.codex, is not listed until it is opened (it then writes its own files there). |
||
|
|
f1ac93aa54 |
codex: Ultra on every other vendor's model that reasons (pingqipai3 on X)
pingqipai3 asked for Codex's Ultra effort on every model, so Codex uses subagents more. Codex offers a level only where the model's catalog entry lists it, and magpie listed Ultra only on OpenAI's own models. What Codex does with it (openai/codex 553c764): Ultra is never sent. ModelInfo::resolve_reasoning_effort sends the entry's multi_agent_reasoning_effort, else max, else its highest other level; and under MultiAgent V2, Ultra is what makes subagents proactive (effective_multi_agent_mode). So Ultra on another vendor's model asks it its own top level, which is honest, and turns on V2's proactive subagents. codexcat.entriesAt now ends the levels of a model that lists some, from a vendor other than OpenAI, with "ultra" and says multi_agent_version v2 (ultraHere). Left alone: GPT, o-series and Codex models (their Ultra is provider.OffersUltra's), a model with no levels, Fast and Seals entries (V1 stays theirs), a vendor's own Codex entry (listedEntry). The default level is never Ultra. catalogFormat goes to v3, so Codex fetches the list again. Only Codex's catalog changes; other agents' level lists don't. docs/subsystems/agent-wiring.md has a row for it. Run: at origin/main |
||
|
|
c2fd48782b |
Put back what 1f05c311d took out of main by mistake
|
||
|
|
1f05c311d9 |
library: an open memory holds still while the Memory tab polls (Nietzsche_Li on X)
"资源库-记忆中,被展开的记忆的表单会定时抖动". While search by meaning
still has memories to read (read < of, which can last up to a minute
between memembed.Keep's reads) or a learn-from-conversations run goes,
the Memory tab reads its row again every 2s, and each read drew the
whole page anew. The open editor was a new .lib-detail each time and
played its content-in entrance (opacity .5, 2px slide) every 2s.
- semWatch/distWatch draw nothing when the read changed nothing, and
redraw only their own row (redrawRow) when it did; the whole tab only
when the memories changed.
- render() marks a .lib-detail open before it (same data-detail) as kept,
so it doesn't replay its entrance. This covers every render of an
open editor in the Library: memories, instruction sets and agents'
files (the siblings; no other Library tab polls into render()).
- A new memory's text no longer takes the focus back on every render.
Run (mote): library-memory-steady.test.cjs, all 5 languages, 980/420,
chromium + webkit: green 4 of 4 whole-file runs after the last change
(webkit alone 2 of 2 before it). Broken by hand: the same test against
origin/main's client.js and library.css: 22 of 22 red ("the editor
played its entrance again"). One webkit de 420 red was the test's own
first row click intercepted by the header at 420px while the page
settled; the test now opens rows with a DOM click.
Also run, both engines, every language, 980/420: library-memory, library-memory-select, library-memory-suggest, memory-icon, library-instr-busy, library-instr-sets, library-linked-set, library-follow-server: all green. No Go code changed, so no go test or vet.
Not tried: the real app on a real memory store mid-read.
|
||
|
|
6a506e2834 |
agent: pi-magpie's source pattern compiles on first use (TestNoEagerPackageRegexps)
|
||
|
|
861a0442c1 |
agent: Codex in a running WSL distro is connected once Codex on Windows is (@not_4O4 on X)
The Codex app's work mode on a project whose run environment is WSL starts
its app-server inside the distro, on the distro's ~/.codex (the app resolves
CODEX_HOME there with `bash -lc 'printf %s "${CODEX_HOME:-$HOME/.codex}"'`).
magpie wired Codex on Windows and, as a separate Agents row, the distro's
twin (codex@wsl:<distro>) only when the user connected that too, so the
picker listed OpenAI's models alone there.
ConnectCodexTwins, run at the start of each SyncCatalog, connects the twin
of each running distro once while Windows' Codex is connected. It leaves a
twin alone that is connected or disconnected already, whose config names a
provider or base URL of the user's own, or whose distro is stopped (asking
one starts it). A stash mark (<id>.autoconnected) keeps it to once, so a
later Disconnect stands. docs/subsystems/agent-wiring.md says so.
Run: TestConnectCodexTwins and TestConnectCodexTwinsKeepsOwnProvider; go
test ./internal/agent on mote (ok, 305s); TestWSL* and the new tests on the
Windows box (ok); gofmt; go vet darwin, linux and windows (nogui).
Broken by hand: Windows-connected check removed (red), own-provider check
removed (red). The Disconnected check is covered by the mark alone.
Not tried: the Codex app itself with a WSL project (read its bundle for the
CODEX_HOME resolution only); the reporter's distro and networking.
|
||
|
|
d52e2feaff |
pi: with the pi-magpie extension installed, magpie's models.json block goes (KenyonCode on X)
pi-magpie (npm, tinysnake) serves provider "magpie" from the live catalog and warns at every start while models.json still names providers.magpie (one baseUrl for every model, a frozen list). magpie wrote that block itself, so the user was told to delete it by hand. When Pi's settings.json "packages" lists pi-magpie, Pi's Sync and model pick now drop magpie's own block (only one pointing at this gateway with magpie's key; a block the user wrote stays) after keeping models.json.before-pi-magpie, through the atomic JSON delete, the rest of the file untouched. Check no longer calls the missing block a broken wiring. Without the extension nothing changes. Run: TestPiMagpieExtensionTakesOverTheBlock (sandbox HOME) and ./internal/agent on mote, vet darwin/linux nogui/windows. Broken by hand: viaExt forced false -> the test goes red with the block still there. Not tried: a real Pi with the extension installed. |
||
|
|
2abfe2b644 |
codex: the editor extension's bundled Codex version is read, so the threshold is written (HermanHongbb on X)
The background-compaction table is written only when every Codex that reads the config is known to be new enough. The openai.chatgpt extension's reader was always made with no version, so any machine with the extension installed counted as "unknown" and the table, with the threshold, was held out: Codex compacted at its own 65%. The extension ships bin/<target>/codex-package.json beside its codex (checked in the real Open VSX packages of chatgpt 26.51111.21308, Linux x64 and Windows x64: "version": "0.169.0-alpha.11.1"). It is read now, one reader per installed copy, in every dot folder's extensions (VS Code, VS Code Server, Cursor, Windsurf, VSCodium, ...); copies in .obsolete are skipped. A version that can't be read stays unknown, not old. Settings' existing note (codexAsyncHeld) names the editor extension and its version when it is what holds the threshold back. Run: TestExtensionCodexVersionRead (new; red with the version read turned off by hand: got map[:4]), go vet darwin/linux/windows, gofmt, and go test ./internal/agent on mote, ok. Not tried: a live VS Code with the extension; the full suite before the tag. The macOS extension layout is the same package (darwin vsix not unpacked). |
||
|
|
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
|