Skip to content

fix: review of #21 — one browser per session, real DPR for maxWidth, GIF follows replaced tab - #22

Merged
compnew2006 merged 2 commits into
mainfrom
fix/review-21
Sep 30, 2026
Merged

compnew2006 merged 2 commits into
mainfrom
fix/review-21

Conversation

@compnew2006

Copy link
Copy Markdown
Owner

Fixes the 3 issues from the post-merge review of #21.

  1. [P1] A batch could run in two browsers. An auto session is now pinned to the browser its first call went to (bridge-connections.ts), so batches and retries stay in one browser. If that browser disconnects, calls fail with a clear error instead of switching silently. browser_select_browser re-pins.
  2. [P2] maxWidth at DPR 2.
    • The DPR is now read from window.devicePixelRatio, because real Chrome reports equal device and CSS viewport widths.
    • If the image still comes out wider than maxWidth, it is captured once more, scaled by the real image size.
  3. [P2] GIF after a frozen-tab replacement.
    • replaceFrozenTab moves the recording to the new tab id, and the router records on the replacement.
    • status/stop/export resolve the old id without looking up the closed tab.

Test plan

  • 4 new tests, all failing on the old code
  • lint, typecheck, build, context:lint
  • vitest: everything passes except the daemon-spawn suites, which also fail on this machine without these changes

🤖 Generated with Claude Code

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: ae0bf159-535e-48da-bd07-a8e1f2a398d4


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.

noiemany and others added 2 commits September 30, 2026 13:50
…dth, GIF follows replaced tab

- Multi-browser: an "auto" session is pinned to the browser its first call
  went to. A browser connecting mid-session no longer takes over its calls
  (a batch did click in "work" then type in "home" with the same tabId).
  If the pinned browser disconnects, calls fail with a clear error instead
  of switching silently; browser_select_browser re-pins.
- Screenshot maxWidth at DPR 2: real Chrome reports equal device and CSS
  viewport widths, so the ratio came out 1 and maxWidth 800 gave 1600 px.
  Read window.devicePixelRatio, and if the image is still wider than
  maxWidth, re-capture once scaled by the real image size.
- GIF: replaceFrozenTab moves the recording to the new tab id (frames keep
  coming; the router records on replacedTabId's successor), and
  status/stop/export resolve the old id without needing the closed tab.

Tests: 4 new, all failing on the old code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…failed select, frame on recovery navigate

- Router: a browser_gif call naming a replaced tab is rewritten to the
  replacement id BEFORE the lock check and per-tab queue, so another
  session can't stop/clear/export/capture a locked replacement via the
  old id.
- browser_select_browser: a failed selection no longer drops the auto
  pin (the next call used to run in the newest browser with the old
  browser's tab ids).
- Frozen-tab recovery navigate (mutex-bypass path) records a frame of the
  replacement tab, queued on its mutex.

Tests: 3 new, failing on the old code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@compnew2006
compnew2006 merged commit 29868c9 into main Sep 30, 2026
7 of 8 checks passed
@compnew2006
compnew2006 deleted the fix/review-21 branch September 30, 2026 11:12
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