Skip to content

[Bug]: First message can disappear when a new thread starts #4078

Description

@D3OXY

Area

apps/server

Steps to reproduce

  1. Create a new thread and immediately send its first message.
  2. Let the thread transition from its draft route while the initial thread-detail snapshot loads.
  3. Observe the assistant response begin streaming.
  4. Reopen or restart the app.

The race is timing-dependent.

Expected behavior

The first user message remains visible before the assistant response.

Actual behavior

The initial snapshot can be delivered before the live thread-event subscription attaches. A first-message event published in that gap is omitted from client state. Later assistant events advance and persist the client cache cursor, so restarting can preserve the missing message.

Server persistence still contains the user message. Removing the affected IndexedDB thread cache entry forces a fresh snapshot and restores it.

Impact

Minor bug or occasional failure. It makes conversation history appear incomplete and requires manual cache invalidation to recover.

Version or commit

main @ fdca154

Environment

macOS desktop app with Codex provider

Investigation

Searched existing issues; no duplicate found. The no-cursor orchestration.subscribeThread path returns a snapshot and only then consumes the live stream, unlike the replay path which buffers live events before catch-up.

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