feat(agent-consoles): registry editor — point "Edit config" at agents.toml - #69
Merged
Conversation
…ation
Backend for the registry editor (agent-consoles follow-up): the config editor
still wrote the deprecated `remote.toml`, even though slice 1 made `agents.toml`
the source of truth. Add the read/write path for the registry itself.
- remote.rs: `read_registry_text` returns `agents.toml`; when it is absent or
empty it seeds the editor with the *adopted* registry (the legacy `remote.toml`
rendered via `AgentRegistry::to_toml`), so opening the editor migrates a
single-endpoint setup into the multi-agent format on first save.
`write_registry_text` parses + runs `AgentRegistry::validate` (unique non-empty
names, ≤1 `management`) before writing — a bad edit never lands. Per-endpoint
url/token completeness stays a dial-time check, matching `remote.toml`.
- lib.rs: `registry_config` / `registry_config_write` commands ({path,text}),
registered in the invoke handler. Tokens live in this text, so it is
editor-only and never mixed into the panel/selector views (which stay
token-free).
- Unit tests for the reject paths (bad TOML, two managements, dup names) — these
short-circuit before any filesystem access.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The remote panel's "Edit config" opened the deprecated `remote.toml`, which `agents.toml` shadows once it exists — so edits silently did nothing. Repoint the editor at the registry. - source.ts / types.ts / fixtures.ts: `RegistryConfig` + `registryConfig` / `writeRegistryConfig` on `Source` (Tauri → `registry_config[_write]`; Mock → a canned `agents.toml`). `remoteConfig` keeps serving the panel's url+status; `writeRemoteConfig` stays for the legacy path but is no longer wired to a button. - main.ts: `EditorTarget` is now `fleet | registry`; `openEditor` loads `agents.toml` lazily (titled "edit agents.toml") on each open; on save it refreshes both the management panel and the agent-console selector, since the registry drives both. The backend rejects a structurally-invalid registry (dup names / two managements) without writing, surfaced as the editor error. 75 frontend tests + tsc + build green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
brettchien
added a commit
that referenced
this pull request
Aug 17, 2026
…ote.toml (#72) Since #69 the REMOTE panel's "Edit config" opens the registry (`agents.toml`, the source of truth), but the panel still *displayed* the `remote.toml` path (from `remoteConfig.path`) with a "configure the remote connection" tooltip — so the shown file didn't match the file the button opens. Label the registry path instead. It lives in a different view-model (`RegistryConfig`) than the connection view, so `remoteHtml`/`renderRemote` take it as a param; `refreshRemote` loads it best-effort (a registry read error never blanks the connection panel) and re-uses the cache a save refreshes. When the registry path isn't known yet the label is omitted — better than mislabelling `remote.toml`. - render.ts: `remoteHtml(view, registryPath?)` / `renderRemote(el, view, registryPath?)` — show the registry path, updated tooltip + comment. - main.ts: `refreshRemote` loads `registryConfig` best-effort; both render sites pass `registryConfig?.path`. - render.test.ts: +2 cases (labels agents.toml not remote.toml; omits the label when no registry path is known). Verification: `tsc --noEmit` clean · 86 vitest (2 new) · `vite build` OK. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The remote panel's Edit config button edited the deprecated
remote.toml. But slice 1 (#66) madeagents.tomlthe source of truth — when it exists,remote.tomlis ignored — so once you have a multi-agent registry, that button edits a file the app no longer reads. This closes that gap: the editor now edits the registry (agents.toml), so multi-agent setups are manageable from the UI instead of by hand-editing files (the "Studio is the control plane" gap Brett flagged).Independent of #68 (fs read path); branched on fresh
main.Backend (
studio-desktop)remote.rs—read_registry_textreturnsagents.toml; when absent/empty it seeds the editor with the adopted legacyremote.toml(rendered viaAgentRegistry::to_toml), so opening the editor migrates a single-endpoint setup to the multi-agent format on first save.write_registry_textparses + runsAgentRegistry::validate(unique non-empty names, ≤1management) before writing — a bad edit never lands. Per-endpoint url/token completeness stays a dial-time check (a half-filled entry is savable, matchingremote.toml).lib.rs—registry_config/registry_config_writecommands returning{path, text}, registered in the invoke handler. The file carries tokens, so this text is editor-only and never mixed into the panel/selector views (those stay token-free).Frontend (
console)RegistryConfig+registryConfig/writeRegistryConfigonSource(Tauri → the new commands; Mock → a cannedagents.tomlfixture).EditorTargetis nowfleet | registry;openEditorloadsagents.tomllazily (titled edit agents.toml) on each open; on save it refreshes both the management panel and the agent-console selector, since the registry drives both.remoteConfigstill feeds the panel's url+status;writeRemoteConfig/remote_config_writeremain for the legacy path but are no longer wired to a button.Verification
console:tsc --noEmitclean · 75 vitest tests ·vite buildOK.acp-tunnel: 34 tests (incl.AgentRegistryparse/validate/round-trip).studio-desktop(out-of-workspace, GTK) compiles + runs the new reject-path tests in the bundle-macos CI job.🤖 Generated with Claude Code