Files
magpie/internal/sessions/testdata
yetone b30734f964 sessions: Antigravity CLI (agy) conversations are listed, with title, folder, tokens and resume (RickyWei, #1718)
agy's conversations were on no Sessions page: internal/sessions had no
lister for them, only the calls reader of #2097. Now each
~/.gemini/antigravity-cli/brain/<id>/.system_generated/logs/transcript_full.jsonl
is a session (agy.go). Its steps give the start and last times, the first
prompt (taken out of agy's <USER_REQUEST> wrapper), prompts, replies, tool
calls, and tokens under the model "agy", since no step names one. A step
written again replaces its tokens, read on or read whole. The title and
folder come from the conversation's conversation_summaries.db row:
title, and workspace_uris through agyFolder, which turns file:///C:/... and
file:///c%3A/... into C:\... and a host into \\host\share on Windows. agy
writes the title after the transcript, so the row is the file's rev. The
database is read again only when it or its -wal changed, and a failed read
keeps the rows read before. A row with conversations/<id>.db and no
transcript (#1718's case) is listed from the row alone, with no tokens and
no conversation to open. Resume is "agy --conversation <id>". When agy is
set to use magpie, it is the agent's launch command (gateway variables and
--model, the PowerShell form on Windows) with --conversation after it,
through sessions.AgyStart, which package agent sets. The transcript (user
text, thinking, text, tool calls, tool results) can be opened and searched.

Format read from real files: agy 1.3.5 and 1.4.7 in a sandbox HOME
against a fake Gemini endpoint, with plain replies, a read_file tool call
with thinking, invalid tool calls, and a conversation picked up again with
--conversation from another folder. testdata/agy-sessions is three of
those conversations with paths rewritten to /work.

Resume tried for real in the sandbox: `agy --conversation <id> -p again`
from another folder appended steps 2-4 to the same transcript and kept the
row's folder. Interactive `agy --conversation <id>` (in tmux) showed the
earlier turns.

Run at this tree, rebased on origin/main:
- gofmt -l internal clean
- go vet: darwin; GOOS=linux -tags nogui; GOOS=windows
- GOOS=windows go build ./...; GOOS=linux go build -tags nogui ./...
- go test -count=1 ./internal/sessions ./internal/gui ./internal/agent: ok
  before the row-only change. After it, sessions ok, and gui had one red,
  TestMainWindowCorners killed at its 40s deadline at load ~300 (#1936).
  It passes alone (47s).
- GUI (playwright 1.62.0, chromium and webkit, en and zh): i18n-keys,
  gui-de, gui-ja, gui-zh-tw, session-terminal, sessions-bar-names,
  sessions-manage, sessions-talk, sessions-toolbar: 49 of 49. No GUI asset
  changed. Tab names come from the agent registry.

Fails without the change (broken by hand, each one red):
- agyFiles out of allFiles: TestAgySessions, TestAgyTitleLater, TestAgyTranscript
- agy out of refresh's DBRevision check: TestAgyTitleLater
- no dropUse of a rewritten step: TestAgyGrows (4510 input, want 3010)
- AgyStart ignored: TestAgySessions (wired resume)
- drive letter not handled: TestAgyFolder
- agy out of HasTranscript: TestAgySessions, TestAgyTranscript
- the row-only listing off: TestAgyRowOnly; readable() off: TestAgyRowOnly

Not tried: agy on Windows. The Windows box (10.0.0.132) didn't answer
ssh, so the Windows paths are covered by unit tests only (agyFolder,
the Set-Location resume form). A wired resume through magpie's real
gateway was not tried. Not done: subagents (parent_conversation_id),
which I never saw agy write. The model name, which is only in
conversations/<id>.db's protobuf (#3147). Deleting an agy session from magpie. agy in WSL: #3595.

Side effect: agy's self-updater ran in the sandbox and replaced the
live ~/.local/bin/agy, 1.3.5 -> 1.4.7.
2026-10-25 18:24:20 +08:00
..
sessions: ZCode, DeepSeek Harness, Cline and Qoder's sessions are listed too (lml: 希望会话里也能看到 ZCode、Qoder CN、Cline、DeepSeek Harness 的) — ZCode's are OpenCode's tables in ~/.zcode/cli/db/db.sqlite, read as OpenCode's database is (opened read-only), its tokens the AI SDK's (input less the cache, output as it is), its model modelId, a title_source of default no title, a prompt typed a real_user's; dsh's are ~/.dsh/sessions ($DSH_HOME), a folder a session, the latest format's session[.vN].jsonl[.zstd] read whole, zstd frames and all, a subagent's (parentSession) in its parent's, a fork's seeded events (seedLength, or up to an inherited session/end-seed) counted where they were first written; Cline's are ~/.cline/data/sessions ($CLINE_SESSION_DATA_DIR, $CLINE_DATA_DIR, $CLINE_DIR), <id>.messages.json with its manifest <id>.json for the cwd, the prompt and the title, a subagent's other messages file beside it, a fork's messages before its forkedAt not counted, cline --id <id> to pick it up; Qoder's and Qoder CN's are Claude Code's lines in ~/.qoder/projects and ~/.qoder-cn/projects ($QODER_CONFIG_DIR, $QODERCN_CONFIG_DIR), qodercli --resume / qoderclicn --resume. Each folder is watched when it's there (Dirs). Tests keep HOME in their sandbox now. Tested with made-up fixtures for each (a ZCode database made in the test, dsh plain and zstd, forks of both formats, a Cline fork and subagent, both Qoder builds), and read-only against copies of this machine's ZCode database and dsh sessions: 2 and 13 sessions, their token totals the same as a separate tally of the raw rows
2026-09-28 22:45:50 +08:00
sessions: ZCode, DeepSeek Harness, Cline and Qoder's sessions are listed too (lml: 希望会话里也能看到 ZCode、Qoder CN、Cline、DeepSeek Harness 的) — ZCode's are OpenCode's tables in ~/.zcode/cli/db/db.sqlite, read as OpenCode's database is (opened read-only), its tokens the AI SDK's (input less the cache, output as it is), its model modelId, a title_source of default no title, a prompt typed a real_user's; dsh's are ~/.dsh/sessions ($DSH_HOME), a folder a session, the latest format's session[.vN].jsonl[.zstd] read whole, zstd frames and all, a subagent's (parentSession) in its parent's, a fork's seeded events (seedLength, or up to an inherited session/end-seed) counted where they were first written; Cline's are ~/.cline/data/sessions ($CLINE_SESSION_DATA_DIR, $CLINE_DATA_DIR, $CLINE_DIR), <id>.messages.json with its manifest <id>.json for the cwd, the prompt and the title, a subagent's other messages file beside it, a fork's messages before its forkedAt not counted, cline --id <id> to pick it up; Qoder's and Qoder CN's are Claude Code's lines in ~/.qoder/projects and ~/.qoder-cn/projects ($QODER_CONFIG_DIR, $QODERCN_CONFIG_DIR), qodercli --resume / qoderclicn --resume. Each folder is watched when it's there (Dirs). Tests keep HOME in their sandbox now. Tested with made-up fixtures for each (a ZCode database made in the test, dsh plain and zstd, forks of both formats, a Cline fork and subagent, both Qoder builds), and read-only against copies of this machine's ZCode database and dsh sessions: 2 and 13 sessions, their token totals the same as a separate tally of the raw rows
2026-09-28 22:45:50 +08:00
sessions: ZCode, DeepSeek Harness, Cline and Qoder's sessions are listed too (lml: 希望会话里也能看到 ZCode、Qoder CN、Cline、DeepSeek Harness 的) — ZCode's are OpenCode's tables in ~/.zcode/cli/db/db.sqlite, read as OpenCode's database is (opened read-only), its tokens the AI SDK's (input less the cache, output as it is), its model modelId, a title_source of default no title, a prompt typed a real_user's; dsh's are ~/.dsh/sessions ($DSH_HOME), a folder a session, the latest format's session[.vN].jsonl[.zstd] read whole, zstd frames and all, a subagent's (parentSession) in its parent's, a fork's seeded events (seedLength, or up to an inherited session/end-seed) counted where they were first written; Cline's are ~/.cline/data/sessions ($CLINE_SESSION_DATA_DIR, $CLINE_DATA_DIR, $CLINE_DIR), <id>.messages.json with its manifest <id>.json for the cwd, the prompt and the title, a subagent's other messages file beside it, a fork's messages before its forkedAt not counted, cline --id <id> to pick it up; Qoder's and Qoder CN's are Claude Code's lines in ~/.qoder/projects and ~/.qoder-cn/projects ($QODER_CONFIG_DIR, $QODERCN_CONFIG_DIR), qodercli --resume / qoderclicn --resume. Each folder is watched when it's there (Dirs). Tests keep HOME in their sandbox now. Tested with made-up fixtures for each (a ZCode database made in the test, dsh plain and zstd, forks of both formats, a Cline fork and subagent, both Qoder builds), and read-only against copies of this machine's ZCode database and dsh sessions: 2 and 13 sessions, their token totals the same as a separate tally of the raw rows
2026-09-28 22:45:50 +08:00