erlinerd's patch on #2721 (profile.Rename, /api/state profile/rename,
a Rename button in the details), reviewed against main and adapted:
- profile.Rename trims both names, refuses an empty, taken or missing
name and leaves profiles.json as it was, renames by case only
(home -> Home), and keeps what the profile holds.
- GUI: Rename turns the details' name into a field. Enter renames
through profileAction, so the chip is renamed at once, pending, and
rolled back with the error if magpie refuses; the details stay open
under the new name, with In use kept. Escape or a click away puts
the name back. The field lives in profilerename.js, imported on
press, so the core script stays under its budget (no raise; 50 bytes
under after comments in app.js were cut). While the field is open
In use, Apply and Rename hide so a 360px panel's field has room.
- TUI: ctrl+e on a profile renames it on the name line.
- CLI: `magpie rename <old> <new>`; a flag is never taken for a name.
- WebDAV: a rename syncs as the old name gone and the new one in
(davsync test).
Run on mote at 47672f11c (on 70b96126e), and again after rebasing on
52195b6b0 (backup), as 3b279fdee:
- go test ./internal/profile ./internal/cli ./internal/gui ./internal/tui
./internal/davsync: ok except TestEveryRouteHasACommandOrIsNamed
(#4826) and TestMainWindowCorners (#3949), both red on origin/main
07f4d46c5 too. gofmt clean; GOOS=linux (-tags nogui) and
GOOS=windows go vet ok.
- GUI, chromium and webkit: profile-rename (en, zh, zh-TW, ja, de;
900x560 window and 360x420 panel), panel-profiles, profile-confirm,
profile-in-use, profile-details, hermes-profiles,
view-wheel-after-click, i18n-keys, gui-de, gui-ja, gui-zh-tw,
editor-roomy: 219 pass, 0 fail. After the rebase: profile, cli,
gui, tui and vet again (same two reds only, core budget ok), and the
GUI files above with auto-backup in place of editor-roomy: 161 pass.
Then rebased over ea51526b6 (gateway, plugin, provider only; no
file of this change, no GUI asset) without another run.
Broken by hand, each red, then restored:
- Rename comparing names with EqualFold: TestRename red (case-only).
- Dropping the CLI's "-" check: TestRenameCommand red.
- Dropping `profileOpen = to`: profile-rename 22 of 22 red, both engines.
Not tried: the real app on Linux (WebKitGTK) or Windows; a rename
synced over a real WebDAV server.
Co-authored-by: erlinerd <erlinerd@outlook.com>
After an agent is uninstalled, the Agents page shows "CLI not found"
(d0fcb8bc), but Library still offered it for skills, MCP servers, shared
instructions and rtk, and a sync wrote into a folder nothing reads.
- library.Targets() leaves out an agent whose CLI is missing
(agent.CLIMissing: false for WSL, plugin and detect agents), so sync,
the read view, market, instructions, skills and found servers all
drop it at their one upstream.
- Takes() refuses a gone agent by name, so `library mcp add ...
agents=hermes` says "Hermes Agent's CLI isn't installed here; nothing
reads its MCP servers until it is installed again" instead of "every
agent already has it".
- The guards that must still see a gone agent's files (projects'
notGlobal for skills and MCP, instructions' own-file check) read
everyTarget(), so a set kept in the agent's own file is still refused.
- rtk: a gone agent isn't offered rtk; one that still has the hook is
listed so the hook can be taken out.
- Nothing a user wrote is removed: sync acts per target, so a gone
agent's skills, servers and AGENTS.md stay as they are, and the client
keeps agent ids it doesn't show.
Run:
- Sandbox HOME, real binaries: old wrote mcp_servers into a gone
~/.hermes/config.yaml; new refuses with the message above, exit 1.
- New tests TestTargetsLeaveGoneAgentsOut, TestGoneAgentKeepsWhatItHas,
TestRTKLeavesGoneAgentsOut; each broken by hand (Targets check,
Takes refusal, everyTarget in instructions, rtk gate) goes red.
- go test -tags nogui ./internal/library ./internal/tui ./internal/cli
./internal/gui: ok. Fixtures that relied on a gone CLI now place one
(holdCLI, TestRTKHermesHome, TestRTKOffPath), and so do profile's
and davsync's sandboxes, whose library syncs to claude and codex
(TestOldProfiles, TestProfileCarriesLibrary, TestSyncLibrary went red
in the full run without them).
- gofmt -l clean; go vet -tags nogui darwin/linux/windows clean.
- go test -tags nogui -p 4 ./... at the pushed head: see the last
commit of this push.
Not tried: the real GUI with an uninstalled agent on a live machine.
Co-authored-by: ggbdpq <ggbdpq@gmail.com>
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.