Skip to content

Detect Antigravity CLI and preserve interactive behavior - #9848

Open
Victor Vazquez (vhvb1989) wants to merge 1 commit into
mainfrom
antigravity
Open

Detect Antigravity CLI and preserve interactive behavior#9848
Victor Vazquez (vhvb1989) wants to merge 1 commit into
mainfrom
antigravity

Conversation

@vhvb1989

Copy link
Copy Markdown
Member

Summary

  • detect Google Antigravity CLI independently from Gemini using verified environment, user-agent, and exact process markers
  • model agent interactive input and output capabilities separately so Antigravity keeps PTY prompts and terminal rendering
  • fall back to automatic no-prompt mode when an Antigravity invocation does not have terminal input
  • report Antigravity as a dedicated execution.environment telemetry value and synchronize telemetry documentation

Testing

  • added unit coverage for Antigravity marker detection, precedence, false positives, process matching, capabilities, explicit overrides, and telemetry mapping
  • verified targeted agent detection, terminal, command flag, telemetry resource, telemetry guard, build, and spelling checks
  • locally validated the official Antigravity CLI 1.1.23 shell tool with offline azd env new, azd env select, and azd env remove prompts; text input, selection, confirmation, and terminal rendering completed without hangs, EOF, duplicated output, or lost responses

Antigravity is not installed or executed in CI. Live compatibility validation is local-only; CI coverage uses unit tests and mocked markers/capabilities.

Adding Antigravity is a new allowed value for the existing execution.environment field, not a new telemetry field or data classification.

Closes #9578

Detect Antigravity independently from Gemini, preserve its interactive shell behavior, and report a dedicated execution environment telemetry value.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 4fa5bc57-11aa-4ddb-91fe-9662bef4fccb
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

📋 Prioritization Note

Thanks for the contribution! The linked issue isn't in the current milestone yet.
Thank you for logging this issue; our team is reviewing it. If you need urgent prioritization, tag Rick Winter (@RickWinter) and Kristen Womack (@kristenwomack) to let us know.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
21 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The telemetry privacy review is undocumented, and existing no-prompt help now contradicts the capability-aware behavior.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds first-class Antigravity CLI detection while preserving its interactive terminal behavior and reporting dedicated telemetry.

Changes:

  • Detects Antigravity through environment, user-agent, and process markers.
  • Separates interactive input/output capabilities and adjusts no-prompt behavior.
  • Updates tests and telemetry documentation.
File summaries
File Description
docs/specs/metrics-audit/telemetry-schema.md Adds the Antigravity telemetry value.
docs/specs/metrics-audit/feature-telemetry-matrix.md Documents environment detection telemetry.
docs/reference/telemetry-data.md Adds Antigravity to the public reference.
cli/azd/internal/tracing/resource/resource_test.go Tests Antigravity telemetry mapping.
cli/azd/internal/tracing/resource/exec_environment.go Maps Antigravity to its telemetry value.
cli/azd/internal/tracing/fields/fields.go Defines the Antigravity environment constant.
cli/azd/internal/terminal/terminal.go Separates input-terminal and output capabilities.
cli/azd/internal/terminal/terminal_test.go Tests Antigravity TTY overrides.
cli/azd/internal/runcontext/agentdetect/types.go Adds the agent type and capabilities.
cli/azd/internal/runcontext/agentdetect/detect_test.go Covers markers, precedence, and false positives.
cli/azd/internal/runcontext/agentdetect/detect_process.go Detects the exact agy process.
cli/azd/internal/runcontext/agentdetect/detect_env.go Adds environment and user-agent markers.
cli/azd/docs/environment-variables.md Documents markers and interactive behavior.
cli/azd/cmd/auto_install.go Applies capability-aware no-prompt defaults.
cli/azd/cmd/auto_install_test.go Tests defaults and explicit overrides.
cli/azd/cmd/auto_install_integration_test.go Isolates Antigravity variables in tests.
Review details
  • Files reviewed: 16/16 changed files
  • Comments generated: 3
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +1048 to +1049
((agent.Detected && (!agent.Type.SupportsInteractiveInput() || !inputTerminal)) ||
resource.IsRunningOnCI()) {
Comment on lines +65 to +68
`azd` detects when it is launched by a known AI coding agent and adjusts its behavior according to
the agent's shell capabilities. Unless explicitly overridden, agents that cannot answer prompts
automatically enable no-prompt mode, and agents that cannot support interactive terminal rendering
are treated as non-TTY. Antigravity supports both interactive input and output. Detection checks the
Comment on lines +74 to +75
case agentdetect.AgentTypeAntigravity:
return fields.EnvAntigravity

@JeffreyCA JeffreyCA left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, I have a related change in #9818 to fix the terminal handling more generally

@JeffreyCA JeffreyCA left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

With #9818 merged, consider rebasing and keeping this PR focused on Antigravity detection, telemetry, and the live shell compatibility findings.

The SupportsInteractiveInput() and SupportsInteractiveOutput() gates would reintroduce the inherited-environment bug for other agents. A normal VS Code terminal launched from Claude Code still carries its markers, so these gates would disable prompts and rendering even when a human is using it.

  • Remove the capability methods and gates. Keep the shared terminal.IsAttached check for physical stdin and stdout attachment, rather than introducing the stdin-only IsInputTerminal check. AZD_FORCE_TTY should remain a rendering override.
  • Adapt the Antigravity tests to the existing descriptor-injection helpers, covering attached and detached invocations without using AZD_FORCE_TTY to simulate attachment.
  • Add the Antigravity environment markers to pkg/azdext/tui.go so SDK detection stays aligned with core.

The marker detection, exact agy process matching, dedicated telemetry value, and live PTY findings still belong here.

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.

Detect Antigravity CLI and validate agent interactivity behavior

3 participants