sessions: an Antigravity app conversation's folder is its summary row's workspace

The Antigravity app's Sessions tab put every conversation under "No
folder". Since 24dc1651b the app reader reads each conversation's row of
~/.gemini/antigravity/conversation_summaries.db for its title, and the
row's workspace_uris (a JSON list of file:// URIs) was already parsed into
the row's folder for agy, but parseAntigravity never set it as the
session's folder. It now does: the first local workspace URI, the same
rule as agy (agyFolder, including Windows drive and UNC forms). A row with
"[]", and a conversation with no row, still have no folder.

The antigravity parse version goes to 2: a parse kept in the Sessions
cache has the same row revision (agyRev already holds the folder) and
would otherwise keep its empty folder until the conversation changed.

Sibling, agy (the Antigravity CLI tab): already sets the folder from the
same column, for transcripts and row-only conversations (TestAgy*); no
change. A transcript with no row has no folder there, as before.

Shapes: workspace_uris and raw_summary as this Mac's agy writes them
(read only; ["file:///<project>"]); the fixture's paths are made up.

Run (mote): go test -tags nogui ./internal/sessions ./internal/usage ok;
GOOS=linux go vet -tags nogui and GOOS=windows go vet ./internal/sessions
ok; gofmt clean; GUI sessions-folder-list, -paging and -delete in
Chromium (34 pass) and WebKit (17 pass).

Broken by hand: with the old antigravity_app.go and sessions.go,
TestAntigravityAppFolder reads "" for both conversations with a workspace,
and TestAntigravityAppParseBeforeFolderReadAgain keeps the old parse.

Not tried: a real Antigravity app summaries database with workspace rows
(this Mac's app data folder has no conversations); the reporter's own
data; Windows paths beyond agyFolder's existing unit test.

Reported-by: xxooioo (Discord)
This commit is contained in:
yetone
2026-11-07 09:42:37 +08:00
parent ca77a9ea85
commit a1774d1235
3 changed files with 58 additions and 4 deletions
+5 -3
View File
@@ -52,8 +52,10 @@ import (
// (agy.go): the app's language server is agy's, and Antigravity 2.29.0's
// makes the same table in ~/.gemini/antigravity on its first start. title
// is the name the app gives it, preview what it lists the conversation as
// before that (the user's own words). Without the row, the steps' text
// being encrypted, a conversation has no name (xxooioo on Discord).
// before that (the user's own words), and workspace_uris the folders open
// when it was started, the first local one its folder on the Sessions page
// (agyFolder). Without the row, the steps' text being encrypted, a
// conversation has no name and no folder (xxooioo on Discord).
//
// A session is listed read only: the app has no command to pick a
// conversation up again from a terminal.
@@ -352,7 +354,7 @@ func parseAntigravity(f file) *state {
}
s := &state{Size: f.size, Mod: f.mod.UnixNano(), DBRevision: f.m().rev}
if r := f.m().agy; r != nil {
s.Named, s.Title = title(r.Title), title(r.Preview)
s.Named, s.Title, s.Cwd = title(r.Title), title(r.Preview), r.Cwd
}
for _, c := range calls {
s.saw(c.at, true)
+50
View File
@@ -1,6 +1,7 @@
package sessions
import (
"bytes"
"database/sql"
"encoding/binary"
"encoding/hex"
@@ -260,3 +261,52 @@ func TestAntigravityAppTitle(t *testing.T) {
t.Fatalf("after the app named it: %q", s.Title)
}
}
// xxooioo (Discord, 11-07): every Antigravity app session sat under "No
// folder". A conversation's folder is its summary row's first local
// workspace URI, as agy's is; a row with none, and a conversation with no
// row, have no folder.
func TestAntigravityAppFolder(t *testing.T) {
claude, _ := setup(t)
home := filepath.Join(filepath.Dir(claude), "home")
const site, api, bare, none = "37c3c786-9a11-44be-97df-b8fc1ccebc78", "4f1d2a77-0c3e-4b8e-9d61-2a5e7c90b311", "8e2b6c14-7f5a-4d09-a3c2-61d0f4e9b7a5", "b9eace9a-b15a-4dde-a440-b52e02016fa5"
for _, id := range []string{site, api, bare, none} {
antigravityFixture(t, home, id)
}
db, err := sql.Open("sqlite", filepath.Join(home, ".gemini", "antigravity", "conversation_summaries.db")+"?_pragma=journal_mode(WAL)")
if err != nil {
t.Fatal(err)
}
defer db.Close()
if _, err := db.Exec(antigravitySummariesSchema); err != nil {
t.Fatal(err)
}
for id, ws := range map[string]string{site: `["file:///work/site"]`, api: `["file:///work/api","file:///work/site"]`, bare: `[]`} {
if _, err := db.Exec("INSERT INTO conversation_summaries (conversation_id, title, preview, step_count, last_modified_time, workspace_uris, status, project_id, last_user_input_time, app_data_dir) VALUES (?, 'A talk', 'A talk', 2, '2026-11-07 00:12:46.60116+00:00', ?, 'CASCADE_RUN_STATUS_IDLE', 'default-project', '2026-11-07 00:12:43.784481+00:00', 'antigravity')", id, ws); err != nil {
t.Fatal(err)
}
}
ss := List(0)
for id, want := range map[string]string{site: "/work/site", api: "/work/api", bare: "", none: ""} {
if s := find(t, ss, "antigravity", id); s.Cwd != want {
t.Errorf("%s: folder %q, want %q", id, s.Cwd, want)
}
}
}
// A parse of an app conversation kept from before its folder was read has
// no folder under the same row, so the cache doesn't keep it.
func TestAntigravityAppParseBeforeFolderReadAgain(t *testing.T) {
var b bytes.Buffer
c := cacheFile{Version: cacheVersion, Zone: "z", Parsers: map[string]int{"antigravity": 1}, Files: map[string]*state{"/a.db": {Agent: "antigravity", Size: 1}}}
if err := encodeCache(&b, c); err != nil {
t.Fatal(err)
}
files, ok := decodeCache(b.Bytes(), "z")
if !ok {
t.Fatal("refused")
}
if _, kept := files["/a.db"]; kept {
t.Fatal("a parse from before the folder was read is kept")
}
}
+3 -1
View File
@@ -1165,7 +1165,9 @@ const cacheVersion = 29
//
// antigravity 1: a Gemini deployment's name with any one letter after it
// (gemini-4-argon-d) is its model's (GeminiDeployment), not -n alone.
var parseVersions = map[string]int{"codex": 3, "zcode": 1, "dsh": 1, "antigravity": 1}
// antigravity 2: a conversation's folder is its summary row's workspace
// (a parse kept from before has none, under the same row revision).
var parseVersions = map[string]int{"codex": 3, "zcode": 1, "dsh": 1, "antigravity": 2}
type cacheFile struct {
Version int `json:"version"`