Skip to content

feat: expand panels and allow managed local previews - #165153

Merged
steipete merged 4 commits into
mainfrom
openclaw/control-web-ui-land-20261004
Oct 24, 2026
Merged

steipete merged 4 commits into
mainfrom
openclaw/control-web-ui-land-20261004

Conversation

@steipete

@steipete steipete commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Agents can open conversation panels but cannot enlarge them through Screen. Default browser navigation also blocks local app previews when the agent already has unrestricted execution on the same host.

User Impact

Screen panel-show accepts expanded: true; expanded: false restores the split view while retaining the selected panel and dock.

This changes the default browser navigation policy. With no explicit browser.ssrfPolicy, agents with unrestricted same-host execution can navigate to localhost, 127.0.0.1, and ::1 on any port in OpenClaw's own live managed local Chrome. This includes unrelated loopback services. Any explicit policy, including {}, disables the automatic exception. Sandboxed or restricted agents, remote targets, externally managed profiles, and tunneled browsers do not qualify.

For Gateway-managed execution, deployment tools.gatewayPolicy must permit actionless exec. Independently authorized native local execution retains its separate authority, as required by the existing deployment-policy contract.

Why This Change Was Made

The Screen command omitted expansion intent (src/agents/tools/screen-tool.ts:94 on the integrated base), and the panel event adapter only selected/opened a panel (ui/src/pages/chat/chat-pane-session-panel-toggle.ts:96). The fix carries presentation intent through those owners and uses the existing sidebar layout operations.

The browser exception derives from the execution-policy owners and binds to the current invocation and exact managed browser process. Current approval restrictions, native-turn cancellation, and config replacement retire the grant at the point of effect. Config replacement may require the next normal tool preparation to renew this optional grant; it does not introduce another conversation-policy owner. The follow-up deployment-policy fix uses the existing Gateway policy parser and forwards native authority from the actual native execution owner through the live generic harness host.

Real Chromium showed that ordinary Playwright routing misses redirect hops and root-only interception misses out-of-process iframes. The automatic exception therefore needs recursive interception through document settlement. This fence is limited to the automatic exception; ordinary explicit-policy redirect hardening is outside scope. The port drops the stale branch's extra generations, old controller/CSS paths, and unrelated browser diagnostics. Persisted SSRF settings and CDP endpoint policy are not widened.

Release-note context: agents can expand Screen panels and preview same-host local apps under the default managed-browser policy.

Evidence

  • The production panel event/layout harness fails on the unchanged base and passes for all four panel kinds. Both focused UI suites pass all 44 tests (70.04 seconds including local transformation); the changed panel and layout modules take about 0.39 and 0.02 seconds in CI. Prompt-prefix stability passes all 11 cases, and prompt snapshot generation completed.
  • All 12 isolated real-Chromium redirect scenarios pass through current production navigation owners, including selected/early-returning actions and existing/new/nested out-of-process iframes. Revoked cases assert zero destination requests and successful subsequent tab reuse.
  • Ten standalone scenarios pass through actual execution-policy owners, including SQLite approval revocation, native cancellation, config replacement, and sandbox/explicit-policy exclusions.
  • The deployment-policy counterexample made one prohibited target request on the prior head. With the fix, a browser-only deployment makes zero; browser-plus-exec and independent native execution each make one successful request. Four focused policy contracts also pass, including an empty exec action allowance.
  • Independent Codex reviews found no actionable P0–P2 issue in the initial implementation, compiler/import correction, or final deployment-policy repair. Core type-aware lint, corrected test type-aware lint, Codex syntax lint, targeted formatting, and whitespace checks pass. The first CI head exposed compiler/import guard mistakes; those were corrected and the subsequent head passed the core/type/boundary jobs.
  • The deployment-policy follow-up exposed two stale consumer assertions in CI: the Codex binding expectation omitted the new native-execution capability, and the released synchronous API guard required exact type equality. The correction preserves the released signature with bidirectional compatibility checks, keeps async/sync parameters exactly aligned, and retains the existing return-type assertions. No production code changes in this correction. The focused compatibility compiler, root-test lint, formatting, and fresh isolated P0–P2 review pass. The exact Codex runtime wrapper completed its worker build but produced no test verdict; its separate lint preflight timed out preparing package declarations before lint. Both corrected consumer jobs pass in final-head CI.
  • Coalesced delta against integrated main: production +1188/-144, tests +1269/-5, documentation +40/-0 across 54 files. Most growth is the request fence and policy preparation needed for the approved default exception; panel expansion reuses the existing presentation owner.

