Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): new threads show the agent's output without a reload #27609

ClosedDuarteFaria(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/27609/headopened View on GitHub

Problem

Since 0.1.6-nightly.20261030.3917, a new thread stays on "Send a message to start the conversation." after the first send, while the agent runs normally on the server. A reload shows the transcript. Fixes #27527.

Change

#27252 added runStopAtom(activeThreadRef) to useThreadLifecycle. activeThreadRef is set for drafts, so it mounts the thread state before the thread exists: the bounded snapshot returns thread_not_found, and makeEnvironmentThreadState records the thread as deleted and parks its subscription. After thread.create, the view reads that same parked state, so nothing renders until a reload.

The hook now reads runStopAtom only once the server thread exists (activeThreadShell), the same condition ChatView's other detail reads use through resolveThreadDetailRef.

Scope and approval

A very small, focused fix for an obvious regression: one condition in one hook. The bug is tracked in #27527, with confirmations on macOS, Windows, and Linux.

Verification

Dev server on isolated state, Replay (dev) provider, new thread, then send:

  • main: the draft's /bounded request returns 404, there is no subscribeThread, and the view shows only the user message (before video).
  • This branch: no request for the draft. After create, /bounded returns 200, subscribeThread runs, and the reply streams in (after video).

vp run check:changed passes.

No automated test: this hook has no test harness, and building one (~40 inputs) for a one-condition fix seemed out of proportion. Happy to add one if you want it.

Before

https://github.com/user-attachments/assets/f0adbe25-bd7a-464a-85f3-20d02f7144d5

After

https://github.com/user-attachments/assets/9899a2c0-7bca-48c8-a600-cdf20f0049ca

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. Berezhnyk(GitHub profile, opens in a new tab) approved these changes

    3. Review in Change Stack →

      No actionable comments were generated in the recent review.

      Recent review info
      Run configuration
      Commits

      Reviewing files that changed from the base of the PR and between 6575ce32508bd7908444241f3719aa33aaf77f90 and 2612b07b14cdec35d2a49a9f59280bd9ba6b0bc6.

      Files selected for processing: 1
      • apps/web/src/components/chat/useThreadLifecycle.tsx

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

      Walkthrough

      useThreadLifecycle now selects the thread’s run-stop atom only when both the active thread reference and shell are available. Otherwise, it uses NO_RUN_STOP_ATOM.

      Changes: Thread lifecycle

      Layer / File(s)Summary
      Gate the run-stop subscription
      apps/web/src/components/chat/useThreadLifecycle.tsx
      The run-stop subscription now requires both the active thread reference and its shell. Without either, the code uses NO_RUN_STOP_ATOM.
      Priority: Normal

      Estimated code review effort: 2 (Simple) | ~8 minutes

      Change: Bug fix · Severity of issue fixed: Medium

      Possibly related issues

      • pingdotgg/t3code#27482 — Reports that a draft thread can be marked missing before server creation, preventing a later subscription. This change gates the run-stop subscription until the thread shell exists.
      • pingdotgg/t3code#27443 — Reports a similar pre-creation request and missed subscription. This change prevents the run-stop read before the shell exists.

      Possibly related PRs

      • pingdotgg/t3code#27522: Addresses the same new-thread regression by preventing run-stop state reads through a draft reference.
      • pingdotgg/t3code#27570: Uses NO_RUN_STOP_ATOM until both the thread reference and shell exist.
      • pingdotgg/t3code#25477: Gates mobile thread detail reads until creation completes, addressing a related premature-read issue.

      Suggested reviewers: juliusmarminge, macroscopeapp

      Merge Risk: Minimal · up to 2612b

      The change addresses the draft-thread subscription race without leaving an identified current-head risk.

      Pre-merge checks: Passed 4
      Check nameStatusExplanation
      Title checkPassedThe title names the main change: new threads now show the agent's output without a reload. It follows the conventional commit form and matches the raw summary, which describes gating the run-stop subs…
      Description checkPassedThe description follows the template. It covers Problem, Change, Scope and approval, and Verification, with before and after videos. It states the regression, the root cause (runStopAtom mounted for d…
      Linked Issues checkPassedThe directly linked issue [#27527] requires a new server-backed thread to show the user message and streaming agent output without reload. The change gates `environmentThreadDetails.runStopAtom(active…
      Out of Scope Changes checkPassedThe pull request changes one condition and one explanatory comment in apps/web/src/components/chat/useThreadLifecycle.tsx. The change directly prevents draft thread state from being marked missing b…
      Full details: Title check

      Explanation

      The title names the main change: new threads now show the agent's output without a reload. It follows the conventional commit form and matches the raw summary, which describes gating the run-stop subscription on the server thread shell. The title is specific and short.

      Full details: Description check

      Explanation

      The description follows the template. It covers Problem, Change, Scope and approval, and Verification, with before and after videos. It states the regression, the root cause (runStopAtom mounted for drafts before the server thread exists), and the one-condition fix. It links issue #27527 and gives macOS, Windows, and Linux confirmations. It also explains why no automated test was added. The Scope section is weaker: it relies on the issue as triage evidence but does not link a maintainer approval comment. The template asks for that approval, or for an explanation of why a small obvious fix qualifies without one. The author gives the second explanation, which covers the requirement. The verification section states what was checked and what was not. It does not name the agent or harness used, though the template asks for that only when an agent was used.

      Full details: Linked Issues check

      Explanation

      The directly linked issue [#27527] requires a new server-backed thread to show the user message and streaming agent output without reload. The change gates environmentThreadDetails.runStopAtom(activeThreadRef) on activeThreadShell, so draft threads use NO_RUN_STOP_ATOM until the server thread exists. The reported verification shows no draft /bounded request, then a successful post-create /bounded request, subscribeThread, and streamed output. No linked issue requires an automated test for this hook.

      Full details: Out of Scope Changes check

      Explanation

      The pull request changes one condition and one explanatory comment in apps/web/src/components/chat/useThreadLifecycle.tsx. The change directly prevents draft thread state from being marked missing before thread.create. The reported verification and vp run check:changed support the focused scope. No unrelated implementation is shown.

      Finishing Touches
      🧪 Generate unit tests (beta)
      • Create a new PR
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
      Comment `@coderabbitai help` to get the list of available commands.
    4. Note

      🤖 Claude Opus 5.5 responding on behalf of Theo

      Closing: this is covered by #27522, which landed. Reopen if a needed part is still missing.

Sign in to join this conversation.