Repository navigation
feat: run sandbox Auto Review with a restricted host reviewer - #173455
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. |
|
|
9061979 to
b742ff9
Compare
|
Codex review: needs maintainer review before merge. What this changesAdds an optional Auto Review tool that captures sandbox changes and runs a restricted, caller-authorized reviewer on the host. Example: A sandbox session calls autoreview with {"mode":"local"}.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This maintainer-authored PR adds a useful sandbox review capability; no actionable introduced defects remain in this review. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe plugin connects the sandbox-owned review helper to host-native inference, carrying caller authority and returning complete reports through existing tool-result delivery. flowchart LR
A[Sandbox session] --> B[Auto Review plugin]
B --> C[Protected sandbox helper]
C --> D[Captured review request]
D --> E[Caller model authority]
E --> F[Restricted native reviewer]
F --> C
C --> G[Validated report]
Technical reviewBest possible solution: Land the optional plugin with the merged native prerequisites and current canonical helper while retaining existing authority and result-delivery owners. Do we have a high-confidence way to reproduce the issue? This is a capability addition; source inspection confirms the missing sandbox-bound execution contract, and supplied guest runs exercise the added flow. Is this the best way to solve the issue? The implementation fits the existing plugin, sandbox, model-policy, native CLI, and canonical-helper owners without introducing a competing review engine or persistent job service. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d6687fdf5fde. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +1002, Tests +829, Docs +127, Config +10, Generated 0, Other +10. Total +1978 across 35 files. Added test files: 2. View PR surface stats
LabelsLabel changes:
Label justifications:
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 (2 earlier review cycles)
Reviewed October 16, 2026, 1:39 AM ET / 05:39 UTC (Revision 3). |
1982924 to
4e4bf9a
Compare
4e4bf9a to
5f6e79d
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Added: sandboxed code review with a restricted host reviewer and complete validated results. |
The optional Auto Review plugin landed in 24ed521 (#173455) without an extension labeler rule. Add the standard path registration so the repository-wide coverage contract includes extensions/autoreview. The plugin registers a tool, not typed hooks, so no hook inventory entry is needed. Existing package metadata and TypeBox dependency are complete; all 580 boundary, package and runtime-dependency contract cases pass. The labeler failure reproduces on main; the repaired labeler and cap suites pass all 9 cases. No production code, assertions or deadlines change. Formatting and diff checks pass; independent P2 review is clean (0.99).
Hourly 38863277510 found exports left behind by recent owner refactors. Fresh main also exposes a retired queue preparation API and two Slack assertion helpers. Remove six uncovered exports at their owners: - Keep the Auto Review parameter schema and theme initial state private. - Register the chat bridge without exporting its unused component alias; exercise its existing registered host in both affected tests. - Inline the queue-clear preparation into its sole immediate caller, preserving selection, lane identity, rejection, and survivor ordering. Remove the stale abort mock and cover selective clearing through the API. - Keep two Slack assertion helpers private, retaining all their assertions. No Knip ignores, policy changes, retries, timeout changes, or removed test cases. Production exports fall from five to the one palette factory covered by active PR #173919; full-tree and script exports are clean. References: #173455, #173688, #173833. Production shrinks by nine lines. Proof: all three deadcode scripts, focused owner tests with --maxWorkers=1, core/UI/extension production types and owning test types, targeted lint, boundary lint, format, assertion safety, and isolated P2 review. Shared Slack helper proof runs its sole importer in full. New selective-clear case passes inside its seven-case file in 4.69s. The three unchanged global max-lines suppression findings are inherited, with base blobs verified. Changed-test wall times: chat-page 21.00s, snapshot custody 30.78s, abort 58.02s, queue cancellation 4.69s. The sole Slack helper importer passes all 90 tests in 75.86s. Total focused coverage: 205 cases.
…aw#173455) Add an optional sandboxed code-review tool that preserves caller permissions and returns canonical validated reports through a restricted host reviewer. Refs openclaw#173636 and openclaw#173761.
The optional Auto Review plugin landed in 09b9660 (openclaw#173455) without an extension labeler rule. Add the standard path registration so the repository-wide coverage contract includes extensions/autoreview. The plugin registers a tool, not typed hooks, so no hook inventory entry is needed. Existing package metadata and TypeBox dependency are complete; all 580 boundary, package and runtime-dependency contract cases pass. The labeler failure reproduces on main; the repaired labeler and cap suites pass all 9 cases. No production code, assertions or deadlines change. Formatting and diff checks pass; independent P2 review is clean (0.99).
Hourly 38863277510 found exports left behind by recent owner refactors. Fresh main also exposes a retired queue preparation API and two Slack assertion helpers. Remove six uncovered exports at their owners: - Keep the Auto Review parameter schema and theme initial state private. - Register the chat bridge without exporting its unused component alias; exercise its existing registered host in both affected tests. - Inline the queue-clear preparation into its sole immediate caller, preserving selection, lane identity, rejection, and survivor ordering. Remove the stale abort mock and cover selective clearing through the API. - Keep two Slack assertion helpers private, retaining all their assertions. No Knip ignores, policy changes, retries, timeout changes, or removed test cases. Production exports fall from five to the one palette factory covered by active PR openclaw#173919; full-tree and script exports are clean. References: openclaw#173455, openclaw#173688, openclaw#173833. Production shrinks by nine lines. Proof: all three deadcode scripts, focused owner tests with --maxWorkers=1, core/UI/extension production types and owning test types, targeted lint, boundary lint, format, assertion safety, and isolated P2 review. Shared Slack helper proof runs its sole importer in full. New selective-clear case passes inside its seven-case file in 4.69s. The three unchanged global max-lines suppression findings are inherited, with base blobs verified. Changed-test wall times: chat-page 21.00s, snapshot custody 30.78s, abort 58.02s, queue cancellation 4.69s. The sole Slack helper importer passes all 90 tests in 75.86s. Total focused coverage: 205 cases.
…ol authority Backport 714d666 (main 6a62821) declares codex_threads for every sender and rejects nonowners inside execution. Port main's follow-up 74dfd5e, which expects the inherited declaration and the owner-authorization denial instead of an undeclared tool. Release adaptation: main's harness host passes its liveness check as plugin invocation authority (#173455, not on stable). Stable takes that authority from the admitted Gateway caller that run-attempt dispatch (withPreparedEmbeddedGatewayTools) keeps ambient for the attempt, so the fixture now supplies the same admitted caller identity for non-worker turns. (cherry picked from commit 74dfd5e)
What Problem This Solves
Sandboxed development needs the canonical Auto Review checkpoint to review the repository the session is editing. Its Git state can differ from the host worktree, while provider credentials and the OpenClaw CLI belong to the host. The existing plugin context did not expose the actual prepared sandbox and current caller authority needed to complete that operation.
User Impact
The optional
autoreviewplugin adds one tool call for this checkpoint. The installed helper captures and rechecks changes inside the current sandbox, the host runs the admitted reviewer throughopenclaw agent exec, and the same helper validates its complete output. Operators enable the plugin and grant the tool through the existing agent and sandbox policies. The integration requires the canonical helper from openclaw/agent-skills#328 and the native run-only configuration override in #173636.A normal call supplies the review target. The canonical helper owns review model, effort, severity, prompts, pass planning, and timeout defaults, so an installed-helper update changes those defaults without rebuilding OpenClaw. Explicit overrides remain available. An allowed configured model is preserved; a prohibited configured preference uses the caller's existing permitted default before execution. Explicit prohibited choices are rejected, and execution failure never switches models or engines. The canonical status records the effective model.
Native execution inherits ordinary host configuration and authentication. Run-only restrictions give the reviewer an empty private workspace, no tools or selected skills, no injected workspace context, and no remembered permission grant that could relax those restrictions. Saved configuration is unchanged and credentials remain on the host. Complete report/status results fit within the existing Code Mode full-value route; oversized direct calls fail explicitly with guidance to use Code Mode or split the review.
Why This Change Was Made
The existing native and plugin harness owners now capture the original invocation authority and skill installation identity for version 2 tool factories. The sandbox owner supplies the actual execution working directory and protected installed package. Repository-local shadows, writable aliases, package-replacing mounts, and backends without enforced read-only resources do not qualify. This preserves the distinction between a host workspace and the repository projected into a sandbox.
The plugin transports the existing helper request/response exchange. It binds the first pass plan, admits its model through the existing model-policy owner, launches the fixed native CLI entry, and returns the complete raw CLI envelope to the helper. No host configuration object, executable path, credential, or runtime grant comes from sandbox output. Capture, source revalidation, response ownership, report parsing, and review policy remain with the canonical helper.
The required backend adaptation explicitly admits piped input while retaining background process and workspace-finalization ownership. Cancellation and model-policy revocation settle each operation's helper, waiter, and reviewer before releasing authority. Reviewer cancellation gives native cleanup up to five seconds before forced termination; concurrent invocations own separate temporary exchanges. Complete-result delivery reuses the existing direct-call budget and Code Mode value owner. The optional plugin has no custom settings, reviewer profile, service, or persistent job store.
Evidence
The earlier temporary-storage guard failure is corrected by using the SDK temporary-directory owner. The retained process mock now documents its isolation contract; the superseded model-projection mock was removed with the projection.
Changed formatting/lint and the affected core, agent-test, extension, and extension-test compiler graphs passed. After conflict resolution, the affected tool, native-caller, and result-delivery files passed all 68 cases in 50.17 seconds, with the affected type graphs and generated metadata rechecked. The tool and execution-owner suites passed 23 cases across the focused runs. The latest tool-only run passed 11 cases in 32.80 seconds including cold SDK preparation; the unchanged execution-owner cases retain their earlier joined 34.35-second batch. Earlier applicable controls cover actual native caller preparation, remapped skill discovery, protected mounts and writable aliases, managed-workspace process lifetime, stdin, revocation, and ordinary versus full-value result delivery. The remaining 44 literal caller files passed 577 cases with one Windows-only skip in 338.54 seconds on the qualified combined source.
A synthetic near-limit response passed through the real canonical helper, plugin lifecycle wrapper, tool, catalog value call, and Code Mode inbox on the combined source: all 283 findings and the effective-model receipt survived a 1,989,634-byte encoded exchange. The same flow rejected an oversized direct result, accepted a small complete direct result, preserved source state, and removed each exchange. This transport case substitutes reviewer output and caller authority; it is not a live provider claim.
A separate provider-effect control exercises the real invocation admission, model-policy binding, plugin instance, Code Mode value call, canonical helper, and native CLI against an observed synthetic HTTP provider. The allowed review made one request and returned a complete validated report in 11.85 seconds. After the real prompt handoff and native startup, the second case removed the selected model from the caller’s permitted policy and notified the existing policy owner: it made zero provider requests, rejected the authority, and exited cooperatively in 3.87 seconds. Every owned command process had settled; native state, host review directories, and helper exchanges were removed; authority subscriptions were released; source and saved configuration were unchanged. The test uses the existing local helper transport fixture; actual protected sandbox binding is covered by the separate guest execution above. No real provider or credential was used.
The native CLI and canonical helper dependencies separately passed an actual synthetic-provider command proving inherited configuration/authentication, custom environment references, no tools or ambient skills, and unchanged saved configuration. The clean combined runtime build, including the final caller-grace correction and native cleanup dependency, passed in 280.4 seconds. In the actual guest UI, a target-only call returned a complete scoped-clean report in a 33-second parent turn. Changing only the installed helper defaults then selected the configured allowed model and detected a known P2 defect; restoring the source passed its tests and review. Additional live checks confirmed permitted-default selection for a prohibited configured preference, rejection of an explicit prohibited override without substitution, two concurrent completed reviews, and cancellation of one review while the other completed. The integration settled its helper and reviewer processes and removed its exchanges. The required native CLI ephemeral-state cleanup repair has landed in #173761. The final two-guest early-Stop check used that repair and the five-second caller grace: the stopped guest was interrupted, the other target-only review completed scoped-clean in 25 seconds, and all native state, host review directories, and sandbox exchanges were gone while both guest containers remained running. An early-start cancellation control exposed forced termination at the process owner’s 300 ms default. The reviewer caller now uses its existing five-second grace option; the same control exited cooperatively in 3.94 seconds with no provider request, surviving process, or temporary state. Independent review is clean for the landing composition containing the native cleanup repair, and all exact-head hosted checks passed.