agent: OpenPencil uses magpie's models (@JC_be_better on X)

OpenPencil (ZSeven-W/openpencil, the openpencil-desktop app) keeps the
builtin agents its chat runs on in settings.json under Rust's
dirs::config_dir()/openpencil (read from its settings_io.rs and
settings_payload.rs). magpie adds one builtin_agents entry, id "magpie",
kind openai-compat at the gateway's /v1 with the magpie-openpencil key,
preset custom, the picked models as OpenPencil writes a list: the first
as `model`, `models` only for two or more, at most 64. The user's other
entries and settings stay, and so do the display_name and enabled they
give magpie's entry; a sync with nothing to change doesn't write. A file
magpie makes gets "version": 1 (OpenPencil sets a file without it aside
as corrupt); a file with another version, or none, is left alone.
Disconnect takes the entry out, and the file when nothing else is left.
OpenPencil reads the file once at start and writes it all back when it
quits, so a change is refused while openpencil-desktop runs (Windows
can't be asked, so the notice says to quit it first). Notice translated
in zh-CN, zh-TW, ja and de. README (en, zh-CN), docs/reference.md and
docs/subsystems/agent-wiring.md list it.

open-pencil/open-pencil, the other app of the name, keeps its providers
in its webview's localStorage, so it gets no row.

Run, under a scratchpad HOME with GOCACHE/GOMODCACHE pinned:
- go test -p 2 -tags nogui -count=1 -timeout 45m ./...: ok, 66 packages
  ok, 18 with no test files
- gofmt -l: clean; GOOS=linux and GOOS=windows go vet -tags nogui ./...: clean
- go test ./internal/agent -run '^TestOpenPencil': ok
- node --test agent-notice-lang, i18n-keys, header-relang (Chromium and
  WebKit, every language, wide and narrow): 37/37 pass
Broken by hand, each went red: the running check, the 64 cap, the
version check, keeping the user's display_name, the no-op sync, and
writing the version into a new file.

Real use: OpenPencil v0.8.4 (latest release, arm64, sha256 checked against
its SHA256SUMS) under a sandbox HOME, started on a settings.json magpie
wrote with the user's own Anthropic entry beside it. It started and ran
15s with the file intact and no .corrupt copy. v0.8.4 has no `models`
field, so it lists only the first magpie model; main lists them all.

Not tried: a chat request through OpenPencil's UI; its exit save (it
didn't quit on an AppleEvent and was stopped with TERM, so the write-back
wasn't seen); Linux and Windows; a build of OpenPencil's main.
This commit is contained in:
yetone
2026-10-16 11:43:51 +08:00
parent 7597c13237
commit a15e576564
10 changed files with 732 additions and 14 deletions
+1 -1
View File
@@ -75,7 +75,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 · OpenCode · OpenChamber · MiMo Code · DevEco Code · Pi · oh-my-pi · StepCode · MothX · Aside · OmO · Prime Agent · Goose · Cursor CLI · Cursor Private Inference · Zed · VS Code Chat · VS Code Insiders · VSCodium Chat · JetBrains Air · Copilot (JetBrains) · Copilot CLI · Crush · DeepSeek Harness · Reasonix Studio · Command Code · fx · Devin · Hermes Agent · Mister Morph · Kimi Code · jcode · Qwen Code · Muse Code · Empryo · MiniMax Code · Droid · Cline · Qoder · Qoder CN · Grok Build · Grok App · ZCode · WorkBuddy · WorkBuddy AI · CodeBuddy Code · Pencil · Raycast · T3 Code · OpenHanako · AtomCode · Snow CLI · Alma · Cindy · Lody · Ante · AstrBot
Claude Code · Claude Desktop · Claude Science · Codex · Gemini CLI · Antigravity CLI · OpenCode · OpenChamber · MiMo Code · DevEco Code · Pi · oh-my-pi · StepCode · MothX · Aside · OmO · Prime Agent · Goose · Cursor CLI · Cursor Private Inference · Zed · VS Code Chat · VS Code Insiders · VSCodium Chat · JetBrains Air · Copilot (JetBrains) · Copilot CLI · Crush · DeepSeek Harness · Reasonix Studio · Command Code · fx · Devin · Hermes Agent · Mister Morph · Kimi Code · jcode · Qwen Code · Muse Code · Empryo · MiniMax Code · Droid · Cline · Qoder · Qoder CN · Grok Build · Grok App · ZCode · WorkBuddy · WorkBuddy AI · CodeBuddy Code · Pencil · OpenPencil · Raycast · T3 Code · OpenHanako · AtomCode · Snow CLI · Alma · Cindy · Lody · Ante · AstrBot
</td></tr>
</table>
+1 -1
View File
@@ -75,7 +75,7 @@ magpie 通过读取智能体的登录信息(Claude Code 和 Codex 的文件、
<table>
<tr><td>
Claude Code · Claude Desktop · Claude Science · Codex · Gemini CLI · Antigravity CLI · OpenCode · OpenChamber · MiMo Code · DevEco Code · Pi · oh-my-pi · StepCode · MothX · Aside · OmO · Prime Agent · Goose · Cursor CLI · Cursor Private Inference · Zed · VS Code Chat · VS Code Insiders · VSCodium Chat · JetBrains Air · Copilot (JetBrains) · Copilot CLI · Crush · DeepSeek Harness · Reasonix Studio · Command Code · fx · Devin · Hermes Agent · Mister Morph · Kimi Code · jcode · Qwen Code · Muse Code · Empryo · MiniMax Code · Droid · Cline · Qoder · Qoder CN · Grok Build · Grok App · ZCode · WorkBuddy · WorkBuddy AI · CodeBuddy Code · Pencil · Raycast · T3 Code · OpenHanako · AtomCode · Snow CLI · Alma · Cindy · Lody · Ante · AstrBot
Claude Code · Claude Desktop · Claude Science · Codex · Gemini CLI · Antigravity CLI · OpenCode · OpenChamber · MiMo Code · DevEco Code · Pi · oh-my-pi · StepCode · MothX · Aside · OmO · Prime Agent · Goose · Cursor CLI · Cursor Private Inference · Zed · VS Code Chat · VS Code Insiders · VSCodium Chat · JetBrains Air · Copilot (JetBrains) · Copilot CLI · Crush · DeepSeek Harness · Reasonix Studio · Command Code · fx · Devin · Hermes Agent · Mister Morph · Kimi Code · jcode · Qwen Code · Muse Code · Empryo · MiniMax Code · Droid · Cline · Qoder · Qoder CN · Grok Build · Grok App · ZCode · WorkBuddy · WorkBuddy AI · CodeBuddy Code · Pencil · OpenPencil · Raycast · T3 Code · OpenHanako · AtomCode · Snow CLI · Alma · Cindy · Lody · Ante · AstrBot
</td></tr>
</table>
+1
View File
@@ -140,6 +140,7 @@ line; agents connected to magpie lose it when it quits.
| WorkBuddy AI | `~/.workbuddy-ai/models.json` (the international build) | provider (magpie's models in WorkBuddy AI's picker) |
| CodeBuddy Code | `~/.codebuddy/models.json` (`$CODEBUDDY_CONFIG_DIR`), `settings.json` | model (magpie's models in its list; the session model) |
| Raycast | `~/.config/raycast/ai/providers.yaml` in the user's folder, on Mac and Windows | provider (a `magpie` entry in Raycast AI's Custom Providers, magpie's models in its model picker; Raycast Pro; the user's providers, `tools` and comments kept) |
| OpenPencil | `openpencil/settings.json` in the config folder: `~/Library/Application Support` (macOS), `$XDG_CONFIG_HOME` or `~/.config` (Linux), `%APPDATA%` (Windows) | provider (a `magpie` entry in its `builtin_agents`, magpie's models in its chat's model picker; the user's entries and settings kept; refused while OpenPencil runs, as it writes the file back when it quits) |
| T3 Code | `~/.t3/userdata/settings.json` (`$T3CODE_HOME/userdata`) | provider (a `magpie` provider instance on Claude Code, magpie's models as its custom models) |
| 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) |
+2
View File
@@ -60,6 +60,7 @@ something else shows up as drift.
- AstrBot keeps its providers in `data/cmd_config.json` under its root (`$ASTRBOT_ROOT`, else `~/.astrbot`, the desktop app's, else `~/astrbot`), written with a UTF-8 BOM, which magpie keeps (`astrbot` in [`astrbot.go`](../../internal/agent/astrbot.go)). magpie adds a `magpie` entry to `provider_sources` and one `magpie/<model>` entry per model to `provider`, keeps the user's own entries byte for byte and keeps what the user changes in magpie's (timeout, proxy, enable), and sets the default chat model (`agent_runner.config.model.provider_id`, or `provider_settings.default_provider_id` before the agent runner), putting back what it found there. A pick the user makes while magpie is wired is theirs and stands. The first connect copies the file to `cmd_config.json.before-magpie`. AstrBot reads the file only at start-up and its WebUI writes it back whole on save, so the agent's notice says to restart AstrBot before saving in the WebUI. A Docker install's root is inside its container, which magpie doesn't reach.
- jcode keeps its settings in `config.toml` in `$JCODE_HOME`, else `~/.jcode` (`jcode` in [`jcode.go`](../../internal/agent/jcode.go)). magpie adds a named profile, `[providers.magpie]`, as `jcode provider add` writes one: `type = "openai-compatible"`, the gateway's `/v1`, an inline `api_key` naming jcode (jcode sends nothing else that tells it apart) and `requires_api_key = true`, since jcode sends no key to a loopback URL without it. Its `models` list has one entry per model, with `context_window`, `input` and `reasoning` for a model with effort levels. A `reasoning_effort` the user set on one stays while the model has that level. The model jcode starts on is `[provider] default_provider = "magpie"` and `default_model`. What was there is stashed and put back on Disconnect. A model of jcode's own picked while it is on magpie takes magpie out. Each key is set alone, so the user's other keys and tables stay, and the `[[providers.magpie.models]]` tables jcode writes when it saves the file itself are replaced by the one list. A sync with nothing to change doesn't write. Disconnect drops the profile whole, its sub-tables included. jcode reads the file when it starts, so the notice says to restart open sessions.
- Raycast AI reads Custom Providers from `~/.config/raycast/ai/providers.yaml` in the user's folder, on Mac and Windows alike (`raycast` in [`raycast.go`](../../internal/agent/raycast.go); manual.raycast.com/ai/custom-providers). magpie adds one entry to its `providers` list, `id: magpie`, at the gateway's `/v1` with an `api_keys` alias holding a key that names Raycast (its User-Agent isn't known), and one model per catalog model with `context` and all five `abilities` said, since Raycast assumes tools and vision off when one isn't. The list is edited as a node (`EditYAMLNode`), so the user's other entries, the `tools` block (anchors too) and comments stay. A key the user adds to magpie's entry or to one of its models (`include_user_email`, a `description`) is kept on a sync (`mergeYAMLKept`), and a sync with nothing to change doesn't write. Disconnect takes the entry out, the list when it was the only one, and a file left with nothing in it. Raycast watches the file, so there is no restart notice. The model is picked in Raycast, so the field is whether magpie is in its picker (`ListsModels`). Detected by `Raycast.app` on a Mac or the `~/.config/raycast` folder.
- OpenPencil (ZSeven-W/openpencil, the `openpencil-desktop` app) keeps the builtin agents its chat runs on in `settings.json` in Rust's `dirs::config_dir()` joined with `openpencil`: `~/Library/Application Support/openpencil` on a Mac, `$XDG_CONFIG_HOME` or `~/.config` on Linux, `%APPDATA%` on Windows (`openPencil` in [`openpencil.go`](../../internal/agent/openpencil.go); its `settings_io.rs` and `settings_payload.rs`). magpie adds one entry to `builtin_agents`, `id: magpie`, `kind: openai-compat` at the gateway's `/v1` with a key naming OpenPencil (its User-Agent isn't known), `preset: custom`, the picked models as OpenPencil writes a list: the first as `model`, `models` only for two or more, at most 64 (v0.8.4 reads `model` alone). The user's other entries and settings stay, and so do the `display_name` and `enabled` they give magpie's entry; a sync with nothing to change doesn't write. OpenPencil needs `"version": 1` (a file without it is set aside as corrupt and saving stops), so magpie writes it in a file it makes and leaves a file with any other version, or none, alone. Disconnect takes the entry out, and the file when only the version and an empty list are left. OpenPencil reads the file once at start and writes it back whole when it quits, so a change is refused while `openpencil-desktop` runs (Windows can't be asked, so the notice says to quit it first). The model is picked in OpenPencil's chat, so the field is whether magpie is in its picker (`ListsModels`). Detected by its settings folder, `~/.openpencil` (its CLI's), `OpenPencil.app` (`com.zseven-w.openpencil`), or `%ProgramFiles%\OpenPencil`. open-pencil/open-pencil, the other app of the name, keeps its providers in its webview's localStorage, so it is not a row: it reaches magpie through Pi or an ACP agent magpie wires.
- DevEco Code (Huawei's OpenCode fork, #1885) is wired as OpenCode is (`deveco` in [`agents.go`](../../internal/agent/agents.go)): magpie's provider goes into the first of `deveco.jsonc`, `deveco.json` and `config.json` in `~/.config/deveco` (the one DevEco merges last, so the one that wins), or in `$DEVECO_CONFIG_DIR` when that is absolute, read after them. 0.2.3 sends `deveco/0.2.3 ai-sdk/…` to a provider of its config, but much of the OpenCode code it keeps still sends OpenCode's own User-Agent (`opencode/<version>`), so its provider's key is `magpie-deveco` (`openCodeKeyAt`), not the plain `magpie` OpenCode and MiMo Code send, and Check asks for that key. Its npm package has no Linux binary, so no install command is offered there (`cliSpec.only`).
- Grok App (RongleCat/grok-app, a desktop front end that starts Grok Build over ACP) keeps its provider channels in `agent-home/config.toml` under its data folder: `$GROK_APP_HOME`, else where its `directories` crate puts it, or its `~/.grok-app` fallback when that is the one there (`grokApp` in [`grokapp.go`](../../internal/agent/grokapp.go)). Its composer lists only Grok Build's official catalog, never the `[model."magpie/…"]` tables of Grok Build's row, so magpie adds itself as a channel, `[model.magpie]`, with the keys the App's Providers page writes: the gateway's `/v1`, a key naming Grok App, `api_backend = "chat_completions"`, `app_provider_mode = "generic"`, and `app_models`, a JSON list of magpie's models with `contextWindow`, `supportsVision` and their effort levels (no `none`; a default the user marks in the App stays, else medium). The picked model's `context_window` (a bare integer) and `supports_reasoning_effort` (a bare bool, Grok Build's gate for `--reasoning-effort`) are on the channel, as the App puts them there when a model is picked in its composer. `[models] default` is the route, and magpie does not set it: setting it to `"magpie"` makes the App drop its own sign-in (`ensure_independent_for_custom_route`). The route stays whatever the App had. Pressing Use on magpie under Accounts is what switches it. A magpie that already set the route puts the old one back once, on the next sync or connect (`grokAppReleased`); a Use after that stays. Disconnect drops only the channel, and puts the route back only when it is still `"magpie"`: the one stashed at connect, else the one `connect.was` holds. One of the App's own routes picked in magpie's model field is written as the route and takes magpie's channel out, as picking another provider does elsewhere. A sync with no channel and a route other than `"magpie"` writes nothing, magpie's stash included, and Check says so when the route is `"magpie"` with the channel gone. A model picked in the App's composer since is the user's and stays through a sync, and a sync with nothing to change doesn't write. Shared mode keeps `GROK_HOME` at `~/.grok` (Grok Build's library row). Independent mode, which Use turns on, reads agent-home: the Library writes `AGENTS.md`, `[mcp_servers]` in the same `config.toml`, and `skills/` there, and Grok App also reads `~/.agents/skills`. RTK has no Grok hook, so the Library lists Grok App with the switch off. The notice, while the App runs, says magpie is a custom provider in Settings › Account, a chat can pick its models in the model picker, and the App stays on its current route until Use.
- JSON/JSONC config edits and their previews reject malformed input rather than editing a partially parsed document. Object edits and VS Code's model-group array edits leave the original file untouched on a parse error; valid comments and trailing commas remain supported (`internal/edit`).
@@ -121,6 +122,7 @@ go test -tags nogui ./internal/agent -run '^TestAnte'
go test -tags nogui ./internal/agent -run '^TestAstrBot'
go test -tags nogui ./internal/agent -run '^TestJcode'
go test -tags nogui ./internal/agent -run '^TestRaycast'
go test -tags nogui ./internal/agent -run '^TestOpenPencil'
go test -tags nogui ./internal/agent -run '^TestGrokApp'
go test -tags nogui ./internal/agent -run 'ClaudeScience'
go test -tags nogui ./internal/gateway -run 'TestClaudeScience'
+1
View File
@@ -142,6 +142,7 @@ func builtins(home, cfg string) []*Agent {
workbuddyAI(home),
codebuddy(home),
pencil(home),
openPencil(home, cfg),
raycast(home),
t3code(home),
hanako(home),
+12 -11
View File
@@ -217,17 +217,18 @@ func TestPinnedGatewayKeyForEveryWriter(t *testing.T) {
agy = m[1]
}
return map[string]string{
"agy": agy,
"alma": almaKey(),
"cindy": cindy.Auth.APIKey,
"copilotjb": jbKey,
"cursor": cursorLocalEnv(gw)[cursorLocalVars[1]],
"hanako": hanakoProvider().APIKey,
"pencil": pencilProviderJSON(gw)["apiKey"].(string),
"vscode": vscodeStable.token(),
"vscodium": vscodiumKind.token(),
"workbuddy": buddyModel("codebuddy", "m", "m", 0, 0, false, nil)["apiKey"].(string),
"zcode": zc,
"agy": agy,
"alma": almaKey(),
"cindy": cindy.Auth.APIKey,
"copilotjb": jbKey,
"cursor": cursorLocalEnv(gw)[cursorLocalVars[1]],
"hanako": hanakoProvider().APIKey,
"openpencil": openPencilEntry(gw).APIKey,
"pencil": pencilProviderJSON(gw)["apiKey"].(string),
"vscode": vscodeStable.token(),
"vscodium": vscodiumKind.token(),
"workbuddy": buddyModel("codebuddy", "m", "m", 0, 0, false, nil)["apiKey"].(string),
"zcode": zc,
}
}
plain := keys()
+1 -1
View File
@@ -58,7 +58,7 @@ func TestEveryPickerOfMagpiesModelsCanBeNarrowed(t *testing.T) {
if len(bare) > 0 {
t.Errorf("magpie's models are put in these agents' pickers with no way to pick which: %v", bare)
}
for _, id := range []string{"zcode", "pencil", "t3code", "workbuddy", "workbuddy-ai", copilotJBID, CursorLocalID} {
for _, id := range []string{"zcode", "pencil", "openpencil", "t3code", "workbuddy", "workbuddy-ai", copilotJBID, CursorLocalID} {
if !slices.Contains(menus, id) {
t.Errorf("%s's row has no model list to pick in (ListsModels): %v", id, menus)
}
+315
View File
@@ -0,0 +1,315 @@
package agent
// OpenPencil (ZSeven-W/openpencil, the openpencil-desktop app; @JC_be_better
// on X) is a design canvas whose chat runs models through "builtin agents"
// of the user's own: an Anthropic or OpenAI-compatible endpoint, a key and
// a list of models, each listed in its chat's model picker. It keeps them
// in one settings.json in the platform's config folder, dirs::config_dir()
// joined with openpencil: ~/Library/Application Support/openpencil on a
// Mac, $XDG_CONFIG_HOME/openpencil (~/.config/openpencil) on Linux,
// %APPDATA%\openpencil on Windows (op-editor-host-core's settings_io.rs,
// settings_path). Its fields (SettingsPayload, BuiltinAgentPayload,
// settings_payload.rs, main at 40902a3f and v0.8.4):
//
// {"version":1, …,
// "builtin_agents":[{"id":"magpie","preset":"custom","display_name":"magpie",
// "kind":"openai-compat","api_key":"magpie-openpencil",
// "model":"<first model>","models":["<model>",…],
// "base_url":"http://127.0.0.1:3425/v1","enabled":true}], …}
//
// version is required (no serde default): a file without it fails to parse,
// is set aside as settings.json.corrupt-<time>, and OpenPencil then refuses
// to save at all; a version other than 1 has the whole file ignored. So
// magpie writes version 1 in a file it makes, and leaves alone a file whose
// version it doesn't know. kind openai-compat posts to base_url +
// /chat/completions, so base_url is the gateway's /v1. models is the list
// (at most 64, written only when there are two or more, the first again as
// model); v0.8.4 knows only model and reads past models, so it lists the
// first model alone.
//
// OpenPencil reads the file once, when it starts, and writes the whole of
// it back from what it holds when a setting changes and when it quits
// (app_handler.rs, settings_io::save). A change magpie makes while it runs
// is written over when it quits, so magpie refuses one then, where it can
// tell (Running can't on Windows, where the notice says so instead).
//
// The model is picked in OpenPencil's own chat picker
// (builtin:magpie:<model>), not in a file, so what magpie sets is whether
// its models are in that picker: one entry of builtin_agents, id magpie
// (OpenPencil numbers its own builtin-N, and reads a picker value up to its
// second colon). The user's other entries and settings stay, and so do the
// name and the on/off they give magpie's entry in OpenPencil's settings.
// Its User-Agent isn't known, so its requests are told apart by their key.
//
// open-pencil/open-pencil, the other app of the name, keeps its providers in
// its webview's localStorage, no file magpie can write: it reaches magpie
// through an agent magpie wires (Pi, an ACP agent) or a base URL typed in.
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"os"
"path/filepath"
"runtime"
"github.com/tidwall/gjson"
"github.com/yetone/magpie/internal/appdir"
"github.com/yetone/magpie/internal/edit"
"github.com/yetone/magpie/internal/gateway"
)
// openPencilApp is OpenPencil's macOS bundle, as its release builds it
// (scripts/bundle-macos.sh).
var openPencilApp = desktopApp{id: "com.zseven-w.openpencil", names: []string{"OpenPencil.app"}}
// openPencilMaxModels is how many models OpenPencil keeps for one entry
// (MAX_BUILTIN_AGENT_MODELS); it drops the rest when it next saves.
const openPencilMaxModels = 64
// openPencilProc is OpenPencil's process, its binary's name on every system
// (the .app's CFBundleExecutable, the .deb's and AppImage's, the .exe).
var openPencilProc = []string{`(^|/)openpencil-desktop( |$)`}
var noticeOpenPencil = newNotice("OpenPencil reads its settings when it starts and writes them all back when it quits — quit OpenPencil before changing this, then open it and pick a magpie model in its chat's model picker.")
// errOpenPencilRunning is a change refused while OpenPencil runs.
var errOpenPencilRunning = errors.New("OpenPencil writes its settings back when it quits, over what magpie writes now: quit OpenPencil, then try again")
func openPencil(home, cfg string) *Agent {
dir := openPencilDir(home, cfg)
path := filepath.Join(dir, "settings.json")
write := func(on bool) error {
if !on {
return openPencilUnwire(path)
}
return openPencilWire(path, openPencilEntry(gateway.URL()))
}
return atomic(&Agent{
ID: "openpencil", Name: "OpenPencil", Icon: "generic", Aliases: []string{"open-pencil", "openpencil-desktop"},
Dir: dir, Path: path,
// its settings folder once it has run, ~/.openpencil once its op
// CLI or MCP server has, else its app. No command: op is its CLI's
// name, and other tools' too
detect: func() bool {
return isDir(dir) || isDir(filepath.Join(home, ".openpencil")) || macBundle(openPencilApp) || openPencilWindowsApp()
},
Notice: func() string {
if openPencilWired(path) && Running(openPencilProc...) {
return noticeOpenPencil.String()
}
return ""
},
// a sync while it runs is written as well: a quit puts back what it
// read, and the next sync puts magpie's models back again
Sync: func() error {
if !openPencilWired(path) {
return nil
}
return write(true)
},
// its picker lists the models picked for it (#1508)
ListsModels: true,
Fields: []Field{{
Key: "provider", Label: "provider",
Get: func() string {
if openPencilWired(path) {
return magpieID
}
return ""
},
Set: func(v string) error {
if openPencilRunning() {
return errOpenPencilRunning
}
return write(v != "")
},
Options: func(map[string]string) []Option {
return []Option{{Value: magpieID, Label: "magpie", Icon: "magpie", Note: "every magpie model in OpenPencil's chat model picker"}}
},
}},
}, path)
}
// openPencilRunning says OpenPencil is open where magpie can tell; on
// Windows, where Running can't, no, and the notice asks to quit it first.
var openPencilRunning = func() bool {
return runtime.GOOS != "windows" && Running(openPencilProc...)
}
// openPencilDir is the folder of OpenPencil's settings.json, as Rust's
// dirs::config_dir() finds the platform's config folder.
func openPencilDir(home, cfg string) string {
return openPencilDirOn(runtime.GOOS, home, cfg, appdir.Getenv("APPDATA"))
}
// openPencilDirOn is openPencilDir on the system goos, with the
// XDG_CONFIG_HOME folder cfg and %APPDATA% appData.
func openPencilDirOn(goos, home, cfg, appData string) string {
switch goos {
case "darwin":
return filepath.Join(home, "Library", "Application Support", "openpencil")
case "windows":
d := appData
if d == "" {
d = filepath.Join(home, "AppData", "Roaming")
}
return filepath.Join(d, "openpencil")
}
return filepath.Join(cfg, "openpencil")
}
// openPencilWindowsApp says OpenPencil's installer has put it where it
// installs it, %ProgramFiles%\OpenPencil (scripts/package-windows.nsi).
func openPencilWindowsApp() bool {
if runtime.GOOS != "windows" {
return false
}
for _, v := range []string{"ProgramW6432", "ProgramFiles"} {
if d := appdir.Getenv(v); d != "" && isFile(filepath.Join(d, "OpenPencil", "openpencil-desktop.exe")) {
return true
}
}
return false
}
// openPencilAgent is an entry of builtin_agents in the order OpenPencil
// writes one.
type openPencilAgent struct {
ID string `json:"id"`
Preset string `json:"preset"`
DisplayName string `json:"display_name"`
Kind string `json:"kind"`
APIKey string `json:"api_key"`
Model string `json:"model"`
Models []string `json:"models,omitempty"`
BaseURL string `json:"base_url"`
Enabled bool `json:"enabled"`
}
// openPencilEntry is magpie's entry for a gateway at gw: its Chat
// Completions, the key that names OpenPencil, and the models picked for it
// as OpenPencil keeps a list (normalize_builtin_models): each once, at most
// 64, the list written only for two or more.
func openPencilEntry(gw string) openPencilAgent {
var ms []string
seen := map[string]bool{}
for _, m := range magpieModels("openpencil") {
if m.ID == "" || seen[m.ID] || len([]rune(m.ID)) > 256 {
continue
}
seen[m.ID] = true
ms = append(ms, m.ID)
if len(ms) == openPencilMaxModels {
break
}
}
e := openPencilAgent{ID: magpieID, Preset: "custom", DisplayName: "magpie", Kind: "openai-compat",
APIKey: agentKeyAt("openpencil", gw), BaseURL: gw + "/v1", Enabled: true}
if len(ms) > 0 {
e.Model = ms[0]
}
if len(ms) > 1 {
e.Models = ms
}
return e
}
// openPencilWired says settings.json has magpie's entry.
func openPencilWired(path string) bool {
_, i, _ := openPencilAgents(path)
return i >= 0
}
// openPencilAgents are the entries of settings.json's builtin_agents as
// written, and the place of magpie's among them (-1 for none). A file that
// isn't there or holds nothing has none; one OpenPencil wouldn't read, or
// whose version it doesn't know, is an error, so magpie leaves it alone.
func openPencilAgents(path string) (list []json.RawMessage, i int, err error) {
i = -1
b, err := edit.Read(path)
if err != nil {
return nil, i, err
}
if len(bytes.TrimSpace(b)) == 0 {
return nil, i, nil
}
if !json.Valid(b) || !gjson.ParseBytes(b).IsObject() {
return nil, i, fmt.Errorf("%s isn't JSON OpenPencil reads", path)
}
if v := gjson.GetBytes(b, "version"); v.Type != gjson.Number || v.Raw != "1" {
return nil, i, fmt.Errorf("%s says version %s, not the 1 OpenPencil reads, so magpie leaves it alone", path, v.Raw)
}
raw := gjson.GetBytes(b, "builtin_agents")
if !raw.Exists() || raw.Type == gjson.Null {
return nil, i, nil
}
if !raw.IsArray() || json.Unmarshal([]byte(raw.Raw), &list) != nil {
return nil, i, fmt.Errorf("%s: builtin_agents is not a list", path)
}
for j, e := range list {
if gjson.GetBytes(e, "id").String() == magpieID {
return list, j, nil
}
}
return list, i, nil
}
// openPencilWire puts magpie's entry into settings.json, the file made when
// there is none; an entry there already keeps the name and the on/off the
// user gave it in OpenPencil. The file is written only when the entry says
// something else.
func openPencilWire(path string, want openPencilAgent) error {
list, i, err := openPencilAgents(path)
if err != nil {
return err
}
if i >= 0 {
if n := gjson.GetBytes(list[i], "display_name"); n.Type == gjson.String {
want.DisplayName = n.String()
}
if e := gjson.GetBytes(list[i], "enabled"); e.IsBool() {
want.Enabled = e.Bool()
}
}
w, err := json.Marshal(want)
if err != nil {
return err
}
if i >= 0 && sameJSON(string(list[i]), want) {
return nil
}
if i >= 0 {
list[i] = w
} else {
list = append(list, w)
}
if _, has := edit.GetJSON(path, "version"); !has {
return edit.SetJSON(path, edit.KV{Path: "version", Value: 1}, edit.KV{Path: "builtin_agents", Value: list})
}
return edit.SetJSON(path, edit.KV{Path: "builtin_agents", Value: list})
}
// openPencilUnwire takes magpie's entry out of settings.json, and the file
// when nothing else is left in it: the version and an empty list are what
// magpie wrote in a file OpenPencil hasn't saved yet.
func openPencilUnwire(path string) error {
list, i, err := openPencilAgents(path)
if err != nil || i < 0 {
return err
}
list = append(list[:i], list[i+1:]...)
if len(list) == 0 {
var rest map[string]json.RawMessage
if b, err := edit.Read(path); err == nil && json.Unmarshal(b, &rest) == nil {
delete(rest, "version")
delete(rest, "builtin_agents")
if len(rest) == 0 {
return os.Remove(path)
}
}
}
return edit.SetJSON(path, edit.KV{Path: "builtin_agents", Value: list})
}
+393
View File
@@ -0,0 +1,393 @@
package agent
import (
"bytes"
"encoding/json"
"fmt"
"os"
"path/filepath"
"runtime"
"slices"
"testing"
"github.com/yetone/magpie/internal/gateway"
"github.com/yetone/magpie/internal/provider"
)
// openPencilUser is settings.json as OpenPencil saves it
// (serde_json::to_string_pretty of SettingsPayload, main at 40902a3f): a
// builtin agent of the user's own, an ACP agent, a recent file and the
// chat's last pick.
const openPencilUser = `{
"version": 1,
"theme": "dark",
"locale": "zh-CN",
"mcp_port": 3100,
"mcp_cli_enabled": [true, false, false],
"images_advanced_open": false,
"openverse_oauth": null,
"openverse_credential_owner": null,
"auto_update_enabled": true,
"experimental_features_enabled": false,
"connected": [false, true],
"builtin_agents": [
{
"id": "builtin-1",
"preset": "anthropic",
"display_name": "Anthropic",
"kind": "anthropic",
"api_key": "sk-ant-users-own",
"model": "claude-sonnet-5",
"models": ["claude-sonnet-5", "claude-opus-5"],
"base_url": "https://api.anthropic.com",
"enabled": true
}
],
"acp_agents": [
{
"id": "acp-1",
"display_name": "Gemini",
"connection_type": "stdio",
"command": "gemini",
"args": ["--experimental-acp"],
"env": {},
"url": null,
"enabled": true
}
],
"image_gen_profiles": [],
"active_image_gen_profile_id": null,
"recent_files": [{"path": "/Users/me/a.op", "modified_at": 1790000000}],
"preferred_agent_team_size": 1,
"entry_surface": "home",
"chat_agent": "builtin",
"chat_model": "builtin:builtin-1:claude-sonnet-5"
}
`
// openPencilEntryDoc is a builtin_agents entry with OpenPencil's fields
// alone (BuiltinAgentPayload on main), so a field of magpie's own fails to
// decode.
type openPencilEntryDoc struct {
ID *string `json:"id"`
Preset *string `json:"preset"`
DisplayName *string `json:"display_name"`
Kind *string `json:"kind"`
APIKey string `json:"api_key"`
Model string `json:"model"`
Models []string `json:"models"`
BaseURL *string `json:"base_url"`
Enabled *bool `json:"enabled"`
}
// openPencilRead is settings.json's magpie entry, checked as OpenPencil
// reads one: the required fields there, nothing else, a kind it knows, and
// the model list in its own form (at most 64, the first as model, models
// only for two or more); and the user's entries, as written.
func openPencilRead(t *testing.T, path string) (magpie openPencilEntryDoc, others []json.RawMessage) {
t.Helper()
b, err := os.ReadFile(path)
if err != nil {
t.Fatal(err)
}
var doc struct {
Version *int `json:"version"`
Agents []json.RawMessage `json:"builtin_agents"`
}
if err := json.Unmarshal(b, &doc); err != nil || doc.Version == nil || *doc.Version != 1 {
t.Fatalf("not a settings.json OpenPencil reads (version 1 required): %v\n%s", err, b)
}
found := false
for _, raw := range doc.Agents {
var e openPencilEntryDoc
d := json.NewDecoder(bytes.NewReader(raw))
d.DisallowUnknownFields()
if err := d.Decode(&e); err != nil {
t.Fatalf("not OpenPencil's entry: %v\n%s", err, raw)
}
if e.ID == nil || e.DisplayName == nil || e.Kind == nil || e.BaseURL == nil || e.Enabled == nil {
t.Fatalf("entry without a required field: %s", raw)
}
if *e.ID != magpieID {
others = append(others, raw)
continue
}
if found {
t.Fatalf("two entries of magpie's: %s", b)
}
found, magpie = true, e
}
if !found {
t.Fatalf("no entry of magpie's: %s", b)
}
if !slices.Contains([]string{"anthropic", "openai", "openai-compat", "openai_compat"}, *magpie.Kind) {
t.Errorf("kind %q", *magpie.Kind)
}
switch {
case len(magpie.Models) == 1, len(magpie.Models) > openPencilMaxModels:
t.Errorf("models: %d, OpenPencil writes two to 64 or none", len(magpie.Models))
case len(magpie.Models) > 1 && magpie.Model != magpie.Models[0]:
t.Errorf("model %q is not the first of %v", magpie.Model, magpie.Models)
}
return magpie, others
}
// OpenPencil (ZSeven-W/openpencil) lists builtin agents of the user's own in
// its chat's model picker, from settings.json in the platform's config
// folder. magpie adds itself as the entry "magpie" on the gateway's Chat
// Completions, keeps the user's entries and settings as they were and the
// name and on/off they give its entry, writes nothing when nothing changed,
// and off takes only its own entry out.
func TestOpenPencilProvider(t *testing.T) {
home := syncHome(t)
cfg := filepath.Join(home, ".config")
if err := provider.Save(provider.Provider{ID: "deepseek", Name: "DeepSeek", Chat: "https://api.deepseek.com/v1", Key: "k", Models: []string{"pro", "flash"}}); err != nil {
t.Fatal(err)
}
t.Cleanup(func() { openPencilRunning = func() bool { return false } })
openPencilRunning = func() bool { return false }
a := openPencil(home, cfg)
if !slices.ContainsFunc(All(), func(x *Agent) bool { return x.ID == "openpencil" && x.Name == "OpenPencil" }) {
t.Fatal("OpenPencil is not among the agents")
}
os.MkdirAll(a.Dir, 0o755)
if !a.Detected() {
t.Fatal("not found with its settings folder")
}
path := a.Path
os.WriteFile(path, []byte(openPencilUser), 0o600)
f := a.Field("provider")
if f.Get() != "" {
t.Fatalf("get: %q", f.Get())
}
if err := f.Set(magpieID); err != nil {
t.Fatal(err)
}
if f.Get() != magpieID {
t.Fatalf("get after set: %q", f.Get())
}
gw := gateway.URL()
e, others := openPencilRead(t, path)
if *e.Kind != "openai-compat" || *e.BaseURL != gw+"/v1" || e.APIKey != agentKeyAt("openpencil", gw) || *e.Preset != "custom" || !*e.Enabled || *e.DisplayName != "magpie" {
t.Errorf("entry: %+v", e)
}
var want []string
for _, m := range magpieModels("openpencil") {
want = append(want, m.ID)
}
if len(want) < 2 || !slices.Equal(e.Models, want) {
t.Errorf("models %v, want %v", e.Models, want)
}
// the user's entry, byte for byte as its JSON says, and every setting
var user struct {
Agents []json.RawMessage `json:"builtin_agents"`
}
json.Unmarshal([]byte(openPencilUser), &user)
if len(others) != 1 || !sameJSON(string(others[0]), user.Agents[0]) {
t.Errorf("the user's entry: %s", others)
}
var before, after map[string]json.RawMessage
json.Unmarshal([]byte(openPencilUser), &before)
b, _ := os.ReadFile(path)
json.Unmarshal(b, &after)
for k, v := range before {
if k != "builtin_agents" && !sameJSON(string(after[k]), v) {
t.Errorf("%s: %s, was %s", k, after[k], v)
}
}
// nothing changed: nothing written
st, _ := os.Stat(path)
if err := a.Sync(); err != nil {
t.Fatal(err)
}
if err := f.Set(magpieID); err != nil {
t.Fatal(err)
}
if b2, _ := os.ReadFile(path); !bytes.Equal(b, b2) {
t.Errorf("rewritten with nothing changed:\n%s\n%s", b, b2)
}
if st2, _ := os.Stat(path); !st2.ModTime().Equal(st.ModTime()) {
t.Error("written with nothing changed")
}
// renamed and turned off in OpenPencil's settings: a sync keeps both,
// and puts a model gone from the list back
var doc map[string]any
json.Unmarshal(b, &doc)
for _, x := range doc["builtin_agents"].([]any) {
if m := x.(map[string]any); m["id"] == magpieID {
m["display_name"], m["enabled"] = "My magpie", false
m["models"] = slices.DeleteFunc(m["models"].([]any), func(v any) bool { return v == want[1] })
}
}
edited, _ := json.MarshalIndent(doc, "", " ")
s := string(edited)
os.WriteFile(path, []byte(s), 0o600)
if err := a.Sync(); err != nil {
t.Fatal(err)
}
e, _ = openPencilRead(t, path)
if *e.DisplayName != "My magpie" || *e.Enabled {
t.Errorf("the user's name and off not kept: %+v", e)
}
if !slices.Equal(e.Models, want) {
t.Errorf("models after sync %v, want %v", e.Models, want)
}
// off: only magpie's entry goes, the file stays
if err := f.Set(""); err != nil {
t.Fatal(err)
}
if f.Get() != "" {
t.Fatalf("get after off: %q", f.Get())
}
b, _ = os.ReadFile(path)
json.Unmarshal(b, &after)
var left []json.RawMessage
json.Unmarshal(after["builtin_agents"], &left)
if len(left) != 1 || !sameJSON(string(left[0]), user.Agents[0]) {
t.Errorf("after off: %s", after["builtin_agents"])
}
for k, v := range before {
if !sameJSON(string(after[k]), v) {
t.Errorf("after off, %s: %s, was %s", k, after[k], v)
}
}
// a sync of an entry that isn't there writes none
if err := a.Sync(); err != nil {
t.Fatal(err)
}
if b2, _ := os.ReadFile(path); !bytes.Equal(b, b2) {
t.Errorf("a sync off wrote:\n%s", b2)
}
}
// OpenPencil not run yet: magpie makes settings.json with the version 1
// OpenPencil needs (a file without it is set aside as corrupt), with one
// model as model alone; off takes the file away again.
func TestOpenPencilMakesItsFile(t *testing.T) {
home := syncHome(t)
if err := provider.Delete("relay"); err != nil {
t.Fatal(err)
}
if err := provider.Save(provider.Provider{ID: "solo", Name: "Solo", Chat: "https://api.example/v1", Key: "k", Models: []string{"one"}}); err != nil {
t.Fatal(err)
}
if n := len(magpieModels("openpencil")); n != 1 {
t.Fatalf("fixture: %d models", n)
}
t.Cleanup(func() { openPencilRunning = func() bool { return false } })
openPencilRunning = func() bool { return false }
a := openPencil(home, filepath.Join(home, ".config"))
if err := a.Field("provider").Set(magpieID); err != nil {
t.Fatal(err)
}
e, others := openPencilRead(t, a.Path)
if len(others) != 0 || e.Models != nil || e.Model == "" {
t.Errorf("one model: %+v, others %s", e, others)
}
b, _ := os.ReadFile(a.Path)
var top map[string]json.RawMessage
json.Unmarshal(b, &top)
if len(top) != 2 || string(top["version"]) != "1" {
t.Errorf("made: %s", b)
}
if err := a.Field("provider").Set(""); err != nil {
t.Fatal(err)
}
if _, err := os.Stat(a.Path); !os.IsNotExist(err) {
t.Errorf("magpie's own file left behind: %v", err)
}
}
// A file OpenPencil wouldn't read as its own — a version it doesn't know,
// none, a list that isn't one — is left as it is, and so is the file while
// OpenPencil runs, as it writes its settings back over magpie's when it
// quits.
func TestOpenPencilLeavesAlone(t *testing.T) {
home := syncHome(t)
running := false
t.Cleanup(func() { openPencilRunning = func() bool { return false } })
openPencilRunning = func() bool { return running }
a := openPencil(home, filepath.Join(home, ".config"))
os.MkdirAll(a.Dir, 0o755)
for _, s := range []string{
`{"version": 2, "builtin_agents": []}`,
`{"theme": "dark"}`,
`{"version": "1"}`,
`{"version": 1, "builtin_agents": {}}`,
`{"version": 1,`,
} {
os.WriteFile(a.Path, []byte(s), 0o600)
if err := a.Field("provider").Set(magpieID); err == nil {
t.Errorf("%s: set", s)
}
if b, _ := os.ReadFile(a.Path); string(b) != s {
t.Errorf("%s: written: %s", s, b)
}
}
os.WriteFile(a.Path, []byte(openPencilUser), 0o600)
running = true
if err := a.Field("provider").Set(magpieID); err != errOpenPencilRunning {
t.Errorf("set while it runs: %v", err)
}
if b, _ := os.ReadFile(a.Path); string(b) != openPencilUser {
t.Errorf("written while it runs: %s", b)
}
running = false
if err := a.Field("provider").Set(magpieID); err != nil {
t.Fatal(err)
}
running = true
if err := a.Field("provider").Set(""); err != errOpenPencilRunning {
t.Errorf("off while it runs: %v", err)
}
if a.Field("provider").Get() != magpieID {
t.Error("taken out while it runs")
}
}
// settings.json is where Rust's dirs::config_dir() puts OpenPencil's
// folder on each system.
func TestOpenPencilDirPerOS(t *testing.T) {
home := filepath.Join("h", "me")
cfg := filepath.Join(home, ".cfg")
for _, c := range []struct{ goos, appData, want string }{
{"darwin", "", filepath.Join(home, "Library", "Application Support", "openpencil")},
{"linux", "", filepath.Join(cfg, "openpencil")},
{"windows", filepath.Join("R", "Roaming"), filepath.Join("R", "Roaming", "openpencil")},
{"windows", "", filepath.Join(home, "AppData", "Roaming", "openpencil")},
} {
if got := openPencilDirOn(c.goos, home, cfg, c.appData); got != c.want {
t.Errorf("%s (APPDATA %q): %s, want %s", c.goos, c.appData, got, c.want)
}
}
if got := openPencilDir(home, cfg); got != openPencilDirOn(runtime.GOOS, home, cfg, os.Getenv("APPDATA")) {
t.Errorf("here: %s", got)
}
}
// OpenPencil keeps 64 models of an entry and drops the rest when it next
// saves; magpie writes the first 64, so what it wrote and what OpenPencil
// saves back agree.
func TestOpenPencilModelCap(t *testing.T) {
syncHome(t)
var ms []string
for i := range 70 {
ms = append(ms, fmt.Sprintf("m%02d", i))
}
if err := provider.Save(provider.Provider{ID: "many", Name: "Many", Chat: "https://api.example/v1", Key: "k", Models: ms}); err != nil {
t.Fatal(err)
}
if n := len(magpieModels("openpencil")); n <= openPencilMaxModels {
t.Fatalf("fixture: %d models", n)
}
e := openPencilEntry(gateway.URL())
if len(e.Models) != openPencilMaxModels || e.Model != e.Models[0] {
t.Errorf("%d models, model %q", len(e.Models), e.Model)
}
}
+5
View File
@@ -3598,6 +3598,7 @@ const I18N = {
"DeepSeek Harness Desktop hasn't been opened yet: it starts on this the first time it opens.": "DeepSeek Harness 桌面版还没打开过:第一次打开时就会使用这项设置。",
"OpenChamber takes the new model for new sessions; sessions already open keep theirs.": "OpenChamber 的新会话会使用新模型;已打开的会话保留原来的模型。",
"OpenChamber's project {project} has a default model of its own ({model}), which it uses there instead.": "OpenChamber 的项目 {project} 有自己的默认模型({model}),在该项目里会改用它。",
"OpenPencil reads its settings when it starts and writes them all back when it quits — quit OpenPencil before changing this, then open it and pick a magpie model in its chat's model picker.": "OpenPencil 启动时读取设置、退出时把设置全部写回 —— 请先退出 OpenPencil 再更改这里,然后打开它,在聊天的模型选择器中选一个 magpie 的模型。",
"Pencil reads its custom models at start-up — restart Pencil to see magpie's models in its model picker.": "Pencil 启动时读取自定义模型,需重启 Pencil 才能在它的模型选择器中看到 magpie 的模型。",
"Qwen Code reads a session's model at start-up — start a new session, or /model anew, to use this.": "Qwen Code 在会话启动时读取模型,需开启新会话或重新执行 /model 才会生效。",
"Reasonix Studio 2.x and the native 1.39.x/2.x CLI read global settings at startup. Start a new process to load changes. Project/session models can override Executor and Plan.": "Reasonix Studio 2.x 和原生 1.39.x/2.x CLI 在启动时读取全局设置,需启动新进程才会加载改动。项目或会话的模型可以覆盖 Executor 和 Plan。",
@@ -7247,6 +7248,7 @@ const I18N = {
"DeepSeek Harness Desktop hasn't been opened yet: it starts on this the first time it opens.": "DeepSeek Harness 桌面版還沒開啟過:第一次開啟時就會使用這項設定。",
"OpenChamber takes the new model for new sessions; sessions already open keep theirs.": "OpenChamber 的新會話會使用新模型;已打開的會話保留原來的模型。",
"OpenChamber's project {project} has a default model of its own ({model}), which it uses there instead.": "OpenChamber 的專案 {project} 有自己的預設模型({model}),在該專案裡會改用它。",
"OpenPencil reads its settings when it starts and writes them all back when it quits — quit OpenPencil before changing this, then open it and pick a magpie model in its chat's model picker.": "OpenPencil 啟動時讀取設定、結束時把設定全部寫回 —— 請先結束 OpenPencil 再變更這裡,然後開啟它,在聊天的模型選擇器中選一個 magpie 的模型。",
"Pencil reads its custom models at start-up — restart Pencil to see magpie's models in its model picker.": "Pencil 啟動時讀取自訂模型,需重啟 Pencil 才能在它的模型選擇器中看到 magpie 的模型。",
"Qwen Code reads a session's model at start-up — start a new session, or /model anew, to use this.": "Qwen Code 在會話啟動時讀取模型,需開啟新會話或重新執行 /model 才會生效。",
"Reasonix Studio 2.x and the native 1.39.x/2.x CLI read global settings at startup. Start a new process to load changes. Project/session models can override Executor and Plan.": "Reasonix Studio 2.x 和原生 1.39.x/2.x CLI 在啟動時讀取全域設定,需啟動新行程才會載入改動。專案或會話的模型可以覆蓋 Executor 和 Plan。",
@@ -10898,6 +10900,7 @@ const I18N = {
"DeepSeek Harness Desktop hasn't been opened yet: it starts on this the first time it opens.": "DeepSeek Harness デスクトップ版はまだ一度も開かれていません。初めて開いたときからこの設定で始まります。",
"OpenChamber takes the new model for new sessions; sessions already open keep theirs.": "OpenChamber は新しいセッションで新しいモデルを使います。開いているセッションは今のモデルのままです。",
"OpenChamber's project {project} has a default model of its own ({model}), which it uses there instead.": "OpenChamber のプロジェクト {project} には独自のデフォルトモデル({model})があり、そこではそちらが使われます。",
"OpenPencil reads its settings when it starts and writes them all back when it quits — quit OpenPencil before changing this, then open it and pick a magpie model in its chat's model picker.": "OpenPencil は起動時に設定を読み込み、終了時に設定をすべて書き戻します。ここを変更する前に OpenPencil を終了し、その後開いてチャットのモデル選択で magpie のモデルを選んでください。",
"Pencil reads its custom models at start-up — restart Pencil to see magpie's models in its model picker.": "Pencil は起動時にカスタムモデルを読み込みます。モデル選択に magpie のモデルを表示するには Pencil を再起動してください。",
"Qwen Code reads a session's model at start-up — start a new session, or /model anew, to use this.": "Qwen Code はセッション開始時にモデルを読み込みます。反映するには新しいセッションを始めるか、もう一度 /model を実行してください。",
"Reasonix Studio 2.x and the native 1.39.x/2.x CLI read global settings at startup. Start a new process to load changes. Project/session models can override Executor and Plan.": "Reasonix Studio 2.x とネイティブの 1.39.x/2.x CLI は起動時にグローバル設定を読み込みます。変更を読み込むには新しいプロセスを起動してください。プロジェクトやセッションのモデルが Executor と Plan を上書きすることがあります。",
@@ -14549,6 +14552,7 @@ const I18N = {
"DeepSeek Harness Desktop hasn't been opened yet: it starts on this the first time it opens.": "DeepSeek Harness Desktop wurde noch nie geöffnet: Beim ersten Öffnen startet es mit dieser Einstellung.",
"OpenChamber takes the new model for new sessions; sessions already open keep theirs.": "OpenChamber nimmt das neue Modell für neue Sitzungen; bereits offene behalten ihres.",
"OpenChamber's project {project} has a default model of its own ({model}), which it uses there instead.": "Das OpenChamber-Projekt {project} hat ein eigenes Standardmodell ({model}), das dort stattdessen genutzt wird.",
"OpenPencil reads its settings when it starts and writes them all back when it quits — quit OpenPencil before changing this, then open it and pick a magpie model in its chat's model picker.": "OpenPencil liest seine Einstellungen beim Start und schreibt sie beim Beenden alle zurück – OpenPencil vor dieser Änderung beenden, dann öffnen und in der Modellauswahl seines Chats ein magpie-Modell wählen.",
"Pencil reads its custom models at start-up — restart Pencil to see magpie's models in its model picker.": "Pencil liest seine eigenen Modelle beim Start – Pencil neu starten, um magpies Modelle in seiner Modellauswahl zu sehen.",
"Qwen Code reads a session's model at start-up — start a new session, or /model anew, to use this.": "Qwen Code liest das Modell einer Sitzung beim Start – eine neue Sitzung beginnen oder /model erneut ausführen, damit es gilt.",
"Reasonix Studio 2.x and the native 1.39.x/2.x CLI read global settings at startup. Start a new process to load changes. Project/session models can override Executor and Plan.": "Reasonix Studio 2.x und die native 1.39.x/2.x-CLI lesen globale Einstellungen beim Start. Einen neuen Prozess starten, um Änderungen zu laden. Projekt- oder Sitzungsmodelle können Executor und Plan überschreiben.",
@@ -14660,6 +14664,7 @@ const NOTICES = [
"DeepSeek Harness Desktop hasn't been opened yet: it starts on this the first time it opens.",
"OpenChamber takes the new model for new sessions; sessions already open keep theirs.",
"OpenChamber's project {project} has a default model of its own ({model}), which it uses there instead.",
"OpenPencil reads its settings when it starts and writes them all back when it quits — quit OpenPencil before changing this, then open it and pick a magpie model in its chat's model picker.",
"Pencil reads its custom models at start-up — restart Pencil to see magpie's models in its model picker.",
"Qwen Code reads a session's model at start-up — start a new session, or /model anew, to use this.",
"Reasonix Studio 2.x and the native 1.39.x/2.x CLI read global settings at startup. Start a new process to load changes. Project/session models can override Executor and Plan.",