Skip to content

fix(preview): Return Request Timeouts Without Disconnecting Other Agents - #23564

Open
ajpemok wants to merge 1 commit into
pingdotgg:mainfrom
ajpemok:fix/preview-request-deadline
Open

ajpemok wants to merge 1 commit into
pingdotgg:mainfrom
ajpemok:fix/preview-request-deadline

Conversation

@ajpemok

@ajpemok ajpemok commented Oct 22, 2026 •

Copy link
Copy Markdown

A stalled server-browser request can outlive its deadline and cause the broker to disconnect the shared host. Other agents then lose their pending requests and browser access.

Bound the complete request handler by request.timeoutMs so it returns the existing typed timeout before the broker evicts the host. Ownership checks and the serial tab queue stay in place. A started action may still finish after its timeout; expired queued actions cannot start later.

This uses the focused obvious-bug exception in CONTRIBUTING.md. It enforces the existing deadline without adding a recovery workflow or changing product defaults. Related #23107 covers timeout diagnostics and recovery instructions separately.

Validation against main e9236274a3a6e0c731a7df4092db1e686f039068:

  • The two regressions fail on the unmodified handler. They cover another agent's pending request surviving a stalled operation and an expired queued navigation never running later.
  • All 64 tests pass across ServerBrowser.test.ts, PreviewAutomationBroker.test.ts and SessionControl.test.ts.
  • Scoped formatting, lint, server typechecking and GraphQL generation checks pass.
  • The Windows check:changed wrapper stalls in its ignored-file cache-key scan. That invocation was interrupted; its result is not a pass. Applicable checks were run directly.

The rebase preserves upstream's new desktop-focus and navigation-timeout tests. Installed-app acceptance is separate; this PR contains the timeout rather than diagnosing every stalled navigation or snapshot.

Prepared with GPT-6.1-Sol through the Codex harness in T3 Code.

@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 22, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at a618bcf

Macroscope's review found this PR approvable — This is a small, localized preview bug fix that enforces the existing request deadline and prevents a stalled tab from disconnecting the shared browser host. Regression tests cover both preservation of another agent's request and suppression of expired queued navigation.

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

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between a618bcf and cad2373.

Files selected for processing: 2
  • apps/server/src/preview/ServerBrowser.test.ts
  • apps/server/src/preview/ServerBrowser.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

handleRequest now applies request.timeoutMs and returns a PreviewAutomationTimeoutError when a request exceeds its deadline. Tests cover a stalled navigation while another agent remains usable and a queued navigation that expires before execution.

Changes: Preview request timeouts

Layer / File(s) Summary
Apply and verify request deadlines
apps/server/src/preview/ServerBrowser.ts, apps/server/src/preview/ServerBrowser.test.ts
handleRequest returns PreviewAutomationTimeoutError when a request exceeds its timeout. Tests check continued access by another agent and confirm an expired queued navigation is not replayed.

Priority: Normal

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

Change: Bug fix

Possibly related issues

  • pingdotgg/t3code#16921 — Addresses the objective of preventing timed-out preview actions from evicting the shared browser host or disrupting other requests.
  • pingdotgg/t3code#8732 — Addresses timeout behavior when navigation can complete after the caller times out.

Possibly related PRs

  • pingdotgg/t3code#24356 — Preserves the navigation timeout through the broker, which connects to this change’s request timeout handling.
  • pingdotgg/t3code#23107 — Uses a typed timeout while preserving the browser connection, a closely related timeout-recovery path.
  • pingdotgg/t3code#24523 — Changes timeout eviction and capture serialization to keep the browser connection usable after a stalled snapshot.

Suggested labels: bugfix

Suggested reviewers: juliusmarminge

Merge Risk: Minimal · up to cad23

The change appears ready to merge after normal checks. A stalled request can time out without starting an expired queued action.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: returning preview request timeouts without disconnecting other agents.
Description check Passed The description covers the problem, change, scope approval exception, related issue, focused verification, observed results, limitations, and agent attribution. It also reports an interrupted check in…
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 covers the problem, change, scope approval exception, related issue, focused verification, observed results, limitations, and agent attribution. It also reports an interrupted check instead of presenting it as passing.

Finishing Touches
🧪 Generate unit tests (beta)
  • 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.

This branch has not been deployed

No deployments
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.

1 participant