sessions: an Antigravity app conversation shows what was said, not only its title

@yansheng1003 on X: the Sessions page showed an Antigravity 2.0
conversation's title and preview only. HasTranscript left "antigravity"
out, since conversations/<id>.db's step text is encrypted at rest, so
the row had no Show conversation and /api/sessions/transcript said
"this agent's conversations can't be shown".

The app also writes every step in plain text beside the database:
brain/<id>/.system_generated/logs/transcript_full.jsonl in the same
store, in agy CLI's format (user input, planner responses with their
tool_calls, tool results). Antigravity 2.30's language server writes it
in the stable store and in Insiders' (both checked: run in a sandbox
HOME on Windows against a fake model that called read_file).

- transcript.go: antigravity has a transcript; readTranscriptOf reads
  it through agyTranscript (antigravityTranscriptOf), so the viewer,
  TranscriptAt, search, the said index and the Markdown export all get
  it. A conversation with no transcript file is ErrNoTranscript, as
  before.
- antigravity_app.go: antigravityTranscript derives the path from the
  database's (stable, Insiders, a WSL distro's); its size and time are
  folded into the session file's with the -wal's, so a step it adds
  reads the session and the said index again.
- search.go: linesFile is false for antigravity, so the encrypted .db is
  never pre-scanned for the words.
- testdata/antigravity-2.30-tools: that real conversation (db with the
  WAL checkpointed, summary row, brain/ logs).

Tests: TestAntigravityAppTranscript (stable, Insiders, WSL: parts, search
hit and miss, Markdown), TestAntigravityAppNoTranscript,
internal/gui TestSessionAntigravityConversation (/api/sessions marks it,
/api/sessions/transcript gives the five parts).

Run: on mica (mica-run) at base de5fc6700:
- gofmt -l internal/sessions internal/gui: clean.
- go vet ./internal/sessions ./internal/gui, GOOS=linux go vet -tags
  nogui and GOOS=windows go vet on the same, go build .: ok.
- go test -count=1 -timeout 45m ./internal/sessions: ok but for
  TestWSLAgentsGoneListingDrops (load ~48; fixed at its cause in the
  commit before this one); go test ./internal/gui: ok (299s).
- After that fix: go test -run 'WSL|Antigravity|Agy|Gone'
  ./internal/sessions ok; GUI files sessions-talk, -talk-sheet,
  -talk-model, -export, -said, -subagents, -reads, -search, -convert:
  168 of 168 in Chromium and WebKit.
- Old code (de5fc6700 with only the new tests and testdata):
  TestAntigravityAppTranscript red in stable, insiders and wsl ("the
  session isn't marked readable"), TestSessionAntigravityConversation
  red ("listed with no conversation to show ... Transcript:false").
- Windows (win-run on xiaomi-gpu): TestAntigravityAppTranscript (3
  subtests) and TestAntigravityAppNoTranscript pass.
  TestAntigravityAppFolder is red there at the base as well (#5957).
Rebased onto bfddc9cfb, on mote (mote-run) at this tree: gofmt clean,
the three vets and go build ok, go test -count=1 ./internal/sessions
./internal/gui ok (56s, 157s).
Not tried: the real GUI window opening this conversation; the API and
page are covered by the tests above.
This commit is contained in:
yetone
2026-11-18 18:55:46 +08:00
parent 65c9a2e411
commit d2fa7d8d79
12 changed files with 256 additions and 8 deletions
+13 -1
View File
@@ -1019,10 +1019,22 @@ including response folding and gateway matching. Insiders session ids
have an `insiders-` prefix in magpie, leaving stable ids unchanged and
keeping equal UUIDs in the two stores from sharing a session or call id.
The files themselves are not renamed. Sessions stay read-only with no
terminal resume command; encrypted conversation text is not read.
terminal resume command. The database's step text is encrypted and not
read; what was said is read from the plain-text transcript the app writes
beside it, `brain/<id>/.system_generated/logs/transcript_full.jsonl` in the
same store (`antigravityTranscript`), in agy's format and through agy's
reader (`agyTranscript`): the user's turns, the replies, each tool call and
its result, on the session viewer, search and the Markdown export
(@yansheng1003 on X: only the title and preview showed). Its size and time
are counted into the session file's with the `-wal`'s, so a step it adds
reads the session again. A conversation with no transcript is
`ErrNoTranscript`, as before.
Verification: `TestAntigravityInsidersSessions` covers Insiders alone,
both stores with the same UUID, per-model tokens, call ids, summary refresh
and turning the existing reading choice off, using #2190's real step bytes.
`TestAntigravityAppTranscript` reads a conversation the app's 2.30 language
server had with a read_file call (testdata/antigravity-2.30-tools) from
stable, Insiders and a WSL distro's store; `TestAntigravityAppNoTranscript`.
A read of every call decodes each file's cached shard, and over a long
history that is tens of thousands of files (#2278: 68k shards, 415 MB).