The real Control UI with synthetic Gateway events passes split → expanded → restored assertions, retaining the selected Browser panel and bottom dock. The full captures were inspected and contain only synthetic data.

Existing split view Expanded Browser
Split view Expanded Browser

Restored split view.

No live Gateway, provider, personal browser profile, or latest-stable upgrade was exercised under this phase's explicit validation scope. The live wrapper failed during unrelated auth staging before Chromium tests. A repository E2E attempt completed its runtime build but stalled before a test verdict; it was cleaned up. Another focused wrapper lost its source snapshot during concurrent edits and yielded no test verdict. The isolated production-owner and Chromium proofs above supply the behavior evidence; exact-head PR CI supplies broad validation.

Final-head CI: run 40077695663, attempt 2 has passing corrected Codex binding and compatibility-type jobs. The sidebar-menu Escape job initially failed because a hover tooltip consumed the key; its single targeted rerun passed on the unchanged head. No inherited job was rerun.

The remaining failures are inherited:

  • checks-node-changed-compact-small-18 (120827739609), session-catalog.test.ts: expected CATALOG_LOADING, received pending: true. Exact signature matches scheduled main 40066610244, job checks-node-compact-large-21 (120791286534).
  • checks-node-changed-compact-small-7 (120827738862), prepare.completion-tools.test.ts: the owner=false/undefined cases expect the old denial sentence and receive the newer child-completion wording. Exact signatures match the same main run, job checks-node-compact-small-10 (120791286407).
  • checks-ui-e2e (1/9) (120827768205), home-attention.e2e.test.ts: the newly extracted run-activity case has an ambiguous page-wide text locator. Main 70f30717e861 introduced this fixture after the prior scheduled run. Current scheduled main 40078639310, job 120827460148, also fails the same case. The immediate assertions differ: this PR run fails at line 211 because both the visible paragraph and screen-reader announcement match; main reaches line 212 and observes one unexpected activity change. Attribution therefore uses the same failing fixture plus its main-only history and identical renderer/announcement blobs, not an identical assertion signature. The changed panel-command adapter is not on this chat-delta path.

ClawSweeper's final-head review reports zero findings and no before-merge items. Its deployment-policy P1 and compiler/consumer P2 findings are addressed. The small registration test remains because it checks the separate core-to-plugin authority handoff; policy-owner and Chromium tests check the resulting effects. The suggested latest-stable upgrade campaign is outside this phase's explicit proof scope.

@clawsweeper

clawsweeper Bot commented Oct 4, 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling extensions: browser size: L labels Oct 4, 2026
@steipete
steipete marked this pull request as ready for review October 4, 2026 22:14
@steipete
steipete requested a review from a team as a code owner October 4, 2026 22:14
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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 Oct 4, 2026
@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR adds Screen panel expansion and execution-scoped loopback previews in OpenClaw-managed local browsers.

Example: An unrestricted same-host agent opens http://127.0.0.1:3000 and calls Screen with browser_show and expanded: true.

  • Before: Default browser policy blocks the local preview, and Screen cannot request panel expansion.
  • After: The managed browser can open the preview while authority remains current, and Screen expands the Browser panel.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The implementation is coherent and the prior finding is resolved, with meaningful visual and authority-boundary evidence but incomplete upgrade qualification.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Agents cannot enlarge conversation panels or preview same-host local apps under the default browser policy despite already having unrestricted host execution.
Reason: The maintainer explicitly requests both capabilities and accepts the all-loopback-port tradeoff, while the implementation preserves explicit operator policy.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-directed feature remains useful, the prior Codex consumer finding is fixed, and no new definite introduced defect was found.

