feat(agent-manager): add Antigravity CLI adapter - #133
Open
nnhhoang wants to merge 3 commits into
Open
Conversation
nnhhoang
force-pushed
the
feat/antigravity-cli-adapter
branch
from
July 2, 2026 07:30
09604b5 to
617efc6
Compare
| * ~/.gemini/antigravity-cli/cache/last_conversations.json, which the CLI | ||
| * maintains as a `{ <cwd>: <conversationId> }` map of the current conversation | ||
| * per workspace. The process cwd is the join key. | ||
| * 3. Reading the transcript from |
Owner
There was a problem hiding this comment.
The implementation does not fully satisfy the stated requirement for historical Antigravity CLI sessions. listSessions() only reads cache/last_conversations.json, which is documented as the current conversation per cwd, so older brain/ transcripts can be missed.
Detect, list, and inspect Google's Antigravity CLI (`agy`) alongside Claude,
Codex, Gemini, and Grok.
- AntigravityCliAdapter (self-contained, parsing inline like the other recent
adapters): detects `agy` processes via matchArgv0, resolves each live process
to its conversation through
~/.gemini/antigravity-cli/cache/last_conversations.json (the { cwd:
conversationId } registry), and reads the transcript from
brain/<id>/.system_generated/logs/transcript.jsonl. The last <USER_REQUEST>
prompt is the summary; the newest record created_at is the last activity.
- AgentType 'antigravity_cli', AGENTS launch map entry (command `agy`), package
exports.
- Registered in the agent command and channel runner; added to TYPE_LABELS,
--type help, and VALID_AGENT_TYPES. README matrix flips Antigravity remote
control to yes.
- Independent of the existing `antigravity` IDE environment, the same way
gemini_cli is independent of the gemini environment.
Verified against a real agy session on disk: listSessions and getConversation
parse the on-disk conversation, and detectAgents resolves a live agy pid via
last_conversations.json to its conversation and summary.
… cache cache/last_conversations.json holds the current conversation per workspace, so listing from it hid every older conversation of a cwd — on a dev machine with five conversations on disk it surfaced one. Enumerate brain/ instead and use the cache only for what it is: the cwd of a workspace's current conversation. Antigravity records the workspace nowhere else — neither transcript.jsonl nor transcript_full.jsonl carries it, and conversations/<id>.db keeps its metadata in protobuf blobs — so a conversation the cache no longer names is listed with an empty cwd and surfaces under `agent sessions --all` rather than a cwd-scoped listing. Listing it without a cwd beats not listing it. Also adopts the shared process snapshot (processNames + AgentDetectionContext) that landed while this branch was open, so the adapter no longer runs its own ps.
nnhhoang
force-pushed
the
feat/antigravity-cli-adapter
branch
from
August 25, 2026 20:14
617efc6 to
40e3908
Compare
Contributor
Author
|
Sorry for the long silence on this one. Rebased onto main and fixed the review comment: |
Remote control drives the `agy` CLI, not the Antigravity IDE, so ticking it on the IDE row was wrong. Add an "Antigravity CLI" row — Setup yes (the antigravity-cli environment shipped in codeaholicguy#134) and Remote control yes from this adapter — and leave the IDE row as it was. Matches how Grok Build CLI is listed and how the merged web docs already separate the CLI from the IDE.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an
antigravity_cliagent adapter so ai-devkit can detect, list, and inspect Google's Antigravity CLI (agy) alongside Claude, Codex, Gemini, and Grok. This is the runtime/agent side of Antigravity and is independent of the existingantigravityenvironment (which configures the Antigravity IDE), the same waygemini_cliis independent of thegeminienvironment.How it works
agyprocesses from the sharedAgentDetectionContextsnapshot (processNames = ['agy']), falling back tocaptureProcessSnapshotfor standalone use.~/.gemini/antigravity-cli/cache/last_conversations.json, a{ "<cwd>": "<conversationId>" }map the CLI keeps per workspace (ANTIGRAVITY_CLI_HOMEoverrides the base).brain/instead. That cache holds only the current conversation of each workspace, so listing from it would hide every older conversation of a cwd;brain/is the complete set. The cache is then used for what it is — the cwd of a workspace's current conversation.brain/<conversationId>/.system_generated/logs/transcript.jsonl: user prompts are the text inside<USER_REQUEST>...</USER_REQUEST>oftype: "USER_INPUT"records, assistant turns aretype: "PLANNER_RESPONSE", tool calls andSYSTEMrecords are skipped unless verbose. Summary is the last user request; last activity is the newest recordcreated_at.Known limitation: cwd for older conversations
Antigravity records a conversation's workspace nowhere except that cache —
transcript.jsonlandtranscript_full.jsonlcontain no cwd, andconversations/<id>.dbkeeps its metadata in protobuf blobs (trajectory_metadata_blob,steps.metadata) with no readable path column. A conversation the cache no longer names is therefore listed withcwd: ''and surfaces underagent sessions --allrather than a cwd-scoped listing. Listing it without a cwd beats hiding it.Changes
AntigravityCliAdapter(self-contained, inline parsing like the other recent adapters) + unit tests.AgentType/StartableAgentTypegainantigravity_cli;AGENTS.antigravity_cli = { command: 'agy', matches: matchArgv0('agy') }; exported from the package.agentcommand and channel runner;TYPE_LABELS,--typehelp, andVALID_AGENT_TYPESupdated.yes | yes) instead of ticking the Antigravity IDE row: remote control drivesagy, not the IDE, and Setup is already true since theantigravity-clienvironment shipped in feat(cli): add Antigravity CLI environment #134. Same separation the web docs already use.docs/ai/*/feature-antigravity-cli-adapter.md.Testing
npx nx run agent-manager:test(594) andnpx nx run cli:test(1057) pass; husky pre-commit ran all packages.agydata on disk:listSessions()returns all 5 conversations underbrain/where the cache named 1, andlistSessions({ cwd })still returns exactly the one belonging to that workspace.detectAgents()with a liveagyprocess resolves the cwd vialast_conversations.jsonto its conversation and summary.