Skip to content

Keep tab selection and live view on the same browser target - #17

Draft
shrey150 wants to merge 2 commits into
codex/desktop-session-lifecyclefrom
codex/desktop-tab-sync
Draft

shrey150 wants to merge 2 commits into
codex/desktop-session-lifecyclefrom
codex/desktop-tab-sync

Conversation

@shrey150

@shrey150 shrey150 commented Nov 13, 2026 •

Copy link
Copy Markdown

Switching between tabs with the same URL can display the wrong Live View, and closing an earlier tab can change which browser page a stale tab ID refers to. Background navigation can also overwrite the address bar, while a late debug response can replace the view after another tab has been selected.

This change assigns stable tab IDs and uses each page's actual CDP target for Live View selection. Active-page identity survives tab removal, background navigation leaves the active address alone, and superseded sync/debug responses cannot overwrite newer state. The current debug URL is retained for renderer reloads and automation. A failed lookup ends the loading state with a retry message for the current selection; stale lookup failures do not show an error over another tab.

Stacked on #16 (codex/desktop-session-lifecycle), which is stacked on #14. Review this diff against the lifecycle branch. No version bump or changeset is included.

E2E Test Matrix

Command / flow Observed output Confidence / sufficiency
npm run build Main-process TypeScript and renderer bundle built successfully. Checks the exact PR head builds.
node --test tests/*.test.cjs 28 tests passed. Includes eight tab regressions for duplicate URLs, stable IDs, background navigation, late live-view responses, overlapping syncs, and loading failure/retry behavior, plus inherited lifecycle/diagnostics coverage.
Background-navigation regression against the original main revision The address event incorrectly contained the background page URL; the same test passes after this change with the active page URL. Demonstrates the original address-bar bug and verifies the fix.
Real SessionManager smoke with three tabs at https://example.com Three distinct CDP targets were observed; every tab switch selected its matching Live View target, even though all URLs were identical. Tests the actual Browserbase API and Playwright connection. Signed access values were excluded from recorded output.
Real viewport, background navigation, and tab-closing flows Remote viewport measured 1024 × 700; background navigation preserved the active address; closing an earlier tab preserved the active ID; a repeated stale close ID did nothing. Checks the actual remote-browser behavior behind the desktop controls.
Real smoke shutdown All six smoke flows passed in about 3.33 seconds; the API confirmed the test session was COMPLETED. Confirms test resource cleanup. This is a single functional run, not a latency benchmark.

Screenshot

Screenshot

Actual desktop window displaying a synthetic task in a real cloud browser, captured with the companion runtime and shell-isolation changes applied. The screenshot-only computer-use model completed the form; the remote page independently confirmed the values.

Desktop cloud browser after computer-use task

Combined validation: the mainline candidate containing #13–#18 and #20 passed builds, all 34 automated tests, and the high/critical advisory gate on Linux, macOS, and Windows. Cross-platform CI results.

@shrey150
shrey150 force-pushed the codex/desktop-tab-sync branch from 1d6b663 to 9a7ba64 Compare November 13, 2026 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant