Skip to content

fix(ui): preserve browser focus during passive follow - #134480

Merged
obviyus merged 3 commits into
openclaw:mainfrom
scotthuang:fix/browser-panel-passive-follow
Sep 9, 2026
Merged

obviyus merged 3 commits into
openclaw:mainfrom
scotthuang:fix/browser-panel-passive-follow

Conversation

@scotthuang

@scotthuang scotthuang commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Related: #134400, #139089

What Problem This Solves

The Browser panel followed session results through the explicit tab-selection path. That sent /tabs/focus and activated the result tab in an attached browser, even when the operator had left another tab active.

Why This Change Was Made

Passive following now skips explicit focus while retaining the shared route, capture, lifecycle, and rollback owners. Card Open and selection of a different panel tab still focus normally. Clicking an already-selected panel tab retains its existing no-op.

The selection owner also rejects a historical target absent from its accepted current tab list before capture. This preserves the validation previously supplied by the focus request, restores a valid prior view when safe, and prevents a missing target from entering repeated stream/screenshot recovery. The error directs the operator to select another tab.

User Impact

Successful Browser results can update the panel without changing the operator's physical browser tab. The merged capture-owner repair in #134400 remains in place. Current streaming, screenshot fallback, attach-only policy, native and remote routes, configuration, protocol, and Browser-card semantics are preserved.

Evidence

  • A public Control UI agent turn through the real Browser tool reproduced one passive focus request and physical tab activation on pinned main. With the same rendered-tab precondition, the final candidate produced no focus request and preserved the sentinel tab while refreshing the result view.
  • Fresh source-blind acceptance also exercised the full selection change: the panel and physical browser initially selected Sentinel; a public Browser evaluation of the other Result page changed the panel to Result, displayed newly changed content through routed screenshot/stream capture, and left Sentinel physically active. Explicit Open and different-tab selection each focused once; later results added no focus. Context changes, unavailable history, and recovery were exercised.
  • The passive-focus regression failed on main. Two additional missing-history cases failed on the initial candidate for invalid selection, lost rollback, and repeated capture. The corrected candidate passed 138 focused tests across selection, routes, input, pending navigation, snapshot races, streaming, and native boundaries. Formatting and keyless language checks passed.
  • Exact-head CI passed, including all four cases in the changed Browser route E2E suite. The native supplemental E2E attempt hit its 4 GiB limit; that failure was retained and the hosted lane supplied the completed check without raising the native limit.

A background Browser-tool screenshot timed out in a separate acceptance attempt. It remains failed evidence, not a passing capture or a claim of general screenshot reliability. The successful evaluation case above verifies the combined background-target selection and fresh-view outcome. Native macOS and remote-node behavior have source/component coverage; no live native-app or remote-node proof is claimed. Raw captures remain private.

Thanks @scotthuang for the original passive-focus correction. Contributor ancestry and prior review history are preserved.

@clawsweeper

clawsweeper Bot commented Aug 31, 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.

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 9, 2026, 4:58 AM ET / 08:58 UTC (Revision 8).

ClawSweeper review

What this changes

The Browser panel follows session results without explicitly activating the browser tab and rejects missing historical targets before capture.

Merge readiness

✅ Ready for maintainer review

This PR remains useful: current main and the latest release still explicitly focus tabs during passive follow. The merged capture prerequisite resolves the earlier concern, and no blocking defect remains in the reviewed patch.

Priority: P2
Reviewed head: 2dd671bf5e71716d4489976b67c4f782e9bde1a5

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with relevant real-browser observations, meaningful regression coverage, and successful exact-head CI.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): Recorded real Control UI and Browser-tool acceptance exercises passive selection through routed capture: fresh Result content appears while Sentinel remains physically active, and explicit choices still focus once. Native macOS and remote-node live behavior are outside this proof scope.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Recorded real Control UI and Browser-tool acceptance exercises passive selection through routed capture: fresh Result content appears while Sentinel remains physically active, and explicit choices still focus once. Native macOS and remote-node live behavior are outside this proof scope.
Evidence reviewed 10 items Current main still needs the correction: Passive follow still invokes ordinary selection, which unconditionally calls focusBrowserTab for a valid target.
Latest release retains passive explicit focus: The supplied latest release, v2026.9.3, calls selectTab without distinguishing passive follow.
Introduced change preserves the shared owner: The verified merge-base-to-head diff makes focus optional only for passive follow, retains explicit selection callers, and validates missing targets against an accepted tab snapshot before capture.
Findings None None.
Security None None.

How this fits together

The Control UI Browser panel receives browser targets from session results or explicit user selections. Its shared selection controller routes tab discovery and capture through the Gateway to the selected browser.

flowchart TD
  A[Session browser result] --> C[Shared tab selection]
  B[Explicit card or tab choice] --> C
  C --> D[Refresh and validate target]
  D --> E{Explicit focus requested?}
  E -->|Yes| F[Activate browser tab]
  E -->|No| G[Capture panel view]
  F --> G
  D -->|Missing target| H[Show error and restore safe view]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +13, Tests +74. Total +87 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 21 8 +13
Tests 2 90 16 +74
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 111 24 +87

Review metrics

None.

Technical review

Best possible solution:

Keep passive follow on the shared selection and capture path, reserving explicit focus for user choices while preserving safe unavailable-tab recovery.

Do we have a high-confidence way to reproduce the issue?

Yes: current main routes a successful session browser result through unconditional explicit focus, and the captured acceptance report describes the corresponding physical-tab activation. This review verified the source path without executing it.

Is this the best way to solve the issue?

Yes: the patch separates focus intent at the existing selection owner and preserves routed capture and rollback, avoiding a parallel passive-selection implementation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 113e8cf6b934.

Labels

Label justifications:

  • P2: Passive Browser-panel updates unexpectedly activate an attached browser tab, a bounded disruption to operator workflow.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Recorded real Control UI and Browser-tool acceptance exercises passive selection through routed capture: fresh Result content appears while Sentinel remains physically active, and explicit choices still focus once. Native macOS and remote-node live behavior are outside this proof scope.
  • proof: sufficient: Contributor real behavior proof is sufficient. Recorded real Control UI and Browser-tool acceptance exercises passive selection through routed capture: fresh Result content appears while Sentinel remains physically active, and explicit choices still focus once. Native macOS and remote-node live behavior are outside this proof scope.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • scotthuang: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (7 earlier review cycles)
  • reviewed 2026-08-31T21:50:05.307Z sha fc0ee7abd2fdb9413cccbc5b1b4abef43b443f88 :: needs real behavior proof before merge. :: [P1] Preserve focus through the passive screenshot path
  • reviewed 2026-09-01T00:02:07.081Z sha fc0ee7abd2fdb9413cccbc5b1b4abef43b443f88 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-07T06:21:32.122Z sha 969162d :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-07T08:13:50.469Z sha 969162d :: blocked before merge. :: none
  • reviewed 2026-09-07T08:37:03.709Z sha 969162d :: needs maintainer review before merge. :: none
  • reviewed 2026-09-08T11:15:13.454Z sha 1b38cd9 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-09T08:23:01.495Z sha 2dd671b :: needs maintainer review before merge. :: none

@scotthuang scotthuang changed the title fix(ui): browser result updates stop focusing Chrome tabs fix(ui): skip explicit tab focus during passive browser follow Aug 31, 2026
@scotthuang

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Accepted the P1 owner-boundary finding. I chose the review's narrow this PR's claim option rather than duplicating #134400's Browser-owner implementation into this UI PR.

  • Retitled this PR to describe the exact behavior it owns: skipping the explicit /tabs/focus RPC during passive follow.
  • Rewrote Scope, User Impact, and Evidence to state that this branch alone can still reach Page.bringToFront through screenshot capture.
  • Marked fix(browser): keep user Chrome tab focused after browser actions #134400 as a hard dependency and stated that this PR must not merge first.
  • Kept the mocked-Gateway evidence explicitly scoped to UI/RPC behavior; it is no longer presented as physical Chrome-focus proof.
  • Kept the two locked branches independent; no moving-main rebase or duplicated Browser-owner patch was introduced.

The complete external-headed-Chrome outcome requires both owner repairs. After #134400 lands, this PR's GitHub test-merge will contain both; that is the correct exact candidate for the requested combined Control UI + real Chrome proof.

@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@scotthuang
scotthuang force-pushed the fix/browser-panel-passive-follow branch from fc0ee7a to 969162d Compare September 7, 2026 06:15
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. and removed P1 High-priority user-facing bug, regression, or broken workflow. labels Sep 7, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Sep 7, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 7, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Sep 7, 2026
@scotthuang
scotthuang force-pushed the fix/browser-panel-passive-follow branch from 969162d to 1b38cd9 Compare September 8, 2026 11:09
@obviyus obviyus self-assigned this Sep 9, 2026
Keep passive result following on the shared tab selection path while skipping
its explicit focus request. Preserve routed capture, lifecycle checks, and
explicit card and tab selection actions.
Validate routed selection against its accepted current tab list before
capture. Report an unavailable tab and retain the safe selection rollback,
so stale history cannot start repeated stream and screenshot requests.
@obviyus obviyus changed the title fix(ui): skip explicit tab focus during passive browser follow fix(ui): preserve browser focus during passive follow Sep 9, 2026
@openclaw-barnacle openclaw-barnacle Bot added triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Sep 9, 2026
@obviyus
obviyus merged commit 5c70585 into openclaw:main Sep 9, 2026
178 of 179 checks passed
@obviyus

obviyus commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Thanks @scotthuang!

Proof: A real Control UI agent turn through the Browser tool updated the panel from Sentinel to a background Result page, displayed newly changed content, and kept Sentinel physically active. The baseline sent one passive focus request; the repaired flow sent none. Explicit Open and selection of a different tab each still focused once.

  • Bug: Passive Browser results activated the operator's attached browser tab.
  • Fix: Passive following uses the shared selection and capture path without explicit focus. An absent historical target is rejected before capture, with safe rollback and a useful error.
  • Checks: 138 focused tests passed. Exact-head CI passed, including all four changed Browser route end-to-end cases.

A separate background screenshot timed out and remains failed evidence. This change does not claim general screenshot reliability. Native macOS and remote-node routes have source/component coverage; no live native-app or remote-node result is claimed. Raw captures remain private.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 10, 2026
Related: openclaw#134400, openclaw#139089

## What Problem This Solves

The Browser panel followed session results through the explicit tab-selection path. That sent `/tabs/focus` and activated the result tab in an attached browser, even when the operator had left another tab active.

## Why This Change Was Made

Passive following now skips explicit focus while retaining the shared route, capture, lifecycle, and rollback owners. Card Open and selection of a different panel tab still focus normally. Clicking an already-selected panel tab retains its existing no-op.

The selection owner also rejects a historical target absent from its accepted current tab list before capture. This preserves the validation previously supplied by the focus request, restores a valid prior view when safe, and prevents a missing target from entering repeated stream/screenshot recovery. The error directs the operator to select another tab.

## User Impact

Successful Browser results can update the panel without changing the operator's physical browser tab. The merged capture-owner repair in openclaw#134400 remains in place. Current streaming, screenshot fallback, attach-only policy, native and remote routes, configuration, protocol, and Browser-card semantics are preserved.

## Evidence

- A public Control UI agent turn through the real Browser tool reproduced one passive focus request and physical tab activation on pinned main. With the same rendered-tab precondition, the final candidate produced no focus request and preserved the sentinel tab while refreshing the result view.
- Fresh source-blind acceptance also exercised the full selection change: the panel and physical browser initially selected Sentinel; a public Browser evaluation of the other Result page changed the panel to Result, displayed newly changed content through routed screenshot/stream capture, and left Sentinel physically active. Explicit Open and different-tab selection each focused once; later results added no focus. Context changes, unavailable history, and recovery were exercised.
- The passive-focus regression failed on main. Two additional missing-history cases failed on the initial candidate for invalid selection, lost rollback, and repeated capture. The corrected candidate passed 138 focused tests across selection, routes, input, pending navigation, snapshot races, streaming, and native boundaries. Formatting and keyless language checks passed.
- [Exact-head CI](https://github.com/openclaw/openclaw/actions/runs/34328435157) passed, including all four cases in the changed [Browser route E2E suite](https://github.com/openclaw/openclaw/actions/runs/34328435157/job/102391432114). The native supplemental E2E attempt hit its 4 GiB limit; that failure was retained and the hosted lane supplied the completed check without raising the native limit.

A background Browser-tool screenshot timed out in a separate acceptance attempt. It remains failed evidence, not a passing capture or a claim of general screenshot reliability. The successful evaluation case above verifies the combined background-target selection and fresh-view outcome. Native macOS and remote-node behavior have source/component coverage; no live native-app or remote-node proof is claimed. Raw captures remain private.

Thanks @scotthuang for the original passive-focus correction. Contributor ancestry and prior review history are preserved.

Co-authored-by: scotthuang <[email protected]>
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

app: web-ui App: web-ui P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants