Skip to content

fix(browser): historical previews launch unwanted browsers - #139064

Merged
obviyus merged 1 commit into
mainfrom
codex/fix-historical-browser-previews
Sep 5, 2026
Merged

obviyus merged 1 commit into
mainfrom
codex/fix-historical-browser-previews

Conversation

@obviyus

@obviyus obviyus commented Sep 5, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Opening a chat with an old browser result could start a stopped managed browser, fail to find its tab, and leave the new browser running. Reconnecting could repeat it.

Why This Change Was Made

Explicit tab references now use the browser owner’s non-starting reachability check. A missing explicit target cannot create a blank tab. Targetless operations and explicit Start/Open retain startup behavior.

User Impact

Historical cards stay static while the browser is stopped. Live previews still work, stale targets do not stop running browsers, and users can start or open tabs explicitly.

Evidence

Real built Control UI, Gateway, and headed-browser checks reproduced unwanted launches before repair. Afterward, history and reconnect kept the browser stopped; live thumbnails and explicit Start/Open worked, and stale targets preserved running tabs. Both regressions failed before the fix; 149 focused browser tests passed. Platform-specific alternate-browser behavior was not independently tested.

Closes #138999. Thanks @Pondsi for the report and repeated-failure evidence.

@obviyus obviyus self-assigned this Sep 5, 2026
@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@obviyus
obviyus marked this pull request as ready for review September 5, 2026 12:01
@obviyus

obviyus commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator Author

Ready to land at fcae617dc0b225b092bc09836177ad38edafb86d.

  • Exact-head CI run 33964889735 is green.
  • Independent exact-head review is clean: zero findings or security concerns; real-behavior proof accepted; no rank-up moves.
  • Real Control UI/Gateway/Chromium proof confirms no startup on history open or reconnect, working live thumbnails and explicit Start/Open, and the same running browser process after a stale lookup.
  • The profile owner retains startup authority; selection no longer has a duplicate startup callback or bypass flag. Production is net zero lines.
  • Screenshots and the inspected recording are in the PR body. Linux was tested; Windows/Edge-specific behavior remains untested.
Commands run in the isolated Linux runner
pnpm build ciArtifacts
OPENCLAW_RUN_NODE_SKIP_DTS_BUILD=1 pnpm build

OPENCLAW_VITEST_MAX_WORKERS=2 node scripts/run-vitest.mjs \
  extensions/browser/src/browser/server.historical-target.test.ts \
  extensions/browser/src/browser/server-context.tab-selection-lookup.test.ts \
  extensions/browser/src/browser/server-context.tab-selection-state.test.ts \
  extensions/browser/src/browser/server-context.tab-discovery-poll-abort.test.ts \
  extensions/browser/src/browser/routes/tabs.test.ts \
  extensions/browser/src/browser/server.agent-contract-core.test.ts \
  extensions/browser/src/browser/server-lifecycle.test.ts \
  extensions/browser/src/browser/routes/agent.existing-session.test.ts \
  extensions/browser/src/browser/routes/agent.snapshot.local-managed.test.ts \
  extensions/browser/src/browser/routes/agent.snapshot.timeout.test.ts

node scripts/run-vitest.mjs extensions/browser/src/browser/server.historical-target.test.ts
node scripts/run-oxlint.mjs \
  extensions/browser/src/browser/server-context.ts \
  extensions/browser/src/browser/server-context.selection.ts \
  extensions/browser/src/browser/server-context.remote-tab-ops.harness.ts \
  extensions/browser/src/browser/server-context.tab-discovery-poll-abort.test.ts \
  extensions/browser/src/browser/server.control-server.test-harness.ts \
  extensions/browser/src/browser/server.historical-target.test.ts

149 focused tests passed. All nine owner tests passed again after test-only lint cleanup. Focused lint had zero warnings/errors. The committed bytes passed repository-pinned formatting 0.65.0 and git diff --check.

@obviyus
obviyus merged commit 8deaa18 into main Sep 5, 2026
154 checks passed
@obviyus
obviyus deleted the codex/fix-historical-browser-previews branch September 5, 2026 12:09
@obviyus

obviyus commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator Author

Merged as 8deaa18a397fa20b5fa4a2095b41c1708d7a743f, from verified head fcae617dc0b225b092bc09836177ad38edafb86d.

Thanks @Pondsi for reporting this.

  • Before: opening old browser history started a browser, then failed to find the tab.
  • After: the browser stays stopped; explicit Start/Open and live previews still work.
  • Real Linux UI/Gateway/Chromium proof covered reconnect and preservation of a running browser after stale lookup.
  • 149 focused tests, final owner tests, lint, formatting, independent review, and exact-head CI passed.
  • Windows/Edge-specific behavior was not independently tested.

Issue #138999 is closed.

obviyus added a commit that referenced this pull request Sep 5, 2026
Keep historical browser selections empty until the current tab snapshot confirms a running browser. Reuse the existing no-target path to avoid focus and capture requests while stopped, keep Reload disabled, and preserve explicit Start.

Retain historical card metadata and running-tab focus/capture behavior. Add regression coverage for stopped selection, a pending routed refresh, and Start recovery. Clarify browser recovery documentation.

Follow-up to #139064 and related to #138999. Includes the original contribution from @ylcn91.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 6, 2026
…139064)

Keep explicit browser target lookup non-starting under the profile lifecycle lease. Do not create a blank tab for a missing explicit target. Remove duplicate startup handling from tab selection.

Preserve targetless startup, explicit Start/Open, live thumbnails, and running-browser state after stale lookups.

Verified with real Control UI, Gateway, and headed Chromium red/green flows on Linux, including fresh-client reconnect. Focused browser tests, type-aware lint, formatting, and independent review passed. Windows-specific behavior was not independently tested.

Closes openclaw#138999.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 6, 2026
…9089)

Keep historical browser selections empty until the current tab snapshot confirms a running browser. Reuse the existing no-target path to avoid focus and capture requests while stopped, keep Reload disabled, and preserve explicit Start.

Retain historical card metadata and running-tab focus/capture behavior. Add regression coverage for stopped selection, a pending routed refresh, and Start recovery. Clarify browser recovery documentation.

Follow-up to openclaw#139064 and related to openclaw#138999. Includes the original contribution from @ylcn91.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

1 participant