Repository navigation
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: blocked before merge. Reviewed October 6, 2026, 12:05 AM ET / 04:05 UTC (Revision 11). ClawSweeper reviewWhat this changesThe branch applies the existing sandbox provider trust rule to web search, shares resolver parameter types with web fetch, and adds recovery diagnostics, documentation, and regression coverage. Merge readiness⛔ Blocked before merge - 4 items remain This PR remains necessary: current main still drops sandbox status before search-provider resolution. The previous plugin-loading finding is addressed, and the strengthened proof covers rejected-plugin side effects; no new blocking code defect was found. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s web-search runtime receives agent queries, configuration, and sandbox status, then selects a plugin provider to execute the search. Shared provider resolution determines which installed plugins are eligible before their code runs. flowchart TD
A[Agent search query] --> B[Search runtime]
C[Configuration and sandbox status] --> B
B --> D[Manifest provider selection]
D --> E[Shared provider trust filter]
E --> F[Eligible provider execution]
E --> G[Rejection and recovery message]
F --> H[Search result]
Decision needed
Why: This repairs an existing trust policy but intentionally stops working search configurations; the contributor’s acknowledgement does not establish owner acceptance. Before merge
Agent review detailsSecurityNone. PR surfaceSource +103, Tests +508, Docs +10. Total +621 across 8 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Enforce the existing shared trust rule before plugin code runs, retain metadata-only recovery diagnostics, and adopt the documented upgrade cutoff only with explicit owner acceptance. Do we have a high-confidence way to reproduce the issue? Yes, source establishes a high-confidence path: current main omits sandbox status before provider resolution, allowing the linked issue’s installed workspace-provider fixture to escape the existing origin filter. This read-only review did not execute that path. Is this the best way to solve the issue? Yes, forwarding the flag through the existing shared owner and deriving rejection diagnostics from metadata is a focused repair. Upgrade acceptance and conflict-resolution validation remain separate landing requirements. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e5b62e7c7914. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (10 earlier review cycles; latest 8 shown)
|
d95e822 to
2503c23
Compare
|
@clawsweeper re-review Real behavior proof added (head 2503c23): new |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
…search web_search dropped the sandboxed flag before provider resolution, so the sandboxed provider-origin filter never engaged, while web_fetch honored it. Thread the flag through the shared resolver handoff, share one handoff parameter type across both contracts' resolvers, and fail closed for sandboxed search. Fixes openclaw#144164
2503c23 to
d869143
Compare
|
CI re-triggered on |
db11053 to
12e6a29
Compare
|
Addressed the P2 finding on head Trust-specific recovery message —
A sandboxed run with nothing configured keeps the previous message verbatim, so this does not turn every empty selection into a trust claim, and the existing Evidence — local Windows run,
The other three items are the owner decision, not code: this cutover stops sandboxed installs that configured a workspace or unverified provider from running managed web search. Maintainer acceptance of that fail-closed behaviour is still required before merge. |
|
CI on head
Notes:
No code change made. A rerun of the two failed jobs once the load window clears would be appreciated — fork contributors have no |
12e6a29 to
a72e272
Compare
|
Addressed both findings on head P2 — verify a trust rejection before prescribing a new provider ( P3 — document the sandboxed search restriction ( Coverage added in Verification on this box ( @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…ejects it When the sandbox trust filter empties the candidate set, runWebSearch now reports which configured provider was unavailable to sandboxed web_search and points at the bundled / verified-official recovery path, instead of the generic 'disabled or no provider' text. Runs with nothing configured keep the previous message.
a72e272 to
d1ed7d0
Compare
Sandboxed web search dropped its session sandbox flag before resolving a provider, allowing configured untrusted workspace or external providers to execute. Carry that flag through both resolver routes into the existing shared manifest trust filter used by web fetch. Bundled, verified official, and nonsandboxed behavior stay intact. Give sandboxed callers an actionable availability hint without loading rejected provider code for diagnostics. Remove obsolete type exclusions, redundant request forwarding, and a duplicate inherited authStore field; production LOC is net +1. The 100-line regression allocation protects the real plugin-loader boundary. On main, two sandboxed rejection cases execute the workspace plugin unexpectedly; the fix passes both and all six controls, with no import, registration, tool creation, or execution trace for rejected code. All 115 focused tests and touched-file format/lint pass on Blacksmith Testbox. The final working tree received P0-P2 autoreview; its only index-only fixture finding was resolved by staging the reviewed replacement. Final CI passes tests, types, lint, builds and security. Its only failure is the existing shared test-line ceiling, six lines over budget, independently reproduced on clean main 31ad71a. Own 100-line regression growth is exactly funded. Landing uses the native inherited-failure evidence route without relabeling failed CI. Supersedes #144520, thanks @Finn763. Related: #144164. Co-authored-by: finn763 <[email protected]>
…#191748) Sandboxed web search dropped its session sandbox flag before resolving a provider, allowing configured untrusted workspace or external providers to execute. Carry that flag through both resolver routes into the existing shared manifest trust filter used by web fetch. Bundled, verified official, and nonsandboxed behavior stay intact. Give sandboxed callers an actionable availability hint without loading rejected provider code for diagnostics. Remove obsolete type exclusions, redundant request forwarding, and a duplicate inherited authStore field; production LOC is net +1. The 100-line regression allocation protects the real plugin-loader boundary. On main, two sandboxed rejection cases execute the workspace plugin unexpectedly; the fix passes both and all six controls, with no import, registration, tool creation, or execution trace for rejected code. All 115 focused tests and touched-file format/lint pass on Blacksmith Testbox. The final working tree received P0-P2 autoreview; its only index-only fixture finding was resolved by staging the reviewed replacement. Final CI passes tests, types, lint, builds and security. Its only failure is the existing shared test-line ceiling, six lines over budget, independently reproduced on clean main f77ae72. Own 100-line regression growth is exactly funded. Landing uses the native inherited-failure evidence route without relabeling failed CI. Supersedes openclaw#144520, thanks @Finn763. Related: openclaw#144164. Co-authored-by: finn763 <[email protected]>
Sandboxed web search dropped its session sandbox flag before resolving a provider, allowing configured untrusted workspace or external providers to execute. Carry that flag through both resolver routes into the existing shared manifest trust filter used by web fetch. Bundled, verified official, and nonsandboxed behavior stay intact. Give sandboxed callers an actionable availability hint without loading rejected provider code for diagnostics. Remove obsolete type exclusions, redundant request forwarding, and a duplicate inherited authStore field; production LOC is net +1. The 100-line regression allocation protects the real plugin-loader boundary. On main, two sandboxed rejection cases execute the workspace plugin unexpectedly; the fix passes both and all six controls, with no import, registration, tool creation, or execution trace for rejected code. All 115 focused tests and touched-file format/lint pass on Blacksmith Testbox. The final working tree received P0-P2 autoreview; its only index-only fixture finding was resolved by staging the reviewed replacement. Final CI passes tests, types, lint, builds and security. Its only failure is the existing shared test-line ceiling, six lines over budget, independently reproduced on clean main 31ad71a. Own 100-line regression growth is exactly funded. Landing uses the native inherited-failure evidence route without relabeling failed CI. Supersedes #144520, thanks @Finn763. Related: #144164. Co-authored-by: finn763 <[email protected]> Backport-source: 3e3935a Backport-scope: Propagate sandboxed through request context and provider resolution plus C1 preparation and synchronous availability entrypoints. Preserve C1 authStore parameter and existing official-provider trust predicate; no blanket plugin trust change. Adapted production backport for release/2026.11.2. Upstream validation descriptions refer to source history; candidate regression coverage and remote qualification are tracked separately. Co-authored-by: RomneyDa <[email protected]>
Sandboxed web search dropped its session sandbox flag before resolving a provider, allowing configured untrusted workspace or external providers to execute. Carry that flag through both resolver routes into the existing shared manifest trust filter used by web fetch. Bundled, verified official, and nonsandboxed behavior stay intact. Give sandboxed callers an actionable availability hint without loading rejected provider code for diagnostics. Remove obsolete type exclusions, redundant request forwarding, and a duplicate inherited authStore field; production LOC is net +1. The 100-line regression allocation protects the real plugin-loader boundary. On main, two sandboxed rejection cases execute the workspace plugin unexpectedly; the fix passes both and all six controls, with no import, registration, tool creation, or execution trace for rejected code. All 115 focused tests and touched-file format/lint pass on Blacksmith Testbox. The final working tree received P0-P2 autoreview; its only index-only fixture finding was resolved by staging the reviewed replacement. Final CI passes tests, types, lint, builds and security. Its only failure is the existing shared test-line ceiling, six lines over budget, independently reproduced on clean main 31ad71a. Own 100-line regression growth is exactly funded. Landing uses the native inherited-failure evidence route without relabeling failed CI. Supersedes #144520, thanks @Finn763. Related: #144164. Co-authored-by: finn763 <[email protected]> (cherry picked from commit 3e3935a) Release adaptation (OpenClaw 2026.11.6): - Cherry-picked onto parent candidate 82f1197 after the scoped #189423 backport. No production or regression-test adaptation required; preserved release's existing tool-result-error import. - Existing manifest trust filtering and explicit empty scopes remain the sole selection authority; sandboxed is now carried through context and both existing selection routes. No new trust owner, configuration, or permissions. - Companion audit pinned at bd692e9: e333f7e (#197657) removes the allocation after main's ratchet reset, not applicable here; retain source's 100-line allocation. a30ec5d (#177228) changes native-research/account-pinning execution, not a prerequisite for sandbox selection and excluded. No later PR mentions. Existing shared trust filter/empty-scope refusal is present-equivalent. Other heuristic runtime-name references do not consume the changed contract. Release validation (local isolated worktree): - Before this pick, source's real-plugin-loader regression: 2 failed / 6 passed. Both sandboxed workspace cases executed rejected code through runtime preference true and false. - After this pick: 95 passed across 7 runtime/owner suites, including all 8 regression cases and shared empty-scope cases. Additional tool, provider-error, fetch-provider and setup consumers pass (counts recorded in lane report). - Changed-TypeScript type-aware lint: 4 files clean using supported core config. Changed-file formatting and git diff --check clean. Manual self-review/pr-simplify: direct propagation into existing owner, no duplicate policy; 3 production files, net +1 line. - No real model/Gateway end-to-end run or broad gates in this lane; parent owns final release qualification. Upstream claims above describe source validation, not release qualification. One attempted suite was absent on this release and was corrected before running; not a product failure. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 3be9be1ddaa4a19d3672994f03bf580fcf20b6c3)
What Problem This Solves
web_searchprovider resolution dropped thesandboxedflag, so the sandboxed provider trust filter was a no-op for search: a sandboxed agent callingweb_searchcould be served by a workspace-origin or external plugin provider, while the same agent callingweb_fetchwas correctly restricted.Root cause, at the shared resolution throat:
src/web-search/runtime.tsbuilt its own resolver argument object and omittedsandboxed, (preferRuntimeProvidersdefaults totrueinrunWebSearch, so the live lazy runtime path ran unfiltered and the flag never reached the shared origin filter on either resolver path).src/plugins/web-search-providers.runtime.tsre-declared both resolver parameter types by hand and neither declaredsandboxed, so the flag could not reachresolvePluginWebProviders(which already honored it end to end) or the origin filter inweb-provider-resolution-shared.ts. The siblingresolveRuntimeWebFetchProvidershad the same hand-written-parameter hole.Fix:
resolvePluginWebSearchProviders/resolveRuntimeWebSearchProviders/resolvePluginWebFetchProviders/resolveRuntimeWebFetchProvidersnow take the sharedResolvePluginWebProvidersParams/ResolveRuntimeWebProvidersParamstypes declared once inweb-provider-runtime-shared.ts.sandboxed(and every other field) is owned by one handoff type instead of four hand-written copies, so it can no longer be silently dropped from one contract's path.web_searchresolution now fails closed for sandboxed agents:sandboxedis forwarded on both the runtime and plugin resolver paths (lazy runtime resolution preserved), so the shared trust filter applies whichever path resolves, and untrusted providers are never eligible. This mirrorsweb_fetch. A sandboxed agent with no eligible provider now gets an actionable error naming the trust restriction and the recovery (select a bundled or explicitly trusted search provider).The flag is now forwarded into both bundled-artifact handoffs (
resolveBundledPublicArtifactProviders,resolveBundledRuntimeArtifactProviders) so it survives every handoff, including the lazy bundled re-resolution.Behavior for non-sandboxed agents is unchanged. The trust filter in
web-provider-resolution-shared.tsis unchanged; it now receives the flag on the search path.Fixes #144164. The closing keyword is intentionally not used anywhere else in this body.Evidence
Regression test with the issue's fixture: a real on-disk workspace plugin at
<workspaceDir>/.openclaw/extensions/untrusted-web/whoseopenclaw.plugin.jsondeclares both contracts:{ "id": "untrusted-web", "contracts": { "webSearchProviders": ["untrusted"], "webFetchProviders": ["untrusted"] } }The plugin registers a provider on both contracts, and the same fixture is driven through both real exported resolvers:
resolvePluginWebSearchProviders({ config, workspaceDir, sandboxed: true })andresolvePluginWebFetchProviders({ config, workspaceDir, sandboxed: true })now both return no provider ([]); before the fix search returneduntrusted-web:untrusted.With
sandboxed: false/ omitted, both resolvers still returnuntrusted-web:untrusted, which is also the control proving the fixture really loads and registers (the assertion cannot pass vacuously).With the untrusted provider configured and
sandboxed: true, resolution returns[]rather than falling back to some other provider: fail-closed, no silent re-selection.src/web-search/runtime.test.tspins the wiring: forsandboxed: truethe flag is threaded through the lazy runtime resolver (resolveRuntimeWebSearchProviderscalled with{ sandboxed: true }, plugin resolver not called), so the shared trust filter applies without eager plugin activation and lazy resolution is preserved; forsandboxed: falsethe runtime resolver is used as before.Red/green and sabotage: the two new wiring assertions were red before the fix (
expected "vi.fn()" to be called 1 times, but got 0 times). Two sabotages were run and both were caught: (a) droppingsandboxedfrom the sandboxed search branch fails the runtime mirror test; (b) making the search wrapper swallowsandboxedfails the fixture test with the exact leaksearch: ["untrusted-web:untrusted"]while the non-sandboxed control still passes.Sibling surfaces swept:
git grepover every caller of the four resolvers.src/web-fetch/runtime.tsalready threaded the flag;resolveRuntimeWebFetchProviderswas missing it and is fixed by the shared parameter type.src/cli/command-secret-targets.ts,src/flows/search-setup.ts,src/secrets/runtime-web-tools-fallback.runtime.tspass only fields that remain in the shared type.src/cron/isolated-agent/run-delivery-trace.tscallshasUsableWebSearchProviderwithout a sandbox flag; that path only produces a diagnostics message, the call site has no sandbox status available, so it is left alone and reported here rather than guessed at.Verification
Ran in the patch worktree (Windows 11):
vitest run --config test/vitest/vitest.plugins.config.ts src/plugins/web-provider-sandboxed-resolution.test.ts-> 3 passed.vitest run --config test/vitest/vitest.unit-src.config.ts src/web-search/runtime.test.ts src/web-fetch/runtime.test.ts-> 54 passed.vitest run --config test/vitest/vitest.plugins.config.ts src/plugins/web-search-providers.runtime.test.ts-> 13 passed.vitest run --config test/vitest/vitest.plugins.config.ts src/plugins/web-provider-runtime-shared.test.ts src/plugins/web-provider-resolution-candidates.test.ts-> passed.src/plugins/web-fetch-providers.runtime.test.tsfails one assertion on this Windows host before and after this change (it expects/tmp/openclaw-home/...while Windows resolvesD:\tmp\...) — pre-existing, verified by stashing the source changes and re-running the same file on unmodified source.Real behavior proof
src/web-search/runtime-sandboxed-execution.test.tsdrives the registeredrunWebSearchentrypoint end to end over the default lazy path (preferRuntimeProviders: true, the path this fix threads the flag through) against a real on-disk workspace plugin (untrusted-web, the issue fixture shape) whose toolexecuteappends to a sentinel file, using the existing-configuration shape (tools.web.search.provider: "untrusted"):runWebSearch({ ..., sandboxed: true })rejects withweb_search is disabled or no provider is available.and the sentinel file is never created -- the configured workspace provider is rejected before provider I/O, fail-closed with no silent re-selection.sandboxedreturns{ provider: "untrusted" }and the sentinel records the query -- the fixture really loads, registers, and executes, so the sandboxed assertion cannot pass vacuously.Ran in the patch worktree (Windows 11):
vitest run --config test/vitest/vitest.unit-src.config.ts src/web-search/runtime-sandboxed-execution.test.ts src/web-search/runtime.test.ts-> 37 passed.vitest run --config test/vitest/vitest.plugins.config.ts src/plugins/web-provider-sandboxed-resolution.test.ts-> 3 passed.Upgrade note: an existing sandboxed configuration that selects a third-party search provider now fails closed with
web_search is disabled or no provider is available.instead of executing that provider. Recovery is to select a bundled or verified-official provider (the same rule sandboxedweb_fetchalready enforces perdocs/tools/web.md); nothing migrates because the previous behavior was the policy gap itself.trustedOfficialInstallfiltering is covered by the existing shared candidate-filter test.Resubmission note: the earlier PR for this branch was auto-closed by
openclaw-barnacleunder the repository's 20-active-PR limit (r: too-many-prs) — a queue-depth rule, not a review outcome. The active queue has been pruned, and this is the identical commit resubmitted verbatim; the previous PR's comments are still there for reference.Revision d1ed7d0 — rejection diagnostic reads manifest metadata (no unfiltered reload)
Supersedes the diagnostic reload described above. The previous revision explained a sandboxed rejection by re-resolving the configured provider with
sandboxed: false. That re-resolution falls through toloadOpenClawPlugins, which evaluates the rejected plugin module and calls itsregister()— rejected plugin code ran before the trust error was thrown. The execution sentinel only observedexecute(), so this path was invisible to the earlier proof.This revision derives the exact same determination from plugin manifest metadata, through the same sandbox predicate the resolution path already uses (
resolveManifestDeclaredWebProviderCandidatePluginIds): a configured provider is blamed on the trust rule only when its owning plugin is declaration-eligible without the filter but not eligible under it. No unfiltered resolution, no plugin load — the rejected plugin is never imported or registered.src/web-search/runtime.ts—wasProviderRejectedBySandboxTrustresolves the owning plugin id from the manifest and compares the declared vs sandbox-eligible candidate sets; the unfilteredloadSortedWebSearchProviders({ sandboxed: false })probe is removed.src/web-search/runtime-sandboxed-execution.test.ts— the on-disk fixture plugin now logs module evaluation andregister(), not justexecute().Real behavior proof (import + registration side effects)
Rejected workspace provider, sandboxed — nothing runs (no import, no register, no execute):
Control — the same plugin, not sandboxed, imports, registers, and executes (non-vacuous):
RED proof — reverting the production fix (previous revision) makes the sandboxed rejection log rejected-plugin side effects, which the strengthened test now catches:
Full run:
src/web-search/runtime-sandboxed-execution.test.ts5/5 green; the surrounding web-search / web-provider unit suites (9 files, 44 tests) green;tsgo -p tsconfig.core.jsonclean.Still open (not addressed in this revision)
web_search(whichweb_fetchalready enforces); accepting the cutoff is a maintainer decision.main; the integrated behavior still needs review after conflict resolution.