fix(web): starting sessions show as working in the chat view #14000
main fromrefs/pull/14000/head·opened View on GitHubWhile 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
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
Approvability#
Verdict: Approved at
f25e2bcMacroscope'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).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
isConnectingas 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.tsxChatView removes its local isConnectingstate and derivesisConnectingfrom the session phase.Priority: ⬇️ Low
Estimated code review effort: 1 (Trivial) | ~5 minutes
Change: Bug fix
Suggested reviewers:
t3dotggMerge Risk: ⚪ Minimal · up to
f25e2ChatView 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 name Status Explanation Resolution Docstring Coverage ⚠️ Warning Docstring 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 name Status Explanation Title check ✅ Passed The title clearly describes the main bug fix: starting sessions now appear as working in the chat view. Description check ✅ Passed The 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 ✅ Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check ✅ Passed Check 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.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.
juliusmarminge closed this
Checked in a live web client (
vp run devon this branch, Chrome-based T3 Browser panel, macOS). Requesting reconsideration.Setup. A scratch git repo added as a project, with a Claude
SessionStarthook 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 instartinguntil the hook finishes.Before (this branch with the
ChatView.tsxchange 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.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.
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'sclaudeprocess, 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 instarting.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.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes