Skip to content

fix(server): a timed-out browser drag no longer exits the server - #17360

Merged
Yash-Singh1 merged 1 commit into
pingdotgg:mainfrom
ScottN-PV:fix/17322-drag-unhandled-rejection
Oct 9, 2026
Merged

Yash-Singh1 merged 1 commit into
pingdotgg:mainfrom
ScottN-PV:fix/17322-drag-unhandled-rejection

Conversation

@ScottN-PV

Copy link
Copy Markdown
Contributor

Problem

drag starts dragTo, then awaits the target's position and a cursor move before it awaits the drag. A drag that times out in that gap rejects with no handler attached, and the server's only unhandledRejection listener exits the process. That matches #17322: the server restarted and startup recovery cancelled the running threads.

Change

drag now handles the drag's outcome in the turn the drag starts, finishes the cursor move as before, then rethrows the drag's error. The server keeps running and the action fails with the drag's error. Ordering is unchanged: a failed drag still settles inside its action, and a cursor-move failure still takes precedence.

Scope and approval

Closes #17322. The triage comment confirms the unobserved rejection on main and suggests catching the drag promise at once and rethrowing after the cursor update, which is this change.

Verification

  • New test in ServerBrowserPage.test.ts: a page whose drag fails at once while the target's position is still pending. No unhandledRejection fires, drag does not settle until the target's position arrives, and it then rejects with the drag's error. The test fails with main's ServerBrowserPage.ts.
  • In apps/server: vp test run src/preview passes, 10 files, 127 tests. Server typecheck, vp lint, and vp fmt --check on the two changed files pass.
  • Not reproduced against a live server.

Model: Claude Opus 5.5, Claude Fable 5.1 (review), GPT-6-Astra (review). Harness: Claude Code, Codex.

drag started dragTo, then awaited the target's position and a cursor move
before awaiting the drag. A drag that timed out in that gap rejected with
no handler attached, and the unhandled rejection exited the server, whose
restart cancelled every running thread. The drag's outcome is now caught as
it starts and reported after the cursor arrives.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Oct 8, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at b3d6d43

Macroscope's review found this PR approvable — This is a focused bug fix that prevents a timed-out browser drag from causing an unhandled rejection and terminating the server, while preserving normal drag behavior and operation-level error reporting. A targeted regression test covers the failure timing, and no product defaults or static-analysis suppressions are changed.

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

@coderabbitai

coderabbitai Bot commented Oct 8, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 219489d2-f38f-4d2a-9a2a-e7ce3820b4fa
📥 Commits

Reviewing files that changed from the base of the PR and between 5b78b34 and b3d6d43.

📒 Files selected for processing (2)
  • apps/server/src/preview/ServerBrowserPage.test.ts
  • apps/server/src/preview/ServerBrowserPage.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The drag operation now observes a rejected source.dragTo(target) promise while moving the pointer. It reports the captured error afterward. A regression test covers a timeout while the target position is pending.

Changes

Browser drag timeout handling

Layer / File(s) Summary
Capture and report drag failures
apps/server/src/preview/ServerBrowserPage.ts, apps/server/src/preview/ServerBrowserPage.test.ts
The drag operation records a rejection before moving the pointer and rethrows it afterward. The test checks that the operation waits for the target position and does not produce an unhandled rejection.

Priority: ➖ Normal

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

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: juliusmarminge

Merge Risk: ⚪ Minimal · up to b3d6d

