Commit Graph
21 Commits
Author SHA1 Message Date
yetone bfaedf1830 gui, profile: the profile in use is ticked and named on the panel's Profiles button, not a count read as its name (superhtoooth on X)
superhtoooth (macOS): 保存方案设置了方案名字,但是应用方案没有用这个名字。
menu 里面变成了方案 1,方案 2。而且在应用里面没有显示当前使用的方案.

The bug: the tray panel's Profiles button showed the number of saved
profiles next to its label ("方案" + "2"), which reads as a profile
named 方案 2. Profiles were saved and applied under the typed name all
along; nothing anywhere said which profile was in use.

What changed:
- profile.InUse: a profile is in use while applying it would change
  nothing on this computer - every detected agent's saved field is as
  the profile has it (compared with the same renamed-ref spelling Apply
  writes), its model lists are held (provider.ModelListsHeld, a dry run
  of SetModelLists via the extracted putModelLists) and its library
  setup is as saved (library.Holds, the mirror of Restore). A profile
  that touches no agent here is not in use.
- Why not "last applied": that would stay ticked after the user changes
  a model by hand, a tick that lies. With this definition a profile
  saved from the current setup is in use at once, a hand change clears
  the tick, and applying puts it back. Two identical profiles are both
  ticked; the button names the first.
- GUI: /api/state carries inUse. The panel's button names the profile
  in use (a pop-up button showing what is picked), else counts them as
  before; its chip gets a check mark and aria-current, in panel and
  window; the chip's tooltip and its details say "In use" (string
  already in every language). CLI `magpie profiles` marks it, the TUI
  notes "in use". Docs (reference, start en/zh/ja) say so.

What was run:
- go test ./internal/profile (new TestProfileInUse: save, hand change,
  apply, hidden model list, library instructions, absent agents) and
  ./internal/gui (new TestStateProfileInUse through the HTTP handler),
  scratch HOME. Broken by hand: field compare, ModelListsHeld,
  library.Holds and state's InUse each turned a test red.
- go test -tags nogui ./... in a scratch HOME (the four slow packages
  rerun with -timeout 40m under load ~45).
- GUI: new profile-in-use.test.cjs (reporter's steps in the panel at
  360px, every language, plus the window) and panel-profiles,
  profile-confirm, profile-details, old-webkit, i18n-keys, gui-zh-tw,
  gui-ja, gui-de in chromium and webkit: all pass. Old app.js fails the
  new test.
- Real CLI in a sandbox HOME with a codex config: save/use/profiles
  show the mark, and it goes after a hand edit.