Priority: P2
Reviewed head: 1eba5886ffc13fa687ca1dc2a77533619f700a1c

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Provide a latest-stable upgrade run preserving explicit SSRF settings and session state while exercising the new default local-preview behavior; the body explicitly excludes this run.
Agent review details

How this fits together

Agent tool preparation supplies execution authority to the Browser plugin, which checks managed-process ownership before navigation; Screen commands travel through the Gateway to the Control UI’s existing layout owner.

flowchart LR
  A[Agent invocation] --> B[Execution policy preparation]
  B --> C[Browser request scope]
  C --> D[Managed Chrome navigation fence]
  D --> E[Loopback preview]
  A --> F[Screen command]
  F --> G[Gateway UI event]
  G --> H[Existing panel layout]
Loading

Technical review

Best possible solution:

Extend the existing presentation owner and confine local previews to current execution authority and owned managed browsers.

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

This is a feature request; current-main source confirms that agent-controlled expansion and the automatic loopback exception are absent.

Is this the best way to solve the issue?

The change reuses the established layout, execution-policy, browser lifecycle, and navigation owners; the additional redirect fence addresses observed Chromium behavior rather than a hypothetical interleaving.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Reviewed head and discussion: Reviewed introduced merge-base-to-head changes at 1eba588 and the author discussion. The captured PR-body source identity is 36815e056e187f877fe7f7167ba777dc08cd944853e4a1ffa6728f64856f36bf. The security guard identifies the author as a repository admin and requires no separate secops approval. (1eba5886ffc1)
  • Previous finding resolved: The native host-binding assertion now expects nativeLocalExecution: true while retaining cwd and tool-routing checks; the compatibility guard preserves bidirectional released-signature compatibility. (extensions/codex/src/app-server/dynamic-tool-build.test.ts:198, 1eba5886ffc1)
  • Execution authority: Automatic access requires unrestricted execution, excludes sandbox and workspace-only contexts, honors deployment permission for actionless exec, and preserves independently authorized native execution. (src/agents/agent-tools.execution-policy.ts:43, 1eba5886ffc1)
  • Managed-browser boundary: The exception requires an absent explicit SSRF policy, live invocation assertions, and the exact owned browser process; final request continuation rechecks authority across redirects and independently hosted iframe targets. (extensions/browser/src/browser/navigation-policy.ts:20, 1eba5886ffc1)
  • Inspected visual and boundary evidence: All three downloaded screenshots show synthetic Browser split, expanded, and restored states with the bottom dock retained. The body and author discussion record real-Chromium redirect rejection with zero destination requests, subsequent tab reuse, and deployment-policy allowed/denied request counts. (1eba5886ffc1)
  • Accepted default-policy tradeoff: The maintainer-authored PR explicitly accepts access to unrelated loopback services on any port for qualifying agents; explicit policies, including {}, disable it. The behavior is documented in Browser security. (docs/tools/browser/security.md:46, 1eba5886ffc1)

Likely related people:

  • Peter Steinberger: Raw commit 70ad789 adds ui/src/pages/chat/sidebar-layout.ts:369 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 70ad789846f2; files: ui/src/pages/chat/sidebar-layout.ts)

PR surface

Source +1044, Tests +1264, Docs +40. Total +2348 across 54 files. Added test files: 5.

View PR surface stats
Area Files Added Removed Net
Source 39 1188 144 +1044
Tests 11 1269 5 +1264
Docs 4 40 0 +40
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 54 2497 149 +2348

Review metrics