The drag timeout is intended to return an error without exiting the server, and the reported targeted checks pass. No actionable merge-blocking risk is identified.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary fix: preventing a timed-out browser drag from terminating the server.
Description check Passed The description includes the required Problem, Change, Scope and approval, and Verification sections. It explains the failure mode, links the issue and approval comment, describes the focused test cov…
Linked Issues check Passed For directly linked issue #17322, drag attaches a rejection handler to source.dragTo(target, { timeout }) in the same turn that it starts the drag. It then completes target.boundingBox and the f…
Out of Scope Changes check Passed The reviewed changes are limited to ServerBrowserPage.ts and its focused drag regression test. The implementation and test directly address #17322. No unrelated production behavior or unrelated test…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@Yash-Singh1
Yash-Singh1 merged commit 8f76037 into pingdotgg:main Oct 9, 2026
29 checks passed
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Oct 9, 2026
## What's Changed
* refactor(provider-core): share attachment prompts, notifications, and event loggers by @juliusmarminge in pingdotgg/t3code#17330
* fix(web): file previews handle downloads, in-page links, and repo paths, and favicons stop leaking internal hosts by @juliusmarminge in pingdotgg/t3code#16950
* fix(server): environment-hosted browser tabs behave like a normal browser by @juliusmarminge in pingdotgg/t3code#16963
* fix(desktop): browser tab fixes for fullscreen, shortcuts, links, reload and hidden tabs by @juliusmarminge in pingdotgg/t3code#16961
* fix(web): desktop opens remote environments' browser tabs locally by @juliusmarminge in pingdotgg/t3code#17316
* fix(desktop): the t3 command warns instead of installing behind another t3 by @juliusmarminge in pingdotgg/t3code#17351
* fix(web): images, video, HTML and PDF preview in a thread before its first message by @juliusmarminge in pingdotgg/t3code#17352
* refactor(provider-muse): move Muse Code into its own provider package by @juliusmarminge in pingdotgg/t3code#17331
* fix(web): semantic branch naming hint lines up with its setting by @limineol in pingdotgg/t3code#16972
* fix(mobile): restore chat image previews in the v5 stack by @juliusmarminge in pingdotgg/t3code#17361
* feat(mobile): fade working threads and match web's status labels by @juliusmarminge in pingdotgg/t3code#17368
* fix(server): agent browser tools stop bloating history, fall back sensibly, and respect ownership by @juliusmarminge in pingdotgg/t3code#16956
* fix(web): add room for thread timeline markers by @Yash-Singh1 in pingdotgg/t3code#17372
* fix(web): drop sidebar context before cancelling pointer drag by @Yash-Singh1 in pingdotgg/t3code#17373
* refactor(providers): namespace-import service modules in core, Muse, Pi, and testing by @juliusmarminge in pingdotgg/t3code#17375
* fix(auth): show connection permissions and enforce session lifetime by @juliusmarminge in pingdotgg/t3code#17370
* refactor(provider-opencode): move OpenCode into its own provider package by @juliusmarminge in pingdotgg/t3code#17345
* refactor(provider-cursor): move Cursor into its own provider package by @juliusmarminge in pingdotgg/t3code#17349
* refactor(provider-acp): move the shared ACP adapter into its own package by @juliusmarminge in pingdotgg/t3code#17354
* refactor(provider-grok): move Grok into its own provider package by @juliusmarminge in pingdotgg/t3code#17357
* fix(server): speed up long thread message sync by @Yash-Singh1 in pingdotgg/t3code#17387
* fix(desktop): cancel backend pipe reads to avoid slow shutdown by @Yash-Singh1 in pingdotgg/t3code#17386
* refactor(providers): adapter factories yield their services by @juliusmarminge in pingdotgg/t3code#17381
* fix(web): show a row spinner instead of a banner when expanding a folder by @juliusmarminge in pingdotgg/t3code#17378
* fix(server): a timed-out browser drag no longer exits the server by @ScottN-PV in pingdotgg/t3code#17360
* fix(server): a logged-out Claude CLI no longer reports as authenticated by @yordis in pingdotgg/t3code#15459
* fix(server): Pi loads every selected skill without losing prompt text by @StiensWout in pingdotgg/t3code#17194

## New Contributors
* @limineol made their first contribution in pingdotgg/t3code#16972

**Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261008.2849...v0.0.46-nightly.20261009.2861

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261009.2861
github-actions Bot added a commit to davidvanderklay/t3code-flake that referenced this pull request Oct 9, 2026
## What's Changed
* refactor(provider-core): share attachment prompts, notifications, and event loggers by @juliusmarminge in pingdotgg/t3code#17330
* fix(web): file previews handle downloads, in-page links, and repo paths, and favicons stop leaking internal hosts by @juliusmarminge in pingdotgg/t3code#16950
* fix(server): environment-hosted browser tabs behave like a normal browser by @juliusmarminge in pingdotgg/t3code#16963
* fix(desktop): browser tab fixes for fullscreen, shortcuts, links, reload and hidden tabs by @juliusmarminge in pingdotgg/t3code#16961
* fix(web): desktop opens remote environments' browser tabs locally by @juliusmarminge in pingdotgg/t3code#17316
* fix(desktop): the t3 command warns instead of installing behind another t3 by @juliusmarminge in pingdotgg/t3code#17351
* fix(web): images, video, HTML and PDF preview in a thread before its first message by @juliusmarminge in pingdotgg/t3code#17352
* refactor(provider-muse): move Muse Code into its own provider package by @juliusmarminge in pingdotgg/t3code#17331
* fix(web): semantic branch naming hint lines up with its setting by @limineol in pingdotgg/t3code#16972
* fix(mobile): restore chat image previews in the v5 stack by @juliusmarminge in pingdotgg/t3code#17361
* feat(mobile): fade working threads and match web's status labels by @juliusmarminge in pingdotgg/t3code#17368
* fix(server): agent browser tools stop bloating history, fall back sensibly, and respect ownership by @juliusmarminge in pingdotgg/t3code#16956
* fix(web): add room for thread timeline markers by @Yash-Singh1 in pingdotgg/t3code#17372
* fix(web): drop sidebar context before cancelling pointer drag by @Yash-Singh1 in pingdotgg/t3code#17373
* refactor(providers): namespace-import service modules in core, Muse, Pi, and testing by @juliusmarminge in pingdotgg/t3code#17375
* fix(auth): show connection permissions and enforce session lifetime by @juliusmarminge in pingdotgg/t3code#17370
* refactor(provider-opencode): move OpenCode into its own provider package by @juliusmarminge in pingdotgg/t3code#17345
* refactor(provider-cursor): move Cursor into its own provider package by @juliusmarminge in pingdotgg/t3code#17349
* refactor(provider-acp): move the shared ACP adapter into its own package by @juliusmarminge in pingdotgg/t3code#17354
* refactor(provider-grok): move Grok into its own provider package by @juliusmarminge in pingdotgg/t3code#17357
* fix(server): speed up long thread message sync by @Yash-Singh1 in pingdotgg/t3code#17387
* fix(desktop): cancel backend pipe reads to avoid slow shutdown by @Yash-Singh1 in pingdotgg/t3code#17386
* refactor(providers): adapter factories yield their services by @juliusmarminge in pingdotgg/t3code#17381
* fix(web): show a row spinner instead of a banner when expanding a folder by @juliusmarminge in pingdotgg/t3code#17378
* fix(server): a timed-out browser drag no longer exits the server by @ScottN-PV in pingdotgg/t3code#17360
* fix(server): a logged-out Claude CLI no longer reports as authenticated by @yordis in pingdotgg/t3code#15459
* fix(server): Pi loads every selected skill without losing prompt text by @StiensWout in pingdotgg/t3code#17194

