Skip to content

fix(ai-vault): restore Antigravity workspace metadata - #15775

Closed
haoliangli wants to merge 1 commit into
stablyai:mainfrom
haoliangli:fix/antigravity-workspace-metadata
Closed

haoliangli wants to merge 1 commit into
stablyai:mainfrom
haoliangli:fix/antigravity-workspace-metadata

Conversation

@haoliangli

Copy link
Copy Markdown

ELI5

Antigravity already records a conversation ID alongside its workspace. Use that exact ID instead of guessing from prompt text, so conversations that begin with setup prompts still appear in the correct workspace history.

What Changed

  • Index Antigravity history rows by conversationId and by the existing normalized display text.
  • Prefer the direct conversation-ID match when enriching workspace metadata.
  • Keep the conservative title/timestamp fallback for legacy history rows without a conversation ID.
  • Add a regression test for a conversation whose setup prompt becomes the session title while a later prompt carries the workspace record.

Why

The transcript parser titles a session from its first user prompt. Antigravity history may only record a later prompt, so the existing title/timestamp join leaves cwd unset even though the history row has the same stable conversation ID. Matching that identifier is both more reliable and safer than broadening truncated-title matching.

Linked Issue

Fixes #15774

Visual Proof

N/A — this is a metadata parser fix with no UI code changes; the workspace-filter behavior is covered by the regression test.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Validated locally:

  • vitest targeted Antigravity parser and source suites: 8 tests passed
  • Node TypeScript project typecheck
  • oxlint on both changed files
  • oxfmt --check on both changed files
  • git diff --check

AI Disclosure

GPT-5.6 Sol via Pi assisted with diagnosis, implementation, and test drafting. The change was reviewed against the repository's existing Antigravity history safety constraints.

Review

The direct join only accepts an exact conversation ID. The earliest valid history row wins if a conversation has multiple workspace entries, preserving origin-workspace semantics. Legacy rows retain the existing ambiguity and truncated-title protections.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

The change is path-independent and reuses the same history transport for local, WSL, and remote scans. It adds one bounded map lookup per session and preserves backward compatibility with history rows that omit conversationId.

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Copilot AI lite review requested due to automatic review settings August 21, 2026 12:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Prefer the stable conversation ID from Antigravity history records so setup prompts and long dispatched prompts still resolve to the correct workspace.

AI-Assisted-By: gpt-5.6-sol via Pi
@haoliangli
haoliangli force-pushed the fix/antigravity-workspace-metadata branch from 08a76c5 to 4682823 Compare August 21, 2026 12:21
@coderabbitai

coderabbitai Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bb9cc03e-ddad-433c-9829-2f6859afc42a

📥 Commits

Reviewing files that changed from the base of the PR and between 59892a2 and 4682823.

📒 Files selected for processing (2)
  • src/main/ai-vault/session-scanner-antigravity-history.ts
  • src/main/ai-vault/session-scanner-antigravity-source.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The Antigravity history index now maintains separate conversation-ID and display-title lookups. Valid records with conversation IDs use the earliest matching timestamp, including records without display titles when workspace and timestamp data are valid. Workspace resolution checks the session conversation ID before using title and time-window matching. A regression test covers sessions whose later history prompt has a different title from the initial transcript prompt.

Merge Risk: ⚪ Minimal · up to 46828

The change restores workspace metadata using the exact conversation ID while retaining legacy fallbacks and regression coverage; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the Antigravity workspace metadata fix and matches the primary change.
Description check ✅ Passed The description covers the required sections, explains the change and rationale, links issue #15774, and documents testing.
Linked Issues check ✅ Passed The implementation matches issue #15774 by using exact conversation IDs, retaining legacy fallback logic, and adding regression coverage.
Out of Scope Changes check ✅ Passed The changes are limited to Antigravity history matching and its regression test, with no unrelated scope identified.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker

Copy link
Copy Markdown
Contributor

Carried this approach into draft #21638 and verified it against fresh files from installed agy 1.2.7. A long initial prompt followed by /usage produced a real transcript with a truncated title and a later history row containing its conversationId. Current lookup returns cwd null; the revised lookup returns the correct validation workspace. Before/after evidence is attached there.

Found one edge in this head (468282341cbd8b913dee1e3cfcd9a6cfdfaaab71): ID-bearing rows also enter byDisplay, so a row explicitly belonging to a different conversation can supply cwd through a matching title/time. The new regression fails on that logic. The takeover restricts prompt/time fallback to legacy rows without IDs.

Ten parser/discovery tests, full typecheck, and quality/pre-commit checks pass. Actual rendered workspace-list validation and real Linux/WSL/SSH/Windows runs remain pending, so no merge readiness or issue closure is claimed. Model generation failed HTTP 401; the saved user turn/history used for the live-file check were real.

@nwparker

Copy link
Copy Markdown
Contributor

Thanks for putting this together, and sorry for the slow turnaround. The area has since been reworked and this is now covered on main by #21794 (conversationId workspace join), so we're closing this as superseded. If you still see the problem on the latest build, please open a fresh report or reopen with a current repro. Thank you for the contribution.

@nwparker nwparker closed this Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Antigravity setup-prompt sessions are missing from workspace history

3 participants