Skip to content

[Bug]: Threads get stuck on "waiting for 0s" #1048

@merlinnot

Description

@merlinnot

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

Not sure

Steps to reproduce

  1. Start the app with t3 v0.0.11 and codex-cli 0.114.0 (I'm using the web version and latest Chrome).
  2. Type a message in any thread.
  3. Wait for the response to "never complete".

I see some messages from the agent, but when it completes the answer, I still can't send new messages. I also can't stop the agent. Browser refresh fixes it - after a refresh I can send new messages. It never gets out of this state:

Image

Expected behavior

I should be able to stop the response and send messages immediately after sending a previous one.

Actual behavior

The UI seems to be stuck.

Impact

Major degradation or frequent failure

Version or commit

v0.0.11

Environment

running t3 on a Linux server I access remotely

Logs, stack traces, or screenshots

No errors on the t3 back end, I can see clear logs that turns are finishing fine.

This is what Codex told me:

Evidence: For thread cbebfd8c-f2fa-4fc9-9198-3bebfc5711f8, the provider log shows normal completion for turn 019ce8b1-ba50-7081-9425-58654c76c223:

codex/event/task_complete
thread/status/changed with idle
turn/completed with status: completed and error: null
Root cause: The runtime/orchestration state can retain a stale activeTurnId even after the session is ready. Later turn.started / turn.completed events are then rejected by the strict lifecycle guard as conflicting with the stale active turn, so projections stop updating correctly. This leaves thread/session state inconsistent and the UI can keep rendering the composer as “working”.

Observed stale state:

projection_thread_sessions had status = ready but a non-null old active_turn_id
projection_turns contained an orphan pending row with turn_id = null
projection_threads.latest_turn_id could lag behind the newest completed turn
Likely fix: In the runtime lifecycle guard, only treat activeTurnId as authoritative while session status is actually running, and clear stale running/latest-turn UI state when the session transitions back to ready.

Workaround

Refresh the page.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is broken or behaving incorrectly.needs-triageIssue needs maintainer review and initial categorization.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions