v5tech's `magpie ls` listed six agents that were uninstalled, found by
the folders they left. agentDir already set aside a folder holding only
skills/ (made by skill installers); it now also sets aside the folders an
agent writes as it runs rather than as it is set up: logs, log, debug,
diagnostics and cache, as folders only (a file of that name still counts).
This machine has the same case: WorkBuddy.app is installed, the CodeBuddy
CLI isn't, and ~/.codebuddy holds only logs/ and diagnostics/ (dated from
WorkBuddy's install), so CodeBuddy Code showed as installed.
Not changed, and why: the reporter's Option A (count only the agent's
Path) would hide every freshly installed agent whose Path is the file
magpie itself writes (WorkBuddy's and CodeBuddy's models.json), and
~/.copilot/config.json or a QWEN.md is the agent's own file either way, so
those stay detected. The GUI already folds agents with nothing set under
Not set up and can hide one; `magpie ls` puts hidden ones last, dimmed.
TestWorkBuddyAIWritesItsOwnFolder's fixture had only logs/ and now holds
argv.json and device-id as well, as the China build's ~/.workbuddy does
(fixed up in the #1494 commit).
Run: TestLeftoverFoldersAreNotInstalled (codebuddy logs+diagnostics, qwen
debug, hermes cache+log+skills, a file named logs) red on the old agentDir
(3/3 subtests), green now; go test ./internal/agent; a sandbox HOME
`magpie ls` with ~/.codebuddy/{logs,diagnostics} and ~/.qwen/debug lists
nothing, and with ~/.qwen/QWEN.md lists Qwen Code. gofmt -l and
GOOS=linux/windows go vet clean.