Repository navigation
fix(antigravity): join IDE cache history metadata - #21794
Conversation
|
Live follow-up evidence for the cache fallback:
ELI5: agy moved the folder lookup card and sometimes lets the old project list go stale. Orca now checks the newer card and the “last conversation in this folder” list, while still leaving the conversation contents alone. |
|
Additional live agy verification from the installed macOS CLI (no credentials or raw response published):
This confirms the installed agy profile is healthy for the CLI path; the PR itself remains scanner-only and does not depend on quota output. |
|
Independent verification (2026-09-20):
Verdict: approve scoped to cache metadata workspace joins. Dedicated IDE sign-in and broader history/resume behavior remain follow-ups; no raw transcript or account data is published. No merge performed. |
|
Fresh verification update (2026-09-20):
Merge verdict: Approve scoped to newer IDE cache metadata workspace joins. The cache-only path is now directly covered by a sanitized sample and the focused scanner tests. Dedicated IDE sign-in, broader history/resume behavior, and remote/SSH/WSL cache locations remain follow-ups. |
|
ELI5: agy's IDE keeps the conversation label and workspace mapping in small metadata files. This change joins those labels to the cached history so Orca can show the right project/session. The sanitized fixture and focused tests pass; this does not claim full IDE transcript replay or remote cache support. |
There was a problem hiding this comment.
ℹ️ No critical issues — minor test-coverage and reuse suggestions inline.
Reviewed changes
- Cache-metadata fallback:
readLocalAntigravityHistorynow falls back tocache/conversation_metadata.json(plus optionalprojects.json/last_conversations.json) whenhistory.jsonlcan't be read, synthesizing{conversationId, timestamp, workspace}JSONL rows for the existing resolver. Gate refusals still rethrow, preserving the documented WSL contract. - Projects/
last_conversationsjoin: project paths are recovered from either orientation ofprojects.json, withlast_conversations.jsonused whenProjectIDis stale. - New fixtures: three tests covering the projects join, the
last_conversationsfallback, and Windows-style workspace paths.
ℹ️ Remote/SSH Antigravity hosts don't get the cache fallback
The fallback is wired only for the local scan. remote-session-scanner.ts:71 injects a readHistory that reads just history.jsonl, so a remote or SSH host running a newer agy build still leaves cwd null — the same symptom this PR fixes locally. Since the repo treats SSH as a first-class execution host, it's worth deciding explicitly whether that's a follow-up or in scope here.
Technical details
# Remote scan lacks the cache-history fallback
## Affected sites
- src/main/ai-vault/remote-session-scanner.ts:71 — injected `readHistory` reads only `provider.readFile(historyPath)`
- src/main/ai-vault/remote-session-scanner-sources.ts:138 — `historyPath` is the only Antigravity metadata file addressed
## Required outcome
- Decide whether newer-cache Antigravity installs on remote/SSH hosts should also recover `cwd`, or whether `cwd: null` is acceptable there.
## Open questions for the human
- Is the remote Antigravity cache readable through the existing provider abstraction, or does it need its own transport?ℹ️ Nitpicks
projects.jsonis guarded for both{workspace: projectId}and{projectId: workspace}(session-scanner-antigravity-history.ts:57-61), but the{projectId: workspace}branch has no test. Given the code comment says agy has emitted both shapes, a fixture for it would pin the behavior.last_conversations.jsonis assumed to be{workspace: conversationId}; if agy ever flips that too, the fallback degrades silently to no rows. Not asking for defensive symmetry, just flagging the asymmetry with the guardedprojects.json.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| await expect(readLocalAntigravityHistory(join(cliRoot, 'history.jsonl'))).resolves.toContain( | ||
| '"conversationId":"aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee"' | ||
| ) | ||
| await expect(readLocalAntigravityHistory(join(cliRoot, 'history.jsonl'))).resolves.toContain( | ||
| '"workspace":"/tmp/sanitized-antigravity-workspace"' | ||
| ) |
There was a problem hiding this comment.
These assertions only inspect the serialized string, so the test would still pass if a synthesized row couldn't actually be indexed. For example, renaming the timestamp key would make indexAntigravityHistory skip every row (timestampMs(undefined) is NaN, session-scanner-antigravity-history.ts:167-168)) and cwd would stay null anyway. The sibling tests below drive scanAiVaultSessions end to end — asserting cwd for the cache-only layout there would cover the integration seam this PR adds.
Technical details
# Cache-path tests don't assert the enrichment outcome
## Affected sites
- src/main/ai-vault/session-scanner-antigravity-source.test.ts:46-51 — `toContain` on the raw returned string
- src/main/ai-vault/session-scanner-antigravity-history.ts:167 — parser drops entries without a finite timestamp
## Required outcome
- A cache-only layout (no `history.jsonl`; `conversation_metadata.json` + `projects.json`) must yield a session with `cwd` set, asserted through `scanAiVaultSessions`.
## Suggested approach (optional)
- Reuse `isolatedScanRoots(root)` + `writeAntigravityTranscript(...)`, write the cache files under `join(root, 'cache')`, then `expect(result.sessions[0]?.cwd).toBe(workspace)`.| } | ||
| } | ||
|
|
||
| function isRecord(value: unknown): value is Record<string, unknown> { |
There was a problem hiding this comment.
asRecord in ./session-scanner-record-value (already re-exported from ./session-scanner-values, which this file imports) is the established guard for exactly this shape. This local isRecord is a second implementation of the same predicate; since asRecord returns a nullable record rather than a boolean, the call sites would become const x = asRecord(v); if (!x) ... — a small change that keeps one record guard in the module.

What changed
Antigravity CLI/IDE builds that use the newer cache format can have conversation metadata without the legacy
history.jsonl. Orca now falls back tocache/conversation_metadata.jsonpluscache/projects.jsonto recover a workspace for an already discovered transcript.ELI5: agy moved the index card that says “this conversation belongs to this folder.” Orca now reads that index card when the old history file is missing, without opening opaque conversation databases or copying prompt contents.
Verification
ORCA_BACKGROUND_LAUNCH=1 pnpm test src/main/ai-vault/session-scanner-antigravity-source.test.tspnpm tc:nodepnpm run check:code-quality:changed origin/mainThis PR is stacked on #21784.