Skip to content

A chat turn that fails before streaming never surfaces an error — the UI hangs to a generic connection timeout #5729

Description

@nocstah

Summary

When a chat turn fails before the provider produces any stream (e.g. the provider probe fails), no error event reaches the frontend — the user stares at an idle chat until the client's own ~2-minute timeout shows "No response from the agent after 2 minutes. Try again or check your connection."

Problem

What happened vs expected: web_chat logged run_chat_task failed … [claude-code] \claude` CLI not installedandreport_errorfired at11:42:46— the backend knew the turn was dead within milliseconds. The UI was never told: nochat_error-style socket event was emitted for the turn (an external_transfer_pendingegress event did go out, but nothing terminal). Expected: an immediate, actionable error bubble ("Claude Code CLI not found — …") the momentrun_chat_task` fails.

The "check your connection" copy is also misleading — the failure was local and permanent, not connectivity.

Steps to reproduce:

  1. Configure the claude-code provider and make the CLI unresolvable (e.g. launch from Finder with the CLI only in ~/.local/bin — see the companion issue — or temporarily rename the binary).
  2. Send a message.
  3. Backend log shows run_chat_task failed instantly; the chat UI shows a spinner/typing state for ~2 minutes, then a generic connection error.

Version/platform: v0.63.14, macOS (Darwin 25.3.0), desktop bundle.

Solution (optional)

Emit a terminal per-turn error event on the socket surface from the run_chat_task failure path (src/openhuman/web_chat/ops.rs — the same place that logs the WRN), carrying the provider's error string; frontend renders it as the turn's result. The 2-minute client timeout then remains a true last resort for transport loss only.

Acceptance criteria

  • Repro gone — a provider failure surfaces in the chat within ~1s with the provider's actual error message.
  • Regression safety — a test covers "run_chat_task error ⇒ terminal error event emitted for that turn".
  • Diff coverage ≥ 80% — the fix PR meets the changed-lines coverage gate (Vitest + cargo-llvm-cov, enforced by .github/workflows/ci-lite.yml).

Related

Companion issue: Finder-launch CLI resolution (the failure that exposed this); its fix removes this particular trigger but not the gap.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions