Repository navigation
feat: add Antigravity CLI integration - #748
Kaushikj-7 wants to merge 18 commits into
Conversation
|
i want to contribute to this repo by adding alternate IDEs like muse code too. |
wangjohn
left a comment
There was a problem hiding this comment.
Thank you for contributing Antigravity support! I appreciate the time you put into the integration and its tests. Supporting another coding agent would be a useful addition, and reusing the shared source handling is a good starting point.
I'm requesting changes because several user-facing paths do not work end to end yet. I've left specific comments with priorities: P1 marks core behavior that needs fixing before merge, and P2 marks correctness and test coverage work that also needs to be addressed in this PR.
Build and targeted vet checks passed, as did the Antigravity unit tests. Broader testing exposed the discovery/import conformance failures and CLI fixture failures described below. I also reproduced the hook decoding and filtered handoff problems with synthetic inputs.
Please update the user documentation, capability evidence, and changelog to match the final supported behavior. Before calling the integration complete, we should also verify a session from a dated Antigravity CLI version through capture, publication, and readback; fixtures committed to the repository should contain synthetic content only.
Thanks again for taking this on! These comments are intended to make the remaining work concrete and help get the contribution ready to merge.
|
|
||
| // Decoder maps Antigravity lifecycle payloads into archive lifecycle events. | ||
| func Decoder() hookconfig.Decoder { | ||
| return hookconfig.Decoder{Spec: hookconfig.DecoderSpec{ |
There was a problem hiding this comment.
[P1] Read Antigravity's actual hook payloads
Antigravity sends fields such as conversationId, transcriptPath, and workspacePaths. This shared decoder expects different field names and also requires hook_event_name, which the documented payload does not include. Passing a documented payload into this decoder currently returns no events and no error, so sessions will not be captured.
Could you add Antigravity-specific decoding and give each hook command a way to identify its event? Please also handle the documented SessionStart event and test how new and resumed sessions are distinguished.
Reference: https://antigravity.google/docs/hooks/
| {Descriptor: agentmeta.Descriptor{ID: agentmeta.Codex}, Launcher: codex.Launcher{}, Skills: codex.Skills(), Imports: codex.Imports(), Evidence: codex.CapabilityEvidence{}, Version: codex.VersionInspector{}, NativeHeaders: codex.NativeHeaders{}, Discovery: codex.NativeHeaders{}, NativePaths: codex.ProjectEvidence{}, Sources: codex.SourceProvider{}, Filter: codex.Filter{}, Runtime: codex.RuntimeDetector{}, Hooks: codex.Hooks(), Decoder: codex.Decoder(), Parser: codex.Parser{}, Preview: codex.Previewer{}, Labels: codex.LabelProvider{}}, | ||
| {Descriptor: agentmeta.Descriptor{ID: agentmeta.Cursor}, Launcher: cursor.Launcher{}, Skills: cursor.Skills(), Imports: cursor.Imports(), Evidence: cursor.CapabilityEvidence{}, Version: cursor.VersionInspector{}, Discovery: cursor.Discovery{}, NativePaths: cursor.ProjectEvidence{}, Workspace: cursor.ProjectEvidence{}, DatabaseCatalog: cursor.DatabaseCatalogInspector{}, Sources: cursor.SourceProvider{}, Filter: cursor.Filter{}, Runtime: cursor.RuntimeDetector{}, Hooks: cursor.Hooks(), Decoder: cursor.Decoder(), Parser: cursor.Parser{}, Labels: cursor.LabelProvider{}}, | ||
| {Descriptor: agentmeta.Descriptor{ID: agentmeta.Muse}, Launcher: muse.Launcher{}, Decoder: muse.Decoder(), Hooks: muse.Hooks(), Skills: muse.Skills(), Version: muse.VersionInspector{}, NativeHeaders: muse.NativeHeaders{}, Discovery: muse.NativeHeaders{}, Preview: muse.Previewer{}, Runtime: muse.RuntimeDetector{}, Sources: muse.SourceProvider{}, Filter: muse.Filter{}, Parser: muse.Parser{}}, | ||
| {Descriptor: agentmeta.Descriptor{ID: agentmeta.Agy}, Launcher: agy.Launcher{}, Sources: agy.SourceProvider{}, Filter: agy.Filter{}, Parser: agy.Parser{}, Discovery: agy.Discovery{}, Hooks: agy.Hooks(), Decoder: agy.Decoder()}, |
There was a problem hiding this comment.
[P1] Connect discovery to the features users actually run
Registering Discovery alone does not make Antigravity sessions available in the CLI. Native browsing and --latest also need NativeHeaders; backfill needs Imports; current-session handoff needs Runtime.
With this binding, local --latest cannot find a transcript in the expected Antigravity directory, and backfill --harness agy --dry-run reports that historical import is unavailable. The new current-session handoff help text is also unsupported.
Please wire up the required providers and test these commands through the CLI. If any feature is intentionally deferred, please make the supported scope and help text accurate.
| if r.ProjectDir != "" { | ||
| args = append([]string{"--add-dir", r.ProjectDir}, args...) | ||
| } | ||
| args = append(args, "-p", r.Prompt) |
There was a problem hiding this comment.
[P1] Start an interactive session for handoff
Antigravity's -p flag runs one prompt noninteractively and then exits. That means a normal handoff --to agy will not leave the user in a conversation they can continue.
Please use -i / --prompt-interactive for the default handoff and update the argument tests, including checks for conflicting prompt flags. A headless run could be a separate, explicit option.
Reference: https://antigravity.google/docs/cli/reference/#command-line-flags
| // FilterJSONL keeps documented Antigravity trajectory records through the | ||
| // shared privacy filter. | ||
| func (AgyAdapter) FilterJSONL(r io.Reader) (archive.FilteredTranscript, error) { | ||
| return filterJSONL(r, "agy-jsonl", map[string]bool{ |
There was a problem hiding this comment.
[P2] Preserve the fields the Antigravity parser needs
This recognizes Antigravity record types, but the shared field allowlist still removes fields the parser reads, including modelName, model_name, toolCall, step_id, conversationId, and prompt.
I reproduced empty model and tool names after filtering. A user record using prompt loses its text and then fails parsing. The current parser tests miss this because they pass records directly to the parser.
Please define which Antigravity fields are safe to retain and add tests that run synthetic records through both filtering and parsing, including privacy checks.
| } | ||
| case "RUN_COMMAND", "TOOL_CALL": | ||
| toolCalls++ | ||
| view.ToolCalls = append(view.ToolCalls, archive.NormalizedToolCall{RecordIndex: index, CallID: id, Name: toolName(record), Model: model}) |
There was a problem hiding this comment.
[P2] Include tool arguments and results in the handoff
These entries keep a tool's name and ID but discard its arguments and result text. Calls are also never linked to their results. In an explicit-file handoff, a synthetic go test ./... call followed by a failure produced only the tool name; the next agent received neither the command nor its failure output.
Please populate the available tool details, link results to calls, and test the rendered handoff. Please also base tool-result availability on result evidence rather than merely the presence of a tool call.
| if !ok { | ||
| return nil, fmt.Errorf("invalid hook definition %s", spec.Definition) | ||
| } | ||
| return configured, nil |
There was a problem hiding this comment.
[P2] Handle the hook definition's enabled setting
Antigravity allows an enabled boolean inside a named hook definition. Returning the whole definition here sends that setting into helpers that expect every property to be an array of event handlers.
For example, {"agent-archive":{"enabled":false}} currently fails with invalid hook list for enabled. This affects setup, inspection, and removal after someone toggles the hook in Antigravity.
Please handle definition settings separately from event handlers, preserve the user's enabled/disabled choice, and cover both values in tests.
| if _, ok := r.Launcher("agy"); !ok { | ||
| t.Fatal("AGY launcher is not registered") | ||
| } | ||
| if _, _, ok := r.LookupSources("agy"); !ok { |
There was a problem hiding this comment.
[P2] Cover the real consumer paths and update the shared tests
Checking that the source provider is registered is useful, but it does not establish that the integration works through the product. The existing discovery and historical-import conformance tests fail for agy. Many CLI tests also fail because the new setup question and destination choice were added without updating scripted answers and goldens.
Please extend coverage beyond registration, update the affected fixtures and expected output, and register the repository's shared -update flag in the new package. The affected suites should pass before this is ready to merge.
|
Yeah, I'll make the necessary changes. |
…ting prompt flags
…gravity parser keys
… availability on evidence
…es and documentation
… up discovery, and harden launch flags
…nd update cli test fixtures
…or agy, validate hook enabled toggle, and update golden files
…d setup next steps
…o FilterVersion 41
Summary
agy/antigravityas a first-class Agent Archive integration--harness agyand--to agyVerification
go test -cover ./internal/agents/agy -count=1(80.3% statement coverage)go test ./internal/agents/hookconfig -count=1go vet ./internal/agents/agy ./internal/agents/hookconfig ./internal/agents/builtin ./internal/agentmeta ./internal/cligo build -buildvcs=false ./cmd/agent-archive