Repository navigation
fix(web): new threads no longer open blank after the first send - #46
Conversation
The draft view read run-stop state for its not-yet-created thread id. The bounded snapshot 404ed, the thread state parked as deleted, and the resume cache kept that miss, so the thread never subscribed after the first send. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…aits Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Missing snapshot and remount behavior packages/client-runtime/src/state/threads.ts, packages/client-runtime/src/state/threads-sync.test.ts |
setDeleted now distinguishes missing snapshot results from delete events. Missing results clear the owned resume snapshot before thread removal; delete events retain the existing cache behavior. The test harness can leave removal pending, and a new test verifies that a remount loads a present thread as live. |
Draft run-stop state
| Layer / File(s) | Summary |
|---|---|
Guard run-stop state for drafts apps/web/src/components/chat/useThreadLifecycle.tsx |
The hook selects the run-stop atom only when an active thread reference and its shell exist. Otherwise, it uses NO_RUN_STOP_ATOM. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: juliusmarminge
Merge Risk: 
Minimal · up to ccfee
-
The missing-thread recovery path is covered, with no identified issue requiring a fix before merge.
Pre-merge checks: 
4
-
Full details: Description check
-
Explanation
The description clearly explains the problem, the code changes, the affected behavior, test evidence, observed results, and blast radius. It does not use the exact template headings and does not explicitly document maintainer approval or explain why the fix qualifies without prior approval, but the required technical context is mostly complete.
-
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
Summary
A new thread showed nothing after its first send (not your own message, not the working status) until a full app restart. The draft view read run-stop state for its not-yet-created thread id, the snapshot request returned 404, and the thread state stopped for good. The resume cache then kept that 404, so leaving the thread and coming back didn't help either. Now drafts don't ask for their future id, and a 404 for an unknown id is no longer remembered.
The run-stop read came from upstream pingdotgg#27252, merged in the Oct 30 sync. Mobile's new-task screen already passes no detail ref, so it doesn't make the early request.
Evidence
launchThreadat 22:53:44, and nosubscribeThreaduntil the app restarted.After: opening and reloading a draft made no request; the first send (Replay provider) went launch → snapshot 200 → subscribe, and the user message and reply showed right away.
threads-sync.test.ts› "checks a missing thread again on remount instead of retaining the miss": a miss whose disk-cache removal is still pending, then unmount, then a remount where the thread exists, must go live. It fails ondev_vmand on the first version of this fix; it passes now.check:changedis green.Merge Danger
Door: two-way
Blast Radius: client-thread-loading
Changes when web, desktop, and mobile load thread detail. A truly missing thread costs one extra HTTP request if it's reopened within 5 minutes. Run-stop shows only for threads the server lists.
🤖 Generated with Claude Code