Detect Antigravity CLI and preserve interactive behavior - #9848
Detect Antigravity CLI and preserve interactive behavior#9848Victor Vazquez (vhvb1989) wants to merge 1 commit into
Conversation
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
📋 Prioritization NoteThanks for the contribution! The linked issue isn't in the current milestone yet. |
|
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. |
There was a problem hiding this comment.
🟡 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.
| ((agent.Detected && (!agent.Type.SupportsInteractiveInput() || !inputTerminal)) || | ||
| resource.IsRunningOnCI()) { |
| `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 |
| case agentdetect.AgentTypeAntigravity: | ||
| return fields.EnvAntigravity |
JeffreyCA
left a comment
There was a problem hiding this comment.
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.IsAttachedcheck for physical stdin and stdout attachment, rather than introducing the stdin-onlyIsInputTerminalcheck.AZD_FORCE_TTYshould remain a rendering override. - Adapt the Antigravity tests to the existing descriptor-injection helpers, covering attached and detached invocations without using
AZD_FORCE_TTYto simulate attachment. - Add the Antigravity environment markers to
pkg/azdext/tui.goso SDK detection stays aligned with core.
The marker detection, exact agy process matching, dedicated telemetry value, and live PTY findings still belong here.
Summary
execution.environmenttelemetry value and synchronize telemetry documentationTesting
azd env new,azd env select, andazd env removeprompts; text input, selection, confirmation, and terminal rendering completed without hangs, EOF, duplicated output, or lost responsesAntigravity is not installed or executed in CI. Live compatibility validation is local-only; CI coverage uses unit tests and mocked markers/capabilities.
Adding
Antigravityis a new allowed value for the existingexecution.environmentfield, not a new telemetry field or data classification.Closes #9578