Skip to content

Headless mode hangs indefinitely on single tool call, ignores timeout (gemini-pro, o3-mini) #19

@ellisjr

Description

@ellisjr

Description

When using certain models in headless mode (gemini-pro via OpenRouter, openai/o3-mini via direct API), the sidecar hangs indefinitely on the first tool call. The --timeout flag is ignored — sessions run for 12-20+ minutes without progressing past message 1 before the polling loop finally gives up with no output.

Steps to Reproduce

sidecar start --model gemini-pro --agent Plan --no-ui --timeout 20 \
  --prompt "Read and review _bmad-output/planning-artifacts/prd.md"

Observed Logs

[sidecar] 15s | 1 messages | Executing tool call...
[sidecar] 30s | 1 messages | Executing tool call...
...
[sidecar] 12m0s | 1 messages | Executing tool call...
...
[sidecar] 20m0s | 1 messages | Executing tool call...
{"level":"error","msg":"Polling loop exited","completed":false,"pollCount":599,"elapsed":1201030}
## Sidecar Results: No Output

Expected Behavior

Session detects a stalled tool call and either retries, times out gracefully, or produces whatever partial output is available.

Actual Behavior

Session hangs for the full duration stuck on a single tool call (file read), never progresses past message 1, then exits with zero output.

Affected Models

  • gemini-pro via OpenRouter (resolves to google/gemini-3-pro-preview) — hung for 20 minutes
  • openai/o3-mini via direct API — hung for 12+ minutes before manual kill

Notes

  • The same task with --model gemini (Flash variant via OpenRouter) completed successfully in ~15 seconds with a full, high-quality review
  • This suggests Pro/reasoning models have latency on tool calls that the polling/timeout logic doesn't account for
  • The --timeout 20 flag had no effect on either model

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions