Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): starting sessions show as working in the chat view #14000

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

While a provider session sits in starting, the sidebar shows Working but the chat view shows an empty timeline and an idle Send button. We hit this for ~2.5 minutes when a repo's Claude SessionStart hook (pnpm install + codegen) blocked the first turn.

The cause: isConnecting in ChatView was a useState(false) whose setter was never called. The starting window only looked busy through the sending client's local dispatch, and that resets on every threadId/draftId change. So after a new-thread draft send moves to the thread route, or on reload or another client, nothing marked the thread as busy. The comment added in #11852 already assumed the starting session "drives the connecting state on its own"; this makes that true.

Fix: derive isConnecting from derivePhase(session) === "connecting". Every existing consumer already treats it like send-busy (spinner on send, sends and reverts blocked), so the view now matches what the sending client saw before the route change. A session can't stay stuck in starting: server startup already reconciles orphaned starting sessions (serverRuntimeStartup.ts).

Surfaces: web/desktop only. Mobile already treats starting as busy (ThreadComposer, ThreadRouteScreen). No contract or provider changes.

Verified with web typecheck and lint. Checked in a live web client (delayed startup that completes and that fails): https://github.com/pingdotgg/t3code/pull/14000#issuecomment-5924799536

Opus 5.5 via Claude Code in T3 Code.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • The connecting indicator now reflects the active chat session’s current phase.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. Approvability

      Verdict: Approved at f25e2bc

      Macroscope's review found this PR approvable — This is a focused web bug fix that derives the existing connecting state from the server session, keeping startup sessions consistently marked as busy across reloads and route changes. It introduces no schema, deployment, security, billing, default, or static-analysis changes.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. Review in Change Stack →

      Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration

      Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

      Review profile: CHILL

      Plan: Advanced

      Run ID: 278d7929-e636-47e0-a538-b4f5cc8ececd

      📥 Commits

      Reviewing files that changed from the base of the PR and between 94f92a7a386a26c98892b24fabdd0ea9fa804ce3 and f25e2bc3268d3d3c84ab08cc432c43ba7d44b610.

      📒 Files selected for processing (1)
      • apps/web/src/components/ChatView.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

      Walkthrough

      ChatView no longer tracks isConnecting as local state. It derives the value from whether the session phase is "connecting".

      Changes

      Chat connection state

      Layer / File(s)Summary
      Derive connecting indicator
      apps/web/src/components/ChatView.tsx
      ChatView removes its local isConnecting state and derives isConnecting from the session phase.

      Priority: ⬇️ Low

      Estimated code review effort: 1 (Trivial) | ~5 minutes

      Change: Bug fix

      Suggested reviewers: t3dotgg

      Merge Risk: ⚪ Minimal · up to f25e2

      ChatView now derives the connecting indicator from the session phase rather than an initially idle local flag, aligning the displayed state with a starting session. No concrete merge-blocking risk is evident.

      🚥 Pre-merge checks | ✅ 4 | ❌ 1

      ❌ Failed checks (1 warning)

      Check nameStatusExplanationResolution
      Docstring Coverage⚠️ WarningDocstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.Write docstrings for the functions missing them to satisfy the coverage threshold.
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Title check✅ PassedThe title clearly describes the main bug fix: starting sessions now appear as working in the chat view.
      Description check✅ PassedThe description explains the problem, root cause, fix, affected surfaces, validation, and scope. It does not use the template headings or include the requested UI screenshots and checklist, but it is …
      Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
      • Fix all pre-merge checks with AI
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create a new PR

      Comment `@coderabbitai help` to get the list of available commands.
    4. Note

      This comment is posted by Julius' dot

      This changes the startup spinner and disables sending and reverting across route changes and reloads, but validation is limited to typecheck and lint. The PR explicitly says it was not exercised in a live client and includes no before/after images or interaction recording. Please provide those checks for a delayed startup and its completion or failure, as required by verification, then request reconsideration.

    5. juliusmarminge closed this

    6. Checked in a live web client (vp run dev on this branch, Chrome-based T3 Browser panel, macOS). Requesting reconsideration.

      Setup. A scratch git repo added as a project, with a Claude SessionStart hook that blocks startup:

      { "hooks": { "SessionStart": [ { "hooks": [ { "type": "command", "command": "sleep 25", "timeout": 60 } ] } ] } }

      Each run starts from a new-thread draft with Claude Haiku 4.5 and sends one message. Sending moves the view from /draft/… to the thread route, which resets the local dispatch state. The provider session stays in starting until the hook finishes.

      Before (this branch with the ChatView.tsx change reverted, same server): The sidebar shows Working, but the chat shows only the user message, with no working row and an idle Send button that can be pressed. This lasts until the hook finishes and the reply arrives.

      before-starting https://github.com/user-attachments/assets/bbc5c29b-d17c-416d-9bd8-5f9b33b18d2a

      After, delayed startup that completes: The chat shows "Working…" and a spinner on Send for the whole hook delay. I reloaded the page partway through, and it still showed the thread as working, which is the case the local dispatch state could never cover. When the hook finished, the reply rendered and Send became available again.

      after-starting after-starting-reload after-complete https://github.com/user-attachments/assets/34368eb2-962e-4b2b-a203-00ea38556bb6

      After, delayed startup that fails: Hook lengthened to sleep 45. About 8s into startup, I killed that thread's claude process, which the dev server had spawned. The session moved to an error state: the spinner cleared, "Claude runtime stream failed." showed in the timeline and as a banner, and Send became available again. Nothing stayed stuck in starting.

      after-failure-starting after-failure-settled https://github.com/user-attachments/assets/50ef92f9-603c-4f2c-920e-f661d1f01522

      Not checked: the desktop shell (it renders the same ChatView), and a second client watching the thread while it starts. The reload case uses the same server-derived path.

Sign in to join this conversation.