fix(ab-connect): bind to stable tabId as the primary key + retry on mid-flight detach (0.4.8, #23)
claude-in-chrome completes the Rakuten cart→購入手続き→checkout flow that chrome-use 1.2.3 couldn't, because it binds to the browser-level tabId (survives renderer-process swaps) rather than a CDP target/sessionId (torn down by the cross-origin OAuth/SSO nav). chrome-use's relay is already keyed to the stable tabId (cb-tab-<tabId>, #17) and sends commands by {tabId} — the gap was purely that the extension treated the session→tab map as the source of truth and only reactively re-attached after a failed lookup. Make the tabId the PRIMARY resolution path: derive it straight from the session id (tabIdFromSession), ensure-attach with short retries across the swap window (recoverSessionTab now loops), and route every send through sendCdpToTab, which on a detached-style error drops the stale handle, re-attaches the stable tab, and retries once. So a cross-process nav never surfaces as a hard error — there's no 'session gone' window, matching claude-in-chrome. Builds on 0.4.5/0.4.6 reattach; makes it primary + bulletproof rather than a fallback.
This commit is contained in:
Binary file not shown.
Reference in New Issue
Block a user