GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(web): a failed plan refinement no longer leaks into another thread by Yuruzuu · Pull Request #28263 · pingdotgg/t3code

Conversation

@Yuruzuu

@Yuruzuu Yuruzuu commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Problem

In plan mode, Refine could send one thread's text from another thread. Click Refine in thread A, switch to thread B while the request is pending, and type in B. If A's request then fails, B's composer still shows B's text, but pressing Send delivers A's text to thread B. Nothing on screen warns you.

Change

When a plan follow-up fails, useComposerSend restores the composer. The draft store write is keyed to A, which is correct. But promptRef, composerTerminalContextsRef and resetCursorState belong to the mounted ChatView, which is reused across threads. They were written without checking which thread is showing, and promptRef is what Send reads.

Now those three only run if the view is still on the originating thread. A's draft is still restored, so nothing is lost. The normal send's failure path already has this same currentRouteThreadKeyRef check; this path was missing it.

test/fakeEnvironment.ts gains plan and interaction-mode fixtures and answerRpc, so the test can fail one request. Those are test-only.

Queued-message edits (useQueuedRunEdit) and the feedback clearDraft callback have a similar unguarded pattern. I left them out to keep this to one problem. Web and desktop share this code. Mobile has its own UI and isn't touched; I didn't check whether it has a similar problem.

#28126 also edits ChatView.browser.test.tsx and fakeEnvironment.ts, so whichever lands second may need a small rebase.

Scope and approval

This fits the small, focused bug-fix exception in CONTRIBUTING.md. Sending text to the wrong thread is an obvious defect, and the fix adds a guard without adding a feature or changing contracts or defaults.

Verification

vp test run apps/web/src/components/ChatView.browser.test.tsx runs the whole app in Chromium against the fake environment, following the steps above.

Text sent to thread B Result
Before (main) draft alpha (test fails)
After (this branch) draft beta (2/2 pass, new test repeated 3 times)

vp run check:changed passes. There's no visual change, so no screenshots.

Not checked: this failure in a real client (the test forces it through the fake server, and Replay couldn't reach a plan state), the desktop app, or relay and tunnel connections.

Made with Claude Opus 5.5 via Claude Code in T3 Code.

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Yuruzuu @claude
fix(web): a failed plan refinement no longer leaks into another thread
1b68c5a
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Oct 31, 2026
macroscopeapp[bot]
macroscopeapp Bot approved these changes Oct 31, 2026
View reviewed changes
@macroscopeapp

macroscopeapp Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 1b68c5a

Macroscope's review found this PR approvable — Failed plan follow-ups now restore live composer state only when the originating thread is still displayed, while retaining its saved draft restoration. The change is narrowly scoped and reduces cross-thread interference.

You can add or adjust custom eligibility rules. Learn more.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coderabbitai

coderabbitai Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: pingdotgg/t3code
  • Branch: main
  • File: .coderabbit.config.ts
  • Commit: 15fe283
  • Layers: Repository TS config
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cce157ba-328e-4c4a-930d-09021f3d7554
Commits

Reviewing files that changed from the base of the PR and between 15fe283 and 1b68c5a.

Files selected for processing: 3
  • apps/web/src/components/ChatView.browser.test.tsx
  • apps/web/src/components/chat/useComposerSend.ts
  • apps/web/test/fakeEnvironment.ts

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

Failed plan follow-ups now restore prompt state and cursor only when the user remains on the thread where the send began. A browser test covers a pending request that fails after navigation to another thread.

Changes: Composer send failure handling

Layer / File(s) Summary
Thread and RPC test fixtures
apps/web/test/fakeEnvironment.ts
Fake threads can provide plans and interaction modes. The fake environment can register and remove an RPC handler.
Thread-scoped failure restoration
apps/web/src/components/chat/useComposerSend.ts
After a failed plan follow-up, prompt and terminal-context refs are restored, and the cursor is reset, only if the current route matches the thread where the send began.
Cross-thread failure regression test
apps/web/src/components/ChatView.browser.test.tsx
The browser test rejects alpha’s pending refinement after navigation to beta. It checks that alpha’s draft and beta’s composer draft remain intact, then verifies that submitting sends beta’s text to beta.

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

Possibly related PRs

  • pingdotgg/t3code#24825: Refactors useComposerSend to restore drafts after send failures while ChatView stays mounted across thread changes.

Suggested reviewers: juliusmarminge

Merge Risk: Minimal · up to 1b68c

The failed refinement preserves alpha’s draft without overwriting beta’s composer. No merge-blocking issue was identified.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main fix: preventing failed plan refinement from affecting another thread.
Description check Passed The description includes all required sections and explains the problem, fix, scope exception, focused verification results, limitations, and lack of screenshots due to no visual change.
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.
Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Yuruzuu

Yuruzuu commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Withdrawing this. Plan mode is off by default and little used, so this isn't worth the review time.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Yuruzuu Yuruzuu closed this Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@macroscopeapp macroscopeapp[bot] macroscopeapp[bot] approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@Yuruzuu
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.