- gofmt; go vet darwin, linux (nogui), windows.
Not tried: the real tray app with real agents, and Windows/Linux at
runtime.
2026-10-12 19:14:54 +08:00
yetoneandggbdpq 89271cd4e8 provider, plugin, settings: accounts left all zero by a crash are read from their last good copy, and every state file is flushed before it is renamed in (#1505, Zhangwier)
Zhangwier's Windows machine went down hard, and logins.json (10783 bytes)
and plugin-auth.json (29926 bytes) came back at full length with every byte
0x00. Every account was gone. The rename had reached the disk before the
data. magpie then read "no accounts", and its next write would have made
that final.

What changed:
- Flushed before rename: steady.WriteFile writes a temp file, fsyncs it,
  then renames it in. A failed write or flush removes the temp file and
  leaves the old file as it was. edit.WriteAtomic, Kiro's writer, the
  Codex session rewrite and the plugin host's writeDurable (host.js)
  flush the same way. So do writePrivate (providers, logins, migrations),
  settings, profiles, plugins.json, plugin-auth.json and mcp-signins.json.
- A last good generation: before each write, lastgood.Keep keeps the
  valid file there as <file>.bak. A file that isn't valid is copied aside
  as <file>.bad-<time>, with -2, -3 when two land in one second (O_EXCL),
  and is never overwritten before that copy exists. The .bak lags one
  write behind on purpose, since a crash zeroes the latest write.
- A failed read is unknown, never empty. On a cold start, logins.json,
  providers.json, migrations.json, settings.json, profiles.json,
  plugins.json, plugin-auth.json (Go and the host) and mcp-signins.json
  are read from their .bak when they don't read. The recovery is logged
  and listed in /api/state's recovered, and the window says it once in
  every language. With no good .bak, a sign-out leaves plugin-auth.json
  and mcp-signins.json as they are (the host's changeAuth no longer
  writes {} over them). magpie's own sign-out returns the error, and a
  sign-in copies the bad file aside before writing.
- caller-keys.json is flushed but never read from a .bak. A key revoked
  in the last write would come back, so a store that doesn't read still
  refuses every key, as its tests require.

ggbdpq's patch (f230bcae) is where the fsync-before-rename in
writePrivate, writeWhole and writeAuth came from. This change puts it in
one shared helper and reaches every other writer of magpie's state. The
JS write cleans up its temp file. The .bak recovery, the .bad copies and
the GUI notice are added here.

What was run:
- New tests, built from the literal case (10783 and 29926 zero bytes):
  - internal/lastgood
  - provider: TestZeroedLogins*, TestZeroedMigrations*,
    TestZeroedProviders*, TestWritePrivateSyncsBeforeRename
  - plugin: TestZeroedPluginAuth* against the real bun host,
    TestPluginAuthSyncedBeforeRename with a plugin that makes fsync fail,
    TestZeroedPluginList*
  - TestZeroedSettings*, TestZeroedProfiles*, TestZeroedMCPSignIns*
  - steady TestWriteFileSyncsBeforeRename, edit
    TestWriteAtomicSyncsBeforeRename
  - gui recovered-file.test.cjs (en/zh/zh-TW/ja/de, Chromium and WebKit)
- Broken by hand, each going red:
  - Without the sync: the steady, edit, writePrivate and host fsync tests.
  - Without the .bak fallback: every TestZeroed* test.
  - The old changeAuth writes "{}\n" over the zeros.
  - The old readLogins default.
  - KeepBad without suffixes fails the one-second test.
  - Without recoveredOnce, the GUI test fails 5/5.
- macOS: go test -tags nogui ./... in a sandbox HOME. The only failures
  were the two access tests (then fixed by not recovering caller keys) and
  TestProvidersCmdSaysUnreadable, which now removes the .bak to test the
  no-backup case. Both packages were rerun and pass. gofmt -l prints
  nothing. go vet, and GOOS=linux and GOOS=windows go vet -tags nogui, are
  clean on the touched packages.
- GUI: recovered-file, whats-new, click-scroll, gui-de, gui-ja,
  gui-zh-tw and i18n-keys pass.
- Windows box (cross-compiled test exes, sandboxed USERPROFILE/APPDATA):
  lastgood, steady, provider, plugin (real bun host), settings, mcpauth,
  edit and access pass. In profile, TestProfileSwitchesModelList and
  TestOldProfileKeepsModelList fail the same on origin/main (filed as
  #1517).

Reported-by: Zhangwier
Co-authored-by: ggbdpq <ggbdpq@gmail.com>
2026-10-10 22:54:09 +08:00
yetone 88f46015c8 profile: the model-list tests name Codex's catalog as magpie writes it, so they pass on Windows (#1517)
TestProfileSwitchesModelList and TestOldProfileKeepsModelList failed on
Windows ("Codex lists []") and passed on macOS. Their fixture wrote
model_catalog_json = "C:/Users/.../.codex/magpie-models.json"
(filepath.ToSlash). On Windows, Codex's ownCatalog takes the list as
magpie's only when it is named "magpie-models.json" (what magpie writes
there since #816), by the native backslash path, or by a path relative to
config.toml. A forward-slash absolute path is none of these, so Sync never
wrote the list and the file stayed empty.

The guess in the issue, that sandbox() blanking APPDATA/LOCALAPPDATA makes
os.UserConfigDir fail and moves the provider or catalog elsewhere, is not
the cause. Built for windows/amd64 and run on the Windows 11 box:
- fixture fixed, APPDATA/LOCALAPPDATA still blanked: both PASS
- fixture unchanged, APPDATA/LOCALAPPDATA left set: both FAIL as reported
magpie's own files sit under ~/.config/magpie and Codex's under ~/.codex
(both from the home folder), so no product write depends on APPDATA here,
and nothing changes for real users.

The fixture now names the catalog as magpie does on each OS: the full
path (a TOML literal string) elsewhere, "magpie-models.json" on Windows.

Run: internal/profile test exe on the Windows box, whole package: before
FAIL (the two tests), after PASS. macOS: go test -tags nogui
./internal/profile/... ok. gofmt -l clean; GOOS=linux and GOOS=windows
go vet -tags nogui ./internal/profile clean.
2026-10-10 22:38:47 +08:00
yetone 02dfb7aa2c profile: applying a profile writes only agents found on this computer, so a profile synced from another one no longer makes missing agents look installed (qtwaiter on X)
ApplyFields looped over every known agent. A profile saved on another
computer (profiles sync over WebDAV) names agents missing here; writing
their model created their config folder, and a config folder alone counts
as installed, so the Agents page grew agents never installed. Snapshot
already takes only detected agents; Apply now matches it.

Run: go test ./internal/profile ./internal/gui ./internal/tui
./internal/backup; TestApplySkipsUndetectedAgents fails on the old code
(agy made to look installed). gofmt, go vet darwin/linux/windows clean.
2026-10-09 21:50:19 +08:00
yetone 6d1322e58e agents, profiles: a profile keeps each agent's model list, and switching profiles switches it (#1368, liuheo)
Saving a profile (+ Save current, magpie save, the TUI) now keeps, beside
every detected agent's fields and the library, the agent's model list as
the Agents page's Pick sets it: the models taken out one by one
(hiddenModels), or "only the models I pick" and those picks
(pickedModels), the order put on them (orderedModels), and the
visibility `magpie visible` narrows it to (visible). It is kept under the
id the lists are kept by (agent.ListsFor), in profiles.json under a
"models" key beside "library". Applying a profile puts each list back
exactly (provider.SetModelLists: one settings write, renamed providers'
ids followed), then the fields, so the model is set last over the list;
the lists are written once through catalog.Touched, the same path a pick
made by hand takes, so Codex's magpie-models.json and the other agents'
model files are rewritten. A list that changed counts in "N settings
changed".

Left out on purpose: fastPicks (how a model is sent, not whether it is
listed, and it stays with the model) and agentEfforts (Cursor Private
Inference's effort is already an agent field a profile keeps).

A profile saved before this has no "models": it is read with none, leaves
every agent's list as it is (unknown, not empty), and is written back
byte for byte. An agent a new profile doesn't name keeps its list too.
A profile's details show a Model list line per agent: "8 hidden", "only
the 3 picked" or "every model shown", in all five languages.

Verified:
- internal/profile TestProfileSwitchesModelList: three profiles (two
  hidden; all shown with an order; only-picked), each applied rewrites
  settings and Codex's magpie-models.json to that list. Fails with Apply's
  list step removed ("applying home changed nothing", the hidden list
  not restored) and with catalog.Touched taken out of SetModelLists
  (Codex's file keeps the old list).
- TestOldProfileKeepsModelList: an old profile keeps codex's hidden and
  claude's only-picked, writes back unchanged; one naming only codex's
  list leaves claude's. Fails when a missing "models" is read as empty.
- The built nogui binary in a sandbox HOME (env -i): magpie save home /
  save work / use home / use work switched Codex's magpie-models.json
  between m1 and m1-m3.
- profile-details.test.cjs (en, zh window and panel, zh-TW, ja, de) in
  Chromium and WebKit; fails without the app.js line. With
  profile-confirm, panel-profiles, gui-ja, gui-de, gui-zh-tw, i18n-keys
  and click-scroll: 38/38 in each engine.
- gofmt -l clean; go vet (darwin), GOOS=linux go vet -tags nogui,
  GOOS=windows go vet on profile, provider, gui; go build, linux nogui
  and windows builds; go test -tags nogui ./... under a temp HOME, all ok.
Not tried in the real window with a live gateway.
2026-10-09 11:06:07 +08:00
tobitege 21702d01ff Add German translation; harden paths against unset env vars (#770)
* Add German translation and harden paths against unset env vars

Add a German locale to the GUI, tray menu, usage alerts and website home page, and refuse to start when the home folder is unset or relative so nothing is written under the working folder; the pi plugin no longer adopts the user's PI_CODING_AGENT_DIR, and an inherited APPIMAGE no longer selects portable mode. Scripts refuse to run from the wrong folder or empty a shared out folder, and a new internal/testenv sandboxes every test package from the user's real files, which also fixes the Claude picker and Termux installer tests on Windows.

* Makefile: know magpie's folder by its go.mod, so paths with spaces work

The check compared $(CURDIR) with $(dir $(abspath …)), which make splits on spaces, so a checkout under 'My Projects' or 'John Doe' refused every target. It now reads go.mod relative to the working folder and wants magpie's module there: make -C and a symlinked Makefile work, make -f from another folder still stops before any recipe runs.

* i18n: German for the strings main added since, with a parity test

75 strings main added (group order, patterns, slow-start wait, usage caps, RTK savings …) get their German, and two that main dropped go. gui-de.test.cjs checks, as gui-ja does, that de has every zh string with its placeholders and tags, and that the window reads in German when picked or on a German system.

* appdir: ignore relative folder variables when reading, keep them for children

CheckEnv no longer unsets anything. magpie reads the XDG folders, APPDATA/LOCALAPPDATA and every agent's folder variable through appdir.Getenv/LookupEnv, which pass over a relative value; the environment stays as it is, so the agents magpie starts get the variable as the user set it. That covers what proc.UserPath lends from the login shell too, which is set after main's check and reached the desktop app unchecked. On Windows a path rooted on the current drive (\Users\x, Git Bash's /c/x) counts as usable, and magpie version and help answer without a home, before run makes any folder.

* Sandbox the tests main added since

internal/wslrun gets testenv's TestMain, and four tests main added that set HOME alone set their home with testenv.SetHome, so on Windows they don't read the runner's profile through USERPROFILE.

* agentenv: PI_CONFIG_DIR and OPENCODE_DB take relative names on purpose

omp puts $PI_CONFIG_DIR under the home and OpenCode a relative $OPENCODE_DB in its data folder, so neither depends on the working folder: appdir no longer passes them over.

* i18n: German for the Library's multi-select and System One's decision API

The 19 strings main added since (#791's skill multi-select, the decision API snippets) get their German; the one main replaced (four APIs → five APIs) goes.

* appdir: tidy the import into magpie's group; say what Go makes of /c/x

The appdir import joins the group of magpie's own imports where a file has one. rooted's comment now says that Go takes a Git Bash path like /c/x as \c\x on the current drive, not C:\x.
2026-10-04 23:30:56 +08:00
Lin Huazhong d8ebf2b893 test: one list of the agent folders a sandbox clears, so no sandbox misses an agent (yetone, on #522: A shared list of env vars for the other sandboxes would be a welcome follow-up) — every sandbox kept its own list of the variables that point at an agent's folder, and each had drifted: the gateway's cleared 5 of the 32 magpie reads, the provider package's 2, the tui's 10, the library's 20. A sandbox clearing 2 meets whatever Grok, Kimi, Hermes, MiniMax, Qoder or ZCode the developer has installed, which is how #522 came about — Qoder's two were in the library's list and in none of the four that failed. internal/agentenv is now the one list, and the 21 sandboxes that fake an environment with no agent in it clear it, each keeping beside it the variables that are not an agent's: APPDATA and LOCALAPPDATA, which a sandbox sets to a folder of its own rather than clearing, VISUAL and EDITOR. A name in the list is one magpie reads, and TestVarsAreRead walks the sources to say so, which is how two names a sandbox had been clearing turned out to be read by nothing at all — GEMINI_CLI_HOME and OPENCODE_CONFIG in internal/backup's, while OPENCODE_CONFIG_DIR, the one internal/agent reads (agents.go:545), was not in it. Where a sandbox set an agent's folder to a fixture of its own, the clearing now comes first, since a list of 32 wipes what a list of 5 left standing. Not converted: the omp tests' four variables, which are the ones omp's own lookup consults (a Pi fork) rather than every agent's, and the warm-up's Claude Code traffic flags, which are not folders — CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC stays out of the list for that reason too, its one test setting it on purpose. On Windows 11 the whole suite answers as it did before the change: 31 packages pass, and the same 15 tests in internal/library, internal/gateway and internal/agent fail for what they failed for before (symlinks this machine has no privilege for, and TestSuffixModesReachAgentFiles). go vet ./..., go build -tags nogui (windows, GOOS=linux, GOOS=darwin), and go vet -tags nogui for linux and darwin over every package touched pass. (#543) 2026-10-02 17:22:16 +08:00
yetone 65f3a6417a settings: portable mode — a data folder beside magpie keeps everything magpie keeps (#508, suixinex) — like VS Code's portable mode, a folder named "data" (or a file named ".portable", the data folder then made beside it) next to magpie makes it keep all its own files there instead of the user's profile. Where magpie keeps its files is now decided in one place, internal/appdir: Config() (~/.config/magpie, $XDG_CONFIG_HOME/magpie; portable: data/), Cache() (~/.cache/magpie, $XDG_CACHE_HOME/magpie; portable: data/cache) and SystemCache() (the OS's cache folder, which the library's market lists and an update staged where magpie may not write used; portable: data/cache). settings.Dir()/Path(), provider.Path(), profile.Path(), the models.dev catalog, the exchange rate and the plugin market cache go through it, and everything built on them follows: providers, logins and saved accounts' folders, usage ledger, routing history and request archive, plugins, library, backups, sync state and lock, caller keys, redact key, stats. "Beside magpie" is the folder holding the executable with links followed; for a Mac app the folder holding Magpie.app (inside the bundle would break its signature), and for an AppImage the folder holding the .AppImage, not where it is mounted. The decision is made once, at start: an update moves the running copy aside (into .magpie-update on a Mac, to magpie.exe.old on Windows) and its files must not move with it; the updated copy replaces the executable or bundle only, so the data folder beside it is left alone. A portable magpie doesn't copy an old dial install's folders in. Not moved, as they aren't magpie's own: the agents' configs (~/.claude, ~/.codex…), the sign-ins agents keep in the system keychain (a saved Claude account's Claude Code keychain item is named after its folder's path on a Mac, so a portable folder moved elsewhere or to another Mac signs that account in again), autostart and link-handler registrations, and temporary folders. The single-instance id already covers the config folder, so a portable and an installed magpie run side by side, but the gateway port is one. Settings shows the config folder as portable. TestResolve (data folder, .portable, a file named data, a Mac bundle), TestResolveSymlinkedExe, TestResolveAppImage (Linux), TestFolders and TestPortableSettings (Path() lands in the data folder, Save writes there, ~/.config/magpie untouched); TestPortableSettings fails without the change (Path() is ~/.config/magpie/settings.json), TestResolveSymlinkedExe without following links. A nogui build run from a folder with data/ under a sandbox HOME wrote profiles.json, cli-identity.json and cache/models.json into data/ and nothing of magpie's into HOME. go vet ./internal/..., go build -tags nogui ./... (darwin, GOOS=linux), GOOS=windows go build ./..., go test -tags nogui ./... pass. 2026-10-02 13:00:22 +08:00
yetone 973bf4eb2c profiles: a profile's details list all four of Claude Code's tiers, one left to follow the main model saying so (#480: opus and fable, following it, were missing from the details, so they read as not set) — a tier is a quiet field, empty while it follows the main model, and the details left every empty quiet field out. A field now says which one it follows (Follows, "model" for the tiers), and the details keep such a field, empty, with it; the panel shows it as "follows the main model (<model>)" (跟随主模型(…)), or "follows the main model" when the main is the agent's default. Other quiet fields (Codex's sign-in, subagents) are still left out while empty, and what applying a profile writes is unchanged. TestDetails and profile-details.test.cjs (Chromium, WebKit, en, zh) fail without the change. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass. 2026-10-02 05:50:23 +08:00
yetone 818621b75e profiles: a click on a profile shows what it holds, and its Apply applies it (#467 emo172: a saved profile could only be seen by applying it over the setup in use) — a profile's chip applied it at once, and all the page knew of it was a one-line summary of its models. The state now carries each profile's fields by agent, under the agents' names and the fields' labels, in the order magpie lists them, with the Library's servers, skills and instructions each agent gets (not the instructions' text); a value that reads as a key or a token (a field named for one, a known key prefix, a long run of letters and digits) is sent as hidden, never its text. A click on a chip opens its details under its line in the window, and over it in the tray panel with Apply at their foot by the chip, the chip clicked staying where it is; opening them changes nothing, a second click closes them, Apply applies the profile; ↻ and × stay on the chip. In English and Chinese. TestDetails and TestStateProfileDetails fail without the change, as does profile-details.test.cjs (Chromium and WebKit, en and zh, window and panel). go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass (TestFXInState's TempDir cleanup flakes with or without the change); profile-details, panel-profiles, click-scroll, old-webkit pass. 2026-10-02 03:09:42 +08:00
Snowyy a3704c422b tests: keep the suite out of a real DSH_HOME, as the other homes already are (#454)
DSH_HOME beats HOME in DshDir and in dsh's own dir, so a suite that sandboxes HOME still reads and writes the developer's ~/.dsh.
2026-10-02 00:42:23 +08:00
yetone 0361189f9e test: every package's tests pass on Windows, and none writes outside its sandbox (the user: 把 Windows 上那几个失败的测试修掉) — on a Windows box the suite failed in most packages, and the root package hung for 25 minutes. Tests set HOME, which os.UserHomeDir ignores on Windows (it reads USERPROFILE), so they read and wrote the runner's own home; each now sets USERPROFILE beside HOME, and Devin's, Goose's, Crush's and Claude Desktop's tests set APPDATA/LOCALAPPDATA, where those keep their files there. said() read the command's output only once it returned, and a pipe holds a few KB on Windows, so magpie model --help blocked forever; it reads while the command writes. Unix permission bits (the gateway key store's 0600 too), exec bits and symlinks Windows lacks are checked only off Windows; TOML strings hold Windows paths as literal strings, JSON as marshalled ones; a URL's path is compared as one. The provider and usage packages run in a home of their own (TestMain, as the gateway's already does), since a CLI's identity kept by a refresh still going when its test ended landed in the runner's ~/.config/magpie — and on a Mac in the user's own. Two product fixes came out of it: imagemcp took a file:///C:/… root or image for the path /C:/…, which doesn't exist on Windows, and now makes a Windows path of it (a host for a UNC share); and session discovery could keep a new Cowork session hidden on Linux, where a folder's mtime is a kernel tick and its size doesn't change, so an entry added within the tick of the last listing left both as they were — a listing made within 2s of its folder's last change is read again, as git does for racy files. TestFilePath and TestRacyDirectoryListedAgain fail without the change. On Windows 11 every package passes (32 of 32) and a run of each package in a fresh home leaves nothing in home, APPDATA or LOCALAPPDATA; on Linux (WSL) and macOS go test -tags nogui ./... passes. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build pass. 2026-10-01 23:15:07 +08:00
TryWorld a32186a6ba fix(profile): preserve default values in snapshots (#421) 2026-10-01 19:43:32 +08:00
yetone 04f374fa8c agent: OmO (oh-my-openagent, omo-ai), a fork of Pi that keeps its own ~/.omo/agent, gets its own row: a magpie model sets settings.json's defaultProvider/defaultModel and magpie's provider in models.json there as Pi's does, $OMO_CODING_AGENT_DIR / $SENPI_CODING_AGENT_DIR are honoured, the Library writes its AGENTS.md, mcp.json and skills, and omo update updates it (#264 rhyme227). Pi's own ~/.pi is left alone. piIn becomes piLike(at, id, name, dir) so both share one wiring. Tested with omo_test.go in agent and library (fail without the change); go vet, go build -tags nogui (darwin, GOOS=linux, GOOS=windows), go test -tags nogui ./... pass. 2026-09-30 11:38:07 +08:00
yetone 52b3ad3a9e agent: on Windows, Codex installed in a WSL distro is an agent of its own, codex@wsl:<distro> ("Codex · WSL Ubuntu") — the distros are listed with wsl.exe -l -q (UTF-16LE, or UTF-8 under WSL_UTF8), each asked once through proc for its $HOME, its ~/.codex, a codex on its PATH and its default route, and shown only where Codex is; its files are Codex's own reading and writing (codexIn, at a place rather than a home) through \\wsl.localhost\<distro> (\\wsl$ before that), with the catalog path written in as the distro spells it and what was there stashed under the distro's agent; the gateway written in is 127.0.0.1 when .wslconfig has networkingMode=mirrored and otherwise the Windows host by the distro's default route, with a notice that NAT needs the gateway beyond loopback and through Windows' firewall and that mirrored is the way; its requests stay counted as Codex's, and a profile key is split at its last dot for distro names like Ubuntu-24.04. Nothing runs off Windows. Kimi CLI isn't an agent magpie has yet, so there is no Kimi in WSL. Tested on a Windows box under NAT with a throwaway Alpine distro: detected (the real distros without Codex left out), a magpie model set and reset from the CLI and a test binary, the catalog read inside WSL at /root/.codex; mirrored networking tested only in unit tests 2026-09-28 17:22:30 +08:00
yetone c4268e524f providers: a provider's id can change — its editor has an ID field (magpie provider set <id> id=<new> in the CLI), and renaming it moves what named it by the old one: the agents on its models (each spelled its own way, recorded as magpie's), the routing groups' members, rules and classifier, other providers' fallbacks, which agents are shown it, and the vendor's fetched list. The old id stays with it, so an agent still running on the old config reaches it, a profile saved before applies to the new id, and its usage so far is counted under the new one. Asked on Discord 2026-09-26 20:22:30 +08:00
yetone 04302b1e63 agent(codex): a Codex taken off magpie behind its back says so, with Apply again — something else rewriting config.toml (another switcher, an installer, a profile of its own) left the row showing a magpie model while Codex asked OpenAI for it, and the user blamed magpie; magpie now remembers what it set on each agent (applied.json) and tells three kinds of drift apart: the wiring gone (the provider table, catalog or base URL, or a profile overriding them), a magpie model replaced by one of Codex's own, and a Codex used since with none of its requests reaching the gateway (history.jsonl against when the gateway last saw it — an old process on an old config). A drifted row carries a coral Apply again pill on its name's line (a badge on the logo in the panel), the reason in its tooltip, Keep current settings in the row menu; the window asks /api/drift every 15s, so it shows without a reload 2026-09-26 01:05:19 +08:00
yetone dd7d4875d7 profiles: a saved profile keeps the Library's setup too, and switching to it switches that as well (#29) — which agents get each MCP server and skill, and the instructions (the shared text, the agents it is written to, what each gets besides), so moving from one profile to another left the tools and the instructions as they were and only the models followed. A profile keeps them under "library" beside its agent.field keys; the servers and skills themselves stay in the library, a profile only names them. Applying one sets the models as before, then gives each server and skill to the agents it names and puts the instructions back, written into the agents as any Library change is, their files and the library's own instructions kept aside first; one removed from the library since is skipped and said so, one added since keeps its agents (the profile knows nothing of it, and switching it off would lose it for good). A profile saved before, or while the library was empty, carries none and leaves the library as it is. magpie profiles, the TUI and the panel's chips say what a profile gives out (+ library: 2 servers, 1 skill, instructions) 2026-09-25 14:23:56 +08:00
yetone 14663c3a65 agent: Claude Code's opus, sonnet, haiku and fable tiers can each take their own model (#3)
Through magpie, each tier follows the main model until it is given one of
its own (ANTHROPIC_DEFAULT_*_MODEL; haiku also sets ANTHROPIC_SMALL_FAST_MODEL).
The GUI shows them under one tiers menu; the CLI takes magpie claude haiku <model>.
2026-09-24 12:38:41 +08:00
yetone 402a96c39d Rename dial to magpie, with a magpie for a logo
The product, module path (github.com/yetone/magpie), binaries, env vars
(MAGPIE_ADDR, MAGPIE_DEV_UI, MAGPIE_THEME, MAGPIE_DEBUG), config and cache
folders (~/.config/magpie, ~/.cache/magpie), bundle id (com.yetone.magpie),
gateway provider id and token, and every UI string now say magpie.

On first run magpie copies ~/.config/dial and ~/.cache/dial to the new
folders when they don't exist yet (copy, not move, so a still-running dial
keeps working; the old folders can be deleted by hand later).

The logo is a small round magpie in profile: one path for the header and
the tray, and the app tile adds the white belly and the blue-green tail.
The header mark is drawn in ink rather than the accent colour, which
fought the text in light mode.
2026-09-23 23:55:11 +08:00
yetoneandClaude 0a234ce41d dial: one dial for every coding agent's model
Wails v3 tray panel and window, TUI and CLI. Switches model, effort and
provider for Claude Code, Codex, Gemini CLI, OpenCode, Pi, Goose, Cursor,
Copilot CLI and Crush with format-preserving config edits. Providers page
and registry, stored keys, live vendor model lists, profiles.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-22 21:47:29 +08:00