Files
magpie/docs
yetone c51b0ca9fa sessions: the Antigravity app connected to WSL has its usage read from the distro (@guyng35955 on X)
@guyng35955 on X: on Windows, with the Antigravity app connected to a
WSL Ubuntu, magpie showed no Antigravity usage.

Why. Antigravity 2.x (dist/wsl.js and languageServer.js in its
app.asar) runs a Linux language server in the distro when it is
connected to WSL ($HOME/.antigravity-server/bin/<version>/
language_server, started through wsl.exe with --app_data_dir
antigravity), so the conversations go to the distro's
~/.gemini/antigravity, not %USERPROFILE%\.gemini\antigravity. magpie
read Antigravity's conversations only from this computer's folder:
- sessions.wslAgents had no antigravity (nor agy, whose
  ~/.gemini/antigravity-cli in a distro wasn't read either);
- internal/agent kept a distro for the Sessions page only when one of
  wslKinds or the Copilot CLI's folder was there, so a distro with only
  the app's data never reached sessions.WSLHomes;
- and, found on the Windows box: no SQLite database under
  \\wsl.localhost opens in place. Every form (file: URI, plain path,
  mode=ro, provider.OpenReadOnly) answers SQLITE_BUSY after its 3s
  busy_timeout, since the share doesn't take the locks a WAL database
  needs. So listing the files alone would have shown nothing still.

What changed.
- agent: wslKept keeps a distro with ~/.gemini/antigravity(-insiders),
  and the probe looks for them (no agent row for them).
- sessions: wslAgents reads the app's conversations (insiders under
  their own key) and agy's in a distro; their summary rows name the
  distro's folders as Linux does (agyFolder with goos "linux", so
  /home/me/site, not a Windows path). The distro's calls count in
  Calls (wslFiles("antigravity"), wslCallFiles("agy")). The listing
  kept on disk (sessions-wsl.json) carries each file's row, rev and
  read-only, so a stopped distro keeps its titles and folders. A
  distro's ~/.gemini that is this computer's own (a link) is read once,
  as this computer's (sameDir).
- sessions: openAppStore opens agy's and the app's databases read only
  in place, or, under \\wsl.localhost or \\wsl$, as OpenUntouched does
  (immutable with no -wal, else from a copy of the db and its -wal).
- docs/subsystems/agent-wiring.md says which distros are kept for reads
  only.

Not changed: session-read consent ("allow selected" names agents found
on this computer) doesn't look in WSL, as before for every WSL agent.
OpenCode's and ZCode's SQLite readers aren't used for a distro (not in
wslAgents), so they keep provider.OpenReadOnly.

Run (at the tree rebased on dc85a7ca5; then rebased on c8290df25, which
changes nothing under internal/sessions or internal/agent):
- mote: gofmt -l internal (clean); GOOS=linux go vet -tags nogui ./...
  and GOOS=windows go vet ./... ok; go test -tags nogui -count=1
  -timeout 45m ./internal/sessions/ ./internal/agent/: ok (sessions 104s,
  agent 223s).
- Windows 11 (xiaomi-gpu, win-run): go test -run TestWSL
  ./internal/sessions/ ok.
- Real \\wsl.localhost read on xiaomi-gpu: a fixture conversation
  (WAL) and conversation_summaries.db, and agy's conversations, written
  in the WSL distro magpie-desktop's real ~/.gemini from inside Linux;
  a throwaway test on Windows with WSLHomes at
  \\wsl.localhost\magpie-desktop\home\yeton. Before openAppStore: agy
  listed with no folders, the app's conversation missing, 0
  antigravity calls, listing 6.4s (each open waits 3s for BUSY).
  After: the conversation listed with the distro, its title, folder
  /home/me/site, tokens and 4 calls; agy's folders read; listing
  0.21s. With a writer in the distro holding a title only in the -wal
  (wal_autocheckpoint=0, db held open), Windows read the -wal's title.
  The fixture and binaries were removed after.

Broken by hand:
- the three wslAgents entries and the Calls line out:
  TestWSLAntigravityApp red (no antigravity session from the distro);
- sameDir check out: TestWSLAntigravityLinkedHomeOnce red (listed as
  the distro's);
- the listing's row (m.agy, m.rev) not carried: TestWSLAntigravityApp
  red (no title or folder);
- wslKept without the Antigravity dirs: TestWSLAntigravityHome red
  (no homes).

Not tried: a real Antigravity sign-in connected to WSL (the box's app
isn't signed in, and the connection needs its GUI), so the language
server's own files are this fixture, laid out as its source writes
them; the full suite (five full suites were queued on mote's
suite.lock and two on mica's).
2026-11-14 12:27:25 +08:00
..