## New Contributors
* @limineol made their first contribution in pingdotgg/t3code#16972

**Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261008.2849...v0.0.46-nightly.20261009.2861

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261009.2861
adampeterhiggins added a commit to adampeterhiggins/t3code that referenced this pull request Oct 9, 2026
* fix(web): link pull requests to threads in folders that aren't Git repos (pingdotgg#15946)

Co-authored-by: PR Batch Tester <agent@local.test>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* feat(web): find messages and plans in the current thread (pingdotgg#10439)

Co-authored-by: Yash Singh <saiansh2525@gmail.com>
Co-authored-by: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* feat(web): improve terminal scrollback navigation and snapshots (pingdotgg#17091)

* docs(internals): add a checklist for adding a provider (pingdotgg#17229)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(mobile): keep native screens ordered during stack pops (pingdotgg#17231)

* fix(server): pairing tokens work on Node versions that cannot bind booleans (pingdotgg#16730)

* fix(mobile): HTML pages in a thread no longer trap scrolling on Android (pingdotgg#17211)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(web): centered scrollers no longer shift when the scrollbar appears (pingdotgg#17077)

Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>

* fix(web): distinguish thread search matches from code tints (pingdotgg#17263)

* fix(server): Pi extension wakes get an owned continuation turn (pingdotgg#17214)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(server): Pi discovers optional T3 tools on demand (pingdotgg#17220)

* fix(web): stack merge dialog closes as soon as you confirm (pingdotgg#17116)

* fix(server): Pi editor dialogs prefill the answer composer (pingdotgg#17206)

* fix(desktop): generate valid User-Agent that follows RFC 9110 guidelines (pingdotgg#17264)

* fix(server): Pi discovers workspace skills and commands (pingdotgg#17190)

* fix(mobile): preserve navigation after native swipe back (pingdotgg#17268)

* fix(server): keep newly discovered models out of legacy groups (pingdotgg#14314)

Co-authored-by: PR Batch Tester <agent@local.test>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* feat(editors): open remote projects in JetBrains IDEs over SSH (pingdotgg#17271)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* test(desktop): expect JetBrains IDEs among remote editors (pingdotgg#17291)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(server): recognize authenticated GitHub Enterprise hosts (pingdotgg#11059)

Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com>

* fix(connect): relay client updates itself and skips incompatible cloudflared (pingdotgg#17275)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(shared): relay client install waits out a brief Windows file lock (pingdotgg#16998)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(shared): release relay install locks on cancellation (pingdotgg#10585)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* chore(shared): bump managed cloudflared to 2026.10.0 (pingdotgg#11184)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(shared): bound cloudflared download with 10-minute timeout (pingdotgg#14139)

Co-authored-by: Kevin Rajan <kevin@kvnloo.dev>

* refactor(provider-core): add provider-core and provider-testing packages (pingdotgg#17299)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(settings): drop the legacy per-driver providers map (pingdotgg#17300)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(provider-pi): move Pi into its own provider package (pingdotgg#17302)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* feat(models): tell users when a CLI update unlocks a new model (pingdotgg#17307)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(web): collapsed composer reserves room for wide send actions (pingdotgg#17016)

* fix(muse): workflow subagents no longer stall on hidden approvals (pingdotgg#17329)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(provider-core): share attachment prompts, notifications, and event loggers (pingdotgg#17330)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(web): file previews handle downloads, in-page links, and repo paths, and favicons stop leaking internal hosts (pingdotgg#16950)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(server): environment-hosted browser tabs behave like a normal browser (pingdotgg#16963)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(desktop): browser tab fixes for fullscreen, shortcuts, links, reload and hidden tabs (pingdotgg#16961)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(web): desktop opens remote environments' browser tabs locally (pingdotgg#17316)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(desktop): the t3 command warns instead of installing behind another t3 (pingdotgg#17351)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(web): images, video, HTML and PDF preview in a thread before its first message (pingdotgg#17352)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(provider-muse): move Muse Code into its own provider package (pingdotgg#17331)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(web): semantic branch naming hint lines up with its setting (pingdotgg#16972)

* fix(mobile): restore chat image previews in the v5 stack (pingdotgg#17361)

* feat(mobile): fade working threads and match web's status labels (pingdotgg#17368)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(server): agent browser tools stop bloating history, fall back sensibly, and respect ownership (pingdotgg#16956)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(web): add room for thread timeline markers (pingdotgg#17372)

* fix(web): drop sidebar context before cancelling pointer drag (pingdotgg#17373)

* refactor(providers): namespace-import service modules in core, Muse, Pi, and testing (pingdotgg#17375)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(auth): show connection permissions and enforce session lifetime (pingdotgg#17370)

Co-authored-by: Bear Huddleston <bear@bearhuddleston.dev>

* refactor(provider-opencode): move OpenCode into its own provider package (pingdotgg#17345)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(provider-cursor): move Cursor into its own provider package (pingdotgg#17349)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(provider-acp): move the shared ACP adapter into its own package (pingdotgg#17354)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(provider-grok): move Grok into its own provider package (pingdotgg#17357)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(server): speed up long thread message sync (pingdotgg#17387)

* fix(desktop): cancel backend pipe reads to avoid slow shutdown (pingdotgg#17386)

* refactor(providers): adapter factories yield their services (pingdotgg#17381)

* fix(web): show a row spinner instead of a banner when expanding a folder (pingdotgg#17378)

* fix(server): a timed-out browser drag no longer exits the server (pingdotgg#17360)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(server): a logged-out Claude CLI no longer reports as authenticated (pingdotgg#15459)

* fix(server): Pi loads every selected skill without losing prompt text (pingdotgg#17194)

* fix(server): keep the Claude MCP token out of process arguments (pingdotgg#17408)

* fix(server): reconcile Pi native session rewinds (pingdotgg#13839)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(provider-pi): cover continuation offers through the driver (pingdotgg#17407)

* refactor(provider-acp-registry): move the ACP Registry into its own package (pingdotgg#17405)

* fix(server): relay client updates no longer drop the host off T3 Connect (pingdotgg#17366)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: shivam <91240327+shivamhwp@users.noreply.github.com>
Co-authored-by: PR Batch Tester <agent@local.test>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Jono Kemball <Noojuno@users.noreply.github.com>
Co-authored-by: Yash Singh <saiansh2525@gmail.com>
Co-authored-by: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com>
Co-authored-by: Wout Stiens <71498452+StiensWout@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: chise <lqff.yt@gmail.com>
Co-authored-by: Dara Adedeji <76637177+SunkenInTime@users.noreply.github.com>
Co-authored-by: maria <maria@kuuro.net>
Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>
Co-authored-by: oliver <97427849+flamboh@users.noreply.github.com>
Co-authored-by: jztmanyl <jztmanyl@gmail.com>
Co-authored-by: Bilal Bakr <62337003+Bil0000@users.noreply.github.com>
Co-authored-by: Grzegorz Mandziak <4248465+alimek@users.noreply.github.com>
Co-authored-by: Scott Norteman <snorteman@gmail.com>
Co-authored-by: Aditya Garud <153842990+yashranaway@users.noreply.github.com>
Co-authored-by: Aaron Queen <bompus@users.noreply.github.com>
Co-authored-by: Kevin Rajan <7121943+kvnloo@users.noreply.github.com>
Co-authored-by: Kevin Rajan <kevin@kvnloo.dev>
Co-authored-by: Theo Browne <me@t3.gg>
Co-authored-by: Daniel Alvim <danielalvim@tuta.io>
Co-authored-by: Bear Huddleston <bear@bearhuddleston.dev>
Co-authored-by: Yordis Prieto <yordis.prieto@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Browser drag timeout crashes the server and cancels unrelated threads

2 participants