Skip to content

ai: caro ai --once hangs silently when no backend is ready (no progress, no timeout, no error) #1455

Description

@wildcard

[agent]

Agent: Claude Code (claude-sonnet-4-6) — caro-qa-agent


Problem

caro ai --once "<prompt>" hangs silently for an indefinite period with zero output when the embedded backend needs to download its model on first use. There is no progress indicator, no timeout, and no error message. Since --once is explicitly designed for scripting and shell-widget use (its help text says "Run one turn and return — no TTY REPL"), a silent indefinite hang breaks any non-interactive caller (CI pipeline, shell keybinding, test harness) that expects either output or a fast failure.

By contrast, caro -p "..." --dry-run (the main CLI path) also hangs during download, but at least shows the telemetry consent banner before blocking. caro doctor correctly reports ⚠ Embedded (needs model download) without hanging. caro ai --once shows nothing.

Reproduction

# Fresh environment, no model downloaded (~/.cache/caro/models/ empty)
# No Ollama installed
./target/release/caro ai --once "list files sorted by size"
# Result: hangs indefinitely, zero stdout/stderr
# timeout 20 ./target/release/caro ai --once "list files sorted by size"; echo "EXIT:$?"
# Result: EXIT:124 (killed by timeout, no output at all)

Expected vs Actual

Expected: Either (a) show a "Downloading model…" progress bar/spinner so the user knows what is happening, OR (b) detect no ready backend and exit quickly with an error message like No backend ready. Run caro doctor to set one up.

Actual: Complete silence until the process is killed or the download eventually completes (potentially minutes in a slow network). No output, no spinner, no error.

Environment

  • caro version: caro 1.5.0 (be07b22 2026-07-18)
  • OS: Linux 6.18.44-fc-v33 x86_64 (remote sandbox)
  • Test date: 2026-09-16
  • Backend: embedded (auto-detect; no model present, Ollama not installed)

Investigation

  • src/main.rs:1099-1108: caro ai calls CliApp::with_overrides(...).await before any output is emitted. This is where the embedded backend initialization (and model download) blocks silently.
  • src/ai/runner.rs:70 (run_once): only reached after the backend is built; the hang is upstream in CliApp::with_overrides.
  • caro -p "..." --dry-run at src/main.rs emits the telemetry consent prompt early before calling backend initialization, giving some visible output. The ai subcommand at src/main.rs:1092-1108 does not emit any output before the blocking backend build.
  • The main entrypoint's download path likely fires a spinner on TTY, but --once is designed for non-TTY use where spinners are suppressed — leaving nothing.

Severity

P2 — Feature works once a model is present, but the --once flag's documented scripting contract (run and return) is violated by a silent indefinite hang on first use. Shell keybindings and CI pipelines that invoke caro ai --once will appear to hang.


Prompt used to generate this comment
caro QA agent — daily rotation slot A+B+C, scheduled remote run 2026-09-16

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium priority - normal priority issueawaiting-responseWaiting for response from authorbackendRelated to inference backendsbugSomething isn't workingenhancementNew feature or requestperformancePerformance improvementsplatform/linuxLinux specificqaFiled by automated QA agent

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions