google-gemini / google-gemini/gemini-cli
CLI 1.2.2: -p (print mode) hangs indefinitely on all inference - no error, no response, no timeout
- Dominant language
- TypeScript
- Stars
- 107k
- Forks
- 14.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 45
Description
## Description
`agy -p "Hi"` hangs indefinitely (5+ minutes, no response, no error, no timeout message) on **all inference calls** in print mode. The CLI starts, accepts the prompt, then never returns. This happens on the latest version (1.2.2) and was confirmed independently by two users on the same machine.
## Steps to reproduce
1. Install agy CLI 1.2.2 (latest)
2. Run: `agy -p "Hi"`
3. Wait — it hangs forever with no output, no error, no timeout
## Expected behavior
The CLI should either:
- Return a response from the model, or
- Show an error (quota, auth, network), or
- Time out with a message
## Actual behavior
The CLI hangs indefinitely with zero output. The only way to stop it is Ctrl+C, which shows only `error: interrupted`.
## Environment
- **CLI version**: 1.2.2 (latest, confirmed via `agy update`)
- **OS**: Ubuntu 22.04.5 LTS
- **Auth**: OAuth token refreshed and valid (confirmed via `agy remote-control start` + daemon shows active)
- **Network**: Backend reachable (HTTP 200 from antigravity.google.com)
- **Web console**: Works perfectly (loads, authenticates, shows remote control instance Online)
- **Daemon**: `agy remote-control status` shows active
## What we verified
| Check | Result |
|---|---|
| CLI version | 1.2.2 (latest) |
| OAuth token | Refreshed, valid |
| Network to backend | Reachable (200) |
| Web console | Works (auth + dashboard load) |
| Daemon | Active |
| `agy --version` | Works (1.2.2) |
| `agy mcp list` | Works |
| `agy changelog` | Works |
| `agy -p "Hi"` | **HANGS** |
| `agy -p "Reply: OK" --output-format text` | **HANGS** |
| `agy -p "Hi" --output-format json` | **HANGS** |
## Additional context
- All non-inference CLI commands work fine (`--version`, `mcp list`, `changelog`, `remote-control`)
- Only inference (-p / --print) hangs
- The web console at antigravity.google.com loads and shows the remote control instance Online
- The OAuth token was refreshed by the daemon and is valid
- No error message is ever shown — the CLI just waits silently
- The `--print-timeout` flag (default 5m) doesn't seem to trigger either
This suggests the inference request is being sent but the response is never received, or the request is silently dropped by the backend without an error being surfaced to the CLI.
Contributor guide
Research direction
Start by reproducing `agy -p "Hi"` on CLI 1.2.2, then trace the `-p/--print` inference path and how `--print-timeout` is applied. Compare `--output-format text` and `json`; done means inference returns a response or surfaces an auth, quota, network, or timeout error instead of waiting indefinitely.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- ai, cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100