Metric Value Why it matters
Presentation parameter 1 optional expanded parameter; 0 new configuration options The tool and wire contract extend existing panel presentation rather than adding another layout owner.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #165146
Summary: This PR is the implementation candidate for the paired request covering both panel expansion and execution-scoped local previews.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Useful, bounded presentation and local-preview capabilities without evidence of an urgent user-facing regression.
  • merge-risk: 🚨 compatibility: The PR extends public tool and harness contracts and intentionally changes default browser navigation; the maintainer accepts the direction and existing explicit policy remains authoritative.
  • merge-risk: 🚨 security-boundary: Execution authority now permits managed-browser access to loopback services, an explicitly accepted boundary change enforced at request continuation.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add latest-stable upgrade evidence for explicit-policy preservation and the changed default.
  • Determine whether the exact-head menu Escape failure is inherited or introduced before relying on the CI gate.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (7 earlier review cycles)
  • reviewed 2026-10-04T22:22:54.412Z sha 5dced22 :: needs real behavior proof before merge. :: [P1] Verify browser ownership before granting loopback access
  • reviewed 2026-10-04T23:01:25.810Z sha 386a065 :: needs real behavior proof before merge. :: [P1] Fence automatic preview authority across real HTTP redirects
  • reviewed 2026-10-04T23:06:33.235Z sha 386a065 :: needs real behavior proof before merge. :: [P1] Fence automatic preview authority across real HTTP redirects
  • reviewed 2026-10-05T00:11:24.197Z sha 9749027 :: needs changes before merge. :: none
  • reviewed 2026-10-24T06:48:44.363Z sha b237237 :: needs changes before merge. :: [P2] [P2] Import port claims through the existing public SDK helper | [P2] [P2] Declare the pending assertion field with a type annotation
  • reviewed 2026-10-24T07:20:51.023Z sha 6881016 :: needs real behavior proof before merge. :: [P1] [P1] Apply deployment execution policy before granting loopback previews
  • reviewed 2026-10-24T08:02:58.315Z sha 745dfa4 :: needs changes before merge. :: [P2] [P2] Update the native host-binding consumer test

Reviewed October 24, 2026, 4:29 AM ET / 08:29 UTC (Revision 8).

@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Head 386a065fcced868c49e3bc8e90bbbf6a4c15c347 addresses the owned-browser and invocation-revocation findings. The PR body now records real Chrome playback plus zero target HTTP requests for revoked preparation and an unowned forwarded CDP browser. The optional-Playwright fallback retains baseline policy; three regression cases fail before the repair and pass afterward. Fresh independent P0–P2 review is clean.

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. labels Oct 4, 2026
@steipete steipete self-assigned this Oct 5, 2026
@steipete

steipete commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Head 9749027c215364c2ed012c388de0d3c9544e3b87 repairs the redirect-authority finding. The actual production browser-tool redirect probe changed from 1 request after revocation to 0; independently hosted iframe redirects reproduced the same defect and now also produce 0. Recursive operation-owned CDP sessions cover existing/new/nested OOPIFs before debugger resume. The fence remains until active document chains finish.

Final proof: 54 focused regressions and all 12 actual-Chromium cases pass, including authorized and revoked goto/click/early-return/iframe flows and next-navigation reuse of a selected tab after denial. All three iframe-reuse regressions failed before the root-only cancellation repair; a fake-clock stuck-policy regression failed before bounded disposal. Failed/unconfirmed cancellation retains interception until close. Final runtime bundle, extension production/test types, lint, formatting and guards pass. The full pre-redirect build and unchanged UI proof remain valid. Detailed evidence and final independent-review dispositions are in the PR body.

@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 5, 2026
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 1eba5886ffc13fa687ca1dc2a77533619f700a1c
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/gateway-tool-policy.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.

Carefully review these changes before merging.

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 24, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 24, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

/refresh-security-review 1eba588

@steipete
steipete merged commit 0901c1d into main Oct 24, 2026
262 of 274 checks passed
@steipete
steipete deleted the openclaw/control-web-ui-land-20261004 branch October 24, 2026 13:24
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 25, 2026
* feat: expand panels and allow managed local previews

Allow Screen to expand and restore the selected panel. Permit default-policy loopback previews only for unrestricted same-host execution in managed local Chrome, with current authority enforced across navigation and frames.

* fix(browser): satisfy preview policy type and import checks

* fix(browser): honor deployment execution policy for local previews

Require deployment permission for actionless exec before granting automatic
loopback access to Gateway-managed agents. Preserve independently authorized
native local execution through the live harness owner.

* test: align native execution binding contracts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui docs Improvements or additions to documentation extensions: browser extensions: codex gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. security-sensitive-changed size: XL 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.

1 participant