Skip to content

New thread marked deleted when fetched before creation, UI stays empty #27482

Closed as not planned

Description

@Skilux

What happened

Starting a new thread in a project and sending a message shows only my message, with no spinner or reply. After a while the view returns to the empty "send a message to start a conversation" state, with no error. Reopening the thread also shows the empty state, with no message. The message and the agent reply do exist on the server.

Diagnosis

The server worked. The client marked the thread as deleted before it existed and never subscribed again.

Server (database and server.trace.ndjson):

  • thread.create and launchThread succeeded at 09:17:56Z.
  • The user message and the assistant reply are in orchestration_v2_projection_messages.
  • The run completed in 12 s.

Client sequence for the thread:

  1. 09:17:50.127Z EnvironmentThreadState.make runs for the new thread ID. The thread is not created yet.
  2. GET /api/orchestration/threads/<id>/bounded returns 404 thread_not_found.
  3. packages/client-runtime/src/state/boundedThreadSnapshotHttp.ts:104-109 maps the 404 to {_tag: "missing"} ("treating the thread as deleted").
  4. packages/client-runtime/src/state/threads.ts:999-1001 calls setDeleted() and returns Effect.never. The trace shows EnvironmentThreadState.setDeleted at 09:17:50.152Z. The makeSubscribeInput span stays open 33,959 ms.
  5. threads.ts:522 makes applyEvent a no-op for a deleted thread. threads.ts:944 parks any later subscribe. The deleted state is also kept in the resume cache for 5 min (threadRetention.ts:1).
  6. 09:17:56.733Z launchThread creates the thread. The client never fetches or subscribes again, so the UI stays empty.

Trigger: apps/web/src/components/ThreadRouteView.tsx:75-82 reads the thread detail when the route is /$environmentId/$threadId, the shell does not list the thread, and the draft store has no draft for that ID. I did not confirm what put the client on that route 6 s before the send. finalizePromotedDraftThreadByRef (composerDraftStore.ts:4383) removes the draft entry, so a window exists between draft removal and the shell listing the thread. I did not reproduce this in the UI.

Suggested direction: a 404 for a thread the client has just opened should not be permanent. Clear deleted on a thread.created event or on the next subscribe attempt.

Steps to reproduce

Not deterministic. Observed on the desktop app (nightly) against the local server, after the app restarted about 2 minutes earlier:

  1. Open a new thread in a project.
  2. Type a message and send it.
  3. The thread view stays empty. Reload to compare.

Version

0.1.6-nightly.20261030.3917 (app and server). main has the same threads.ts as this tag.

Environment

macOS (Darwin 27.0.0, arm64), T3 Code Nightly desktop with local server, provider claudeAgent, model claude-sonnet-5-5.

Evidence

09:17:50.127 EnvironmentThreadState.make
09:17:50.140 EnvironmentThreadState.makeSubscribeInput  33959ms
09:17:50.141 GET /api/orchestration/threads/<id>/bounded 404
09:17:50.143 GET /api/orchestration/threads/<id>/bounded 404
09:17:50.152 EnvironmentThreadState.setDeleted
09:17:56.733 ws.rpc.orchestration.launchThread 50ms
09:17:56.735 orchestrationV2.dispatch.threadCreate
server cause: ProjectionStoreThreadNotFoundError / EnvironmentResourceNotFoundError (thread_not_found)

Related issues

None found in 5 searches of pingdotgg/t3code (thread deleted before creation, blank new thread, setDeleted subscription).

Fix applied or workaround

None applied. Reloading the window or restarting the app should clear the state (not tested).

Filed by

claude (claude-sonnet-5-5) via t3 triage

Activity

  1. Skilux commented on Oct 30, 2026

    @Skilux
    Author

    Duplicate of #27443. Evidence and the confirmed trigger (#27252's runStopAtom) are posted there.

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