Skip to content

Route preview automation through live owner streams (#3548) - #127

Merged
aaditagrawal merged 1 commit into
mainfrom
sync/upstream-20260626-preview-owner-streams
Jun 26, 2026
Merged

Route preview automation through live owner streams (#3548)#127
aaditagrawal merged 1 commit into
mainfrom
sync/upstream-20260626-preview-owner-streams

Conversation

@aaditagrawal

Copy link
Copy Markdown
Owner

What Changed

Why

UI Changes

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@aaditagrawal, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 56 minutes. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 82e87dfd-a6f5-4033-a8f9-ccdff61adc51

📥 Commits

Reviewing files that changed from the base of the PR and between da27228 and 38ef8bd.

📒 Files selected for processing (69)
  • apps/desktop/scripts/electron-launcher.mjs
  • apps/desktop/scripts/electron-launcher.test.mjs
  • apps/desktop/src/preview/Manager.test.ts
  • apps/desktop/src/preview/Manager.ts
  • apps/desktop/src/preview/PreviewKeyboard.test.ts
  • apps/desktop/src/preview/PreviewKeyboard.ts
  • apps/desktop/src/window/DesktopWindow.test.ts
  • apps/desktop/src/window/DesktopWindow.ts
  • apps/server/src/mcp/McpHttpServer.test.ts
  • apps/server/src/mcp/McpHttpServer.ts
  • apps/server/src/mcp/PreviewAutomationBroker.test.ts
  • apps/server/src/mcp/PreviewAutomationBroker.ts
  • apps/server/src/mcp/toolkits/preview/handlers.ts
  • apps/server/src/mcp/toolkits/preview/tools.ts
  • apps/server/src/preview/Manager.test.ts
  • apps/server/src/preview/Manager.ts
  • apps/server/src/server.test.ts
  • apps/server/src/server.ts
  • apps/server/src/ws.ts
  • apps/web/src/AppRoot.test.tsx
  • apps/web/src/AppRoot.tsx
  • apps/web/src/browser/BrowserDeviceToolbar.test.ts
  • apps/web/src/browser/BrowserDeviceToolbar.tsx
  • apps/web/src/browser/BrowserViewportResizeHandles.tsx
  • apps/web/src/browser/ElectronBrowserHost.tsx
  • apps/web/src/browser/HostedBrowserWebview.tsx
  • apps/web/src/browser/browserDeviceToolbarState.ts
  • apps/web/src/browser/browserRecording.ts
  • apps/web/src/browser/browserRecordingScope.test.ts
  • apps/web/src/browser/browserRecordingScope.ts
  • apps/web/src/browser/browserSurfaceStore.test.ts
  • apps/web/src/browser/browserSurfaceStore.ts
  • apps/web/src/browser/browserViewportActions.test.ts
  • apps/web/src/browser/browserViewportActions.ts
  • apps/web/src/browser/browserViewportLayout.test.ts
  • apps/web/src/browser/browserViewportLayout.ts
  • apps/web/src/browser/useBrowserViewportResize.ts
  • apps/web/src/components/ChatView.tsx
  • apps/web/src/components/preview/AgentBrowserCursor.tsx
  • apps/web/src/components/preview/PreviewAutomationHosts.tsx
  • apps/web/src/components/preview/PreviewAutomationOwner.test.ts
  • apps/web/src/components/preview/PreviewAutomationOwner.tsx
  • apps/web/src/components/preview/PreviewMoreMenu.tsx
  • apps/web/src/components/preview/PreviewView.tsx
  • apps/web/src/components/preview/previewAutomationClientId.test.ts
  • apps/web/src/components/preview/previewAutomationClientId.ts
  • apps/web/src/components/preview/previewAutomationErrors.ts
  • apps/web/src/components/preview/previewAutomationRequestConsumer.test.ts
  • apps/web/src/components/preview/previewAutomationRequestConsumer.ts
  • apps/web/src/components/preview/previewAutomationTarget.test.ts
  • apps/web/src/components/preview/previewAutomationTarget.ts
  • apps/web/src/components/preview/previewViewportReadiness.test.ts
  • apps/web/src/components/preview/previewViewportReadiness.ts
  • apps/web/src/components/preview/usePreviewSession.ts
  • apps/web/src/previewStateStore.test.ts
  • apps/web/src/previewStateStore.ts
  • infra/relay/scripts/deploy.test.ts
  • packages/client-runtime/src/state/preview.test.ts
  • packages/client-runtime/src/state/preview.ts
  • packages/contracts/src/ipc.ts
  • packages/contracts/src/preview.test.ts
  • packages/contracts/src/preview.ts
  • packages/contracts/src/previewAutomation.ts
  • packages/contracts/src/rpc.ts
  • packages/shared/package.json
  • packages/shared/src/previewViewport.test.ts
  • packages/shared/src/previewViewport.ts
  • scripts/dev-runner.test.ts
  • scripts/dev-runner.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sync/upstream-20260626-preview-owner-streams

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL 1,000+ effective changed lines (test files excluded in mixed PRs). labels Jun 26, 2026
@aaditagrawal
aaditagrawal marked this pull request as ready for review June 26, 2026 12:11
@aaditagrawal
aaditagrawal force-pushed the sync/upstream-20260626-electron-startup branch from 9789673 to d7ec665 Compare June 26, 2026 13:11
@aaditagrawal
aaditagrawal force-pushed the sync/upstream-20260626-preview-owner-streams branch from 259504c to cd4e5d8 Compare June 26, 2026 13:11

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cd4e5d8de5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

case "recordingStop": {
const recordingTabId = readActiveBrowserRecordingTabId();
const stopTabId = resolveBrowserRecordingStopTarget(recordingTabId);
const artifact = stopTabId ? await stopBrowserRecording(stopTabId) : null;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Scope recording_stop to the requested thread

Because the automation host is now environment-wide, readActiveBrowserRecordingTabId() can refer to a tab owned by a different thread/provider session than request.threadId. In that case a preview_recording_stop from another agent/thread will stop and return the active recording artifact for the unrelated tab instead of failing for the request's tab, which can corrupt evidence collection and interrupt another workflow; check that the active recording tab belongs to this thread before calling stopBrowserRecording.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cd4e5d8de5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +487 to +489
const recordingTabId = readActiveBrowserRecordingTabId();
const stopTabId = resolveBrowserRecordingStopTarget(recordingTabId);
const artifact = stopTabId ? await stopBrowserRecording(stopTabId) : null;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep recording stops scoped to the requesting thread

When another thread/session has the only active browser recording, this branch ignores request.threadId and stops whatever global recording is active. A preview_recording_stop call from the current thread can therefore stop and return the artifact for a different thread instead of reporting that this thread has no active recording; verify the active recording tab belongs to readThreadPreviewState(threadRef).sessions before calling stopBrowserRecording.

Useful? React with 👍 / 👎.

Comment on lines +354 to +355
if (input.show ?? true) {
useRightPanelStore.getState().openBrowser(threadRef, activeTabId);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reveal background preview opens when show is true

When the broker routes preview_open to this environment host for a thread that is not the currently displayed ChatView, this only mutates that thread's right-panel store entry. Nothing activates that thread in the UI, so the default show: true can return with the browser still invisible to the user (and status visible: false); switch to the target thread or otherwise surface the panel when handling background-thread opens.

Useful? React with 👍 / 👎.

aaditagrawal commented Jun 26, 2026

Copy link
Copy Markdown
Owner Author

Merge activity

  • Jun 26, 3:03 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 26, 3:09 PM UTC: Graphite rebased this pull request as part of a merge.
  • Jun 26, 3:09 PM UTC: @aaditagrawal merged this pull request with Graphite.

@aaditagrawal
aaditagrawal changed the base branch from sync/upstream-20260626-electron-startup to graphite-base/127 June 26, 2026 15:06
@aaditagrawal
aaditagrawal changed the base branch from graphite-base/127 to main June 26, 2026 15:07
Co-authored-by: codex <codex@users.noreply.github.com>
@aaditagrawal
aaditagrawal force-pushed the sync/upstream-20260626-preview-owner-streams branch from cd4e5d8 to 38ef8bd Compare June 26, 2026 15:08
@aaditagrawal
aaditagrawal merged commit 790074e into main Jun 26, 2026
12 checks passed
@aaditagrawal
aaditagrawal deleted the sync/upstream-20260626-preview-owner-streams branch August 1, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ effective changed lines (test files excluded in mixed PRs). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants