ac4af582301a4e8a29245dbba767eba31334ddf9
37
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
32fc5809e1 |
agents: OpenMausBot gets magpie as an engine of its own, written as its own Claude endpoints are (a user on X)
A user on X asked for OpenMausBot (github.com/milind-soni/OpenMausBot,
read at 516ca75; released 0.1.145). Its bots run on engines from
`instances` in ~/.openmausbot/config.json ($OMB_DATA_DIR,
server/config.ts:713). Without this, a Claude bot reached magpie only
through ~/.claude/settings.json, and its picker listed Claude's static
models alone: OpenMausBot doesn't read the model from env
(readClaudeModelCatalog, claude.ts:296-316).
- openmausbot.go writes `instances.magpie` in the shape of OpenMausBot's
own "Claude endpoint" (newClaudeEndpoint, claude-endpoints.ts:91-139):
- driver claudeAgent, access custom
- config.configDir is <data>/providers/magpie. Given that,
OpenMausBot starts Claude Code with that CLAUDE_CONFIG_DIR and
strips account keys the engine doesn't set (claudeEnvironment,
claude.ts:111-136, 158-179), so the engine owns its routing.
- requireApiKey
- ANTHROPIC_BASE_URL, AUTH_TOKEN, API_KEY and MODEL point at the
gateway
- endpointModels holds magpie's models, kept to the ids
CLAUDE_MODEL_ID accepts. One bad id makes OpenMausBot refuse the
whole engine (claude.ts:636).
- A non-empty `instances` is the whole fleet (config.ts:1173). With
none saved, magpie writes DEFAULT_FLEET (instance-fleets.ts) beside
magpie, stashed as openmausbot.fleet. Off takes the fleet out again
if the user hasn't changed it.
- What stays the user's: the engine's name, a model they picked from
the list, their other env and an inherited `cli`.
- Check reports the base URL drifting away from the gateway.
- OpenMausBot reads config.json once at start (index.ts:780), and an
engine edited in it writes back the fleet it holds
(routes/instances.ts:132, config.ts:997-1012). So Set is refused
while it runs (errOMBRunning), and the notice asks to quit it first,
since Windows can't tell.
- ListOnly, ListsModels, OMB_DATA_DIR in agentenv. The icon is
OpenMausBot's build/icon.svg (Apache-2.0).
- i18n in zh, zh-TW, ja and de. Docs: reference, agent-wiring, both
READMEs.
- Codex bots use ~/.codex (codex.ts:373-386), which the Codex wiring
already covers.
- The agent package's TestMain holds ombRunning false. An OpenMausBot
open on the test machine refused every test that turns magpie on for
each agent: my own sandbox OpenMausBot on mote turned
TestSyncKeepsAnAddressOnAnotherMachine, TestListOnlyAgentsReadConnected
and TestReverseProxyIsStillMagpie red. With a process named
openmausbot running, they now pass. LiveAgent's, OpenPencil's and
NewMax's running checks have the same hole and are left to #5587.
Run (all on mote):
- gofmt -l: clean
- go vet ./... on darwin, GOOS=linux -tags nogui and GOOS=windows: ok
- go build for the same three targets: ok
- go test -tags nogui ./... -timeout 45m at e1453a168 (this change on
origin/main
|
||
|
|
49f207c784 |
agents: DS Bot, wired in the DSH home it runs on
DS Bot (github.com/Fei2411/DS-Bot, Apache-2.0, dsbot.app) is a DSH plugin and an Electron app built on it. The app ships its own DSH (0.2.2-rc.1 in 0.3.0) and runs it with DSH_HOME at a data folder of its own, booting the profile ds-bot, and never reads ~/.dsh: magpie's dsh row didn't reach it. It is a row of its own now, ds-bot (dsbot.go), wired by dsh's code on its folder (dshOn, split out of dshAt): magpie's routes and start in profiles/ds-bot/cordis.patch.yml, the key in that folder's .env and .credentials.yaml. The folder is $DS_BOT_HOME, else locations.json's dataDir in the app's userData ($DS_BOT_SHELL_DATA, else <config>/DS Bot, or the legacy DeepSeek Bot), else ~/.ds-bot, as the app's first-run.mjs and legacy.mjs choose it. A locations.json that can't be read or names no folder is unknown: nothing is read or written. The routes there list the models shown for DS Bot on the Agents page (dshListFor), and the serving round fills a profile the app makes there as it does ~/.dsh's (dshHomesRounds). Found by DS Bot.app (io.github.fei2411.dsbot) or its Windows per-user install (guid from its electron-builder.yml). Three notices, translated into zh, zh-TW, ja and de. DS_BOT_HOME and DS_BOT_SHELL_DATA are in agentenv's sandbox list. Run: - go test ./internal/agent/ ./internal/agentenv/ ./internal/gui/ ./internal/cli/ ./internal/appdir/ on mote: ok but internal/gui TestMainWindowCorners/macOS_26_SDK, red on mote's macOS 27 whatever the change (#3949). - go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./... on mote: ok. gofmt -l: clean. - node --test i18n-keys, i18n-en-no-cjk, agent-notice-lang (chromium), and agent-notice-lang in webkit: all pass but i18n-keys "a plugin's words are its own", red on main for three plugin words (#5332, #5426, #5482). - Real DS Bot 0.3.0 (DS-Bot-0.3.0-mac-arm64.zip) on mote, all in a sandbox HOME with DS_BOT_HOME, DS_BOT_SHELL_DATA and DS_BOT_WORKSPACE under it: a magpie built from this tree (nogui), MAGPIE_ADDR 127.0.0.1:3572, a fake OpenAI upstream on 3571 added as a provider. `magpie ds-bot magpie/fake/m1` before the app was ever opened wrote the profile; the app's first start kept it (agent-default-model still magpie's) and added its own files beside it. Its Chief Bot offered "Magpie: m1 · fake, m2 · fake"; picking m1 and sending "ping" over CDP went through magpie to the fake (POST /v1/chat/completions model m1, stream) and "pong from fake" showed. `magpie ds-bot default` then took every magpie entry out and the .env with it. Only my own pids (app, serve, fake) were stopped. Broken by hand, each red, then put back: - dsbot's desktopApps entry out: TestDsBotWired (not detected). - dshListFor always "dsh": TestDsBotOwnModels. - dshHomesRounds without DS Bot's home: TestDsBotProfileMadeWhileServing. - a bad locations.json taken for ~/.ds-bot: TestDsBotDataFolder. On the old code the tests don't build (no ds-bot row at all). Not tried: the Windows app (install path and registry guid read from its electron-builder.yml, not from an installed copy); Linux (its AppImage and deb aren't looked for; the data folder its first start makes finds it); a real vendor behind magpie; a default Bot model set in DS Bot (the notice says it wins, per its models.js). Not done: usage gives DS Bot no User-Agent of its own (its DSH's requests likely count as dsh's), and the Sessions page doesn't read its data folder's sessions. Reported-by: rnhung |
||
|
|
34116ec012 |
gateway: Codex signed in to one account lists another account's models
bigfisheatsmall on X: Codex was kept signed in to ChatGPT account A, on the Free plan. Account B (Team) was the only account on in magpie. dsh listed B's models and Codex didn't. codexMerged added CodexListed(), which leaves out every ChatGPT account's own models because it assumes the backend lists them. But the backend list is fetched with Codex's own sign-in (A, Free), so B's plan-only models were listed nowhere. Routing already sent codex/<model> to B (codexAccounts). - provider.CodexListedBeside(backend) lists an account's own model by magpie's id (codex/<slug>) when the sign-in's backend list lacks it. codexMerged uses it, and FitOwn keeps those entries. - spawnChoices (spawn_agent's models) had the same gap. It now uses the same rule with the slugs in Codex's models cache. - buildCodexListTag covers the accounts' own models, so another account gaining or losing one has Codex ask for the list again. Every Codex asks once after the update. - TestSyncCatalogAgesCodexCache built its "current" tag by hand from CodexListed(). It now uses provider.CodexListTag(), the tag SyncCatalog compares against. Tests (sandbox HOME, fake backend with per-plan lists): TestCodexListHasAnotherAccountsModels covers the list, routing of codex/gpt-6.1-sol to the Pro account, and spawn_agent's choices. TestCodexListOneAccountNoneTwice checks that a single account gets no codex/ duplicates. Run on mote at this tree: go vet (darwin, windows, linux) on gateway, provider and agent: ok. go test -count=1 on provider, agent and codexcat: ok. go test -run 'Codex|Spawn' on gateway and gui: ok. Run at the tree before the sync_test change and the buildCodexListTag tidy: the full gateway package was ok (1224s). Agent was red only in TestSyncCatalogAgesCodexCache, fixed above. Broken by hand: on the old codexMerged, the new test fails with "Codex's list lacks codex/gpt-6.1-sol: [gpt-6-luna gpt-5.6-terra gpt-5.6-luna]". With only codex_spawn_models.go reverted, it fails with "spawn_agent's models lack codex/gpt-6.1-sol". Not tried: real accounts or a real Codex. Not a full go test ./... run. Not tried: models the backend marks hidden. A Codex here for failover alone (codexOwnOnly) is unchanged. |
||
|
|
d3de7e8f3e |
agent: a provider of the user's own at magpie's gateway, under OpenCode 2's providers, stays theirs (#3915)
Found while fixing #3883. OpenCode 2 keeps a provider under providers, its base URL in settings.baseURL, and reads it there before the same name under provider, OpenCode 1's spelling: the one under providers is taken whole, and the other is only a WARN, "retained native value over legacy value" (packages/core/src/config/normalize.ts, mergeMaps, at v2.1.4). OpenChamber's provider form saves a provider there and takes it out of provider (packages/web/server/lib/opencode/config-v2.js, writeSectionEntry). magpie read the user's own providers under provider only, in the two places that look for them: - ownGatewayProvider: a provider of the user's own at magpie's gateway that lists the model, as a layout of one provider per family of magpie's models has, gets a pick of that model of magpie's as <theirs>/<model>, with no provider.magpie beside it. One under providers wasn't seen, so the pick went to magpie/<model> and magpie's provider was added beside the user's. - openCodeSpelled: a model on a provider named as one of magpie's and at the gateway (relay/glm-4.6 on the user's own relay) counts as magpie's. Under providers it didn't, so Agent.Models left it out. On origin/main |
||
|
|
cdd470ce9f |
agent: opencode.json lists magpie's models in the order the user set
The models of magpie's provider in opencode.json were a
map[string]any, whose keys encoding/json marshals sorted: the order the
user dragged to on the Agents page reached magpieModels and died at the
last step, the file listing the models A to Z (#4575). A pure
re-ordering wasn't even written — syncJSONInOrder's sameOrder compared
two alphabetical lists and found them alike. The variants under each
model kept their order since #713 (orderedJSON); the models keep theirs
the same way now, and openCodeKept looks a model up in the ordered
block to put a variant of the user's on it.
Every config in OpenCode's shape moves with the one fix: OpenCode,
OpenChamber, Air, MiMo Code and DevEco Code (openCodeLike and the
openCodeKept calls in air.go and openchamber.go). Pi, Crush and Codex
list models in arrays and were never touched.
Run: TestOpenCodeModelsInOrder in internal/agent (written first) fails
on the unmodified code — the fresh block lands alphabetical and a
dragged order is never written — and passes with the fix. The
models-as-map assertions in TestInferredGroupImagesReachAgentCatalogs,
TestMiMoCodeCatalogNarrowedSeparately and
TestGroupModelsCarryTheirFirstMembersPrice read the ordered block now.
go test -tags nogui -count=1 ./internal/agent ok (150s) but for
TestMothX, which fails the same on unmodified main
|
||
|
|
70a0c387cb |
agent: a provider named magpie written by hand is the user's, not connected (JFunfunfun on X)
Pi set up by hand on a provider of its own named magpie (magpie/<model> at the gateway) read as connected in magpie: every catalog change wrote magpie's list over that provider, RenameProvider rewrote its refs, Drift offered Reconnect, and Disconnect took the provider out. |
||
|
|
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
|
||
|
|
3fd7e16983 |
agent: PenguinHarness is installed from the Agents page and served by magpie with nothing to set up
rankyurky asked on Discord #feedback for PenguinHarness (npm @prismshadow/penguin-cli, command penguin). Every value comes from Penguin's own source (0.2.17): - Config: $PENGUIN_HOME (else ~/.penguin/data, every OS) / $PENGUIN_PROJECT_ID (else default_project) /.project_config.toml. magpie writes [providers.magpie] (base_url, client_type, api_key), one [[models]] entry per magpie model (context_window, vision, max_tokens, [models.pricing] in usd_per_mtok) and default_model in Penguin's own inline spelling. Penguin's server reads the file again when its mtime changes, so no restart; a default naming no entry is refused by Penguin, so Check fails when one is missing. - A file magpie creates is 0600 in a 0700 folder, as Penguin keeps it. Disconnect restores the user's own default_model (or none), drops a magpie vision model, and removes the file when magpie made it. Penguin's own entries, providers and command_policy rules are kept. - A sync that changes nothing writes nothing (bytes and mtime kept), so Penguin's watcher isn't woken. - Install: curl -fsSL https://penguin.ooo/install.sh | sh, or irm https://penguin.ooo/install.ps1 | iex on Windows; update: npm, or penguin update --yes for the tarball, except on Windows where update.ts refuses it. - WSL: a penguin kind with no restart notice; the WSL test now expects an empty Notice for a kind with no restart. - agentenv: PENGUIN_HOME, PENGUIN_PROJECT_ID; the project id is in NotPaths, or appdir dropped a value like "work" as a relative path. - edit.SetTOMLArrayTables: replaces every [[name]] entry with key = value (with child tables) by blocks, or removes them; blank lines between replaced entries go with them, and an unchanged result isn't written. - GUI: penguin-color.svg icon; README (en, zh-CN), docs/reference.md and docs/subsystems/agent-wiring.md. Run (worktree at |
||
|
|
ca4a1cde0d |
dsh: maxTokens leaves dsh half its window, or a quarter for output where that is more (#3298 item 3)
|
||
|
|
822f2b3042 |
agent: dsh lists a vendor's reply limit at most a quarter of the window, so it has room to compact (#2823, LoKi on Discord)
dsh takes a model entry's maxTokens as the output of every request. Before deciding when to compact, it reserves that output plus 65536 of headroom out of contextWindow (dsh-compaction-basic resolveCompactSpec). When a vendor's reply limit is close to its window, dsh compacts at a sliver of the window, or can't compact at all. magpie now lists a vendor's figure held to a quarter of the window (dshMaxTokens). It does this on every pi-ai route and in the legacy llm-deepseek entry, the same rule VS Code and Copilot in JetBrains already use. A Max output the user set stays as they set it (outputOr). LoKi's patch capped only an output >= the window. That misses #2823's own case (a group at 500000 / 393216) and outputs above window - 65536, such as 131072 / 65536. The quarter rule covers all of them, and a cap can only lower the reservation. Run: real dsh 0.2.0-rc.2 headless, sandbox HOME/DSH_HOME, a fake OpenAI SSE server with a tool-call step so pre-step compaction runs, and an observe-only loader hook on resolveCompactSpec. origin/main |
||
|
|
5c0049a38c |
agent: MothX is an Agents-page row, wired into ~/.mothx/settings.json, and Disconnect puts it back (#2353, zhenruyan)
MothX (oschina/mothx, formerly vibecoding; npm mothx-installer) reads its providers and start-up model from one settings.json: $MOTHX_DIR, else %APPDATA%\mothx on Windows, else ~/.mothx. This follows zhenruyan's fork (#2353) and the jcode/Prime Agent pattern. What changed - internal/agent/mothx.go: the agent. Connect writes provider "magpie" (openai-chat at the gateway's /v1, key magpie-mothx, one entry per magpie model with reasoning, input, contextWindow, maxTokens, cost) beside the user's own providers, and sets defaultProvider/defaultModel; "thinking" is defaultThinkingLevel, narrowed to the levels magpie knows for the model (none → off). thinkingFormat "openai" makes MothX send reasoning_effort for every model; without it MothX guesses Qwen's enable_thinking/thinking_budget or DeepSeek's thinking from the model id. A thinkingFormat or headers the user put in magpie's block are kept. Model options: the user's own providers' models, the current built-in pick (deepseek-openai/…), then magpie's. - Disconnect: settings.json is copied aside before magpie's first write (beforeMagpie) and put back byte for byte when nothing else changed; a file that wasn't there goes again. When MothX rewrote it meanwhile (/model, /statusline … global: SaveGlobalSettings marshals the whole struct), only magpie's provider, the pick and a providers object left empty go; the user's changes stay. - Detection, the restart notice (mothx or vibecoding running; translated in zh-CN, zh-TW, ja, de), WSL distros (~/.mothx), MOTHX_DIR in agentenv and the WSL dir moves, CLI updates through npm mothx-installer. - usage names its requests: the User-Agent is "Vibecoding Client/<ver>", matched by the alias vibecoding (usage.AgentOf takes the first word). - GUI: the icon (upstream docs/assets/mothx-small.png, MIT). - Docs: README en/zh lists, docs/reference.md (table row, provider-scoped list, notes), docs/subsystems/agent-wiring.md. - Not in this commit: MothX as a Library skills target (its own goal). Run - go test -p 1 -tags nogui: TestMothX* (real first-run settings.json as the fixture; user keys, headers and thinkingFormat kept; no-op Sync and same-value Set leave bytes and mtime alone; Disconnect byte-identical; no-file round trip x2; changes while connected kept; MOTHX_DIR/Windows/ WSL dirs; thinking levels), TestAgentOf, TestEveryNoticeIsTranslated, TestEveryAgentNamedByItsKey, TestWSLMore*; then ./internal/agent (1120s at load ~100; an earlier run hit the default 10m timeout inside TestReasonixConcurrentEditsAndSync at load ~50, not a failure), ./internal/agentenv, ./internal/usage: ok. - Broken by hand, each red then restored: no take() (TestMothX and RoundTripNoFile red), user thinkingFormat not kept, thinkingFormat "openai" dropped, the vibecoding alias dropped (TestAgentOf: got "Vibecoding"), the empty-providers cleanup (KeepsWhatChanged red). - gofmt -l clean; GOOS=darwin/linux/windows go vet -tags nogui ./... clean. - GUI (playwright 1.62.0, chromium and webkit): agent-notice-lang, models-add-and-icons, pi-default-note 30/30; a scratch check of the MothX row (icon loads, connect, notice in the window's language, fits) in en/zh/zh-TW/ja/de at 1100 and 420: 22/22. - Real binary, MothX 1.3.104 (npm mothx-installer) in a sandbox HOME against a sandbox `magpie serve` and a fake OpenAI upstream: - `magpie mothx magpie/fake/echo-1` wrote the block; `mothx doctor` showed provider magpie, model fake/echo-1. - `mothx -P "Say PONG"` answered from the fake; usage.jsonl recorded agent mothx, provider fake. - Adding qwen3.7-plus to the provider live-synced the block (context, maxTokens, cost, reasoning). With thinking high, MothX sent reasoning_effort "high"; with thinkingFormat removed by hand it sent enable_thinking/thinking_budget instead, and `magpie provider refresh` put "openai" back. - The interactive TUI (tmux) started on "magpie | Qwen3.7 Plus · fake" and got the fake's reply; `magpie mothx effort medium` while it ran printed the restart notice. - `/statusline refresh 5 global` in the TUI rewrote the whole file (dropped reasoning:false, added responses:{…} to magpie's block); `magpie mothx` still read connected. `magpie mothx default` then left the original plus the user's refreshInterval, and (after the cleanup above) no empty providers. - Not tried: Windows and WSL with the real binary; a real vendor key. Full suite: SUITE_LINE |
||
|
|
e528aeb3ce |
agent: DevEco Code, Huawei's OpenCode, as an agent (#1885)
foobra asked for DevEco Code (npm @deveco/deveco-code), Huawei's
HarmonyOS coding agent. It is OpenCode underneath, so it joins through
openCodeLike as MiMo Code did (
|
||
|
|
5cb5b6b7ae | tests: syncHome scopes APPDATA and LOCALAPPDATA into the per-test home | ||
|
|
64262a19f0 |
agent: Prime Agent is an Agents-page row, wired like Pi into ~/.prime/agent, and Disconnect puts its files back (#1528, takltc)
What changed
- internal/agent/primeagent.go: Prime Agent (PrimeIntellect-ai/prime-agent,
CLI prime-agent) through the piLike path, as OmO was added. Its folder is
~/.prime/agent or PRIME_AGENT_CODING_AGENT_DIR (~ expands, as upstream's
agent_dir does; appdir now lets that variable carry ~). models.json and
settings.json were checked against upstream v0.10.0 (pa-core settings and
models registry): Pi's camelCase fields, the same thinking levels and
enabledModels rules. Connect writes providers.magpie, defaultProvider and
defaultModel and keeps the user's providers and settings. Only the global
settings.json is written; allowedModels and subagentDefaultModel are left
alone.
- Prime Agent sends no User-Agent, so its provider block carries the key
magpie-prime-agent and the usage log names it (piLikeKeyed). The block is
Pi's otherwise, compat.sendSessionAffinityHeaders included (Prime Agent's
openai_completions honours it), kept as the user set it (piBlockKept).
- Disconnect restores both files byte-for-byte: before magpie's first write
a copy is kept (*.before-magpie, or a note that the file was absent), and
Disconnect puts it back when nothing else changed since (Agent.Restore). A
file changed while connected is left with only magpie's part taken out.
- WSL kind, agentenv, the icon, PICKS_ITSELF in the GUI, docs and READMEs.
Run
- go test -tags nogui ./internal/agent ./internal/appdir ./internal/agentenv
./internal/library ./internal/usage; the new tests went red with the key,
the restore, the ~ expansion, PICKS_ITSELF and the icon each taken out.
- pi-default-note.test.cjs in chromium and webkit.
- Real use: prime-agent 0.10.0 installed into a sandbox HOME, a sandbox
gateway on 127.0.0.1:3651 and a fake upstream on 3652. The interactive
TUI with no flags started on magpie/fake/echo-1, the fake got the request
and usage.jsonl recorded agent "prime-agent". `magpie prime-agent default`
put models.json back byte-for-byte; settings.json got its values back, but
Prime Agent rewrites the whole file when it runs (every key, nulls), so
that file is equal in content, not bytes. Reconnecting over that
null-filled file and disconnecting again left it byte-identical. After
the rebase onto
|
||
|
|
6ad5dc5855 |
agent: Snow CLI's window, output and image support follow magpie's model until the user sets them in Snow, and a vision model of theirs that would reach the gateway is left out (#1457)
zRain (#1457, Discord #feedback) asked that maxContextTokens / maxTokens be synced when the model changes, and for Snow's vision settings. magpie's profile (profiles/magpie.json) already took maxContextTokens and maxTokens from the catalog on every pick and catalog sync, which also wrote over a value the user had set on that profile in Snow's own settings. Now what magpie last wrote of maxContextTokens, maxTokens and supportsVision is stashed (snow:<dir>:wrote), and a value that differs from it is the user's and is kept through later picks and syncs; the others follow the new model. Leaving magpie's profile forgets the stash, so connecting again starts from the user's profile. supportsVision is now set as every agent is told a model sees (fx, Copilot): true while magpie's Vision describes images at the gateway, else the catalog's word; it used to be copied from the user's profile, where it described their own model. Snow 0.9.2 sends images to the main model only when supportsVision !== false (agents/visionAgent.ts). The user's profile is copied into magpie's, vision settings included. Snow's vision model takes visionBaseUrl || baseUrl and visionApiKey || apiKey (buildVisionConfigOverride), so one with no endpoint of its own went to the gateway, which doesn't know it, and one with its own endpoint but no key sent magpie's key there. snowOwnVision keeps only a vision model with both, on the requestMethod and baseUrlMode it was asked with. Checked against Snow CLI 0.9.2's source (6ef56454: utils/config/ apiConfig.ts ApiConfig, agents/visionAgent.ts, api/chat.ts). Tests (temp HOME, pinned caches): TestSnowSyncedKeepsTheUsers, TestSnowVisionThroughMagpie, TestSnowUsersVisionModel, with Snow's own profile layout. With the stash check disabled TestSnowSyncedKeepsTheUsers fails "the user's window was written over: 65536"; without supportsVision TestSnowVisionThroughMagpie fails "supportsVision <nil>"; without snowOwnVision TestSnowUsersVisionModel fails "visionModel kept: glm-4.5v". go vet (darwin, linux, windows) clean, gofmt clean. |
||
|
|
9bb2a467e4 |
agent: Snow CLI is an agent magpie sets up: a magpie profile in ~/.snow, made the active one, that Snow App takes in with "Sync Snow CLI API config" (#1457)
Snow CLI (npm snow-ai, MIT, MayDay-wpf/snow-cli) keeps one profile per file under ~/.snow/profiles (or $SNOW_CONFIG_DIR), names the active one in active-profile.json, and copies it over config.json at every start, headless `snow --ask` included. Each profile is the whole snowcfg: base URL, key, request method and models. Snow App (MayDay-wpf/snow-app) reads ~/.snow/profiles/*.json when "Sync Snow CLI API config" is pressed. magpie writes profiles/magpie.json from the profile the user was on (their settings kept, Snow's OAuth sign-in left out): baseUrlMode base at the gateway's /v1, requestMethod chat, the agent's key, the model as advancedModel and basicModel, and the catalog's window and output (200000 and 64000 when not known, the output cut to the window). It makes that profile active and copies it to config.json. The profile the user was on, whether there was an active-profile.json at all, and a magpie.json of their own are stashed; Disconnect, `magpie snow default`, or picking a model of one of the user's profiles puts those back. A Snow from before profiles (config.json alone) gets the default.json Snow itself would make, so its next start doesn't take magpie's config for the user's. Check reports a base URL, key or request method moved off magpie's; Sync rewrites the profile on a port move. A WSL distro's ~/.snow is found and written the same way. Registered: agents.go, the WSL kinds, SNOW_CONFIG_DIR in agentenv, the npm update spec (snow-ai), the icon (Snow App's own, trimmed to 96px), README, docs/reference.md, docs/subsystems/agent-wiring.md, the site's agent list and start.html (en, zh, ja). Run: - go test -tags nogui ./... in a scratch HOME: 44 packages ok. New: TestSnow, TestSnowOwnProfile, TestSnowNoProfiles, TestSnowUsersMagpieProfile, TestSnowCheckSync, TestAgentSnowDefault; snow added to TestOwnProviderNamedAsMagpies, the WSL more-agents tests and TestMaxTokensWithinContextWindow. All fail before this commit (no agent "snow"). - go vet -tags nogui for darwin, linux and windows; gofmt -l clean. - Real Snow CLI 0.9.2 in a sandbox HOME against a sandbox magpie (`magpie serve` on 127.0.0.1:3571, a fake OpenAI upstream on 3561): `magpie snow fake/pro` made the magpie profile active, `snow --ask` answered through the gateway (POST /v1/chat/completions, model pro, logged as agent snow), and `magpie snow default` left profiles, active-profile.json and config.json byte-identical to before. - GUI: agent-layout, agent-connect, agent-models-picker, agent-field-names and models-add-and-icons in Chromium and WebKit; a Snow CLI row checked at 520-960px in en, zh, zh-TW, ja and de in both engines. No new GUI strings. |
||
|
|
06420a7121 |
tests: a fake program is a file macOS has already let run (testenv.Program), so a fake's first start no longer eats a test's wait under load
macOS checks a newly written executable before its first exec: 0.27s alone, 2-5s while other new programs start (a go test ./... starting its test binaries). The same file again takes 0.009s, and the pass is kept across a rename and an in-place rewrite. |
||
|
|
8031edc78b |
agent: AtomCode support — one provider account, one model table per catalog model, as its own sign-in writes (#736)
* agent: AtomCode is wired like its own CodingPlan sign-in — one provider account, one model table per catalog model
AtomCode (atomgit.com/atomgit_atomcode/atomcode, AtomGit's open Rust terminal agent) keeps its settings in ~/.atomcode/config.toml ($ATOMCODE_HOME). Its account schema, what its own CodingPlan sign-in writes, is one [provider_accounts."magpie"] table at the gateway's /v1 (protocol openai, gateway.TokenFor("atomcode") as the key, so a request is its agent's even when the UA is overridden) and one [models."magpie/<provider>/<model>"] table per catalog model: the model string goes to the gateway as it is to resolve, with the model's context window (AtomCode compacts as it nears it; a 128000 one is told when the model's isn't known, and an output above the told window is cut to it), its output limit, vision and reasoning_effort_levels; reasoning_effort rides on the table once the user picks one. Picking a model points default_provider and default_model at it — default_model wins when both are set, as atomcode reads it — and stashes the defaults the user had; stepping out puts them back. The picker offers the user's own model tables and the catalog via magpie; the Library gives AtomCode its ATOMCODE.md, its mcp.json (omp's shape) and skills/; its UA is atomcode/<version>.
Found against a real atomcode 5.2.1: the documented legacy [providers.*] tables work, but its own sign-in writes the account schema, so magpie writes that; reasoning_effort, max_tokens and supports_vision were verified to reach the request from the model table, and default_model to win over default_provider. Verified end to end on a real install: atomcode --provider "magpie/…" answered through the gateway, and the Agents page shows the tile, its picker and the Usage attribution. TestAtomcodeWiring, TestAtomcodeRestoresOwnDefaults and TestAtomcodeSync fail on the old code; TestDriftUnwiredEveryAgent and TestUnsetAgentsReadEmpty cover it from All(). go vet, builds (darwin, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./internal/agent ./internal/library ./internal/agentenv pass; the plugin-host and timing failures of the full ./... run fail on main without this change too.
* tweak
* agent: AtomCode's config is matched by its own spellings, and Sync keeps the effort — AtomCode rewrites its config through serde on every /model and /cd, and that writes the account header bare ([provider_accounts.magpie]) where magpie wrote it quoted, so after the first rewrite Check read the wiring as gone, Sync and every pick appended a second account table (edited TOML is invalid: table magpie already exists) and clearing left the unquoted table and its api_key behind. The account is now matched by exact name in its three spellings (quoted, bare, literal — magpie-2 stays out) and the model tables by their decoded keys (kimiModelKey, replacing atomcodeModelName), through a new SetTOMLTablesMatching that takes exact names beside prefixes; SetTOMLTables delegates with none, unchanged. Sync carries each magpie model table's reasoning_effort over when rewriting — it ran at every gateway start and catalog change and dropped both an effort picked in magpie and one picked with AtomCode's /effort, and picking another model cleared every table's. The effort Set validates against the levels AtomCode knows (low, medium, high, xhigh, max — its clamp_effort_to_levels drops none, minimal and ultra), a model without levels offers none now, and the low/medium/high fallback is gone with it. supports_vision is written explicitly false, where AtomCode otherwise guesses from the model name. The user's legacy [providers.*] entries join the picker, a stashed default_model naming one comes back on Disconnect, and picking one sets default_provider and takes default_model out, as the legacy shape reads. site docs (en, zh, ja) list AtomCode. TestAtomcodeSync rewrites the config into the bare and single-quoted spellings before Sync and again before clearing and fails on the old code (drift reported, effort dropped, unquoted table left behind); TestAtomcodeLegacyProvidersArePickableAndRestored and TestAtomcodeEffortLevelsMatchAgentSupport are new. Reported by yetone on #736. go vet, builds (darwin, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./internal/agent ./internal/edit pass.
* agent: TestAtomcodeWiring picks an effort through the field too — the write side of the validation the last commit added (a level AtomCode knows lands as reasoning_effort on the model table, one it does not know is refused) had no coverage left: the test only read back what AtomCode's own /effort had written. provider.SetModelEfforts gives fake/m1 levels to offer.
* agent: Disconnect puts AtomCode's default_provider back only where AtomCode still has it — the restore checked the stash's value was not magpie's but not that the table it names was still there, so a table the user had deleted in between came back as a dangling default (the account schema's default_provider names a model table, the legacy shape a [providers.*] one; own answers for both). The default_model branch checked already. TestAtomcodeRestoresOwnDefaults deletes the stashed provider's model table before clearing and fails on the old code.
* agent: AtomCode joins the CLI updates — npm @atomgit.com/atomcode, the brew cask atomcode, and the curl script's ~/.local/bin/atomcode updating itself with atomcode upgrade, so the Agents page shows its version and a newer one as the other agents' do (#736). TestHowInstalled covers the npm prefix, the cask and the self-updating installer.
* agent: AtomCode's self-updater waits for its install paths to be confirmed — the branch recognized a binary under ~/.local/bin as `atomcode upgrade`, on a docs page, while the README shows another path and the command has not been driven outside the help text; the reviewer asked for it removed until the standalone command and the script's real default are settled. npm and the brew cask stay, with their tests; a comment marks what is pending.
---------
Co-authored-by: googya <118465+googya@users.noreply.github.com>
|
||
|
|
04d4bae323 | agent: ZCode's magpie provider pointed at a magpie on another machine keeps that address and key when magpie syncs its models (Discord, 悠悠哥: ZCode connected in a local magpie for its model list, then its base URL and API key changed by hand in ZCode to a magpie deployed on a NAS, kept going back to the local gateway's, they guessed on each update) — ZCode's Sync, which runs whenever magpie's models change and brings the provider in ~/.zcode/v2/config.json and the rule in provider_config.json up to date, wrote options.baseURL/apiKey and config.api.baseUrl/access.apiKey as gateway.URL() and gateway.Token every time. A sync now keeps an address the provider holds whose host isn't this machine's loopback (onAnotherMachine: an http(s) URL with a host other than localhost, a loopback or unspecified IP), with its key (magpie's token where it has none), and refreshes only the models; one on loopback still follows the gateway, so a magpie on another port keeps rewiring it. Picking magpie in the agent's provider field (Set) points it at this magpie as before. TestZCodeKeepsRemoteAddress: a NAS address kept by a sync in both files while a new model arrives, a loopback one moved to the gateway, connecting in magpie resets a NAS one, and onAnotherMachine's cases. go vet, builds (darwin, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass. Not tried in ZCode itself with the reporter's NAS; the models listed are this magpie's, so one the NAS's magpie doesn't serve is refused there. | ||
|
|
6953627b10 | agents: DeepSeek Harness in a WSL distro (lgtm on Discord: wsl中安装的dsh,目前magpie还是扫描不到,可以添加上吗?) — dsh was this machine's only: dsh(home) read DSH_HOME and wrote the gateway's own address. It is now dshAt(place), as Empryo and the others are: its home is the distro's ~/.dsh (a distro's DSH_HOME can't be read), and the gateway it names in a profile's route, the legacy llm-deepseek entry and Check is the place's (gw threaded through dshSync, dshSet, dshSetEffort, dshCheck and the route writers). wslKinds lists it (dir .dsh, bin dsh); a stopped distro's thinking options come from magpie alone, as its patch lists can't be looked at. KeepDshWired stays this machine's: a distro's route is written again on a sync. TestWSLDshProfiles (a profile's route names 172.20.0.1, a sync and dshWiredOnce leave it) and dsh in wslMore (probe, pick, stopped) fail without it. go vet ./internal/..., go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui -count=1 ./... under a temp HOME pass. | ||
|
|
9845e3af51 | dsh: magpie's route keeps the protocol picked for it in dsh's Models page, OpenAI Responses or Anthropic Messages, where each round put Chat Completions back (01huadalang on Discord: 这些协议怎么改 responses,在 dsh 改了一会就会被 magpie 接管) — the route was written whole each round, api: openai-completions included (dshRouteConfig), so a route switched to OpenAI Responses in dsh's Models page went back to Chat Completions within the 30 s the loop takes. Each round now reads the route's api from the profile's patch list and keeps it when it is one of the three llm-pi-ai protocols the gateway serves (dshAPI: openai-completions at /v1/chat/completions, openai-responses at /v1/responses, anthropic-messages at /v1/messages); none, or one the gateway has no endpoint for (google-generative-ai), goes back to openai-completions. The base goes with the protocol (dshBaseURL): pi-ai hands it to the vendor's SDK as it is, and Anthropic's adds /v1/messages itself, so anthropic-messages is at the gateway's root and the two OpenAI ones at its /v1 (as omp and Pi have it); dshCheck asks for the same base, so a route on Messages isn't reported as pointed elsewhere. On Messages a Claude that thinks only adaptively gets compat.forceAdaptiveThinking, which llm-pi-ai offers there, since pi-ai asks every other model for a thinking budget it turns away. reasoningEfforts are as before on all three: llm-pi-ai (0.2.0-rc.2) makes them pi-ai's thinkingLevelMap, sent as reasoning_effort on Chat, reasoning.effort on Responses (off as the map's none, a model without none having off hidden) and output_config.effort for an adaptive Claude on Messages. TestDshRouteKeepsTheAPIPickedInDsh (a loop round and a sync on a route set to openai-responses, to anthropic-messages at the /v1 base, to google-generative-ai and to none; dsh's check clean, a second round writing nothing) fails without the change (openai-responses written back as openai-completions). TestDshResponsesReachChatVendor sends pi-ai's Responses request, with dsh's User-Agent, to the gateway for a model served on Chat Completions alone: it is asked in Chat with reasoning_effort high, the image, tool call and output carried over, and the reply comes back as Responses events. Read from the installed dsh's llm-pi-ai and pi-ai only; no dsh profile, live agent config or running magpie was touched. go vet ./internal/..., go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui -count=1 ./... under a temp HOME pass (TestFXInState failed once on its TempDir cleanup, passes alone). | ||
|
|
d5322cfbf1 |
agents: dsh's route is written again while magpie serves, not only when magpie starts (#528)
dsh resolves a session's model from the patch list before it contacts the gateway, so a route that lists a model magpie no longer gives dsh fails every session, with nothing reaching magpie to show for it. While magpie serves the gateway it now writes the fields it manages on existing dsh magpie routes again every 30s where they are not what magpie would write now, from gateway.WhileServing next to the WebDAV sync. A route the user removed stays removed, agent-default-model stays the user's choice, and an empty catalog writes nothing. |
||
|
|
0361189f9e | test: every package's tests pass on Windows, and none writes outside its sandbox (the user: 把 Windows 上那几个失败的测试修掉) — on a Windows box the suite failed in most packages, and the root package hung for 25 minutes. Tests set HOME, which os.UserHomeDir ignores on Windows (it reads USERPROFILE), so they read and wrote the runner's own home; each now sets USERPROFILE beside HOME, and Devin's, Goose's, Crush's and Claude Desktop's tests set APPDATA/LOCALAPPDATA, where those keep their files there. said() read the command's output only once it returned, and a pipe holds a few KB on Windows, so magpie model --help blocked forever; it reads while the command writes. Unix permission bits (the gateway key store's 0600 too), exec bits and symlinks Windows lacks are checked only off Windows; TOML strings hold Windows paths as literal strings, JSON as marshalled ones; a URL's path is compared as one. The provider and usage packages run in a home of their own (TestMain, as the gateway's already does), since a CLI's identity kept by a refresh still going when its test ended landed in the runner's ~/.config/magpie — and on a Mac in the user's own. Two product fixes came out of it: imagemcp took a file:///C:/… root or image for the path /C:/…, which doesn't exist on Windows, and now makes a Windows path of it (a host for a UNC share); and session discovery could keep a new Cowork session hidden on Linux, where a folder's mtime is a kernel tick and its size doesn't change, so an entry added within the tick of the last listing left both as they were — a listing made within 2s of its folder's last change is read again, as git does for racy files. TestFilePath and TestRacyDirectoryListedAgain fail without the change. On Windows 11 every package passes (32 of 32) and a run of each package in a fresh home leaves nothing in home, APPDATA or LOCALAPPDATA; on Linux (WSL) and macOS go test -tags nogui ./... passes. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build pass. | ||
|
|
471956c837 | agents: dsh takes magpie as a custom provider of its own, Magpie, not by taking over its DeepSeek one (01huadalang on Discord: 集成进 dsh 会有 bug,会被 dsh 覆写,应该走 dsh 的那个另外的供应商) — magpie rewrote dsh's llm-deepseek entry in every profile to point at the gateway with the key MAGPIE_API_KEY. dsh's Models page showed it as DeepSeek, so a DeepSeek key typed there went into dsh's key store under that name, which dsh reads before .env: the next request carried the DeepSeek key and failed, magpie seemingly overwritten; dsh's own DeepSeek models were gone meanwhile. magpie now adds a magpie provider under llm-pi-ai, as dsh's Add model provider → Custom model API writes one (gateway URL, openai-completions, MAGPIE_GATEWAY_KEY, magpie's models with their limits, images and effort levels), and points the default model at it; llm-deepseek and the user's other providers are left alone, a profile wired the old way is moved on sync with its model and effort kept, new profiles get it, switching to a dsh model or clearing takes it out, and the check says when dsh's key store holds another MAGPIE_GATEWAY_KEY. Verified with dsh 0.2.0-rc.2 in a sandbox HOME against a fake gateway: headless and web requests carry magpie's token, a DeepSeek key saved in dsh's Models page no longer displaces it. TestDshCustomProvider and TestDshMovesOffDeepSeekRow fail without the change. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass. | ||
|
|
49f40b463f |
Configure per-model context windows and output limits (#279)
A provider that serves a model the catalogue does not list, or lists at the wrong size, has a window and a reply limit magpie cannot know: both fall back to whatever the catalogue says about the model's maker, which for such a provider is nothing at all. magpie model context relay-a/gpt-5.5 262144 magpie model output relay-a/gpt-5.5 131072 magpie model context 'relay-a/*' 200000 magpie model output relay-a/gpt-5.5 --reset Both are looked for in the same order as each other: this model, then `<provider id>/*`, then the provider's own list, then the catalogue. A model's own value wins over its provider's. The reply limit is new; the window is not — `Provider.Contexts` has been there, with a `"*"` of its own, settable through `magpie provider set <id> context.<model>=`, and this reuses it rather than shadowing it. That reuse is the point rather than a detail. A context is a routing input and not only a number agents are shown: at 95% of a held member's window a request moves to a member that takes more, so two sources of truth would mean the gateway routing on one number while agents are told another. `magpie model context` is a second way to set the same field, not a second field. Both reach the agents. Pi keeps a model's window and reply limit in its own models.json, OpenCode keeps its limit, and Crush, Droid, Cline, Qoder and Zcode keep their own; an agent reads those files when it starts, so a limit set here that never reaches them is a limit that does not take effect. `magpie provider set` has always told the agents, and this behaves the same way rather than introducing a second, quieter path. The test asserts each setter reaches them exactly once — the two paths differ (one saves the provider file, the other settings and then says so) and that difference is worth pinning. An end-to-end pass confirms it: with a Pi models.json in place, `magpie model context relay-a/sol 999999` writes `contextWindow: 999999` into `providers.magpie.models`. A `0` is refused rather than read as a reset, naming `--reset`; a mistyped model id is refused the way `magpie model name` refuses the same id; a reset says what is actually in force instead of claiming to be back to the vendor's list while a provider-wide value still applies; and `magpie model context <provider>/*` reports that value rather than saying the provider serves no such model. Validation happens where the entry is written, so one hand-edited bad key cannot stop a theme or a window size from saving, and #288's walk moves these on a provider rename without a line here. |
||
|
|
f3b45634a3 | agents: Droid, Qoder, OpenHanako, WorkBuddy, OpenCode and ZCode no longer get an output limit above the model's context window (#347) | ||
|
|
b60cfa6787 |
agents: omp, Pi, Cline and dsh are no longer told a model writes more than its window holds (#338)
models.dev lists some models' output above their context (deepseek-chat: 384000 out, 128000 in), and magpie handed that on as maxTokens. The limit is now kept within the contextWindow written beside it; a model whose window isn't known keeps its output as before. Follow-up to the review of |
||
|
|
953bce2cfb | agents: Codex signed in with only an API key gets magpie as its provider, its picker listing magpie's models (#322, dakango: switching the Codex app to one of its own models went to OpenAI, 502) — magpie counted an API key in auth.json as a ChatGPT sign-in and only set openai_base_url, counting on Codex to ask the gateway for its models; but Codex asks for none with an API key (models-manager refresh_available_models returns early), so the picker showed Codex's built-in models and the one magpie model, and a built-in one went to OpenAI with the relay's key. Now only a ChatGPT sign-in takes that route; with an API key alone magpie is the model_provider with model_catalog_json listing every magpie model on for Codex, as when signed out, and a sync moves a setup an older magpie wrote; going back to Codex's own model restores the user's model_provider. A Codex model whose OpenAI can't be reached now fails naming the model and what to do instead of a bare 502. TestCodexAPIKeyUsesProvider, TestCodexAPIKeyBaseURLMoved and TestCodexOwnModelUnreached fail without the change. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass. | ||
|
|
98cbea0ffb | agents: Pi's models go to PI_CODING_AGENT_DIR (#304), and the Codex app offers magpie's models' efforts (#310) — Pi keeps settings.json and models.json in PI_CODING_AGENT_DIR when set (~ expanded; @earendil-works/pi-coding-agent config.js), and magpie wrote ~/.pi/agent regardless; omp is read by its own rules (PI_CONFIG_DIR, OMP_PROFILE/PI_PROFILE, then PI_CODING_AGENT_DIR), and the library's Pi and omp targets follow. The Codex app's model picker offers only the efforts in [desktop] enabled-reasoning-efforts of config.toml (ChatGPT.app 26.924: default low…xhigh, ultra, persistent), so a magpie model's max or minimal was never offered; routed through magpie, the efforts its models take are added to the user's list (or the default), nothing else changed, only values the app knows (it drops the setting for any other), comments kept, nothing written when nothing is missing. TestPiAgentDir, TestOmpAgentDir and TestCodexDesktopEfforts fail without the change. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass. | ||
|
|
04f374fa8c |
agent: OmO (oh-my-openagent, omo-ai), a fork of Pi that keeps its own ~/.omo/agent, gets its own row: a magpie model sets settings.json's defaultProvider/defaultModel and magpie's provider in models.json there as Pi's does, $OMO_CODING_AGENT_DIR / $SENPI_CODING_AGENT_DIR are honoured, the Library writes its AGENTS.md, mcp.json and skills, and omo update updates it (#264 rhyme227). Pi's own ~/.pi is left alone. piIn becomes piLike(at, id, name, dir) so both share one wiring. Tested with omo_test.go in agent and library (fail without the change); go vet, go build -tags nogui (darwin, GOOS=linux, GOOS=windows), go test -tags nogui ./... pass.
|
||
|
|
899ddf594c |
mimo: a Xiaomi MiMo account (the one MiMo's app signs in to) is signed in inside magpie and its models served through the gateway to any agent, and MiMo Code is an agent magpie configures (#249 thedavidweng) — magpie had neither. The subscription (id mimo-app, shown as Xiaomi MiMo) signs in with Xiaomi's long-poll login (account.xiaomi.com/longPolling/loginUrl, sid mimosgp) and keeps the MiMo server's cookie session (serviceToken, userId) in logins.json at 0600; the passToken is replayed to renew the session after a day or on a 401. Requests go to POST <base>/route/chat/completions on mimo-server-{sgp,ru,in}.xiaomimimo.com/api with X-Mimo-Source mimocode-cli-free and X-Client-Version; mimo-auto is sent as mimo-pro; the models are mimo-pro and mimo-flash. Usage from /user/usage and /user/xiaomi/subscription/self. Several accounts, switched, on/off and forgotten as the other subscriptions. The add list has a Xiaomi MiMo tile (Free · Starter · Plus · Pro · Ultra) that says Xiaomi may treat this as third-party use before anything is posted; en and zh. magpie accounts takes mimo. MiMo Code (agent mimocode, OpenCode-like) is configured in its config dir (MIMOCODE_HOME/config when set), reading mimocode.jsonc, mimocode.json or config.json, whichever is there. Tested with internal/provider/mimo_test.go against fake Xiaomi SSO and MiMo servers in a temp HOME, internal/agent tests for MiMo Code's config, and internal/gui/tests/mimo-sub.test.cjs, Chromium and WebKit, en and zh; they fail without the change. factory-sub, click-scroll, old-webkit, zed-sub and add-sheet pass; go vet, go build -tags nogui (and GOOS=linux, GOOS=windows) and go test -tags nogui ./... pass. Not tried with a real Xiaomi account: the long-poll's success payload, the SSO cookie chain, whether /route accepts magpie's requests, the UTC+8 times, and whether MiMo Code picks up the config; not tried in the real Wails window.
|
||
|
|
6c9a0aa4d7 | agents: OpenHanako — magpie is a provider there, chat completions at the gateway's /v1 under the key magpie-hanako with every model it serves, their windows, output, images and reasoning said; picking one makes it the primary agent's chat model, and default puts back the one it had and removes the provider, marked deleted as OpenHanako marks one it removes. While OpenHanako runs it goes through its local API (server-info.json's port and token), which reloads at once; otherwise into provider-catalog.json and agents/<id>/config.yaml for its next start. Asked on Discord; checked with OpenHanako's own provider registry and model manager, which list magpie's models and resolve the chat model to the gateway | ||
|
|
03a01a548d |
agent: MiMo Code — Xiaomi's fork of OpenCode, sharing its config shape (#98)
* agent: MiMo Code — a terminal coding assistant that is Xiaomi's fork of OpenCode, whose config keeps OpenCode's shape: its own mimocode.json(c) under ~/.config/mimocode, its auth beside it, and a magpie provider block with npm/@ai-sdk/openai-compatible, model and small_model fields. opencode() becomes openCodeLike() for the two to share it, and magpieProviderJSON splits shape from the catalog id (magpieProviderJSONFor), so a visibility narrowed on mimocode (magpie visible mimocode …) narrows its list and leaves OpenCode's alone. The library gives it the same instructions, MCP servers (its mcp key) and skills as OpenCode, except the shared skills go into its own skills/ folder: it reads Claude Code's skills only behind a flag, though it reads its CLAUDE.md like OpenCode, and the page says so. Its requests are told by the mimocode/ User-Agent. Checked against XiaomiMiMo/MiMo-Code * icon: MiMo Code's own favicon, from packages/ui/src/assets/favicon — its frame with the bottom bar, in the monochrome the app masks to the text colour |
||
|
|
9b1641a493 | opencode: a model chosen for OpenCode that a provider of the config's own already sends to magpie's gateway is named under that provider — a layout of one provider per family (magpie-relay, magpie-claude, …) is no longer doubled by magpie's flat provider with the same models, nor the default model moved onto it, by magpie opencode <model> | ||
|
|
796dac8de9 |
agent(pi): a magpie model tells Pi how long a reply may be — maxTokens from the model's output limit, where Pi otherwise capped every reply at 16384 tokens (#91)
* agent(pi): a model through magpie tells Pi how long a reply may be — Pi's models.json got contextWindow but no maxTokens, so Pi capped every reply at its default 16384 tokens, Claude Opus and GPT groups that can write 128K included; each model now carries maxTokens when its output is known (a group's is the smallest of its members'), as DSH and OpenCode's limit.output already do Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * drop internal/provider/devin/config.json, a file a provider test leaves behind --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: yetone <kumw95ya25@gmail.com> |
||
|
|
d05763a5dc | opencode: each model of magpie's carries its window (limit.context), a group's context= with it, so OpenCode compacts when the model needs it and not at its own guess; and magpie sync puts magpie's provider back into opencode.json when a model of magpie's is chosen there but the provider is gone. /v1/models says each model's window too (context_window, context_length, max_input_tokens, max_output_tokens). Asked on Discord | ||
|
|
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 |