Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- Start T3 Code with
defaultRuntimeMode: "approval-required"and theReplay (dev)provider. - Add a project and start a thread with the
approvalreplay recording (so run 1,ordinal:1, pauses waiting on approval). - While run 1 is active, queue a follow-up message:
t3 thread send <threadId> "Queued follow-up"(creates run 2,ordinal:2, statusqueued). - In the web client, remove the queued message (Remove queued message) — or promote it to steer (Send now). Run 2 transitions to
status: "cancelled"withstartedAt: null. - Click Approve so run 1 completes cleanly.
- Compare
t3 thread list --project <project> --json(t3_thread_list) witht3 thread show <threadId> --json(t3_thread_read).
The same mismatch affects t3_thread_wait with no runId: calling it while run 1 is still running returns run 2 (status: "cancelled") immediately instead of waiting for run 1, and calling it after run 1 finishes still returns run 2 (status: "cancelled").
Root cause: OrchestratorMcpService.threadDetail derives thread.status and thread.latestRunId from ThreadManagementService.latestRun(projection) (raw highest ordinal) instead of reusing the already-loaded shell (presentedShellRunId / latestUnheldRun) that t3_thread_list uses, and ThreadManagementService.waitForThread uses the same raw latestRun when runId is omitted.
Expected behavior
t3_thread_read (t3 thread show) agrees with t3_thread_list and the UI shell (latestUnheldRun / presentedShellRunId, #35661; aligned with t3_thread_read in #36610): a queued run cancelled before it started while an earlier run outlived it does not replace that run as latest, so thread.status is "completed" and thread.latestRunId is ordinal:1. t3_thread_wait with no runId waits on and returns ordinal:1.
Actual behavior
After run 1 finishes cleanly:
t3_thread_list(t3 thread list) reportsstatus: "completed"andlatestRunId: "...:ordinal:1".t3_thread_read(t3 thread show) reportsstatus: "cancelled"andlatestRunId: "...:ordinal:2".t3_thread_waitwithoutrunIdreturnsordinal:2(status: "cancelled") immediately even while run 1 is still running, and after run 1 completes.
Impact
Minor bug or occasional failure
Version or commit
v0.1.14-nightly.20261129.5452 (58a4e59962) and main @ e4c315a896 (also observed on 0.1.13)
Environment
Reproduced in an isolated instance on macOS 27.2.1 (arm64), Node v26.13.1, headless Chromium with Replay (dev) (no provider account required; platform-independent server behavior). Originally hit on 0.1.13 after a queued follow-up on a delegated thread was promoted to steer (ordinal:2 cancelled at 18:57:31Z with startedAt: null, ordinal:1 completed cleanly at 19:12:21Z).
Logs or stack traces
t3_thread_list -> status: "completed", latestRunId: "run:thread:...:ordinal:1"
t3_thread_read -> status: "cancelled", latestRunId: "run:thread:...:ordinal:2"
Screenshots, recordings, or supporting files
Workaround
Check t3_thread_list for the thread's shell status, or inspect recentRuns in t3_thread_read instead of thread.status / thread.latestRunId.

Activity