Warning
Review limit reached
Only developers with an assigned seat can use this organization's usage-based review budget, and seats here are assigned manually. Ask an admin to assign a seat, or change the review continuation mode in Billing.
Next included review available in 42 seconds.
View limit details
Limit details: Youβve used all 10 included reviews currently available.
Review configuration:
βοΈ Run configuration
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
544d9485-a429-4290-be4b-21d6ceaa5ded
π₯ Commits
Reviewing files that changed from the base of the PR and between e063028d915e8ea7196b550820c67c37494c61f7 and 31cbeeda9e7426f32b456b55343a2449b607f2c9.
π Files selected for processing: 3
apps/server/src/mcp/PreviewAutomationBroker.tsapps/server/src/preview/ServerBrowser.test.tsapps/server/src/preview/ServerBrowser.ts
π Walkthrough
ServerBrowser now reserves capacity while tabs open. Active tabs and opening reservations count toward the server and per-agent limits. Agent-initiated opens and popups use a shared opening flow that cleans up failed or interrupted launches.
Changes: Tab capacity management
Layer / File(s) Summary Reserve capacity during tab opens
apps/server/src/preview/ServerBrowser.ts,apps/server/src/preview/ServerBrowser.test.tsOpening tabs count toward server and per-agent limits. The opening flow releases reservations when creation settles and closes manager sessions after failures or interruptions. Tests cover concurrent opens, tab reuse, failures, and capacity release. Apply shared limits to popups
apps/server/src/preview/ServerBrowser.ts,apps/server/src/preview/ServerBrowser.test.tsPopup adoption uses the shared opening flow and rejects popups when the opener is closing. Tests cover concurrent popup admission and closure of rejected popup pages. Priority: β Normal
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Bug fix
Suggested reviewers:
maria-rcks,juliusmarminge
Merge Risk: π‘ Moderate Β· up to e0630
Preview tab behavior is not shown to be broken, but the server typecheck fails. Forward the argument before merging.
Security architecture risk: π΅ Low Β· up to e0630
The change strengthens browser resource limits without adding permissions or access paths. Risk is low, with remaining uncertainty around cleanup during partial browser setup and interruption.
Retained concerns No architecture-level concerns identified.
Security review details
Security Blast Radius
- inferred β The relevant failure-containment boundary is browser resource consumption within one server-browser instance. Concurrent agent requests and page-generated popups reach the same page-creation sink; reservations now account for these admitted opens across agents before asynchronous session and browser work completes.
Trust Boundaries and Controls
- observed β Ordinary opens pass request.agentSessionId as automationOwner, while popup ownership is inherited from the opener. Page creation continues to initialize SessionControl from that owner and retains the existing profile and isolated-context selection. The reviewed changes do not introduce a different identity source or browser privilege grant.
Resilience and Maintainability Implications
- inferred β A setup rejection after page allocation but before tracked-tab publication can leave an untracked page: creation performs fallible CDP and rendering setup without a local cleanup guard, and Manager.close only removes session state. This mechanism exists in both base and head; no increased exposure from this PR was established. It limits assurances about actual Chromium-page containment under partial setup failure.
Hardening Proposals
- proposed β Extend explicit page and context cleanup ownership from allocation through successful tab publication, with fault injection after page allocation to validate containment. This would address the pre-existing partial-setup gap, not a demonstrated regression introduced here.
Pre-merge checks: Passed 4
Check name Status Explanation 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. Title check Passed The title clearly and concisely describes the primary change: reserving tab capacity before concurrent preview opens. Description check Passed The description provides detailed problem, change, and verification information, including test results, live proof, limitations, and scope exclusions. It does not explicitly document maintainer appro⦠Full details: Description check
Explanation
The description provides detailed problem, change, and verification information, including test results, live proof, limitations, and scope exclusions. It does not explicitly document maintainer approval or explain an approval exemption, but it is otherwise substantially complete.
β¨ Finishing Touches: π‘ 1
-
π οΈ Fix failing CI checks: π‘
- Commit to this branch
- Create a new PR
π§ͺ 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.