Repository navigation
fix(browser): keep the panel on the session browser profile - #132159
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 9:26 PM ET / August 29, 2026, 01:26 UTC. ClawSweeper reviewWhat this changesThe branch carries browser host or node, profile, and tab identity from successful browser actions into Control UI preview cards and the browser side panel. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessNo introduced correctness defect was found. The route tuple is preserved from the executed browser action through Gateway projection, preview cards, and panel operations; retain the PR for normal maintainer review and exact-head checks. Priority: P2 Review scores
Verification
How this fits togetherBrowser tool actions identify the host or node, profile, and tab they actually used. Gateway projects that bounded identity to Control UI, whose panel requests stay scoped to the same browser. flowchart LR
A[Browser tool action] --> B[Executed tab route]
B --> C[Gateway display projection]
C --> D[Control UI preview card]
D --> E[Browser side panel]
E --> F[Bound browser request]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +478, Tests +1672, Docs +43, Other 0. Total +2193 across 62 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the canonical route-bound handoff and land after maintainer review confirms the necessary cross-boundary production growth and exact-head checks pass. Do we have a high-confidence way to reproduce the issue? Yes—source-reproducible: fetched main selects a bare target identifier, while the branch's deterministic mocked-Gateway Chromium suite exercises host/node/profile handoff; this read-only review did not execute it. Is this the best way to solve the issue? Yes—the route tuple is carried from the successful browser action through Gateway and the UI operation owner, eliminating bare-target/default-route guessing rather than compensating in the panel. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5c68c8f58364. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
Move tool-result projection coverage into its own suite without changing assertions. Split UI pages and E2E typecheck programs while retaining exact once-only coverage and the existing 720-root cap. Required to validate #132159 against current main.
Preserve composer adaptations and stream status ownership while removing duplicated prop forwarding. Deliver the second native queue-removal activation to the surviving row explicitly, retaining exact removal and reconnect-drain assertions across layout changes. Clears merged-tree CI failures for #132159 without suppressions or raised limits.
|
The pages/E2E typecheck split in this PR also resolves the only failed job on #132190 — preserve headroom for local chat follow-up turns. Its completed CI run reports Dependency cleared: the same exact-coverage split has now landed independently in #132193 — share fs-safe native assets across package graphs, commit 249c248285b. The compaction patch adds no test roots and no longer waits on this browser PR. I am refreshing it onto the repaired main and rerunning proof, without duplicating the split or changing the 720-root cap. No request to change or rush the browser behavior work. |
Land-ready verificationVerified candidate: ac6aaf2f3c363696499fd68bf998d4d587181ad5. Exact-head CI run 33225992766, attempt 1 completed successfully, including the required openclaw/ci-gate. Native preparation and merge are next; no merge has been submitted yet. Both review findings are repaired. Canonical browser origin is required before generic tool data becomes an actionable preview. The first-open handoff now reuses the Desktop-style RED: the origin defect failed 11 unit cases and separate history/live Chromium no-I/O cases. The ordering defect failed the older-card Chromium case with GREEN: the ordering repair passes 110 focused tests and all four browser E2E scenarios, including the origin negative/positive controls and normal panel-first behavior. The request-order assertion waits for legitimate initial thumbnails, marks the click boundary, then checks every subsequent list/focus/capture/action request belongs to the clicked route. Retained-panel coverage also advances the viewport timer. The full five-file changed-check gate, UI build, and fresh independent P0-only Codex autoreview pass. Source is unchanged since these runs. node scripts/run-vitest.mjs ui/src/components/browser/browser-panel-route.test.ts ui/src/components/browser/browser-panel.test.ts ui/src/components/browser/browser-panel-controller-viewport-sync.test.ts ui/src/pages/chat/chat-pane-embedded-panels.test.ts ui/src/pages/chat/components/chat-tool-cards.node.test.ts ui/src/lib/chat/browser-tab-preview.test.tsnode scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/browser-route-handoff.e2e.test.tsnode scripts/check-changed.mjs --base cb5d89bfaf470ba1e2ea68bb8cd36b724495a7fb -- ui/src/pages/chat/chat-pane-layout-render.ts ui/src/pages/chat/chat-pane-embedded-panels.ts ui/src/components/browser/browser-panel.ts ui/src/components/browser/browser-panel-route.test.ts ui/src/e2e/browser-route-handoff.e2e.test.tspnpm ui:buildEarlier integrated runs and exact-head rebase proof remain documented in the PR body, including 408 browser/Gateway tests and the 195-test plus eight-scenario replay on the preceding head. Counts overlap. The full build passed after the browser owner integration. No baseline increase, suppression, larger timeout, weaker safety assertion, or network-policy relaxation was used. The new inspected first-open capture records two legitimate thumbnail requests before the click, then exactly four requests afterward ( Current main was materialized and the repair is not redundant. Main's queue-test and typecheck-partition fixes are retained. All latest ClawSweeper rank-up moves are addressed, including the now-green exact-head hosted check. Both source repairs were independently reviewed at P0-only; that is not claimed as wider-priority clearance. No persistent-store or migration change: route/cache identities are in-memory, annotation context is bounded, and display metadata is additive inside the existing result envelope. Production delta is +1,145/-670 (net +475); tests/support +2,028/-353; docs +45/-2; assertion-baseline configuration +1/-1. The two final safety repairs add seven and eight net production lines. Cross-boundary route and lifecycle ownership justify the broader growth; detached decoration, duplicate screenshot handling, wrong-host compensation, and redundant renderer forwarding were removed. The Chrome-extension new-tab restriction and post-build Slack/SDK declaration mismatch remain separate follow-ups. No operator browser defaults, running Gateway, credentials, or live state were changed. |
Preserve executed host/node/profile identity through browser results, previews, and panel operations. Explain redacted tab URLs without relaxing navigation guards, and keep compound node actions on their executed browser. Fixes #132141.
Move tool-result projection coverage into its own suite without changing assertions. Split UI pages and E2E typecheck programs while retaining exact once-only coverage and the existing 720-root cap. Required to validate #132159 against current main.
Preserve composer adaptations and stream status ownership while removing duplicated prop forwarding. Deliver the second native queue-removal activation to the surviving row explicitly, retaining exact removal and reconnect-drain assertions across layout changes. Clears merged-tree CI failures for #132159 without suppressions or raised limits.
675fa49 to
6e2c622
Compare
|
Merged via squash.
|
…#132159) * fix(browser): follow session profile in the browser panel Preserve executed host/node/profile identity through browser results, previews, and panel operations. Explain redacted tab URLs without relaxing navigation guards, and keep compound node actions on their executed browser. Fixes openclaw#132141. * test: keep browser proof within CI file and shard limits Move tool-result projection coverage into its own suite without changing assertions. Split UI pages and E2E typecheck programs while retaining exact once-only coverage and the existing 720-root cap. Required to validate openclaw#132159 against current main. * refactor(ui): reuse chat render options and stabilize queue proof Preserve composer adaptations and stream status ownership while removing duplicated prop forwarding. Deliver the second native queue-removal activation to the surviving row explicitly, retaining exact removal and reconnect-drain assertions across layout changes. Clears merged-tree CI failures for openclaw#132159 without suppressions or raised limits. * fix(ui): require browser tool origin for route previews * fix(ui): prioritize explicit browser card selection
Closes #132141.
What Problem This Solves
Fixes an issue where opening the Browser side panel after an agent used a non-default browser profile showed an unrelated default-profile tab, sometimes with a generic navigation-policy error, instead of the page the agent successfully opened. A tab ID alone is not unique across browser profiles or hosts.
Why This Change Was Made
The browser tool records the browser that actually executed the action: exact host/node, profile, and tab identity. Gateway history, thumbnail caches, panel operations, and annotation context carry that bounded identity instead of guessing from global defaults. URL-unavailability reasons are recorded at validation; the panel reads safe metadata before focus, and compound node actions stay on the browser that handled their first request.
The final review identified a second boundary: generic tool details must not become privileged browser requests merely because they contain browser-shaped metadata. Actionable previews now require canonical
browserorigin. A matched call owns its result's name; non-browser or unnamed standalone envelopes cannot obtain browser origin from nested content. Canvas/MCP App previews and ordinary tool output remain intact. The check belongs where the UI produces actionable previews, so it covers both history and live messages without parallel downstream guards.The repair reuses main's routing, lifecycle, and screenshot owners, preserves the page-error action, and removes the detached preview decorator and downstream wrong-host snapshot compensation. It does not repair the separate Chrome-extension new-tab creation restriction.
User Impact
The panel follows successful browser activity in the current session without changing
browser.defaultProfile. Opening an older preview deliberately selects that browser, including on the panel's first opening. Same-ID tabs on different profiles or nodes do not share thumbnails or queued input.Blocked tabs keep their title and close action, hide blocked URLs/content, explain the next step, and recover on Reload. A denied destination does not erase a valid source screenshot. Unrelated tool metadata cannot trigger a thumbnail capture or change the panel route. SSRF, sandbox, node-command, and operator-admin checks remain intact. No configuration option, dependency, persistent store, schema, or migration is added.
Evidence
Original failures were reproduced before editing: unscoped UI requests, node-to-host follow-up switching, raw-target/stable-alias mismatch, missing denial metadata, focus-before-list ordering, and padded authoritative profile identity. The origin defect separately failed 11 unit cases and two real Chromium scenarios: unrelated history and live results each issued a browser request where zero was expected.
Earlier integrated runs covered 408 browser/Gateway tests, 58 projection tests, 571 shared UI tests, 26 isolated transcript tests, and eight typecheck partition/stripe tests. The origin repair passed 136 focused UI tests plus eight Chromium scenarios, including both history/live no-I/O cases, canonical-browser positive controls on the same live transport, host/node and cold older-card handoffs, and queue/reconnect behavior. Browser capability and operator-admin scope are enabled in the no-I/O scenarios; missing permissions are not the reason they pass. Ordinary output is asserted visible.
The combined history/live fixture originally counted mounted rows across turn changes. Its synchronization now waits for the actual consumed tool output; browser-request, card, route, and positive-control assertions remain. One standalone recorder attempt timed out waiting for an expanded live disclosure; a subsequent completed capture shows the final tool output and retained configured browser. That recorder timeout is not described as a product fix. The deterministic E2E cases pass.
The latest source is rebased on
cb5d89bfaf470ba1e2ea68bb8cd36b724495a7fb. Main now contains the UI typecheck partition and an equivalent, more targeted native second-click queue regression. Those upstream versions are retained unchanged rather than duplicated. Range-diff confirms the origin repair is byte-for-byte unchanged by rebase. Final exact-head CI and replay status are recorded in the verification comment; the prior head's green CI is not readiness evidence for the new head.Fresh independent Codex autoreview of the origin repair is scoped-clean at P0-only, not broader-priority clearance. The complete changed-check plan passed; final E2E synchronization also passed its scoped typecheck, formatting, and canonical lint. The full build passed after the browser owner integration; the UI build is repeated for the final candidate.
Review resolution
Both review stages are addressed. Canonical browser origin is required, and non-browser history/nested/live results cannot create browser cards, capture screenshots, or select a route. Valid browser results still work on the same transport. The subsequent first-open finding was reproduced: clicking the older host card first issued
GET /tabsto the newer node/work route. A separate retained-panel regression also caught an unwanted fallback refresh.The panel now uses the existing Desktop-style presentation ownership contract: a pending explicit toggle suppresses automatic preferred-tab follow and default refresh, while retaining preferred metadata so the clicked handler can consume its revision. The ordering repair is net +8 production lines. After initial thumbnail captures settle, the rendered regression marks the click boundary and requires every subsequent list/focus/capture/action request to use only the clicked host/managed route. Retained-panel coverage also advances the resize timer and verifies the new route. All 110 focused tests and four browser E2E scenarios pass, as does the fresh P0-only autoreview. The inspected first-open capture records exactly four post-click requests, all on host/managed, with zero page errors.
Current main was materialized locally, resolving the review's DNS-limited comparison gap; the route repair is not redundant. Exact-head CI is rerun after each behavior repair; no earlier green run is used to authorize a later head.
The stored-state heuristic does not imply a migration: route keys and card request identity are in-memory, annotation routing is bounded text in the existing model-context string, and browser-tab display metadata is additive within the existing tool-result envelope. No table, index, retention policy, saved preference, or storage owner changes. Historical text remains readable; incomplete routes are not guessed into interactive addresses.
CI repairs and scope
CI run 33216315771 exposed test-file and type-program capacity limits. Tool-result projection tests were moved without changing assertions; the UI pages/E2E partition now lives on main with exact once-only coverage and the 720-root cap retained. CI run 33217676939 exposed two renderer line limits and a queue click-geometry assumption. This PR removes 100 production lines of redundant composer/stream forwarding, and retains main's native second-activation queue proof. No suppression, larger timeout, weaker assertion, or performance-baseline increase was added.
Final delta against the rebased main: production +1,145/-670 (net +475); tests/support +2,028/-353; docs +45/-2; assertion-baseline configuration +1/-1. Growth supplies the previously missing cross-boundary route identity, asynchronous ownership, and browser-origin safety boundary. The final origin repair itself is net +7 production lines. Pure test moves are not new coverage.
Separate follow-ups remain for Chrome-extension tab creation and a post-build Slack/SDK declaration-generation mismatch exposed by an extra noncanonical local UI lint invocation. The canonical lint lane passes; neither follow-up is represented as fixed here.
Provenance: the target-only preview handoff was introduced by the browser-card feature, #131592, authored and merged by @steipete on 2026-08-28. The older unscoped panel-client path predates available shallow history and is not attributed to its shallow boundary.
AI-assisted, maintainer-owned implementation. Screenshots below were inspected and use a real rendered Control UI with a mocked Gateway and synthetic pages. They do not show a live account login or deployment. No operator defaults, running Gateway, live credentials, or private screenshot were modified or published.