Skip to content

[upstream #16609] Minimal resume submission breaks the error card when a reattached stream fails #223

Description

@berry-13

Found while testing resumeStream for LibreChat-AI#16609.

When the stream status route answers a running job without resumeState, useResumeOnLoad builds a minimal resume submission whose initialResponse is { messageId: 'resume_', conversationId, text: '', content } with no isCreatedByUser (client/src/hooks/SSE/useResumeOnLoad.ts, the else branch that sets resumeStreamId). If the reattached stream then delivers a server-written error event, errorHandler builds the error turn from that initialResponse and tMessageSchema.parse throws a ZodError (isCreatedByUser required) in parseErrorResponse (client/src/hooks/SSE/useEventHandlers.ts). The error card is never written and the pane stays submitted.

Reproduce: in client/src/hooks/Chat/__tests__/transport.spec.tsx (resume block), answer the status read with { active: true, streamId, status: 'running', createdAt } and no resumeState, call resumeStream(), then emit { type: 'error', data: { message: 'x' } } on the reattached stream.

Current servers send resumeState for running jobs, so this needs an older server or a status without it. Fix: give the minimal initialResponse isCreatedByUser: false (and a parent), and cover the error path in that spec.

Activity

  1. added
    bugSomething isn't working
    readyreviewctl followups state
    area: clientreviewctl followups state
    on Oct 1, 2026
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

    area: clientreviewctl followups statebugSomething isn't workingreadyreviewctl followups state

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions