main
18
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
498d23b1d1 |
commandcode: providers.json entries carry a model's window and reply limit (#5567)
Command Code reads a model's context window and output limit from
providers.json alone: its parseModel2 takes raw.contextWindow (or
limit.context) and raw.maxOutput (or limit.output), its getContextLimit
falls through to its own 200K default when both miss, and its catalog
lookup keys on the bare vendor id, so "magpie/deepseek-v4.1-flash"
never matches the embedded "deepseek/deepseek-v4.1-flash" — and it
never interrogates the gateway's /v1/models. magpie's entry carried
only name, reasoning and reasoningEfforts, so a 1M-window model was
served to Command Code as a 200K one and compacted long before it had
to; the same model's dsh entry carried both numbers, per model.
ccProviderJSONAt now writes the pair the way piModelJSON does: the
window as m.Context when it is known, the reply limit as maxTokens(m)
when the model declares an output, under Command Code's own names,
contextWindow and maxOutput. A model with no output declared carries
no maxOutput.
Checked against Command Code's own bundle (command-code 1.74.1,
dist/cli.mjs): it reads contextWindow ?? limit.context and
maxOutput ?? limit.output for a providers.json model.
Run on mote at this tree: go test -tags nogui -run TestCommandCode
./internal/agent ok. TestCommandCodeModelLimits is red with main's
commandcode.go put back ("pro contextWindow <nil>, want 1048576"), and
red with the Output > 0 guard dropped ("flash carries maxOutput 0 with
no output declared"); green restored. gofmt -l clean.
Not tried: a real Command Code session against the gateway.
Reported-by: becausemadoka
Co-authored-by: ggbdpq <ggbdpq@gmail.com>
|
||
|
|
cdfdb62c69 |
agent: a model field's list is joined with the catalog once while neither changed
Each agent's model field returned append(its own models,
viaMagpieShared(...)...), a copy of the whole catalog's options for
each field of each agent on every poll: Picks was 94.7 MB of 496 MB
over forty polls of the Agents page with real accounts. withVia keeps
the joined list per agent and prefix while the own models read the same
(sameOption, field by field) and the catalog's list is the very one
kept (same array), and joins it again when either changed. The list is
read only and clipped, as viaMagpieShared's is; every caller of a
field's Options reads it, Picks clones it before it drops anything.
The 52 `return append(own, viaMagpieShared(...)...)` sites call it.
omp's and Reasonix's planner edit the joined list after the append, and
Grok's writes Same into its copy, so they keep their own copies.
TestWithViaKeepsTheJoinedList: the same own models give the same array,
own models changed in a value or only an icon are joined anew, a
provider saved since is listed, and nothing joined is the catalog's own
list. TestSameOptionReadsEveryField sets each field of Option alone and
fails when sameOption doesn't see it. Broken by hand: never answering
from the kept list ("the same own models joined the catalog again"),
and FastFor left out of sameOption ("sameOption doesn't read
Option.FastFor").
Run on mote: both tests alone 3 of 3; internal/agent, internal/tui and
internal/cli ok; internal/gui red only on TestSettingsSaveKeepsWhatItDoesNotSend
(#4514) and TestMainWindowCorners (#3949); gofmt, vet and GOOS=windows
and linux vet clean. Real accounts in a sandbox HOME, forty polls:
Picks 94.7 MB -> 51.2 MB, state 190.8 MB -> 154.0 MB, state and drift
replies byte for byte the same as before. Footprint peak 136 MB.
|
||
|
|
bb478f0e50 |
agent: a look that only ranges over magpie's models reads the list kept
magpieModels gives each caller its own copy of the list it keeps per
agent. Most callers only range over it, or count it, and a range copies
each model anyway, so the copy guarded nothing for them (the models'
own lists were shared before too: the copy was shallow). sharedModels
is the list kept, read only; every `range magpieModels(` and
`len(magpieModels(` in internal/agent (39 files) takes it. Callers that
keep the list, append to it or hand it on still get their copy.
Real accounts (sandbox copy of the owner's HOME, network blocked), 40
polls of /api/state, /api/providers and drift, pprof alloc_space
between two heap snapshots,
|
||
|
|
dd7442f283 |
agent: a look at the via-magpie options shares the kept list
viaMagpie handed every caller its own copy of the options list it keeps per stamp, and a window poll asks for it from most agents' fields and pickers. In a real-account sandbox (abr.sh, 20 polls of drift, state and providers on v0.1.2463) those copies were 33.7 MB of slices.Clone, plus ~8 MB more on the way, of the 713 MB the polls allocated. viaMagpieShared returns the kept list itself, clipped, so an append makes the caller's own array. The 58 callers that only read it, or append onto it, now take it; viaMagpie (a copy) stays for the ones that change it. TestKeptListSharedWithoutACopy checks that 20 shared looks return the kept array, and that an append onto a shared look and a write into get's copy leave the kept list as it was. Run on mote at this tree: - gofmt, go vet (darwin, GOOS=windows, GOOS=linux with gateway), go build ./...: ok. - Broken by hand (shared returns slices.Clone): the test is red, "a shared look copies the kept list". - go test -count=1 ./internal/agent: ok (480s). Not run: internal/gateway and internal/gui packages on this tree. |
||
|
|
73a12e8bf6 |
wsl: a distro's agent folder that is a link is opened where it leads (#4502)
On Windows, adding a skill or switching RTK on for an agent in WSL failed with `mkdir \\wsl.localhost\<distro>\root\.codex: Cannot create a file when that file already exists` (linusxiong). In the distro ~/.codex is a link to /mnt/c/Users/<user>/.codex. Through \\wsl.localhost Windows can't follow a link the distro has: a mkdir of it says it exists, and nothing below it can be made, written, read or listed. ggbdpq found and explained the link (thanks); their patch, which takes that EEXIST as "there", wasn't used: the writes below the link fail next (its test passed because a symlink here is followed). The fix, for every agent folder and every writer through \\wsl.localhost: - The WSL probe asks `readlink -f` in the distro where each agent folder, its skills folder and the folders beside them lead (wslLinkPaths -> distro.Links; a $HOME that is itself through a link is left alone), and which drive each Windows mount is (win:/mnt/c C: -> distro.Drives). - distro.open opens a path at or below a link where it leads: on a Windows drive, the drive's own path (C:\Users\<user>\.codex); elsewhere in the distro, through \\wsl.localhost again. native spells it back through the link, so the agent is told its own path. - A link readlink couldn't resolve is never guessed at: distro.open errors, and the agent is unreached (Agent.Unreached: its notice says why; every field Set and Sync returns it). - Writers: the agents' own files (place.join/place.open, every filepath.Join(at.home, ...) in internal/agent), the library's WSL targets (wslOpen/wslOpened; one "wsl" problem per agent and nothing written), RTK (rtkAt, rtkInstall checks agent.WSLOpen before its mkdir), the Sessions page's WSL reads (sessions.WSLHome.Open) and the Copilot CLI sign-in read (provider.CopilotWSLHomes -> CopilotWSLDirs). - Not changed: magpie's image MCP server opens arbitrary paths an agent in WSL gives it the same way; filed as #4578. Links deeper than the probed paths (other than <agent dir>/skills) aren't resolved. A distro probed by an older magpie has no Links until probed again (each run). Run: - Real Windows box (xiaomi-gpu, distro magpie-desktop, sandbox /tmp/x4502/home with .codex -> /mnt/c/Users/yeton/runs/x4502-target/.codex, .claude -> /tmp/x4502/data/claude, .pi -> a missing folder), a throwaway Windows test running the real probe with that HOME: probe said link:.codex /mnt/c/..., link:.claude /tmp/x4502/data/claude, link:.pi, win:/mnt/c C:, win:/mnt/d D:. The old way, MkdirAll(\\wsl.localhost\ magpie-desktop\tmp\x4502\home\.codex\skills\pdf) = "Cannot create a file when that file already exists" (the report's error). distro.open wrote SKILL.md to C:\Users\yeton\runs\x4502-target\.codex\skills\pdf and to \\wsl.localhost\magpie-desktop\tmp\x4502\data\claude\skills\pdf, both read back with cat in the distro through the links; .pi said "~/.pi in WSL magpie-desktop is a link magpie couldn't follow". Sandbox and target removed after. - New tests with a fake distro whose ~/.codex and ~/.claude are links to /mnt/c/... that don't exist here, so, as through \\wsl.localhost, nothing below them can be made: TestWSLFolderIsALinkToC, TestWSLFolderLinkUnresolved, TestRTKWSLFolderIsALink, TestRTKWSLFolderLinkUnresolved (library); TestWSLProbeLinks (runs the probe script), TestWSLOpenThroughLinks, TestWSLAgentFolderIsALink (config and a Claude session read on C:), TestWSLAgentFolderLinkUnresolved (agent). - Broken by hand: the library tests on the base (with a no-op FakeWSLDrives) fail with "mkdir .../home/me/.codex: file exists", the report's error; with ggbdpq's patch applied they still fail (the skill mkdir, and RTK's hook not written). - mote: go build ./...; go vet of agent, library, sessions, provider for darwin, GOOS=windows (and linux for agent, library); gofmt -l clean; go test -timeout 45m ./internal/agent ./internal/library ./internal/sessions ./internal/provider: all ok. - Windows (win-run): the same four packages. The new tests pass (the RTK ones skip: the fake distro runs sh). 32 tests are red, all already red at the base |
||
|
|
0911a65e7d |
agent: a catalog sync leaves a magpie provider the user wrote alone while the agent isn't connected
yyddbds on Discord: in Xiaomi MiMo they added a custom provider pointing
at magpie and picked a few models by hand. MiMo's switch on the Agents
page was off, yet after an update the provider held every one of
magpie's models. SyncCatalog runs at each start and update and on every
catalog change, and MiMo Code's Sync (openCodeLike) brought any
provider.magpie block up to the catalog whether magpie wrote it or not.
magpie's default went over a list the user set.
An Agent whose Sync does nothing but keep a block of magpie's name up
to the catalog is now ListOnly, and SyncCatalog runs it only while the
agent is Wired, which is what the Agents page's switch shows. The same
sync was in every sibling, so ListOnly is on all of them: openCodeLike
(OpenCode, MiMo Code and their WSL forms), piLikeKeyed (Pi and forks),
Goose, Crush, Air, AtomCode, Command Code, Droid, Fx, jcode, Kimi,
MiniMax, Mothx, omp, OpenChamber, OpenClaw, OpenPencil, Penguin, Qwen
Code and T3 Code. Left out on purpose: Codex, Claude, Grok and Hermes,
whose Syncs also repair while not connected (Hermes keeps its bots'
magpie provider current) and have their own gates.
Trade-off: a list magpie wrote while connected doesn't follow the
catalog while the agent runs a model of its own (switch off); it does
again once a model of magpie's is picked. Users whose list was already
written over: magpie keeps no copy of the old list, so it stays full;
from this release on it is left alone, and they trim it once by hand
(or connect the agent in magpie and use its model list's Pick).
Tests: TestCatalogSyncLeavesAHandWrittenMagpieBlock (MiMo, Pi and Crush
with a hand-written magpie block stay byte for byte; connected, MiMo's
list follows the catalog; disconnected and written by hand again, left
alone; a magpie model picked in MiMo, followed again).
TestListOnlyAgentsReadConnected: every ListOnly agent magpie connects
reads as Wired (n >= 15), so none of them loses catalog updates.
Fixtures of TestSyncCatalogRewritesAgentLists,
TestModelNameAndLevelsReachAgentFiles, TestSuffixModesReachAgentFiles
and TestPiKeepsTheirKeysInMagpiesProvider, and internal/cli's
TestSaveAnswersBeforeTheAgentsSync (its Pi settings were {}), now have
Pi connected (settings.json defaultProvider magpie), as a block magpie
wrote implies.
docs/subsystems/agent-wiring.md says the rule.
Run (mote, sandbox HOME via the tests' syncHome/codexHome):
- old code + the new test: red (MiMo, Pi, Crush written over; after
Disconnect written over).
- broken by hand: ListOnly dropped from openCodeLike: red on MiMo
(lines 52, 82); the Wired gate in SyncCatalog replaced with true: red
on all three.
- go test -tags nogui -count=1 ./internal/agent: ok.
- gofmt -l clean; go vet ./... for darwin, GOOS=linux and GOOS=windows:
ok.
- full suite, go test -tags nogui -count=1 -timeout 45m ./... at base
|
||
|
|
9f8fe81aa2 |
models: a model that thinks with no levels magpie knows is marked reasoning for Pi and Command Code, as /v1/models says it (#2380)
Trae CN's kimi-k3 / kimi-k3-max / kimi-k3-auto think, and /v1/models said reasoning: true, but Pi's models.json was written reasoning: false: piModelJSON read the levels alone. Pi then offered off alone and `magpie pi effort high` was clamped to off. provider.Entry.Thinks() (Reasoning or levels) is now the one judgement: /v1/models' modelObject and magpieModels, which every agent export reads, both take it. Pi writes reasoning from it, with no thinkingLevelMap when the levels aren't known, so Pi offers its own off to high (getSupportedThinkingLevels, read in Pi's bundle) and the gateway fits them (fitFor caps a switch-only model at high, #214). Command Code is told reasoning alone for such a model, which its BYOK reference takes for low/medium/high. OpenCode, Alma and Zed already judged it so. Left as they are: omp (pi-catalog's getSupportedEfforts gives a reasoning model without thinking.efforts no levels, so the flag alone buys nothing), jcode (how it reads reasoning with no effort not verified), Crush (can_reason without levels sends no effort on its openai type), cline/workbuddy/zcode (they write level lists only). TestOpenCodeNoResellerLevelsForSwitchModel pinned Xiaomi's mimo-v2.6-flash (a thinking switch alone) as reasoning: false in Pi; it is now reasoning: true with no map, so Pi still offers no xhigh or max. Run (worktree, sandbox HOME, -tags nogui -p 1): - new TestThinkingWithoutLevelsReachesTheExports (trae-cn/kimi-k3-max): green; red with Pi's old line ("Pi offers [off]") and red with Command Code's case removed - internal/agent -run 'Pi|CommandCode|CC|Cc|Thinking|Reason|OpenCode| Alma|Zed|Omp|JCode|Jcode|Crush|Route|MagpieModels': ok (382s) - internal/gateway -run 'Model|Reason|Thinks': ok - internal/provider -run 'Entry|Reason|Thinks|Catalog': ok - gofmt -l clean; go vet -tags nogui darwin/linux/windows on agent, provider, gateway: clean Not tried: a real Pi against a real Trae CN account; whether Xiaomi takes Pi's "minimal" for mimo-v2.6-flash (the gateway passes a level it has no list for as asked). Full suite: SUITE_LINE |
||
|
|
20582866a5 |
agent, gui: an agent's advice after a change reads in the window's language (#1508, NovaTrailX)
A Chinese window said "ZCode 已接入 magpie. ZCode reads its providers at
start-up — restart ZCode …": the notice an agent gives after a change
(state.notice) was English text written in place in each agent's file, and
i18n.js had no entry for any of them.
What changed:
- internal/agent/notice.go: a notice is a template registered with
newNotice ("Restart {agent} to …"), filled with say(kv...); Notices()
lists every one. All the agents' notices (claude, codex daemon, zcode,
agy, cursor-local, wsl, AstrBot's added today, …) are now such templates, the issue's list
being a sample of them.
- i18n.js: every template has a zh, zh-TW, ja and de translation, and
NOTICES lists them. tNotice() reads a notice of several joined: longest
template first, a {slot} never runs over a sentence's end, and a notice
with any part that has no template (a plugin's own) reads as given
rather than half in each language. withNotice() joins the status line
and the notice with 。 in zh/ja.
- app.js: the six places that showed state.notice use withNotice.
Tests:
- TestEveryNoticeIsTranslated: every Notices() template is in NOTICES and
in each language table, with the same slots. Fails with the zh ZCode
line deleted from i18n.js (tried).
- TestNoticesAreTemplates: an AST scan for English written in place as a
Notice. Fails with zcode.go's literal put back (tried).
- tests/agent-notice-lang.test.cjs: every template, filled, alone and
joined, plus a plugin's notice, and connecting ZCode as the reporter
did; en, zh, zh-TW, ja, de at 1100 and 420px, Chromium and WebKit:
22/22. Its zh subtests fail without the zh line.
Run: go test -tags nogui ./internal/agent ./internal/gui; gofmt -l;
GOOS=linux and GOOS=windows go vet -tags nogui ./internal/agent
./internal/gui; the full GUI suite (node --test, both engines, -concurrency 6,
machine load ~140): 5130/5195, 64 failing in 22 files. Rerun alone, 16
files pass; mobile-web, old-webkit, panel-usage and routing-context/
group/keys-fold fail the same on the base commit,
|
||
|
|
a8290d2772 |
agent: a catalog sync or a model pick keeps the keys a user or another tool added to magpie's provider block (Pi's providers.magpie.compat.sendSessionAffinityHeaders from pi-cache-optimizer) instead of writing the block whole (#1103)
syncJSON and Pi's writeMagpie set providers.magpie to a freshly built
object, so a key magpie doesn't write there was dropped on every sync.
theirsKept now merges magpie's block into what the file holds: keys magpie
writes are its own, objects in both are merged key by key, and anything
else (compat, an options key, Crush's extra_headers) stays. The model list
is still magpie's whole, so a model gone from the catalog leaves it, and a
sync with nothing new writes nothing.
The same goes for every agent that writes the block whole: Pi and OmO,
Aside, Pencil, OpenCode (and the agents built on it), OpenChamber, Crush
and Command Code.
Verified: TestPiKeepsTheirKeysInMagpiesProvider (the reporter's
compat.sendSessionAffinityHeaders: true in Pi's models.json, through
SyncCatalog and a pick) and TestOpenCodeAndCrushKeepTheirKeysInMagpiesProvider
fail without the change ("compat.sendSessionAffinityHeaders dropped by the
sync", "opencode sync") and pass with it. go test -race ./internal/agent
and go vet ./... pass in a sandbox HOME.
|
||
|
|
17f790b145 |
agent: five package-level twins nothing calls are gone — isCodexGateway, ccProviderJSON, fxProvider, hermesProvider and writeMiniMaxEntry
Each was a one-line wrapper of its *At function for the local gateway. The callers moved to closures of the same name over the agent's own address (at.v1(), at.gw()), which shadow the package function, so the wrappers were reached by nothing, tests included (deadcode -test). Their doc comments now sit on the *At functions, and isCodexGatewayOn has its own again: it had been left above codexKeptGateway. go vet (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui ./internal/agent under a temp HOME pass. |
||
|
|
165fee0df5 | agent: an agent's own provider named as one of magpie's isn't magpie's, in every agent that spells a model provider/model (the rest of #835) — OpenHanako's own deepseek/deepseek-v4-pro read as magpie's deepseek, and so did a model of any agent's own provider whose name magpie has a provider by: Pi's, Crush's, Hermes's, OpenCode's relay/glm-4.6 with magpie's relay had the row connected on the agent's own model, and Disconnect from magpie put that model back and left the row connected. An agent says how magpie's values are spelled in it (Spelled, replacing #835's Prefixed): magpie/<ref> for Antigravity CLI, Pi, OmO, Aside, Goose, Zed, VS Code, Crush, DeepSeek Harness, Command Code, fx, omp, Hermes, Mister Morph, Kimi Code, Empryo, MiniMax Code, Droid, Qoder, Qoder CN, Grok Build, AtomCode, Cline and OpenHanako, whose every Get spells magpie's so (a sandbox Set of magpie/relay/glm-4.6 read back as that in each); for OpenCode, MiMo Code and OpenChamber also a provider of the config's own that sends to magpie's gateway, as openCodeRef names a model there. A stopped WSL distro's agent keeps its live one's. Left as they are: Claude Code, Claude Desktop, Codex, Gemini CLI, Cursor, Copilot, Devin (magpie's are bare refs there), Muse Code (a model with / is magpie's by design: Meta's have none), Alma (its own are providerId:model), Air (magpie's only). TestOwnProviderNamedAsMagpies (26 agents: own relay/glm-4.6 not connected, Connect, Disconnect puts it back and the row is off) fails on the old code in each; TestOpenCodeGatewayProviderIsMagpies. go vet, builds (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass. | ||
|
|
dd70a4055a | wsl: OpenCode, Kimi Code, omp and the other CLIs magpie sets up through a file in the home are set up in WSL distros too (#515: on Windows only Codex, Pi, OmO and Claude Code were found in a distro) — fourteen agents join wslKinds, each found by its folder under the distro's $HOME or its command on the distro's own PATH, and listed as <name> · WSL <distro> (opencode@wsl:Ubuntu…): OpenCode (~/.config/opencode, opencode), MiMo Code (~/.config/mimocode, mimo), Kimi Code (~/.kimi-code, kimi; the old kimi-cli's ~/.kimi where that is all there is, found by the command), omp (~/.omp/agent, omp), Crush (~/.config/crush/crush.json, Linux's place, not Windows' LOCALAPPDATA), Hermes Agent (~/.hermes), Grok Build (~/.grok, by its folder alone, as on this machine), Droid (~/.factory), fx (~/.fx, by its folder alone: fx is also the JSON viewer), Command Code (~/.commandcode), MiniMax Code's mcode (~/.minimax), Muse Code (~/.config/muse), Qoder and Qoder CN (~/.qoder, ~/.qoder-cn). Each is its host constructor at a place (opencodeIn, kimiIn, ompIn, crushIn, hermesIn, grokIn, droidIn, fxIn, commandCodeIn, miniMaxIn, museIn, qoderIn/qoderCNIn; the host's opencode(home, cfg) and the rest wrap them), so it writes the same keys and schema as on this machine, but the gateway as the distro reaches it (place.gw/v1: 127.0.0.1 when mirrored, Windows' address under NAT) in its provider, its Check and its Sync, and its folder at the default, as the distro's variables (OPENCODE_CONFIG_DIR, KIMI_CODE_HOME, HERMES_HOME, FACTORY_HOME_OVERRIDE, MINIMAX_DATA_DIR, QODER_CONFIG_DIR…) aren't read (place.getenv is "" there); OpenChamber, a Windows app, isn't looked at for a distro's OpenCode, and omp there, whose version isn't known, gets xhigh rather than a max an older omp refuses. Their notices are the restart advice of their own, as for Codex. A stopped distro's agent is built without looking at its files (place.cold: exists/isDir are false, so the defaults are taken), its options read none (wslOwnAsleep, kimiOwnOptions/ompOwnOptions/miniMaxOwnOptions without a file), and a pick, once the distro is started, builds the agent again warm, so it writes the file the agent reads — an opencode.jsonc already there, ~/.kimi for kimi-cli — not the default. Left out: Gemini CLI and Antigravity (a key lent through .env, a launch command), dsh (profiles and .env), Devin (no gateway; its model list from the devin command on this machine), Goose (no magpie routing; its name is pressly's goose too), Cursor and Copilot (no magpie routing), and the apps (Cline, Hanako, WorkBuddy, ZCode, Claude Desktop, OpenChamber, Alma, Cindy); and the library's skills, MCP and instructions for the new WSL agents, which wslTargetOf still gives only Claude Code, Codex, Pi and OmO. Nothing ran on Windows or in a real WSL. wsl_more_test.go, on fake distro roots under temp dirs with the host's variables pointed elsewhere: TestWSLProbeFindsMoreAgents (each folder and command in the probe, none for grok and fx, kimi-cli by its command), TestWSLMoreAgentsDiscovered (all fourteen listed, no command, UA or aliases), TestWSLMoreAgentsPick (each agent, mirrored and NAT: its file in the distro names the distro's gateway, no 127.0.0.1 under NAT, Check passes, Sync keeps it, the notice; this machine's home and the folders its variables name untouched), TestWSLMoreAgentsStopped (nothing asked nor opened, the last value shown, options, a pick starts the distro and writes there) fail without the change; TestWSLStoppedPickFindsItsFiles fails without the warm rebuild (the pick wrote a second opencode.json beside the .jsonc). go vet ./internal/..., go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build and vet ./internal/..., GOOS=windows go test -c ./internal/agent/ ./internal/library/, and go test -tags nogui -count=1 ./... under a temp HOME pass (TestFXInState failed once on its TempDir cleanup race, passes on the rerun; untouched). | ||
|
|
6694108bf2 | agent: an agent whose own config keeps the reasoning effort its sessions start with gets an effort field, as Codex, Grok and Pi have — Claude Code's effortLevel (low to xhigh; max lasts a session only), Hermes's agent.reasoning_effort, omp's defaultThinkingLevel, Goose's GOOSE_THINKING_EFFORT, Copilot's effortLevel (the model's levels when its list says), Crush's large model reasoning_effort, Command Code's reasoningEffort for the current model (it keeps one per model) and dsh's llm-deepseek reasoningEffort (off, high or max, kept when the model changes or the catalog syncs); OpenCode, Gemini CLI, Cursor, ZCode, Devin and Alma keep none of their own in a file, so they get none. Asked on Discord | ||
|
|
73be42eca8 | models: each agent can be shown only some of them — a provider or group gets a family (magpie provider set relay-x family=relay), and magpie visible zcode relay shows zcode only that family's models (or named providers and groups): in the files magpie writes for it and in what /v1/models answers it, told apart by its User-Agent; magpie models zcode lists what it is shown and what is kept from it, and magpie visible zcode all shows it everything again. A model kept from an agent is still served when asked for by name. Asked for on Discord | ||
|
|
1b5d1f87db | agent: every agent on a magpie model says when it was taken off magpie behind its back, not only Codex — each checks what magpie wired into it to reach the gateway (Claude Code's env base URL and token, and a managed-settings base URL that wins over them; Gemini CLI's .env and its auth type; OpenCode, Pi, Crush, Command Code, Hermes, omp and Grok Build's magpie provider; DeepSeek Harness's llm-deepseek entry and its key in .env), and one pointed elsewhere or gone shows Apply again with what is off in its tooltip; Claude Code, like Codex, is also said to be bypassed when it was used and nothing of it reached the gateway (its history.jsonl), and slash commands no longer count as use. A test takes every such agent off the gateway and back | ||
|
|
09c635cf03 | agents: a model through magpie tells Pi, Crush, omp and Codex how much it holds, and a provider added, edited or removed reaches the model lists agents keep in files of their own — the catalog carried no context window, so Pi took every model through magpie for a 128K one (a CLIProxyAPI's gpt-5.5 holds 922K) and Crush for a 200K one; each model now carries models.dev's input limit, else its context, looked up by bare id as most of the providers serving it give it (a proxy's "openai/gpt-5.4", "gpt-5.4(high)", "glm-4.6:free" find it too; a group holds the least of its members'). And those lists were written only when a model was picked: Codex's magpie-models.json, Pi's models.json, OpenCode's, Crush's, Command Code's, omp's and Hermes' provider blocks and dsh's llm-deepseek entry kept the catalog as it was then, so a provider added later never showed. Saving a provider, a vendor's list fetched anew or models.dev synced now rewrites each one magpie wrote, where it differs, and the app does once at start-up; a Codex signed in to ChatGPT, which asks the gateway, kept its cached list under the backend's ETag, which a change of magpie's never changed — the ETag (and a reply's X-Models-Etag) now carries a tag of magpie's models, and a cache from before a change is aged so the next Codex asks again | ||
|
|
a9e1a6769a | agent + usage: each agent says what its User-Agent begins with, beside its name and icon, and the gateway tells requests apart by that — usage kept a list of its own, which had to be kept in step with the agents by hand and wasn't (DeepSeek Harness, omp and Command Code were missing from it, so they were drawn with no logo); a new agent is now known by its requests as soon as it is described | ||
|
|
be1b3967f4 | agent: Command Code — its model picked in magpie like any agent's; a model through magpie adds magpie as a keyless provider in ~/.commandcode/providers.json with the catalog as its models, and sets settings.json's model to magpie/<provider>/<model>; its own models stay as they are, and default takes magpie's entry out; Command Code still wants its own sign-in (#32) |