refactor(web): resuming an interrupted run lives in its own hook#23087
useComposerSend was moved verbatim out of ChatView in #23062. It is still one ~1,900-line hook that takes an 82-field input object. This stack splits it along its send paths, and each piece reads what it needs.
This layer moves resuming an interrupted run (and releasing held queued runs) into useComposerResume. ChatView calls that hook directly. Resume shares the per-route send lock with the other send paths through draftSendState, as before. useComposerSend no longer takes resumableRunId, hasHeldQueuedRuns, interactionMode or scrollToEnd.
| before | after | |
|---|---|---|
useComposerSend.ts lines | 1,916 | 1,823 |
useComposerSend input fields | 82 | 78 |
useComposerResume input fields | — | 19 |
Render boundaries are unchanged: these are hooks inside ChatView, so render counts are unchanged and were not measured.
Tested in this worktree's dev server (isolated .t3, throwaway git repo as the project) with the whole stack applied: plain send from a draft (new thread), send with an image, queued follow-up and Ctrl+Enter steer during a running turn, resume of a stopped run, plan refinement and "Implement in a new thread" (legacy plan mode on), and a two-model start (two threads, two worktrees). All replies arrived and nothing errored. Also ran apps/web typecheck, lint on changed files (only the pre-existing prefer-set-has warning in useComposerSend.ts remains) and the React Compiler coverage test for changed files (0 bailouts).
🤖 Generated with Claude Code
Checks
- SuccessfulCodeRabbitGitHub
Review completed
- Successful
Skipped - Not affected
- Skipped
- Skipped
- Skipped
- SuccessfulRemove preview downloadGitHub
- SuccessfulLabel PR 23087GitHub
- Successful
- Successful
- Skipped
- SuccessfulLabel PR sizeGitHub
- Successful
- Successful
- SuccessfulCollect PR targetsGitHub
- SuccessfulPrepare PR size configGitHub
- SuccessfulNative fingerprint diffGitHub
- SuccessfulCheckGitHub
- SkippedRelease SmokeGitHub
- SkippedRustGitHub
- Skipped
- SuccessfulBuild and TypecheckGitHub
- SuccessfulTestGitHub
- SuccessfulTest WebGitHub
- SuccessfulLabel PR 23087GitHub
- Skipped
- SuccessfulLabel PR sizeGitHub
- SuccessfulTest Server 8GitHub
- SuccessfulCollect PR targetsGitHub
- SkippedEAS PreviewGitHub
- SuccessfulPrepare PR size configGitHub
- SuccessfulTest Server 1GitHub
- SuccessfulTest Server 5GitHub
- SuccessfulTest Server 3GitHub
- SuccessfulTest Server 6GitHub
- SuccessfulTest Server 7GitHub
- SuccessfulTest Server 2GitHub
- SuccessfulTest Server 4GitHub
- SuccessfulChangesGitHub
- SuccessfulLintGitHub
- SuccessfulNative fingerprint diffGitHub
Added 1 commit
- refactor(web): resuming an interrupted run lives in its own hook9c7a742
Approvability
Verdict: Approved at 9c7a742
Macroscope's review found this PR approvable — This PR extracts existing resume behavior from useComposerSend into a dedicated hook without changing the commands, guards, state coordination, or UI wiring. The remaining changes are limited to moving dependencies and handlers between the two hooks.
You can add or adjust custom eligibility rules. Learn more.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Team
- Run ID:
2d3c2fb0-2626-449d-a636-4b55d458da24
📥 Commits
Reviewing files that changed from the base of the PR and between 322d08dbd46eecf4446d33d85f9fd7ff08d60f1b and 9c7a742e1f18ec3fb7be07b6099e20ea01c7a8d3.
📒 Files selected for processing: 3
apps/web/src/components/ChatView.tsxapps/web/src/components/chat/useComposerResume.tsapps/web/src/components/chat/useComposerSend.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
📝 Walkthrough
Resume handling moved from
useComposerSendto a dedicateduseComposerResumehook.ChatViewinvokes the new hook separately and keeps send and plan-implementation behavior inuseComposerSend.Changes: Composer resume flow
Layer / File(s) Summary Separate resume handling from sending
apps/web/src/components/chat/useComposerResume.ts,apps/web/src/components/chat/useComposerSend.tsThe new hook handles guarded interrupted-run continuation and queued-run release. useComposerSendno longer accepts resume inputs or maintains resume state and behavior.Connect the resume hook in ChatView
apps/web/src/components/ChatView.tsxChatViewinvokesuseComposerResumewith thread and runtime inputs. It no longer passes resume inputs or scrolling touseComposerSend.Priority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Refactor
Possibly related issues
pingdotgg/t3code#22851— This change moves interrupted-run resumption and queued-run release intouseComposerResume. It does not change normal Send dispatch or continuation text.pingdotgg/t3code#14169— This change updates the client-side interrupted-run resume path used by the recovery action. It does not add the missing reset timestamp.
Merge Risk: ⚪ Minimal · up to 9c7a7
This refactor moves resuming interrupted runs and releasing queued runs into their own hook without changing behavior. No concrete risk was identified, so it looks ready to merge after the normal checks.
Pre-merge checks: Passed 3 · Failed 1
Failed Failed checks: 1 warning
Check name Status Explanation Resolution Description check Warning The description clearly explains the problem, change, and verification, but it does not follow the required template headings and does not provide the required triaged issue or explicit maintainer app… Add the Problem, Change, Scope and approval, and Verification sections. Include a link to the triaged issue or approval discussion with the maintainer approval comment, or explain why this focused refactor qualifies for an exemption. Passed Passed checks: 3 passed
Check name Status Explanation Title check Passed The title clearly identifies the main change: moving interrupted-run resumption into its own hook. 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.
Full details: Description check
Explanation
The description clearly explains the problem, change, and verification, but it does not follow the required template headings and does not provide the required triaged issue or explicit maintainer approval for scope.
Resolution
Add the Problem, Change, Scope and approval, and Verification sections. Include a link to the triaged issue or approval discussion with the maintainer approval comment, or explain why this focused refactor qualifies for an exemption.
✨ Finishing Touches
📝 Generate docstrings
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
- Commit to this branch
- 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.