Skip to content

fix: llama-down failures answer fast and say what to do - #141

Merged
sosidudku1 merged 4 commits into
mainfrom
valeryb/actionable-llama-errors
Aug 18, 2026
Merged

fix: llama-down failures answer fast and say what to do#141
sosidudku1 merged 4 commits into
mainfrom
valeryb/actionable-llama-errors

Conversation

@plombeer31

Copy link
Copy Markdown
Collaborator

What

With llama-server down, the most common first-run failure was 17 seconds of dead air
followed by the two words fetch failed — no URL, no diagnosis, no fix. After this change
the same run fails in ~2 seconds and says:

! [transport] fetch failed
    llama-server is not reachable at http://127.0.0.1:8080
      start it with:       atomic-agent models start
      or point elsewhere:  atomic-agent config set localModels.url <url>

Where the 17 seconds went

createAgentRuntime runs checkLlamaServer() with the default retry ladder — 5 attempts,
exponential backoff, 500·(1+2+4+8+16) = 15.5 s — purely to log a warning
(bootstrap.ts, the probe never throws). The sidecar's start_session status probe had
the same ladder. Both now probe once: these are observability probes, and with a
refused connection the retries change nothing — the first real completion is the retry.
The TUI startup gate already probed with retries: 0; now every probe agrees.

The message

New formatLlamaUnreachableHint(url) in llama-server-health.ts — the shared, actionable
wording. run appends it to the first transport failure (step_error / loop_failed)
only when the active text route is the local server — on a cloud route the same
category points at the provider, not llama — and only once per process, so retries
don't bury the log in repeated advice.

Testing

  • 6 new unit tests: hint content; appended on local-route transport failures; printed
    once, not per retry; untouched on cloud routes; untouched for non-transport categories;
    loop_failed decorated the same way. Plus the existing health-check suite (15/15 total).
  • End-to-end against the built CLI, llama down, fresh state dir:
    before 17.3 s + bare fetch failed → after 2 s, exit 1, hint printed with URL and
    both fix commands.
  • npm run lint clean.

Not covered here: the TUI feed still prints the bare ! [transport] fetch failed line —
that surface already has the health pill and the startup wizard, and enriching it touches
the reducer path, so it is left for a separate change.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants