Skip to content

AI chat: a failed stream shows the user nothing — no error, no retry, no partial-apply signal #594

Description

@Aymericr

What happens

When an AI chat turn's stream fails mid-flight, the UI shows nothing. No assistant message, no error banner, no retry affordance. The user sees their own prompt and then silence, and the only evidence is in the browser console.

This is the defect that made #557 expensive to diagnose. The underlying cause there was a 404 on the stream-resume endpoint, fixed separately — but the 404 was visible only in devtools:

GET /api/ai/scene/workflow/wrun_…/stream → 404
[scene-ai] useChat stream error: Failed to fetch chat: 404
{"duration_ms":121729,"phase":"stream","outcome":"failed"}

It took a maintainer round-trip asking for console output to identify a failure the client had already caught and named. That's the part worth fixing: the next bug in this class should produce a one-line report instead of a two-week mystery.

Why it's separate from the 404

Fixing the resume URL removes one cause of a dead stream. It doesn't make any other cause visible — provider errors, a genuinely expired run, a network drop past the retry budget, a lambda timeout. Each of those still ends in the same silence. The missing feedback is the general defect; the 404 was one instance.

Where it lives

  • apps/community/features/community/components/ai-commands.tsxonError on the chat transport already receives these, and reportAiWorkflowTiming already logs {outcome: 'failed', phase: 'stream'} to observability. The information exists at the moment of failure; it just doesn't reach the user.
  • The resume path throws 'No active AI workflow to resume' when there's no run to reconnect to, which is likewise invisible.

What would fix it

An assistant-slot error state in the thread when a turn ends without a completion, carrying:

  1. A plain-language cause where we have one ("The connection dropped", "Out of credits", "The model provider returned an error"), falling back to something honest rather than nothing.
  2. A retry action that resends the same prompt, since most of these are transient.
  3. Confirmation of what the turn did or didn't apply to the scene — a turn can die after several successful tool calls, and right now the user can't tell whether their scene was partially modified.

Point 3 matters most for trust: a half-built room with no explanation is worse than a clean failure, and the user currently has no way to distinguish "nothing happened" from "four walls and a door happened".

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions