Repository navigation
feat: expand panels and allow managed local previews - #165153
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis 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.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete 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 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherAgent 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]
Technical reviewBest 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
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +1044, Tests +1264, Docs +40. Total +2348 across 54 files. Added test files: 5. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (7 earlier review cycles)
Reviewed October 24, 2026, 4:29 AM ET / 08:29 UTC (Revision 8). |
|
@clawsweeper re-review Head |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Head 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. |
|
🦞👀 Re-review progress:
|
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
/refresh-security-review 1eba588 |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
* 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
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: falserestores 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.gatewayPolicymust permit actionlessexec. 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:94on 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
execaction allowance.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.
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: expectedCATALOG_LOADING, receivedpending: true. Exact signature matches scheduled main 40066610244, jobchecks-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, jobchecks-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.