Files
magpie/internal/sessions
yetone 29d0ab39fb sessions: Antigravity CLI (agy) sessions can be deleted (ysm119 on Discord)
ysm119 (#help) could delete Codex sessions on the Sessions page but not
agy's, and wanted to clear out empty ones. A delete now moves a
conversation to magpie's trash the way agy's own /resume delete (F4)
removes it: brain/<id>/, conversations/<id>.db with the -wal, -shm and
-journal SQLite leaves beside it, and annotations/<id>.pbtxt. Restore puts
them back.

What agy keeps of a conversation, read from real agy 1.4.12 in a sandbox
HOME against a fake Gemini endpoint (the live ~/.gemini was only read):
the files above, presence/<id>.lock, a row in conversation_summaries.db,
an entry in jetbox_summaries_proto.pb, and cache/last_conversations.json.
agy's own delete removes the files, the row and the jetbox entry. It
leaves the lock and last_conversations.json. magpie leaves the row and
jetbox entry too, because agy keeps both files open and jetbox is an
unknown protobuf. agy's /resume list leaves out a row whose files are
gone, so it never lists a deleted conversation.

A conversation agy has open is not deleted: agy flocks presence/<id>.lock
for as long as it has it open, idle too, and a held lock (or one that
can't be tried) is ErrActive. On Windows how agy locks it hasn't been seen,
so the minute since a write decides there alone.

Siblings: Hermes, Alma, OpenCode, ZCode, Cline, Grok Build, Kimi Code and
Claude Desktop (Cowork) sessions still can't be deleted. Each keeps an
index magpie would have to edit or leave stale; filed as #4595 with what
each needs.

Run at d018b9302 (on origin/main c30d3b7b6), then rebased onto 2cca11176,
which changes internal/gateway only; go test ./internal/sessions passed
again at the pushed head:
- mote: gofmt -l internal/sessions clean; go vet ./internal/sessions
  (darwin, GOOS=linux -tags nogui, GOOS=windows -tags nogui); go build
  ./... and the linux/windows nogui builds: ok.
- mote: go test -tags nogui -count=1 -timeout 45m ./...: 82 packages ok,
  internal/gui red only on TestSettingsSaveKeepsWhatItDoesNotSend (#4514)
  and TestColdTurnsTaken (#4510), both filed before and untouched here.
  go test ./internal/gui alone also showed TestMainWindowCorners (#3949).
- Windows (win-run): go test -run Agy ./internal/sessions: both new tests
  pass. TestAgySessions and TestAgyRowOnly are red there already (#4115,
  a /work cwd read as \work).
- Real agy 1.4.12 in a sandbox HOME, with a test binary built from this
  tree: Delete of one of three conversations moved its brain folder,
  .db and .pbtxt. agy's /resume then listed 2 of 3 and Other "No
  conversations available". Restore brought it back, and /resume listed 3.
  Before this, with the files moved by hand, `agy --conversation <id>`
  resumed a restored conversation and appended to it.

Broken by hand (each red in TestAgyDeleteRestore/TestAgyDeleteRowOnly):
agy taken out of Deletable; the presence-lock check turned off (a
conversation agy has open was deleted); only <id>.db moved, not its
-wal/-shm (a fresh -wal wasn't seen as recent, and they'd be left behind).

Not tried: agy on Windows or Linux for real; the GUI suite (no GUI file
changed: the Sessions page shows Delete from /api/sessions/manage's
deletable flag).
2026-10-31 23:10:48 +08:00
..
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
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
2026-10-02 08:20:33 +08:00