fix(browser): resolve correct targetId in navigate response after renderer swap#25326
Merged
vincentkoc merged 8 commits intoopenclaw:mainfrom Feb 28, 2026
Conversation
…derer swap When `navigateViaPlaywright` triggers a Chrome renderer-process swap (e.g. navigating from chrome-extension:// to https://), the old `tab.targetId` captured before navigation becomes stale. The `/navigate` route previously returned this stale targetId in its response. After navigation, re-resolve the current tab by matching against the final URL via `profileCtx.listTabs()`. If the old target is already gone but the new one is not yet visible (extension re-attach in progress), retry after 800ms. Follow-up to openclaw#19744 (67bac62) which fixed the extension-side stale session cleanup.
22a233b to
37c0186
Compare
…same URL When multiple tabs have the same URL after navigation, find() could pick a pre-existing tab instead of the newly created one. Now only re-resolve when the old target is gone (renderer swap detected), and prefer the tab whose targetId differs from the old one.
Introduced a new function `resolveTargetIdAfterNavigate` to handle the resolution of the correct targetId after a navigation event that may trigger a renderer swap. This refactor improves code clarity and reuses the logic for determining the current targetId, ensuring that the correct tab is identified even when multiple tabs share the same URL.
…ests Updated the initialization of listTabs in the agent snapshot tests for better readability by removing unnecessary line breaks. This change enhances code clarity without altering the test logic.
Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Feb 28, 2026
Member
|
Deep review + rebase pass complete on a maintained branch with two focused follow-up commits:
What changed:
Validation run:
If helpful, these commits can be cherry-picked onto this PR branch for final merge. |
vincentkoc
added a commit
that referenced
this pull request
Feb 28, 2026
18 tasks
mrosmarin
added a commit
to mrosmarin/openclaw
that referenced
this pull request
Feb 28, 2026
* main: (31 commits) fix(browser): resolve correct targetId in navigate response after renderer swap (openclaw#25326) fix: sed escaping and UID mismatch in Podman Quadlet setup (openclaw#26414) fix(cron): pass heartbeat target=last for main-session cron jobs (openclaw#28508) (openclaw#28583) fix(cron): disable messaging tool when delivery.mode is none (openclaw#21808) (openclaw#21896) fix: clear delivery routing state when creating isolated cron sessions (openclaw#27778) fix(cron): avoid marking queued announce paths as delivered (openclaw#29716) fix(cron): enable completion direct send for text-only announce delivery (openclaw#29151) fix(cron): force main-target system events onto main session (openclaw#28898) fix(cron): condition requireExplicitMessageTarget on resolved delivery (openclaw#28017) feat(cron): add --account flag for multi-account delivery routing (openclaw#26284) fix: schedule nextWakeAtMs for isolated sessionTarget cron jobs (openclaw#19541) fix: sandbox browser docker no-sandbox rollout (openclaw#29879) (thanks @Lukavyi) GitHub: add regression bug issue template and routing (openclaw#29864) thanks @Takhoffman feat(feishu): add chat info/member tool (openclaw#14674) feat(feishu): add markdown tables, positional insert, color_text, and table ops (openclaw#29411) feat(feishu): add parent/root inbound context for quote support (openclaw#18529) fix: land android onboarding and voice reliability updates (openclaw#29796) fix(android-voice): rotate playback token per assistant reply fix(android-voice): retry talk config after transient failures fix(android-voice): cancel in-flight speech when speaker muted ...
vincentkoc
added a commit
that referenced
this pull request
Feb 28, 2026
nsd97
pushed a commit
to nsd97/openclaw
that referenced
this pull request
Feb 28, 2026
…derer swap (openclaw#25326) * fix(browser): resolve correct targetId in navigate response after renderer swap When `navigateViaPlaywright` triggers a Chrome renderer-process swap (e.g. navigating from chrome-extension:// to https://), the old `tab.targetId` captured before navigation becomes stale. The `/navigate` route previously returned this stale targetId in its response. After navigation, re-resolve the current tab by matching against the final URL via `profileCtx.listTabs()`. If the old target is already gone but the new one is not yet visible (extension re-attach in progress), retry after 800ms. Follow-up to openclaw#19744 (67bac62) which fixed the extension-side stale session cleanup. * fix(browser): prefer non-stale targetId when multiple tabs share the same URL When multiple tabs have the same URL after navigation, find() could pick a pre-existing tab instead of the newly created one. Now only re-resolve when the old target is gone (renderer swap detected), and prefer the tab whose targetId differs from the old one. * fix(browser): encapsulate targetId resolution logic after navigation Introduced a new function `resolveTargetIdAfterNavigate` to handle the resolution of the correct targetId after a navigation event that may trigger a renderer swap. This refactor improves code clarity and reuses the logic for determining the current targetId, ensuring that the correct tab is identified even when multiple tabs share the same URL. * refactor(tests): simplify listTabs initialization in agent snapshot tests Updated the initialization of listTabs in the agent snapshot tests for better readability by removing unnecessary line breaks. This change enhances code clarity without altering the test logic. * fix(ui): widen Set type to accept string tokens in external-link helper * chore: retrigger CI (unrelated Windows flaky test) Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
nsd97
pushed a commit
to nsd97/openclaw
that referenced
this pull request
Feb 28, 2026
wanjizheng
pushed a commit
to wanjizheng/openclaw
that referenced
this pull request
Mar 1, 2026
…derer swap (openclaw#25326) * fix(browser): resolve correct targetId in navigate response after renderer swap When `navigateViaPlaywright` triggers a Chrome renderer-process swap (e.g. navigating from chrome-extension:// to https://), the old `tab.targetId` captured before navigation becomes stale. The `/navigate` route previously returned this stale targetId in its response. After navigation, re-resolve the current tab by matching against the final URL via `profileCtx.listTabs()`. If the old target is already gone but the new one is not yet visible (extension re-attach in progress), retry after 800ms. Follow-up to openclaw#19744 (67bac62) which fixed the extension-side stale session cleanup. * fix(browser): prefer non-stale targetId when multiple tabs share the same URL When multiple tabs have the same URL after navigation, find() could pick a pre-existing tab instead of the newly created one. Now only re-resolve when the old target is gone (renderer swap detected), and prefer the tab whose targetId differs from the old one. * fix(browser): encapsulate targetId resolution logic after navigation Introduced a new function `resolveTargetIdAfterNavigate` to handle the resolution of the correct targetId after a navigation event that may trigger a renderer swap. This refactor improves code clarity and reuses the logic for determining the current targetId, ensuring that the correct tab is identified even when multiple tabs share the same URL. * refactor(tests): simplify listTabs initialization in agent snapshot tests Updated the initialization of listTabs in the agent snapshot tests for better readability by removing unnecessary line breaks. This change enhances code clarity without altering the test logic. * fix(ui): widen Set type to accept string tokens in external-link helper * chore: retrigger CI (unrelated Windows flaky test) Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
wanjizheng
pushed a commit
to wanjizheng/openclaw
that referenced
this pull request
Mar 1, 2026
wanjizheng
pushed a commit
to wanjizheng/openclaw
that referenced
this pull request
Mar 1, 2026
…derer swap (openclaw#25326) * fix(browser): resolve correct targetId in navigate response after renderer swap When `navigateViaPlaywright` triggers a Chrome renderer-process swap (e.g. navigating from chrome-extension:// to https://), the old `tab.targetId` captured before navigation becomes stale. The `/navigate` route previously returned this stale targetId in its response. After navigation, re-resolve the current tab by matching against the final URL via `profileCtx.listTabs()`. If the old target is already gone but the new one is not yet visible (extension re-attach in progress), retry after 800ms. Follow-up to openclaw#19744 (67bac62) which fixed the extension-side stale session cleanup. * fix(browser): prefer non-stale targetId when multiple tabs share the same URL When multiple tabs have the same URL after navigation, find() could pick a pre-existing tab instead of the newly created one. Now only re-resolve when the old target is gone (renderer swap detected), and prefer the tab whose targetId differs from the old one. * fix(browser): encapsulate targetId resolution logic after navigation Introduced a new function `resolveTargetIdAfterNavigate` to handle the resolution of the correct targetId after a navigation event that may trigger a renderer swap. This refactor improves code clarity and reuses the logic for determining the current targetId, ensuring that the correct tab is identified even when multiple tabs share the same URL. * refactor(tests): simplify listTabs initialization in agent snapshot tests Updated the initialization of listTabs in the agent snapshot tests for better readability by removing unnecessary line breaks. This change enhances code clarity without altering the test logic. * fix(ui): widen Set type to accept string tokens in external-link helper * chore: retrigger CI (unrelated Windows flaky test) Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
wanjizheng
pushed a commit
to wanjizheng/openclaw
that referenced
this pull request
Mar 1, 2026
wanjizheng
pushed a commit
to wanjizheng/openclaw
that referenced
this pull request
Mar 1, 2026
6 tasks
hughdidit
pushed a commit
to hughdidit/DAISy-Agency
that referenced
this pull request
Mar 1, 2026
(cherry picked from commit db25b26)
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 1, 2026
…derer swap (openclaw#25326) * fix(browser): resolve correct targetId in navigate response after renderer swap When `navigateViaPlaywright` triggers a Chrome renderer-process swap (e.g. navigating from chrome-extension:// to https://), the old `tab.targetId` captured before navigation becomes stale. The `/navigate` route previously returned this stale targetId in its response. After navigation, re-resolve the current tab by matching against the final URL via `profileCtx.listTabs()`. If the old target is already gone but the new one is not yet visible (extension re-attach in progress), retry after 800ms. Follow-up to openclaw#19744 (67bac62) which fixed the extension-side stale session cleanup. * fix(browser): prefer non-stale targetId when multiple tabs share the same URL When multiple tabs have the same URL after navigation, find() could pick a pre-existing tab instead of the newly created one. Now only re-resolve when the old target is gone (renderer swap detected), and prefer the tab whose targetId differs from the old one. * fix(browser): encapsulate targetId resolution logic after navigation Introduced a new function `resolveTargetIdAfterNavigate` to handle the resolution of the correct targetId after a navigation event that may trigger a renderer swap. This refactor improves code clarity and reuses the logic for determining the current targetId, ensuring that the correct tab is identified even when multiple tabs share the same URL. * refactor(tests): simplify listTabs initialization in agent snapshot tests Updated the initialization of listTabs in the agent snapshot tests for better readability by removing unnecessary line breaks. This change enhances code clarity without altering the test logic. * fix(ui): widen Set type to accept string tokens in external-link helper * chore: retrigger CI (unrelated Windows flaky test) Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
ansh
pushed a commit
to vibecode/openclaw
that referenced
this pull request
Mar 2, 2026
…derer swap (openclaw#25326) * fix(browser): resolve correct targetId in navigate response after renderer swap When `navigateViaPlaywright` triggers a Chrome renderer-process swap (e.g. navigating from chrome-extension:// to https://), the old `tab.targetId` captured before navigation becomes stale. The `/navigate` route previously returned this stale targetId in its response. After navigation, re-resolve the current tab by matching against the final URL via `profileCtx.listTabs()`. If the old target is already gone but the new one is not yet visible (extension re-attach in progress), retry after 800ms. Follow-up to openclaw#19744 (67bac62) which fixed the extension-side stale session cleanup. * fix(browser): prefer non-stale targetId when multiple tabs share the same URL When multiple tabs have the same URL after navigation, find() could pick a pre-existing tab instead of the newly created one. Now only re-resolve when the old target is gone (renderer swap detected), and prefer the tab whose targetId differs from the old one. * fix(browser): encapsulate targetId resolution logic after navigation Introduced a new function `resolveTargetIdAfterNavigate` to handle the resolution of the correct targetId after a navigation event that may trigger a renderer swap. This refactor improves code clarity and reuses the logic for determining the current targetId, ensuring that the correct tab is identified even when multiple tabs share the same URL. * refactor(tests): simplify listTabs initialization in agent snapshot tests Updated the initialization of listTabs in the agent snapshot tests for better readability by removing unnecessary line breaks. This change enhances code clarity without altering the test logic. * fix(ui): widen Set type to accept string tokens in external-link helper * chore: retrigger CI (unrelated Windows flaky test) Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
ansh
pushed a commit
to vibecode/openclaw
that referenced
this pull request
Mar 2, 2026
steipete
pushed a commit
to Sid-Qin/openclaw
that referenced
this pull request
Mar 2, 2026
…derer swap (openclaw#25326) * fix(browser): resolve correct targetId in navigate response after renderer swap When `navigateViaPlaywright` triggers a Chrome renderer-process swap (e.g. navigating from chrome-extension:// to https://), the old `tab.targetId` captured before navigation becomes stale. The `/navigate` route previously returned this stale targetId in its response. After navigation, re-resolve the current tab by matching against the final URL via `profileCtx.listTabs()`. If the old target is already gone but the new one is not yet visible (extension re-attach in progress), retry after 800ms. Follow-up to openclaw#19744 (67bac62) which fixed the extension-side stale session cleanup. * fix(browser): prefer non-stale targetId when multiple tabs share the same URL When multiple tabs have the same URL after navigation, find() could pick a pre-existing tab instead of the newly created one. Now only re-resolve when the old target is gone (renderer swap detected), and prefer the tab whose targetId differs from the old one. * fix(browser): encapsulate targetId resolution logic after navigation Introduced a new function `resolveTargetIdAfterNavigate` to handle the resolution of the correct targetId after a navigation event that may trigger a renderer swap. This refactor improves code clarity and reuses the logic for determining the current targetId, ensuring that the correct tab is identified even when multiple tabs share the same URL. * refactor(tests): simplify listTabs initialization in agent snapshot tests Updated the initialization of listTabs in the agent snapshot tests for better readability by removing unnecessary line breaks. This change enhances code clarity without altering the test logic. * fix(ui): widen Set type to accept string tokens in external-link helper * chore: retrigger CI (unrelated Windows flaky test) Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
steipete
pushed a commit
to Sid-Qin/openclaw
that referenced
this pull request
Mar 2, 2026
safzanpirani
pushed a commit
to safzanpirani/clawdbot
that referenced
this pull request
Mar 2, 2026
…derer swap (openclaw#25326) * fix(browser): resolve correct targetId in navigate response after renderer swap When `navigateViaPlaywright` triggers a Chrome renderer-process swap (e.g. navigating from chrome-extension:// to https://), the old `tab.targetId` captured before navigation becomes stale. The `/navigate` route previously returned this stale targetId in its response. After navigation, re-resolve the current tab by matching against the final URL via `profileCtx.listTabs()`. If the old target is already gone but the new one is not yet visible (extension re-attach in progress), retry after 800ms. Follow-up to openclaw#19744 (67bac62) which fixed the extension-side stale session cleanup. * fix(browser): prefer non-stale targetId when multiple tabs share the same URL When multiple tabs have the same URL after navigation, find() could pick a pre-existing tab instead of the newly created one. Now only re-resolve when the old target is gone (renderer swap detected), and prefer the tab whose targetId differs from the old one. * fix(browser): encapsulate targetId resolution logic after navigation Introduced a new function `resolveTargetIdAfterNavigate` to handle the resolution of the correct targetId after a navigation event that may trigger a renderer swap. This refactor improves code clarity and reuses the logic for determining the current targetId, ensuring that the correct tab is identified even when multiple tabs share the same URL. * refactor(tests): simplify listTabs initialization in agent snapshot tests Updated the initialization of listTabs in the agent snapshot tests for better readability by removing unnecessary line breaks. This change enhances code clarity without altering the test logic. * fix(ui): widen Set type to accept string tokens in external-link helper * chore: retrigger CI (unrelated Windows flaky test) Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
safzanpirani
pushed a commit
to safzanpirani/clawdbot
that referenced
this pull request
Mar 2, 2026
steipete
pushed a commit
to Sid-Qin/openclaw
that referenced
this pull request
Mar 2, 2026
…derer swap (openclaw#25326) * fix(browser): resolve correct targetId in navigate response after renderer swap When `navigateViaPlaywright` triggers a Chrome renderer-process swap (e.g. navigating from chrome-extension:// to https://), the old `tab.targetId` captured before navigation becomes stale. The `/navigate` route previously returned this stale targetId in its response. After navigation, re-resolve the current tab by matching against the final URL via `profileCtx.listTabs()`. If the old target is already gone but the new one is not yet visible (extension re-attach in progress), retry after 800ms. Follow-up to openclaw#19744 (67bac62) which fixed the extension-side stale session cleanup. * fix(browser): prefer non-stale targetId when multiple tabs share the same URL When multiple tabs have the same URL after navigation, find() could pick a pre-existing tab instead of the newly created one. Now only re-resolve when the old target is gone (renderer swap detected), and prefer the tab whose targetId differs from the old one. * fix(browser): encapsulate targetId resolution logic after navigation Introduced a new function `resolveTargetIdAfterNavigate` to handle the resolution of the correct targetId after a navigation event that may trigger a renderer swap. This refactor improves code clarity and reuses the logic for determining the current targetId, ensuring that the correct tab is identified even when multiple tabs share the same URL. * refactor(tests): simplify listTabs initialization in agent snapshot tests Updated the initialization of listTabs in the agent snapshot tests for better readability by removing unnecessary line breaks. This change enhances code clarity without altering the test logic. * fix(ui): widen Set type to accept string tokens in external-link helper * chore: retrigger CI (unrelated Windows flaky test) Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
steipete
pushed a commit
to Sid-Qin/openclaw
that referenced
this pull request
Mar 2, 2026
robertchang-ga
pushed a commit
to robertchang-ga/openclaw
that referenced
this pull request
Mar 2, 2026
…derer swap (openclaw#25326) * fix(browser): resolve correct targetId in navigate response after renderer swap When `navigateViaPlaywright` triggers a Chrome renderer-process swap (e.g. navigating from chrome-extension:// to https://), the old `tab.targetId` captured before navigation becomes stale. The `/navigate` route previously returned this stale targetId in its response. After navigation, re-resolve the current tab by matching against the final URL via `profileCtx.listTabs()`. If the old target is already gone but the new one is not yet visible (extension re-attach in progress), retry after 800ms. Follow-up to openclaw#19744 (67bac62) which fixed the extension-side stale session cleanup. * fix(browser): prefer non-stale targetId when multiple tabs share the same URL When multiple tabs have the same URL after navigation, find() could pick a pre-existing tab instead of the newly created one. Now only re-resolve when the old target is gone (renderer swap detected), and prefer the tab whose targetId differs from the old one. * fix(browser): encapsulate targetId resolution logic after navigation Introduced a new function `resolveTargetIdAfterNavigate` to handle the resolution of the correct targetId after a navigation event that may trigger a renderer swap. This refactor improves code clarity and reuses the logic for determining the current targetId, ensuring that the correct tab is identified even when multiple tabs share the same URL. * refactor(tests): simplify listTabs initialization in agent snapshot tests Updated the initialization of listTabs in the agent snapshot tests for better readability by removing unnecessary line breaks. This change enhances code clarity without altering the test logic. * fix(ui): widen Set type to accept string tokens in external-link helper * chore: retrigger CI (unrelated Windows flaky test) Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
robertchang-ga
pushed a commit
to robertchang-ga/openclaw
that referenced
this pull request
Mar 2, 2026
execute008
pushed a commit
to execute008/openclaw
that referenced
this pull request
Mar 2, 2026
…derer swap (openclaw#25326) * fix(browser): resolve correct targetId in navigate response after renderer swap When `navigateViaPlaywright` triggers a Chrome renderer-process swap (e.g. navigating from chrome-extension:// to https://), the old `tab.targetId` captured before navigation becomes stale. The `/navigate` route previously returned this stale targetId in its response. After navigation, re-resolve the current tab by matching against the final URL via `profileCtx.listTabs()`. If the old target is already gone but the new one is not yet visible (extension re-attach in progress), retry after 800ms. Follow-up to openclaw#19744 (67bac62) which fixed the extension-side stale session cleanup. * fix(browser): prefer non-stale targetId when multiple tabs share the same URL When multiple tabs have the same URL after navigation, find() could pick a pre-existing tab instead of the newly created one. Now only re-resolve when the old target is gone (renderer swap detected), and prefer the tab whose targetId differs from the old one. * fix(browser): encapsulate targetId resolution logic after navigation Introduced a new function `resolveTargetIdAfterNavigate` to handle the resolution of the correct targetId after a navigation event that may trigger a renderer swap. This refactor improves code clarity and reuses the logic for determining the current targetId, ensuring that the correct tab is identified even when multiple tabs share the same URL. * refactor(tests): simplify listTabs initialization in agent snapshot tests Updated the initialization of listTabs in the agent snapshot tests for better readability by removing unnecessary line breaks. This change enhances code clarity without altering the test logic. * fix(ui): widen Set type to accept string tokens in external-link helper * chore: retrigger CI (unrelated Windows flaky test) Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
execute008
pushed a commit
to execute008/openclaw
that referenced
this pull request
Mar 2, 2026
hughdidit
pushed a commit
to hughdidit/DAISy-Agency
that referenced
this pull request
Mar 3, 2026
(cherry picked from commit db25b26)
dorgonman
pushed a commit
to kanohorizonia/openclaw
that referenced
this pull request
Mar 3, 2026
…derer swap (openclaw#25326) * fix(browser): resolve correct targetId in navigate response after renderer swap When `navigateViaPlaywright` triggers a Chrome renderer-process swap (e.g. navigating from chrome-extension:// to https://), the old `tab.targetId` captured before navigation becomes stale. The `/navigate` route previously returned this stale targetId in its response. After navigation, re-resolve the current tab by matching against the final URL via `profileCtx.listTabs()`. If the old target is already gone but the new one is not yet visible (extension re-attach in progress), retry after 800ms. Follow-up to openclaw#19744 (67bac62) which fixed the extension-side stale session cleanup. * fix(browser): prefer non-stale targetId when multiple tabs share the same URL When multiple tabs have the same URL after navigation, find() could pick a pre-existing tab instead of the newly created one. Now only re-resolve when the old target is gone (renderer swap detected), and prefer the tab whose targetId differs from the old one. * fix(browser): encapsulate targetId resolution logic after navigation Introduced a new function `resolveTargetIdAfterNavigate` to handle the resolution of the correct targetId after a navigation event that may trigger a renderer swap. This refactor improves code clarity and reuses the logic for determining the current targetId, ensuring that the correct tab is identified even when multiple tabs share the same URL. * refactor(tests): simplify listTabs initialization in agent snapshot tests Updated the initialization of listTabs in the agent snapshot tests for better readability by removing unnecessary line breaks. This change enhances code clarity without altering the test logic. * fix(ui): widen Set type to accept string tokens in external-link helper * chore: retrigger CI (unrelated Windows flaky test) Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
dorgonman
pushed a commit
to kanohorizonia/openclaw
that referenced
this pull request
Mar 3, 2026
sachinkundu
pushed a commit
to sachinkundu/openclaw
that referenced
this pull request
Mar 6, 2026
…derer swap (openclaw#25326) * fix(browser): resolve correct targetId in navigate response after renderer swap When `navigateViaPlaywright` triggers a Chrome renderer-process swap (e.g. navigating from chrome-extension:// to https://), the old `tab.targetId` captured before navigation becomes stale. The `/navigate` route previously returned this stale targetId in its response. After navigation, re-resolve the current tab by matching against the final URL via `profileCtx.listTabs()`. If the old target is already gone but the new one is not yet visible (extension re-attach in progress), retry after 800ms. Follow-up to openclaw#19744 (67bac62) which fixed the extension-side stale session cleanup. * fix(browser): prefer non-stale targetId when multiple tabs share the same URL When multiple tabs have the same URL after navigation, find() could pick a pre-existing tab instead of the newly created one. Now only re-resolve when the old target is gone (renderer swap detected), and prefer the tab whose targetId differs from the old one. * fix(browser): encapsulate targetId resolution logic after navigation Introduced a new function `resolveTargetIdAfterNavigate` to handle the resolution of the correct targetId after a navigation event that may trigger a renderer swap. This refactor improves code clarity and reuses the logic for determining the current targetId, ensuring that the correct tab is identified even when multiple tabs share the same URL. * refactor(tests): simplify listTabs initialization in agent snapshot tests Updated the initialization of listTabs in the agent snapshot tests for better readability by removing unnecessary line breaks. This change enhances code clarity without altering the test logic. * fix(ui): widen Set type to accept string tokens in external-link helper * chore: retrigger CI (unrelated Windows flaky test) Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
sachinkundu
pushed a commit
to sachinkundu/openclaw
that referenced
this pull request
Mar 6, 2026
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
…derer swap (openclaw#25326) * fix(browser): resolve correct targetId in navigate response after renderer swap When `navigateViaPlaywright` triggers a Chrome renderer-process swap (e.g. navigating from chrome-extension:// to https://), the old `tab.targetId` captured before navigation becomes stale. The `/navigate` route previously returned this stale targetId in its response. After navigation, re-resolve the current tab by matching against the final URL via `profileCtx.listTabs()`. If the old target is already gone but the new one is not yet visible (extension re-attach in progress), retry after 800ms. Follow-up to openclaw#19744 (67bac62) which fixed the extension-side stale session cleanup. * fix(browser): prefer non-stale targetId when multiple tabs share the same URL When multiple tabs have the same URL after navigation, find() could pick a pre-existing tab instead of the newly created one. Now only re-resolve when the old target is gone (renderer swap detected), and prefer the tab whose targetId differs from the old one. * fix(browser): encapsulate targetId resolution logic after navigation Introduced a new function `resolveTargetIdAfterNavigate` to handle the resolution of the correct targetId after a navigation event that may trigger a renderer swap. This refactor improves code clarity and reuses the logic for determining the current targetId, ensuring that the correct tab is identified even when multiple tabs share the same URL. * refactor(tests): simplify listTabs initialization in agent snapshot tests Updated the initialization of listTabs in the agent snapshot tests for better readability by removing unnecessary line breaks. This change enhances code clarity without altering the test logic. * fix(ui): widen Set type to accept string tokens in external-link helper * chore: retrigger CI (unrelated Windows flaky test) Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
…derer swap (openclaw#25326) * fix(browser): resolve correct targetId in navigate response after renderer swap When `navigateViaPlaywright` triggers a Chrome renderer-process swap (e.g. navigating from chrome-extension:// to https://), the old `tab.targetId` captured before navigation becomes stale. The `/navigate` route previously returned this stale targetId in its response. After navigation, re-resolve the current tab by matching against the final URL via `profileCtx.listTabs()`. If the old target is already gone but the new one is not yet visible (extension re-attach in progress), retry after 800ms. Follow-up to openclaw#19744 (67bac62) which fixed the extension-side stale session cleanup. * fix(browser): prefer non-stale targetId when multiple tabs share the same URL When multiple tabs have the same URL after navigation, find() could pick a pre-existing tab instead of the newly created one. Now only re-resolve when the old target is gone (renderer swap detected), and prefer the tab whose targetId differs from the old one. * fix(browser): encapsulate targetId resolution logic after navigation Introduced a new function `resolveTargetIdAfterNavigate` to handle the resolution of the correct targetId after a navigation event that may trigger a renderer swap. This refactor improves code clarity and reuses the logic for determining the current targetId, ensuring that the correct tab is identified even when multiple tabs share the same URL. * refactor(tests): simplify listTabs initialization in agent snapshot tests Updated the initialization of listTabs in the agent snapshot tests for better readability by removing unnecessary line breaks. This change enhances code clarity without altering the test logic. * fix(ui): widen Set type to accept string tokens in external-link helper * chore: retrigger CI (unrelated Windows flaky test) Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
Mateljan1
pushed a commit
to Mateljan1/openclaw
that referenced
this pull request
Mar 7, 2026
…derer swap (openclaw#25326) * fix(browser): resolve correct targetId in navigate response after renderer swap When `navigateViaPlaywright` triggers a Chrome renderer-process swap (e.g. navigating from chrome-extension:// to https://), the old `tab.targetId` captured before navigation becomes stale. The `/navigate` route previously returned this stale targetId in its response. After navigation, re-resolve the current tab by matching against the final URL via `profileCtx.listTabs()`. If the old target is already gone but the new one is not yet visible (extension re-attach in progress), retry after 800ms. Follow-up to openclaw#19744 (67bac62) which fixed the extension-side stale session cleanup. * fix(browser): prefer non-stale targetId when multiple tabs share the same URL When multiple tabs have the same URL after navigation, find() could pick a pre-existing tab instead of the newly created one. Now only re-resolve when the old target is gone (renderer swap detected), and prefer the tab whose targetId differs from the old one. * fix(browser): encapsulate targetId resolution logic after navigation Introduced a new function `resolveTargetIdAfterNavigate` to handle the resolution of the correct targetId after a navigation event that may trigger a renderer swap. This refactor improves code clarity and reuses the logic for determining the current targetId, ensuring that the correct tab is identified even when multiple tabs share the same URL. * refactor(tests): simplify listTabs initialization in agent snapshot tests Updated the initialization of listTabs in the agent snapshot tests for better readability by removing unnecessary line breaks. This change enhances code clarity without altering the test logic. * fix(ui): widen Set type to accept string tokens in external-link helper * chore: retrigger CI (unrelated Windows flaky test) Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
Mateljan1
pushed a commit
to Mateljan1/openclaw
that referenced
this pull request
Mar 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #25323
Summary
The
/navigateroute returns a staletargetIdafter a Chrome renderer-process swap (e.g. navigating fromchrome-extension://tohttps://). This happens becausetab.targetIdis captured fromensureTabAvailablebeforenavigateViaPlaywright, and the response returns it unchanged even though the underlying target has been replaced.Changes
After
navigateViaPlaywrightcompletes, re-resolve the current tab by matching the final URL againstprofileCtx.listTabs():targetId.targetIdis no longer in the tab list (renderer swap occurred, extension re-attaching), wait 800ms and retry.targetIdif resolution fails.This is a follow-up to #19744 (
67bac62c2) which fixed the extension-side stale session cleanup by sendingTarget.detachedFromTargetbefore re-attaching.Test plan
chrome-extension://settings page to HTTPS returns correct newtargetIdbrowser actexecutes on the navigated page, not the extension pageGreptile Summary
Fixes a stale
targetIdreturned by the/navigateroute after Chrome renderer-process swaps (e.g., navigating fromchrome-extension://tohttps://). AfternavigateViaPlaywrightcompletes, the code now re-resolves the active tab by matching the final URL against the current tab list, with an 800ms retry if the old target has disappeared, and a graceful fallback to the pre-navigationtargetId./navigateroute returns stale targetId after renderer-process swap (e.g. chrome-extension:// → https://) #25323targetIdfind()returns the first match which could be a different tab — consider narrowing the match in multi-tab scenariosConfidence Score: 4/5
/navigateroute response, wrapped in a try/catch that falls back to the original behavior on any failure. The logic is straightforward and addresses a real bug. One minor concern is the URL-based matching when multiple tabs share the same URL, but this is unlikely to cause worse behavior than the current staletargetIdbug.src/browser/routes/agent.snapshot.ts.Last reviewed commit: 22a233b
(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!