agent: Open Code Review (ocr) is an agent magpie sets up (@AlanWang1027713 on X)
Open Code Review (github.com/alibaba/open-code-review, npm @alibaba-group/open-code-review) is a Go CLI, `ocr`, that reviews a diff with a model. Its Claude Code, Codex, Cursor, Kimi Code and OpenCode plugins and its skills all run that command, which reads ~/.opencodereview/config.json on every run. Picking one of magpie's models on its row writes a custom provider "magpie" there (protocol openai, the gateway's /v1, a key naming Open Code Review, the model) and points provider at it. The user's own provider and model are stashed and come back on Disconnect, which also drops a custom_providers left empty. A model of the user's own can be picked too (written the way `ocr config model` writes it). Check reports a hand-edited url or key, or a removed entry. The `ocr` command counts only under a folder named for Open Code Review, since other programs share the name. WSL distros get the row too (cold distros not opened). Its User-Agent, open-code-review/<version>, already counts as this agent. CLI update via npm. Docs, READMEs, site and icon (OCR's own logo, Apache-2.0). Run (mica, at 593517bf0; origin/main has one unrelated usage commit since): - go test ./internal/agent -run 'TestOCR|WSL|Wsl|TestOwnProviderNamedAsMagpies|TestHandWiredMagpieProviderSiblings|TestAgentOf|TestEveryAgentNamedByItsKey|TestMarkedLinesEveryAgent': ok - gofmt -l: clean; GOOS=linux go vet -tags nogui ./... and GOOS=windows go vet ./...: ok - Broken by hand: url dropped from Check -> TestOCRWiring red; stash turned off -> red at the Disconnect restore. TestWSLColdPlaceOpensNothing went red before the row's options were given an asleep path. - Real e2e in a sandbox HOME: npm-installed ocr v1.13.10 (7e5ce06c) darwin/arm64, magpie built from this tree, a fake OpenAI upstream that calls tools. `magpie agents` lists the row with the user's deepseek/deepseek-chat; `magpie open-code-review magpie/fake/m1` wrote the entry and kept the user's keys and settings; `ocr llm test`: connection ok, tool-call round trip verified; `ocr review` on a repo with a nil dereference: 2 findings "[bug · high]" through magpie (8 /v1/chat/completions calls, UA open-code-review/v1.13.10, model m1, its six review tools); `magpie usage` counts them under Open Code Review; `magpie open-code-review default` put deepseek/deepseek-chat back and removed custom_providers. - Full suite: not run before this push (ship at once; mote was running another session's suite). It runs on mica right after, at this head. Not tried: a real vendor model behind magpie; WSL and Windows/Linux machines for real; the Claude Code / OpenCode plugin path itself (it runs the same `ocr`); an ocr installed by the curl script outside a folder named for it is found by ~/.opencodereview only.
This commit is contained in:
@@ -83,7 +83,7 @@ magpie finds the subscriptions your agents are signed in to by reading their sig
|
||||
<table>
|
||||
<tr><td>
|
||||
|
||||
Claude Code · Claude Desktop · Claude Science · Codex · Gemini CLI · Antigravity CLI · Dim · OpenCode · OpenChamber · MiMo Code · DevEco Code · Pi · oh-my-pi · StepCode · MothX · PenguinHarness · Aside · OmO · Prime Agent · mu · Goose · Cursor CLI · Cursor Private Inference · Zed · VS Code Chat · VS Code Insiders · VSCodium Chat · Zoo Code · JetBrains Air · Air (JetBrains IDEs) · Copilot (JetBrains) · Copilot CLI · Crush · DeepSeek Harness · Reasonix Studio · Command Code · fx · Devin · Hermes Agent · Mister Morph · Kimi Code · jcode · Mistral Vibe · Qwen Code · Muse Code · Empryo · nanobot · miniQ · Paimon · MiniMax Code · Droid · Cline · Qoder · Qoder CN · Grok Build · Grok App · ZCode · WorkBuddy · WorkBuddy AI · CodeBuddy · Pencil · Paseo · OpenPencil · OpenBot · Craft Agents · Tuanjie Cowork · NewMax · LiveAgent · Raycast · Kiro Crew · OpenMausBot · T3 Code · OpenHanako · AtomCode · Snow CLI · Alma · Shelley · Cindy · Lody · AionUi · Cherry Studio · Ante · AstrBot · QwenPaw · OpenClaw · Avibe · Kun
|
||||
Claude Code · Claude Desktop · Claude Science · Codex · Gemini CLI · Antigravity CLI · Dim · OpenCode · OpenChamber · MiMo Code · DevEco Code · Pi · oh-my-pi · StepCode · MothX · PenguinHarness · Aside · OmO · Prime Agent · mu · Goose · Cursor CLI · Cursor Private Inference · Zed · VS Code Chat · VS Code Insiders · VSCodium Chat · Zoo Code · JetBrains Air · Air (JetBrains IDEs) · Copilot (JetBrains) · Copilot CLI · Crush · DeepSeek Harness · Reasonix Studio · Command Code · fx · Devin · Hermes Agent · Mister Morph · Kimi Code · jcode · Mistral Vibe · Qwen Code · Muse Code · Empryo · nanobot · miniQ · Paimon · MiniMax Code · Droid · Cline · Qoder · Qoder CN · Grok Build · Grok App · ZCode · WorkBuddy · WorkBuddy AI · CodeBuddy · Pencil · Paseo · OpenPencil · OpenBot · Craft Agents · Tuanjie Cowork · NewMax · LiveAgent · Raycast · Kiro Crew · OpenMausBot · T3 Code · OpenHanako · AtomCode · Open Code Review · Snow CLI · Alma · Shelley · Cindy · Lody · AionUi · Cherry Studio · Ante · AstrBot · QwenPaw · OpenClaw · Avibe · Kun
|
||||
|
||||
</td></tr>
|
||||
</table>
|
||||
|
||||
+1
-1
@@ -83,7 +83,7 @@ magpie 通过读取智能体的登录信息(Claude Code 和 Codex 的文件、
|
||||
<table>
|
||||
<tr><td>
|
||||
|
||||
Claude Code · Claude Desktop · Claude Science · Codex · Gemini CLI · Antigravity CLI · Dim · OpenCode · OpenChamber · MiMo Code · DevEco Code · Pi · oh-my-pi · StepCode · MothX · PenguinHarness · Aside · OmO · Prime Agent · mu · Goose · Cursor CLI · Cursor Private Inference · Zed · VS Code Chat · VS Code Insiders · VSCodium Chat · Zoo Code · JetBrains Air · Air (JetBrains IDEs) · Copilot (JetBrains) · Copilot CLI · Crush · DeepSeek Harness · Reasonix Studio · Command Code · fx · Devin · Hermes Agent · Mister Morph · Kimi Code · jcode · Mistral Vibe · Qwen Code · Muse Code · Empryo · nanobot · miniQ · Paimon · MiniMax Code · Droid · Cline · Qoder · Qoder CN · Grok Build · Grok App · ZCode · WorkBuddy · WorkBuddy AI · CodeBuddy · Pencil · Paseo · OpenPencil · OpenBot · Craft Agents · Tuanjie Cowork · NewMax · LiveAgent · Raycast · Kiro Crew · OpenMausBot · T3 Code · OpenHanako · AtomCode · Snow CLI · Alma · Shelley · Cindy · Lody · AionUi · Cherry Studio · Ante · AstrBot · QwenPaw · OpenClaw · Avibe · Kun
|
||||
Claude Code · Claude Desktop · Claude Science · Codex · Gemini CLI · Antigravity CLI · Dim · OpenCode · OpenChamber · MiMo Code · DevEco Code · Pi · oh-my-pi · StepCode · MothX · PenguinHarness · Aside · OmO · Prime Agent · mu · Goose · Cursor CLI · Cursor Private Inference · Zed · VS Code Chat · VS Code Insiders · VSCodium Chat · Zoo Code · JetBrains Air · Air (JetBrains IDEs) · Copilot (JetBrains) · Copilot CLI · Crush · DeepSeek Harness · Reasonix Studio · Command Code · fx · Devin · Hermes Agent · Mister Morph · Kimi Code · jcode · Mistral Vibe · Qwen Code · Muse Code · Empryo · nanobot · miniQ · Paimon · MiniMax Code · Droid · Cline · Qoder · Qoder CN · Grok Build · Grok App · ZCode · WorkBuddy · WorkBuddy AI · CodeBuddy · Pencil · Paseo · OpenPencil · OpenBot · Craft Agents · Tuanjie Cowork · NewMax · LiveAgent · Raycast · Kiro Crew · OpenMausBot · T3 Code · OpenHanako · AtomCode · Open Code Review · Snow CLI · Alma · Shelley · Cindy · Lody · AionUi · Cherry Studio · Ante · AstrBot · QwenPaw · OpenClaw · Avibe · Kun
|
||||
|
||||
</td></tr>
|
||||
</table>
|
||||
|
||||
@@ -168,6 +168,7 @@ line; agents connected to magpie lose it when it quits.
|
||||
| Kun | `~/.kun/data/model-connections.v2.json` (`$KUN_DATA_DIR`), changed through its runtime's admin API (`baseUrl` and `runtimeToken` of `runtime.json` in the same folder) while it runs | model (a `magpie` connection in Settings > Providers: HTTP, OpenAI chat completions at the gateway's `/v1`, with Kun's own key and the models picked for Kun; the model picked is Kun's default. Kun has to be running to connect or disconnect it) |
|
||||
| OpenHanako | `~/.hanako/provider-catalog.json` + `agents/<id>/config.yaml` (`$HANA_HOME`; its local API while it runs) | model (the primary agent's; magpie's models as a provider) |
|
||||
| AtomCode | `~/.atomcode/config.toml` (`$ATOMCODE_HOME`) | model, effort (a `magpie` provider account, one model table per catalog model as its own sign-in writes) |
|
||||
| Open Code Review | `~/.opencodereview/config.json` | model (a `magpie` custom provider made the one in use; its Claude Code, Codex, Cursor, Kimi Code and OpenCode plugins run the same `ocr`) |
|
||||
| Snow CLI | `~/.snow/profiles/magpie.json` (`$SNOW_CONFIG_DIR`), made the active profile and copied to `config.json` | model (the user's other profiles' models too; Snow App takes the profile in with "Sync Snow CLI API config") |
|
||||
| Alma | Alma's local API (`localhost:23001`, while Alma runs; alma-server's data in `$ALMA_DATA_DIR`, `$XDG_DATA_HOME/alma` or `~/.local/share/alma` on Linux) | model (Alma's default; magpie's models as a provider), and Image Generation's model when it is Auto: the one magpie draws with |
|
||||
| Shelley | Shelley's local socket (`~/.config/shelley/shelley.sock`, `$XDG_CONFIG_HOME/shelley`, `$SHELLEY_SOCKET`; while `shelley serve` runs) | model (the default profile's; magpie's models as Shelley custom models of type `openai` at the gateway's `/v1` with Shelley's own key, one per model picked; the profile's model and thinking level are stashed and put back on Disconnect, and magpie's custom models go) |
|
||||
|
||||
@@ -201,6 +201,7 @@ something else shows up as drift.
|
||||
- Claude Magpie's Code tab can have a Claude Code folder of its own (#6459, xMopf7RF on X): `settings.DesktopIsolatedClaude`, on for a Claude Magpie made new and off for one made before. Made new is the app off and no Claude-Magpie-3p folder yet, and the user never set it (`DesktopIsolatedClaudeChosen`, which the fold and the CLI set): then `desktopIsoClaudeDefault` turns it on before the app is made, so the twin's Code tab writes nothing of `~/.claude`, like a phone's app clone. One with chats in Claude-Magpie-3p already, or one the user turned off, keeps `~/.claude`. Set under the Separate app's Advanced fold (`POST /api/settings/desktop-isolated-claude`, drawn by `claudemagpie.js`) or `magpie claude-desktop launcher claude-dir on|off`, both `SetDesktopIsolatedClaude`. While on, and the Separate app is on, the app's script exports `CLAUDE_CONFIG_DIR=~/.claude-magpie-desktop` (`desktopiso.Script`'s `claudeDir`), which Desktop passes to its bundled Claude Code, and `desktopOn` in [`claude.go`](../../internal/agent/claude.go) writes Desktop's model windows, caps and explore entries into that folder's `settings.json` instead of `~/.claude`'s (`desktopCodeDir`, `desktopClaudeSync`); off moves them back. The folder stays when it is turned off, and it is a `claude#` row named "Claude Code · Claude Magpie" (`claudeDirAgents`). A change remakes the app; a running Claude Magpie keeps the old environment until it is quit and opened again. In the Library it is an agent of its own (see [library](library.md), Claude Magpie): `DesktopTwinApp` (`claude-desktop#magpie`) takes MCP servers and Cowork skills in Claude-Magpie-3p, and the `claude#magpie-desktop` row takes instructions, skills and servers in `~/.claude-magpie-desktop`; `DesktopConfigs3p` no longer includes Claude-Magpie-3p's config. The "Use Claude Magpie" button, beside Claude Desktop's switch while it isn't on magpie (its own button there, not words in the status line, so it reads as a way that doesn't connect the user's own Desktop), turns the Separate app on and then connects Desktop (`desktopTwinBtn`, also `claudemagpie.js`), so only Claude-Magpie-3p is wired and the user's own Desktop is left as it was. It shows whenever Desktop isn't on magpie, with Claude Magpie made already too (where connecting wires only Claude-Magpie-3p, `desktopSets`, and the button also makes the app again if it was deleted; xMopf7RF on X, 0.1.4076); then the row's status line says connecting puts Claude Magpie on magpie, not that Desktop opens a separate profile. While the Separate app is on, the `claude-desktop` row is named Claude Magpie (`state()` in [`api.go`](../../internal/gui/api.go)): the only config it wires then is Claude-Magpie-3p's, so the row that turns on after Use Claude Magpie never reads Claude Desktop (xMopf7RF on X, 0.1.4111, who read it as their own Desktop being connected). The `claude#magpie-desktop` row isn't wired itself (Desktop's Code tab runs Claude Code with `CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`, so its requests go through Claude Magpie whatever that folder's settings.json says); while Claude Magpie is on magpie it carries `twinCode` (`agent.DesktopTwinCode`) and its status line, lit, says it is on magpie through Claude Magpie, instead of "not connected, its own settings". `TestClaudeMagpieCodeTabRowIsOnThroughIt`, `TestClaudeMagpieRowsAfterUseClaudeMagpie`, `desktop-twin-code.test.cjs`, `TestClaudeDesktopIsolatedClaudeDir`, `TestClaudeMagpieTwinLeavesTheOriginal`, `TestClaudeMagpieOwnFolderKeepsWhatWasSet`, `TestScriptClaudeConfigDir`, `desktop-isolated-claude.test.cjs`, `desktop-twin.test.cjs`.
|
||||
- Claude Desktop names a Claude model with reasoning levels after its own catalog ("Opus 5.5"), not by the `display_name` magpie lists, because magpie lists it as `magpie-<number>.anthropic.<model>` to keep its effort picker (`claudeLooking` in [`desktop.go`](../../internal/gateway/desktop.go)). Desktop 4.4212 labels a picker row by its catalog's name before `display_name` (only an admin's `inferenceModels` list carries the `labelOverride` that beats it), so two providers' rows of one model read alike and Desktop adds the part of the id that differs, "Opus 5.5 (…7922287072.anthropic.claude-opus-5-5)", in 5.11492 "(…<number>.anthropic.claude-opu…)" (onkashiko on X). magpie therefore writes the list, with each row's `display_name` as `labelOverride`, while a tier is picked and also while two rows are named after the same Claude model of Desktop's catalog (`desktopNamesClash`, `desktopCatalogNamed` in [`desktop_list.go`](../../internal/gateway/desktop_list.go)); Desktop leaves a `labelOverride` as it is (`keep` in xVn, 5.11492), so those rows read "Opus 5.5 · agy-cli" after Desktop restarts (`TestDesktopInferenceModelsCatalogNamesClash`). Such a list freezes Desktop's menu until its next start, as a tier's does. Two rows that `display_name` still leaves alike (one provider's models named alike) get the model's own id after the name, or the whole catalog id when two providers share a name (`desktopNames`, `TestDesktopNames`). Desktop shows the gateway's `description` under the name, before the catalog's, so such a row's description names its provider when the Provider in model names setting puts it after the name (`desktopSaidBy`: on, every one; off, only two of one name), and a 1M row listed by its `[1m]` id says "1M context window · <provider>" (4 v5 on Discord, `TestClaudeDesktopCatalogNamedSaysProvider`). The id stays as it was. The provider editor shows the number too on the model's chip (`gateway.DesktopNumber`, `desktopNumbers` in [`providers.go`](../../internal/gui/providers.go), #2578). The chip shows it only while Claude Desktop is installed and is shown that model. Every other model Desktop is shown carries no number on the chip: Desktop names it by `display_name`, which already says the provider, or by its own id.
|
||||
- Codex's `spawn_agent` tool names only the first five models of its catalog to the lead (codex-rs `MAX_SPAWN_AGENT_MODEL_OVERRIDES` in `child_config.rs`, `spawn_agent_models_description`), Codex's own ahead of magpie's, though it takes any catalog model by name (`find_spawn_agent_model_name`). So a lead could put its subagents on none of magpie's models (Gearclickist on Discord). The gateway adds the rest of the catalog Codex was handed to that tool's description, after Codex's own list, at most 200 (`spawnAgentModels` in [`codex_spawn_models.go`](../../internal/gateway/codex_spawn_models.go)). A model that can search tools (`supports_search_tool`) isn't handed it in the request's tools: Codex defers its multi-agent V1 tools behind `tool_search` (codex-rs `core/src/tools/spec_plan.rs`), and the lead gets `spawn_agent` in the `tool_search_output` Codex puts in the conversation and sends again every turn, so that one is widened too. That text goes upstream with the prompt, to OpenAI too for a ChatGPT lead, so its header (`spawnMore`) stays neutral: it names neither magpie nor Codex's limit. At `CodexPath` that is Codex's own listed models less the hidden ones, then `CodexListed` unless Codex is held to its own. At `/v1` it is `CodexCatalog` under the key's allowance. A lead the ChatGPT backend answers in multi-agent V2 seals its subagents' tasks for a ChatGPT account (#619), so it gets Codex's own only. The model catalog Codex puts in context under `model_catalog_in_context` (under development, off by default) is capped at five too, and isn't widened.
|
||||
- Open Code Review (`ocr`) reads `~/.opencodereview/config.json` on every run; `provider` names an entry of `providers` (its presets) or `custom_providers`, and the entry's own `model` wins over the top-level one ([`ocr.go`](../../internal/agent/ocr.go)). magpie writes the custom provider `magpie` (openai protocol, the gateway's `/v1`, a key naming the agent, the model) and points `provider` at it; the provider and model the user had are stashed and come back on Disconnect. Its Claude Code, Codex, Cursor, Kimi Code and OpenCode plugins all run this `ocr`, so they follow it. `ocr` is other programs' name too: only one under a folder named for it counts (`ocrNotOurs`), else `~/.opencodereview` says it is there.
|
||||
- Snow CLI runs on one profile at a time (`profiles/<name>.json` in `~/.snow` or `$SNOW_CONFIG_DIR`, named in `active-profile.json`) and copies the active one over `config.json` at every start, `snow --ask` too ([`snow.go`](../../internal/agent/snow.go)). magpie writes a `magpie` profile, makes it the active one, and copies it to `config.json` itself, so a Snow already running and Snow App's "Sync Snow CLI API config" see the same. It is made from the profile the user was on, their settings kept and its OAuth sign-in left out. A vision model of that profile comes along only with an endpoint and key of its own (`snowOwnVision`), since one on the profile's would now go to the gateway. `maxContextTokens`, `maxTokens` and `supportsVision` follow the model from the catalog (`snowSynced`; `supportsVision` as every agent is told, true while magpie's Vision describes images); what magpie last wrote of them is stashed, and one the user changed since in Snow's own settings is kept through later picks and syncs. The small field is magpie's profile's `basicModel`, Snow's light model for summaries, compaction and file search: empty while it follows the main model, a model through magpie of its own kept through new main models and syncs; on a profile of the user's it offers nothing and is hidden. The thinking field is magpie's profile's `chatThinking` (`{enabled: true, reasoning_effort}`), the only thinking setting Snow reads on the chat protocol; empty deletes it, Snow's default, which sends thinking disabled. A chatThinking the user brought from their profile is shown, not written over. The profile they were on (or that there was no `active-profile.json`) and a `magpie.json` of their own are stashed and put back by Disconnect. A Snow from before profiles (`config.json` alone) gets the `default.json` Snow itself would have made of it, so its next start doesn't take magpie's for the user's. Picking a model of another of the user's profiles switches Snow to that profile. On magpie's profile, a value that is neither a model through magpie nor the model of one of the user's profiles is refused and changes nothing (#1457: `magpie snow --help` used to take magpie out and write `--help` as the model of the profile it went back to). Gemini CLI's auth field refuses an auth it doesn't know before it unroutes, for the same reason. On the CLI, `-h`/`--help` after any command or agent only prints its usage, before `run` reads or moves anything, and any other flag given to `magpie <agent> …` is refused (`help_cli.go`; `TestHelpOnEveryCommandDoesNothing` walks `run`'s switch and every agent).
|
||||
- omp's `enabledModels` in `config.yml` is the list it holds its default role to: a model left out of it isn't used, whatever `modelRoles.default` says (#1769). So a model picked for the default role is added to a list that is there and doesn't take it in already, by name or by one of omp's globs (`*` not crossing `/`, as `Bun.Glob`), and once nothing in `config.yml` is on magpie its plain `magpie/…` entries are taken out (a list left empty goes, never `[]`); a renamed provider's entries are renamed once, and folder-scoped entries are left alone (`ompScope*` in [`omp_scope.go`](../../internal/agent/omp_scope.go)). No list, no change: omp then takes every model. A list that leaves the default role's model out is drift, which Reapply mends.
|
||||
- Pi's `enabledModels` in `settings.json` (and OmO's, Prime Agent's and mu's, `piLike`) is the Ctrl+P list a new session starts from. A picked model the list doesn't take in is added (`piScopeWith` in [`pi.go`](../../internal/agent/pi.go)), and a renamed provider's `magpie/<old>/` entries are renamed with it, a glob or a thinking level included, the copy the pick just added dropped (`renameRefList` in [`rename.go`](../../internal/agent/rename.go), #1919, `TestPiEnabledModelsFollowRename`). The user's other entries stay; a list naming none of the provider's models isn't rewritten.
|
||||
|
||||
@@ -396,6 +396,7 @@ func onMachineAll(home, cfg string) []*Agent {
|
||||
kun(home),
|
||||
hanako(home),
|
||||
atomcode(home),
|
||||
ocr(home),
|
||||
snow(home),
|
||||
alma(),
|
||||
shelley(home),
|
||||
|
||||
@@ -227,6 +227,8 @@ var cliSpecs = map[string]cliSpec{
|
||||
// exists, but its installed-binary update path is not exercised here, so
|
||||
// only its npm package and brew cask are recognized
|
||||
"atomcode": {npm: []string{"@atomgit.com/atomcode"}, brew: []string{"atomcode"}},
|
||||
// Open Code Review: npm, or its install script's /usr/local/bin/ocr
|
||||
"open-code-review": {npm: []string{"@alibaba-group/open-code-review"}},
|
||||
// Snow CLI is published on npm alone (snow-ai)
|
||||
"snow": {npm: []string{"snow-ai"}, scripts: true},
|
||||
// MothX: its npm installer package, which brings the native binary
|
||||
|
||||
@@ -140,7 +140,7 @@ func TestPiConnectedBeforeStaysConnected(t *testing.T) {
|
||||
func TestHandWiredMagpieProviderSiblings(t *testing.T) {
|
||||
ids := []string{"agy", "opencode", "openchamber", "mimocode", "deveco", "pi", "aside", "omo", "prime-agent", "mu", "goose", "zed", "vscode",
|
||||
"crush", "dsh", "ds-bot", "commandcode", "fx", "omp", "hermes", "morph", "kimi", "empryo", "nanobot", "miniq", "paimon", "craft-agents", "minimax-code", "droid",
|
||||
"qoder", "qoder-cn", "grok", "atomcode", "cline", "snow", "tuanjie-cowork"}
|
||||
"qoder", "qoder-cn", "grok", "atomcode", "cline", "snow", "tuanjie-cowork", "open-code-review"}
|
||||
for _, id := range ids {
|
||||
t.Run(id, func(t *testing.T) {
|
||||
if id == "aside" {
|
||||
|
||||
@@ -0,0 +1,249 @@
|
||||
package agent
|
||||
|
||||
// Open Code Review (github.com/alibaba/open-code-review, npm
|
||||
// @alibaba-group/open-code-review) is a Go CLI, `ocr`, that reviews a
|
||||
// diff with a model; its plugins for Claude Code, Codex, Cursor, Kimi Code
|
||||
// and OpenCode, and its skills, all run that same command. It keeps its
|
||||
// settings in ~/.opencodereview/config.json (os.UserHomeDir, no variable
|
||||
// moves it): `provider` names the entry in use, from `providers` (its
|
||||
// presets: anthropic, openai, deepseek, …) or `custom_providers` (any
|
||||
// other name), and `model` the model, the entry's own `model` winning
|
||||
// (internal/llm/resolver.go tryProviderConfig). A custom entry needs a
|
||||
// protocol, a url and a key of its own: no variable stands in for it.
|
||||
//
|
||||
// magpie adds the custom provider "magpie": the openai protocol, which
|
||||
// posts Chat Completions to url + "/chat/completions", the gateway's /v1,
|
||||
// a key naming Open Code Review, and the model picked, which goes to the
|
||||
// gateway as it is, for it to resolve. provider is pointed at it; the
|
||||
// provider and model the user had are stashed and put back when magpie
|
||||
// steps out. Requests carry a User-Agent of open-code-review/<version>,
|
||||
// which the gateway counts as this agent's. ocr reads the file on every
|
||||
// run, so a change needs no restart.
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/tidwall/gjson"
|
||||
|
||||
"github.com/yetone/magpie/internal/edit"
|
||||
)
|
||||
|
||||
const ocrID = "open-code-review"
|
||||
|
||||
// ocrEntry is the key path of magpie's custom provider in config.json.
|
||||
var ocrEntry = "custom_providers." + magpieID
|
||||
|
||||
func ocr(home string) *Agent { return ocrIn(here(home)) }
|
||||
|
||||
// ocrIn is Open Code Review at a place.
|
||||
func ocrIn(at place) *Agent {
|
||||
dir := at.join(".opencodereview")
|
||||
path := filepath.Join(dir, "config.json")
|
||||
key := ocrID + ":" + path
|
||||
get := func(k string) string { v, _ := edit.GetJSON(path, k); return v }
|
||||
// section is where OCR keeps the entry of a provider of the user's
|
||||
// own: "providers" or "custom_providers"; "" when it has none.
|
||||
section := func(p string) string {
|
||||
for _, s := range []string{"providers", "custom_providers"} {
|
||||
if r, ok := edit.GetJSONRaw(path, s+"."+gjson.Escape(p)); ok && strings.HasPrefix(strings.TrimSpace(r), "{") {
|
||||
return s
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
// model is the model OCR sends for provider p: its entry's, which
|
||||
// wins, else the top-level one.
|
||||
model := func(p string) string {
|
||||
if s := section(p); s != "" {
|
||||
if m := get(s + "." + gjson.Escape(p) + ".model"); m != "" {
|
||||
return m
|
||||
}
|
||||
}
|
||||
return get("model")
|
||||
}
|
||||
cur := func() string {
|
||||
p := get("provider")
|
||||
if p == "" {
|
||||
return ""
|
||||
}
|
||||
m := model(p)
|
||||
if m == "" {
|
||||
return p
|
||||
}
|
||||
return p + "/" + m
|
||||
}
|
||||
writeMagpie := func(ref string) error {
|
||||
kvs := []edit.KV{
|
||||
{Path: ocrEntry + ".protocol", Value: "openai"},
|
||||
{Path: ocrEntry + ".url", Value: at.v1()},
|
||||
{Path: ocrEntry + ".api_key", Value: agentKeyAt(ocrID, at.gw())},
|
||||
}
|
||||
if ref != "" {
|
||||
kvs = append(kvs, edit.KV{Path: ocrEntry + ".model", Value: ref})
|
||||
}
|
||||
return edit.SetJSON(path, kvs...)
|
||||
}
|
||||
// setOwn makes provider/model of the user's own the one in use, as
|
||||
// `ocr config model` does: the top-level model and the entry's.
|
||||
setOwn := func(v string) error {
|
||||
p, m, _ := strings.Cut(v, "/")
|
||||
s := section(p)
|
||||
if p == magpieID || s == "" {
|
||||
return fmt.Errorf("Open Code Review has no provider %q set up; add it with `ocr config provider` first", p)
|
||||
}
|
||||
kvs := []edit.KV{{Path: "provider", Value: p}}
|
||||
if m != "" {
|
||||
kvs = append(kvs, edit.KV{Path: "model", Value: m}, edit.KV{Path: s + "." + gjson.Escape(p) + ".model", Value: m})
|
||||
}
|
||||
return edit.SetJSON(path, kvs...)
|
||||
}
|
||||
leave := func() error {
|
||||
forget(key+":provider", key+":model")
|
||||
if err := edit.DelJSON(path, ocrEntry); err != nil {
|
||||
return err
|
||||
}
|
||||
// custom_providers made for magpie's alone goes with it
|
||||
if r, ok := edit.GetJSONRaw(path, "custom_providers"); ok && strings.Join(strings.Fields(r), "") == "{}" {
|
||||
return edit.DelJSON(path, "custom_providers")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
return atomic(&Agent{
|
||||
ID: ocrID, Name: "Open Code Review", Icon: ocrID, Spelled: prefixed, NoNames: true,
|
||||
UA: []string{ocrID},
|
||||
// `ocr` is other programs' name too: only one under a folder
|
||||
// named for it (npm's) is taken for it; one the install script put
|
||||
// in /usr/local/bin is known by its folder
|
||||
Bin: "ocr", binNot: ocrNotOurs,
|
||||
Dir: dir, Path: path,
|
||||
Sync: func() error {
|
||||
if _, ok := edit.GetJSONRaw(path, ocrEntry); !ok {
|
||||
return nil
|
||||
}
|
||||
return writeMagpie("")
|
||||
},
|
||||
Check: func() string {
|
||||
if get("provider") != magpieID {
|
||||
return ""
|
||||
}
|
||||
if _, ok := edit.GetJSONRaw(path, ocrEntry); !ok {
|
||||
return "Open Code Review's " + ocrEntry + " (config.json) is gone, so it no longer reaches magpie"
|
||||
}
|
||||
return wiringOff("Open Code Review", path, func(f string) (string, bool) { return edit.GetJSON(path, ocrEntry+"."+f) },
|
||||
"url", at.v1(), "api_key", agentKeyAt(ocrID, at.gw()))
|
||||
},
|
||||
Fields: []Field{{
|
||||
Key: "model", Label: "model",
|
||||
Get: func() string {
|
||||
if get("provider") != magpieID {
|
||||
return cur()
|
||||
}
|
||||
m := get(ocrEntry + ".model")
|
||||
if m == "" {
|
||||
m = get("model")
|
||||
}
|
||||
return magpieID + "/" + m
|
||||
},
|
||||
Set: func(v string) error {
|
||||
onMagpie := get("provider") == magpieID
|
||||
if ref, ok := strings.CutPrefix(v, magpieID+"/"); ok && isMagpie(ref) {
|
||||
if !onMagpie {
|
||||
stash(map[string]string{
|
||||
key + ":provider": get("provider"),
|
||||
key + ":model": get("model"),
|
||||
})
|
||||
}
|
||||
if err := writeMagpie(ref); err != nil {
|
||||
return err
|
||||
}
|
||||
return edit.SetJSON(path, edit.KV{Path: "provider", Value: magpieID})
|
||||
}
|
||||
if v != "" {
|
||||
if err := setOwn(v); err != nil {
|
||||
return err
|
||||
}
|
||||
if onMagpie {
|
||||
return leave()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
if !onMagpie {
|
||||
return edit.DelJSON(path, "provider", "model")
|
||||
}
|
||||
// magpie was in use: the provider and model the user had
|
||||
// come back, where OCR still has the provider
|
||||
saved := stashLoad()
|
||||
p, m := saved[key+":provider"], saved[key+":model"]
|
||||
if p != "" && p != magpieID && section(p) != "" {
|
||||
if err := edit.SetJSON(path, edit.KV{Path: "provider", Value: p}); err != nil {
|
||||
return err
|
||||
}
|
||||
} else if err := edit.DelJSON(path, "provider"); err != nil {
|
||||
return err
|
||||
}
|
||||
if m != "" {
|
||||
if err := edit.SetJSON(path, edit.KV{Path: "model", Value: m}); err != nil {
|
||||
return err
|
||||
}
|
||||
} else if err := edit.DelJSON(path, "model"); err != nil {
|
||||
return err
|
||||
}
|
||||
return leave()
|
||||
},
|
||||
Options: func(c map[string]string) []Option {
|
||||
return withVia(ocrOwnModels(path, c["model"]), ocrID, magpieID+"/")
|
||||
},
|
||||
}},
|
||||
})
|
||||
}
|
||||
|
||||
// ocrNotOurs turns away an `ocr` command that isn't Open Code Review's:
|
||||
// one under no folder named for it.
|
||||
func ocrNotOurs(bin string) bool {
|
||||
for _, p := range []string{bin, evalLink(bin)} {
|
||||
s := strings.ToLower(filepath.ToSlash(p))
|
||||
if strings.Contains(s, "open-code-review") || strings.Contains(s, "opencodereview") {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// ocrOwnModels is the provider/model pairs OCR's config.json sets up of
|
||||
// the user's own: each entry's model and models, and the one in use.
|
||||
func ocrOwnModels(path, cur string) []Option {
|
||||
seen := map[string]bool{}
|
||||
var vals []string
|
||||
add := func(v string) {
|
||||
if v == "" || seen[v] || strings.HasPrefix(v, magpieID+"/") || v == magpieID {
|
||||
return
|
||||
}
|
||||
seen[v] = true
|
||||
vals = append(vals, v)
|
||||
}
|
||||
add(cur)
|
||||
if raw, err := edit.Read(path); err == nil {
|
||||
for _, s := range []string{"providers", "custom_providers"} {
|
||||
gjson.GetBytes(raw, gjson.Escape(s)).ForEach(func(k, e gjson.Result) bool {
|
||||
p := k.String()
|
||||
if p == magpieID || !e.IsObject() {
|
||||
return true
|
||||
}
|
||||
if m := e.Get("model").String(); m != "" {
|
||||
add(p + "/" + m)
|
||||
}
|
||||
for _, m := range e.Get("models").Array() {
|
||||
if m.String() != "" {
|
||||
add(p + "/" + m.String())
|
||||
}
|
||||
}
|
||||
return true
|
||||
})
|
||||
}
|
||||
}
|
||||
sort.Strings(vals)
|
||||
return static(vals...)
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"slices"
|
||||
"testing"
|
||||
|
||||
"github.com/yetone/magpie/internal/edit"
|
||||
"github.com/yetone/magpie/internal/gateway"
|
||||
"github.com/yetone/magpie/internal/provider"
|
||||
)
|
||||
|
||||
// ocrOwnConfig is a config.json as `ocr config provider` writes one: a
|
||||
// preset of the user's on a model of its own, and a setting beside it.
|
||||
const ocrOwnConfig = `{
|
||||
"provider": "anthropic",
|
||||
"model": "claude-sonnet-4-6",
|
||||
"language": "zh",
|
||||
"providers": {
|
||||
"anthropic": {"api_key": "sk-ant-own", "model": "claude-sonnet-4-6"}
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
// Picking a model of magpie's for Open Code Review writes the custom
|
||||
// provider "magpie" (openai protocol, the gateway's /v1, a key naming
|
||||
// it, the model) and points provider at it; going back puts the user's
|
||||
// own provider and model back and takes magpie's entry out.
|
||||
func TestOCRWiring(t *testing.T) {
|
||||
syncHome(t)
|
||||
if err := provider.Save(provider.Provider{ID: "fake", Name: "Fake", Key: "k", Chat: "http://127.0.0.1:1/v1", Models: []string{"m1", "m2"}}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
a, err := Find(ocrID)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
path := a.Path
|
||||
if filepath.Base(filepath.Dir(path)) != ".opencodereview" || filepath.Base(path) != "config.json" {
|
||||
t.Fatalf("path %s", path)
|
||||
}
|
||||
hanakoWrite(t, path, ocrOwnConfig, 0o600)
|
||||
if !a.Detected() {
|
||||
t.Fatal("~/.opencodereview doesn't count as Open Code Review there")
|
||||
}
|
||||
if v := a.Field("model").Get(); v != "anthropic/claude-sonnet-4-6" {
|
||||
t.Fatalf("own model reads %q", v)
|
||||
}
|
||||
if a.Wired() {
|
||||
t.Fatal("the user's own anthropic reads as magpie's")
|
||||
}
|
||||
opts := a.Field("model").Options(a.Values())
|
||||
if !slices.ContainsFunc(opts, func(o Option) bool { return o.Value == "anthropic/claude-sonnet-4-6" }) ||
|
||||
!slices.ContainsFunc(opts, func(o Option) bool { return o.Value == "magpie/fake/m1" }) {
|
||||
t.Fatalf("options: %+v", opts)
|
||||
}
|
||||
|
||||
if err := a.Apply("model", "magpie/fake/m1"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for k, want := range map[string]string{
|
||||
"provider": "magpie",
|
||||
"custom_providers.magpie.protocol": "openai",
|
||||
"custom_providers.magpie.url": gatewayV1(),
|
||||
"custom_providers.magpie.api_key": gateway.TokenFor(ocrID),
|
||||
"custom_providers.magpie.model": "fake/m1",
|
||||
"language": "zh",
|
||||
"providers.anthropic.api_key": "sk-ant-own",
|
||||
} {
|
||||
if v, _ := edit.GetJSON(path, k); v != want {
|
||||
b, _ := os.ReadFile(path)
|
||||
t.Fatalf("%s = %q, want %q in:\n%s", k, v, want, b)
|
||||
}
|
||||
}
|
||||
if v := a.Field("model").Get(); v != "magpie/fake/m1" {
|
||||
t.Fatalf("model reads %q", v)
|
||||
}
|
||||
if !a.Wired() {
|
||||
t.Fatalf("not connected after a pick: %v", a.Values())
|
||||
}
|
||||
if d := a.Drift(); d != nil {
|
||||
t.Fatalf("drift right after a set: %+v", d)
|
||||
}
|
||||
// another of magpie's models: the stash keeps the user's, not magpie's
|
||||
if err := a.Apply("model", "magpie/fake/m2"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if v, _ := edit.GetJSON(path, "custom_providers.magpie.model"); v != "fake/m2" {
|
||||
t.Fatalf("model %q", v)
|
||||
}
|
||||
|
||||
// the url changed by hand: magpie says so
|
||||
if err := edit.SetJSON(path, edit.KV{Path: "custom_providers.magpie.url", Value: "http://127.0.0.1:1/v1"}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if d := a.Drift(); d == nil {
|
||||
t.Fatal("a url that no longer reaches the gateway reads as fine")
|
||||
}
|
||||
if err := a.Apply("model", "magpie/fake/m2"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := a.Disconnect(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for k, want := range map[string]string{
|
||||
"provider": "anthropic",
|
||||
"model": "claude-sonnet-4-6",
|
||||
"language": "zh",
|
||||
} {
|
||||
if v, _ := edit.GetJSON(path, k); v != want {
|
||||
b, _ := os.ReadFile(path)
|
||||
t.Fatalf("after Disconnect %s = %q, want %q in:\n%s", k, v, want, b)
|
||||
}
|
||||
}
|
||||
if _, ok := edit.GetJSONRaw(path, "custom_providers"); ok {
|
||||
b, _ := os.ReadFile(path)
|
||||
t.Fatalf("magpie's entry, or the custom_providers made for it, left behind:\n%s", b)
|
||||
}
|
||||
if a.Wired() {
|
||||
t.Fatal("still connected after Disconnect")
|
||||
}
|
||||
}
|
||||
|
||||
// A model of the user's own picked while on magpie goes the way `ocr
|
||||
// config model` writes it, and magpie's entry goes; a provider OCR hasn't
|
||||
// set up is turned away rather than written as one it can't reach.
|
||||
func TestOCROwnPick(t *testing.T) {
|
||||
syncHome(t)
|
||||
if err := provider.Save(provider.Provider{ID: "fake", Name: "Fake", Key: "k", Chat: "http://127.0.0.1:1/v1", Models: []string{"m1"}}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
a, err := Find(ocrID)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
hanakoWrite(t, a.Path, ocrOwnConfig, 0o600)
|
||||
if err := a.Apply("model", "magpie/fake/m1"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := a.Apply("model", "anthropic/claude-opus-4-6"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for k, want := range map[string]string{
|
||||
"provider": "anthropic",
|
||||
"model": "claude-opus-4-6",
|
||||
"providers.anthropic.model": "claude-opus-4-6",
|
||||
} {
|
||||
if v, _ := edit.GetJSON(a.Path, k); v != want {
|
||||
t.Fatalf("%s = %q, want %q", k, v, want)
|
||||
}
|
||||
}
|
||||
if _, ok := edit.GetJSONRaw(a.Path, "custom_providers.magpie"); ok {
|
||||
t.Fatal("magpie's entry left behind")
|
||||
}
|
||||
if err := a.Apply("model", "nowhere/x"); err == nil {
|
||||
t.Fatal("a provider OCR hasn't set up was written")
|
||||
}
|
||||
}
|
||||
|
||||
// `ocr` names other programs too: only one under a folder named for Open
|
||||
// Code Review is its.
|
||||
func TestOCRNotOurs(t *testing.T) {
|
||||
for bin, ours := range map[string]bool{
|
||||
"/usr/local/lib/node_modules/@alibaba-group/open-code-review/bin/ocr": true,
|
||||
"/home/u/.opencodereview/bin/ocr": true,
|
||||
"/usr/bin/ocr": false,
|
||||
"/opt/homebrew/bin/ocr": false,
|
||||
} {
|
||||
if got := !ocrNotOurs(bin); got != ours {
|
||||
t.Errorf("%s: ours %v, want %v", bin, got, ours)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
func TestOwnProviderNamedAsMagpies(t *testing.T) {
|
||||
ids := []string{"agy", "opencode", "openchamber", "mimocode", "deveco", "pi", "aside", "omo", "prime-agent", "mu", "goose", "zed", "vscode",
|
||||
"crush", "dsh", "ds-bot", "commandcode", "fx", "omp", "hermes", "morph", "kimi", "empryo", "nanobot", "miniq", "paimon", "craft-agents", "minimax-code", "droid",
|
||||
"qoder", "qoder-cn", "grok", "atomcode", "cline", "snow", "qwenpaw"}
|
||||
"qoder", "qoder-cn", "grok", "atomcode", "cline", "snow", "qwenpaw", "open-code-review"}
|
||||
for _, id := range ids {
|
||||
t.Run(id, func(t *testing.T) {
|
||||
if id == "aside" {
|
||||
@@ -35,6 +35,11 @@ func TestOwnProviderNamedAsMagpies(t *testing.T) {
|
||||
// Craft's own config, with a connection of the user's
|
||||
hanakoWrite(t, a.Path, craftUser, 0o644)
|
||||
}
|
||||
if id == "open-code-review" {
|
||||
// a custom provider of the user's own, for its own model
|
||||
// to be on
|
||||
hanakoWrite(t, a.Path, `{"custom_providers":{"relay":{"protocol":"openai","url":"https://relay.example/v1","api_key":"sk-own"}}}`, 0o600)
|
||||
}
|
||||
if id == "cline" {
|
||||
// a model of OpenRouter's, the provider Cline is on
|
||||
hanakoWrite(t, a.Path, `{"version":1,"modes":{},"providers":{},"lastUsedProvider":"openrouter"}`, 0o600)
|
||||
|
||||
@@ -27,6 +27,8 @@ func TestAgentOf(t *testing.T) {
|
||||
"HanaAgent/1.0": "hanako",
|
||||
"hanako": "hanako", // its key
|
||||
"atomcode/5.2.1": "atomcode",
|
||||
"open-code-review/1.13.10": "open-code-review",
|
||||
"open-code-review/1.13.10 | claude": "open-code-review",
|
||||
"cline ai-sdk/openai-compatible/3.0.37": "cline",
|
||||
"Vibecoding Client/1.3.104 (darwin; arm64; go1.26.2)": "mothx",
|
||||
"ZooCode/3.90.0": "zoo-code",
|
||||
|
||||
@@ -757,6 +757,11 @@ var wslKinds = []wslKind{
|
||||
return withVia(atomcodeOwnModels("", cur["model"]), "atomcode", magpieID+"/")
|
||||
}
|
||||
}},
|
||||
// Open Code Review's ~/.opencodereview: no bin, as `ocr` is other
|
||||
// programs' name too; ocr reads its config on every run. A stopped
|
||||
// distro's config.json is looked at once it is started
|
||||
{id: ocrID, name: "Open Code Review", dir: ".opencodereview", in: ocrIn,
|
||||
asleep: wslOwnAsleep(ocrID, "model")},
|
||||
// Snow CLI's ~/.snow, its profiles the distro's own; a stopped
|
||||
// distro's are looked at once it is started
|
||||
{id: "snow", name: "Snow CLI", dir: ".snow", bin: "snow", in: snowIn,
|
||||
|
||||
@@ -39,6 +39,7 @@ var wslMore = []struct {
|
||||
{"codebuddy", ".codebuddy/models.json", "/v1/chat/completions"},
|
||||
{"cline", ".cline/data/settings/providers.json", "/v1"},
|
||||
{"atomcode", ".atomcode/config.toml", "/v1"},
|
||||
{"open-code-review", ".opencodereview/config.json", "/v1"},
|
||||
{"snow", ".snow/profiles/magpie.json", "/v1"},
|
||||
{"goose", ".config/goose/custom_providers/magpie.json", "/v1"},
|
||||
{"mothx", ".mothx/settings.json", "/v1"},
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" version="1.1" width="64" height="64" viewBox="0 0 64 64"><path d="M16.011564254260254,24.651044499999998C14.199108154260253,26.0486085,12.604812654260254,27.6949085,11.290275574260255,29.5567475C11.202753064260254,29.6807115,10.984476089260253,29.5737765,11.051337242260255,29.4375555C12.365951554260254,26.7591665,14.005819354260254,24.3629835,15.886684454260255,22.313341100000002L15.886684454260255,14.091053C15.886684454260255,13.28568935,16.539560354260253,12.6328125,17.344924954260254,12.6328125L46.644013054260256,12.6328125C47.449376054260256,12.6328125,48.10225405426026,13.28568935,48.10225405426026,14.091054L48.10225405426026,24.7461315C43.604340054260255,21.2891407,37.94170905426026,19.4149723,31.994634054260253,19.4149723C26.104784054260254,19.4149723,20.491794554260252,21.2537956,16.011564254260254,24.651044499999998ZM31.994557054260255,36.8882445C35.14015305426025,36.8882445,37.690160054260254,34.3323665,37.690160054260254,31.1795235C37.690160054260254,30.5937725,37.60022405426025,30.0115585,37.423505054260254,29.4532315C36.96355905426026,30.4290525,35.98299105426025,31.0517195,34.906236054260255,31.0517195C33.36864905426025,31.0517195,32.122189054260254,29.8023895,32.122189054260254,28.2612605C32.122189054260254,27.1816535,32.74318005426025,26.199264499999998,33.71711105426026,25.738142500000002C33.160027054260254,25.5609745,32.57901505426025,25.4708005,31.994557054260255,25.4708005C28.848966054260252,25.4708005,26.298958054260254,28.026681500000002,26.298958054260254,31.1795235C26.298958054260254,34.3323665,28.848966054260252,36.8882445,31.994557054260255,36.8882445ZM47.15295105426026,40.7200085C49.430203054260254,38.5980795,51.40581205426025,36.0023425,52.94698805426025,33.029174499999996C53.01721305426025,32.8936925,52.805627054260256,32.7626725,52.716546054260256,32.8865775C51.36659305426026,34.7642635,49.73017205426025,36.4189305,47.87169405426025,37.8158765C47.87339505426026,37.8053205,47.87509205426026,37.7947615,47.87677505426026,37.7842025C43.46611505426026,41.092453500000005,37.971620054260256,42.9006615,32.199830054260254,42.9434055C32.19153705426025,42.9434665,32.18324405426026,42.9435235,32.174951054260255,42.9435765C32.11482705426025,42.943946499999996,32.054662054260255,42.9441415,31.994454054260252,42.9441415C26.150606054260255,42.9441185,20.577615754260254,41.1334415,16.112119654260255,37.7839245C17.329820654260253,45.4193075,23.367437054260254,51.7093845,31.457871054260252,54.2405735C31.808347054260253,54.3502275,32.18059205426025,54.3502275,32.53106805426025,54.2405775C39.557904054260256,52.0421445,45.03618705426025,47.0081745,47.15295105426026,40.7200085Z" fill-rule="evenodd" fill="#2BDE5E"/></svg>
|
||||
|
After Width: | Height: | Size: 2.7 KiB |
@@ -209,6 +209,7 @@
|
||||
<tr><td>Claude Code</td><td><code>~/.claude/settings.json</code>:<code>env</code> ブロック内の <code>ANTHROPIC_BASE_URL</code>、<code>ANTHROPIC_AUTH_TOKEN</code> とモデル関連の変数</td></tr>
|
||||
<tr><td>Codex</td><td><code>~/.codex/config.toml</code>:<code>[model_providers.magpie]</code> テーブルとモデル、一覧は <code>magpie-models.json</code>。ChatGPT のサインインには手を加えません</td></tr>
|
||||
<tr><td>OpenCode、MiMo Code、DevEco Code、Pi、Crush</td><td><code>magpie</code> プロバイダのエントリと <code>magpie/provider/model</code></td></tr>
|
||||
<tr><td>Open Code Review</td><td><code>~/.opencodereview/config.json</code>:<code>magpie</code> カスタムプロバイダを追加し、<code>ocr</code> が使うものに設定</td></tr>
|
||||
<tr><td>AtomCode</td><td><code>~/.atomcode/config.toml</code>:<code>magpie</code> プロバイダアカウントと、カタログ内の各モデルのエントリ</td></tr>
|
||||
<tr><td>Snow CLI</td><td><code>~/.snow/profiles/magpie.json</code>:<code>magpie</code> プロファイルを作り、使用中のプロファイルにする(Snow App は「Sync Snow CLI API config」で取り込む)</td></tr>
|
||||
<tr><td>QwenPaw</td><td><code>~/.qwenpaw.secret/providers/custom/magpie.json</code> の <code>magpie</code> プロバイダーと、各エージェントの <code>agent.json</code> の <code>active_model</code>。初回の接続後に QwenPaw を再起動</td></tr>
|
||||
|
||||
@@ -209,6 +209,7 @@
|
||||
<tr><td>Claude Code</td><td><code>~/.claude/settings.json</code>: <code>ANTHROPIC_BASE_URL</code>, <code>ANTHROPIC_AUTH_TOKEN</code> and the model variables in its <code>env</code> block</td></tr>
|
||||
<tr><td>Codex</td><td><code>~/.codex/config.toml</code>: a <code>[model_providers.magpie]</code> table and the model, with the list in <code>magpie-models.json</code>. Your ChatGPT sign-in is left alone</td></tr>
|
||||
<tr><td>OpenCode, MiMo Code, DevEco Code, Pi, Crush</td><td>A <code>magpie</code> provider entry, and <code>magpie/provider/model</code></td></tr>
|
||||
<tr><td>Open Code Review</td><td><code>~/.opencodereview/config.json</code>: a <code>magpie</code> custom provider, made the one <code>ocr</code> uses</td></tr>
|
||||
<tr><td>AtomCode</td><td><code>~/.atomcode/config.toml</code>: a <code>magpie</code> provider account and one model entry per catalog model</td></tr>
|
||||
<tr><td>Snow CLI</td><td><code>~/.snow/profiles/magpie.json</code>: a <code>magpie</code> profile, made the active one (Snow App takes it in with "Sync Snow CLI API config")</td></tr>
|
||||
<tr><td>QwenPaw</td><td>A <code>magpie</code> provider in <code>~/.qwenpaw.secret/providers/custom/magpie.json</code>, and each agent's <code>active_model</code> in its <code>agent.json</code>. Restart QwenPaw after the first connect</td></tr>
|
||||
|
||||
@@ -209,6 +209,7 @@
|
||||
<tr><td>Claude Code</td><td><code>~/.claude/settings.json</code>:<code>env</code> 里的 <code>ANTHROPIC_BASE_URL</code>、<code>ANTHROPIC_AUTH_TOKEN</code> 和模型变量</td></tr>
|
||||
<tr><td>Codex</td><td><code>~/.codex/config.toml</code>:一个 <code>[model_providers.magpie]</code> 表和模型,模型列表写在 <code>magpie-models.json</code>。你的 ChatGPT 登录不受影响</td></tr>
|
||||
<tr><td>OpenCode、MiMo Code、DevEco Code、Pi、Crush</td><td>一个 <code>magpie</code> 供应商条目,以及 <code>magpie/provider/model</code></td></tr>
|
||||
<tr><td>Open Code Review</td><td><code>~/.opencodereview/config.json</code>:一个 <code>magpie</code> 自定义供应商,设为 <code>ocr</code> 使用的那个</td></tr>
|
||||
<tr><td>AtomCode</td><td><code>~/.atomcode/config.toml</code>:一个 <code>magpie</code> 供应商账号,以及目录中每个模型各自的条目</td></tr>
|
||||
<tr><td>Snow CLI</td><td><code>~/.snow/profiles/magpie.json</code>:一个 <code>magpie</code> 配置文件,并设为当前配置(Snow App 用“同步 Snow CLI API 配置”导入)</td></tr>
|
||||
<tr><td>QwenPaw</td><td><code>~/.qwenpaw.secret/providers/custom/magpie.json</code> 中的 <code>magpie</code> 提供商,以及每个智能体 <code>agent.json</code> 里的 <code>active_model</code>。首次连接后需重启 QwenPaw</td></tr>
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" version="1.1" width="64" height="64" viewBox="0 0 64 64"><path d="M16.011564254260254,24.651044499999998C14.199108154260253,26.0486085,12.604812654260254,27.6949085,11.290275574260255,29.5567475C11.202753064260254,29.6807115,10.984476089260253,29.5737765,11.051337242260255,29.4375555C12.365951554260254,26.7591665,14.005819354260254,24.3629835,15.886684454260255,22.313341100000002L15.886684454260255,14.091053C15.886684454260255,13.28568935,16.539560354260253,12.6328125,17.344924954260254,12.6328125L46.644013054260256,12.6328125C47.449376054260256,12.6328125,48.10225405426026,13.28568935,48.10225405426026,14.091054L48.10225405426026,24.7461315C43.604340054260255,21.2891407,37.94170905426026,19.4149723,31.994634054260253,19.4149723C26.104784054260254,19.4149723,20.491794554260252,21.2537956,16.011564254260254,24.651044499999998ZM31.994557054260255,36.8882445C35.14015305426025,36.8882445,37.690160054260254,34.3323665,37.690160054260254,31.1795235C37.690160054260254,30.5937725,37.60022405426025,30.0115585,37.423505054260254,29.4532315C36.96355905426026,30.4290525,35.98299105426025,31.0517195,34.906236054260255,31.0517195C33.36864905426025,31.0517195,32.122189054260254,29.8023895,32.122189054260254,28.2612605C32.122189054260254,27.1816535,32.74318005426025,26.199264499999998,33.71711105426026,25.738142500000002C33.160027054260254,25.5609745,32.57901505426025,25.4708005,31.994557054260255,25.4708005C28.848966054260252,25.4708005,26.298958054260254,28.026681500000002,26.298958054260254,31.1795235C26.298958054260254,34.3323665,28.848966054260252,36.8882445,31.994557054260255,36.8882445ZM47.15295105426026,40.7200085C49.430203054260254,38.5980795,51.40581205426025,36.0023425,52.94698805426025,33.029174499999996C53.01721305426025,32.8936925,52.805627054260256,32.7626725,52.716546054260256,32.8865775C51.36659305426026,34.7642635,49.73017205426025,36.4189305,47.87169405426025,37.8158765C47.87339505426026,37.8053205,47.87509205426026,37.7947615,47.87677505426026,37.7842025C43.46611505426026,41.092453500000005,37.971620054260256,42.9006615,32.199830054260254,42.9434055C32.19153705426025,42.9434665,32.18324405426026,42.9435235,32.174951054260255,42.9435765C32.11482705426025,42.943946499999996,32.054662054260255,42.9441415,31.994454054260252,42.9441415C26.150606054260255,42.9441185,20.577615754260254,41.1334415,16.112119654260255,37.7839245C17.329820654260253,45.4193075,23.367437054260254,51.7093845,31.457871054260252,54.2405735C31.808347054260253,54.3502275,32.18059205426025,54.3502275,32.53106805426025,54.2405775C39.557904054260256,52.0421445,45.03618705426025,47.0081745,47.15295105426026,40.7200085Z" fill-rule="evenodd" fill="#2BDE5E"/></svg>
|
||||
|
After Width: | Height: | Size: 2.7 KiB |
@@ -539,6 +539,7 @@ footer a:hover { color: var(--ink); }
|
||||
<li><img src="/icons/zcode.png" alt="">ZCode</li>
|
||||
<li><img src="/icons/hanako.png" alt="">OpenHanako</li>
|
||||
<li><img src="/icons/atomcode.png" alt="">AtomCode</li>
|
||||
<li><img src="/icons/open-code-review.svg" alt="">Open Code Review</li>
|
||||
<li><img src="/icons/snow.png" alt="">Snow CLI</li>
|
||||
<li><img src="/icons/qwenpaw.svg" alt="">QwenPaw</li>
|
||||
<li><img src="/icons/alma.png" alt="">Alma</li>
|
||||
|
||||
Reference in New Issue
Block a user