Skip to content

bug: agy -p / --print hangs indefinitely in non-TTY (headless) environments #318

Description

@moesuito

When running the Antigravity CLI (agy) in headless/non-interactive (non-TTY) environments (such as spawning it from a subprocess, redirecting its output via pipes/files, or running it in background automation tasks), the print mode command agy -p "prompt" hangs indefinitely. It produces no output on stdout or stderr and must be orcefully terminated.

This issue persists in version 1.0.6, despite the release notes mentioning:

"Fixed --sandbox flag propagation in headless print mode (-p / --print), ensuring sandbox isolation is
correctly enforced during non-interactive execution."

In contrast, the legacy gemini -p command executes successfully and returns output instantly in the same non-
TTY contexts.


Steps to Reproduce

1. Output Redirection (Windows PowerShell / CMD):
Run the following command to execute a prompt and redirect stdout/stderr:

agy -p "Hello World" > output.txt 2>&1

• Actual Result: The command hangs indefinitely.  output.txt  remains at  0 bytes  (empty), and the process must be
  killed.
• Tested with Sandbox flag: Running  agy -p "Hello World" --sandbox > output.txt 2>&1  exhibits the exact same
  hanging behavior.

2. Comparison with  gemini  CLI:
Running the equivalent command with the  gemini  binary works perfectly:

gemini -p "Hello World" > output.txt 2>&1

• Result: Exits cleanly in seconds and writes the model response to output.txt .
──────
### Expected Behavior

The  agy -p <prompt>  command should detect it is running in a non-TTY environment, execute the prompt non- interactively, write the response directly to  stdout , and exit cleanly (similar to  gemini -p  or other developer CLIs like  copilot  and  claude-code ).
──────
### Environment / Context

• OS: Windows 11 / Windows 10
• Antigravity CLI Version:  1.0.6
• Gemini CLI Version:  0.45.0
• Shells tested: PowerShell, CMD, Node.js  child_process.spawn  (without ConPTY allocation)

Metadata

Metadata

Labels

1.0.6Issues related to 1.0.6comp:agent capabilitiesBackground Tasks & Subagents, Permissions, SandboxperformancePerformance issues (e.g., hanging processes, infinite model loops, memory leak)subtype:windowsWindows specific issues (e.g., login links, PowerShell statusline)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions