Repository navigation
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 27, 2026, 9:10 PM ET / August 28, 2026, 01:10 UTC. ClawSweeper reviewWhat this changesThe PR makes configuration validation and provider-changing writes preflight manual exec SecretRef command paths using the same non-executing checks as gateway startup. Merge readinessKeep this PR open for normal maintainer merge review: its fix is not on current main, and the previous non-dry Priority: P1 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — step 1 Assertions:
How this fits togetherConfig commands prepare gateway settings, while startup later resolves SecretRef providers. The PR aligns those boundaries so an unsafe executable path is rejected before a restart attempts provider resolution. flowchart LR
A[Config command] --> B[Candidate configuration]
B --> C[Command-path trust check]
C --> D[Persist configuration]
D --> E[Gateway startup]
E --> F[Secret provider resolution]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +142, Tests +594, Docs +22. Total +758 across 11 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one shared startup-equivalent validator and accept the documented strict all-provider validation scope only if maintainers are comfortable with its upgrade effect. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main emits successful validation after schema checks, while its startup exec resolver separately rejects unsafe command paths. Is this the best way to solve the issue? Yes. Reusing the startup validator removes policy drift and the current head now applies it to validate, set/patch, dry-run, and non-dry unset boundaries. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2026a7b47b1b. 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 (50 earlier review cycles; latest 8 shown)
|
bca7ee4 to
f4fac45
Compare
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
e8c85a6 to
57c6ea8
Compare
3e04a39 to
a5a79f3
Compare
a5a79f3 to
b67be86
Compare
b67be86 to
989e0ba
Compare
caf8dd1 to
eb07e8b
Compare
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review — rebased head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Please don’t spam-ping multiple maintainers at once. Be patient, or join our community Discord for help: https://discord.gg/clawd |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
…eptance Schema validation and config writes accepted exec SecretRef command paths that gateway cold start rejects (symlink, missing, unsafe permissions/ownership), so a config that printed "Config valid" could crash the gateway on the next restart. Share one non-executing exec-provider command-path validator (`src/secrets/exec-provider-path-validation.ts`, extracted from `resolve.ts` `assertSecurePath`) across cold-start activation, `openclaw config validate`, and supported config writes so all three surfaces return the same verdict for manual exec SecretRef providers. - New `src/secrets/exec-provider-path-validation.ts` (`assertSecureExecCommandPath`); `resolve.ts` imports and calls it, deleting the duplicated logic. - `config validate` calls `collectManualExecProviderCommandPathErrors` with `validateAllProviders: true` so the strict validation command checks every configured manual exec provider. Config writes (`config set/patch/dry-run`) use targeted preflight instead — they check only providers touched by the operation, or all providers when the write edits the `secrets.providers` collection itself — so an unrelated routine write is not blocked by a dormant inactive provider that gateway startup would skip. A shared `collectTouchedProviders` helper deduplicates the touch-collection logic this function and `collectPluginIntegrationProviderErrors` both need. - Guards against non-object provider values so a value-mode write setting a provider to `null`/primitive no longer throws a raw TypeError. - Docs aligned with the exact permission rule, symlink rejection, and that `config validate` checks every provider while writes use targeted preflight. The extracted validator stays at parity with current `resolve.ts` cold-start activation: absolute path, non-symlink, trusted-directory containment, non-writable-by-others permissions, current-user ownership, and Windows ACL availability. It deliberately does not add a regular-file or owner-execute-bit requirement, so cold start (which now calls the shared validator) does not grow stricter and block existing configurations without an upgrade path. Tightening the executable policy is upgrade-sensitive and left to maintainers (the issue carries `needs-product-decision` / `needs-security-review`). Scope is limited to manual exec SecretRef providers as reported in openclaw#117051. Plugin-integration materialized-command parity, the deprecated `allowInsecurePath` manifest field, `checks.schema` semantic widening, and dead CLI flag retirement from earlier revisions are intentionally left out for the same boundary reason. Closes openclaw#117051
Share one provider issue collector and one set/patch/unset write lifecycle. Preserve validation JSON and targeted recovery, and carry provider metadata through patch deletions. Keep startup path policy unchanged. Co-authored-by: SunnyShu0925 <[email protected]>
|
Maintainer review and refactor completed on The root cause is split acceptance policy: config commands validated shape while startup owned command-path trust. The fix shares the startup validator and one provider issue collector. I also fixed the original patch's malformed The unset consolidation overlapped with #131369 landing during proof. The conflict is resolved on its canonical mutation runner and normalized Evidence: three added regressions failed against the original PR and passed after the fix. The rebased exact head passed 312 focused/integration tests plus real source-CLI validation, patch, and removal scenarios on a fresh secretless AWS machine (run The ClawSweeper rank-up move is retained: explicit validation checks all manual exec providers, while targeted writes check changed/referenced providers and allow recovery around unrelated dormant ones. This strict validation behavior is intentional and documented. Windows live CLI and macOS ownership edges were not exercised; their policies were not broadened. A separate review of existing Windows executable ownership policy is outside this parity repair. The complete changed-surface checks also passed on that rebased head: production/test types, lint (0 warnings/errors), formatting, dead exports, plugin boundaries, storage rules, and runtime import checks. Exact-head CI completed successfully for the reviewed head. @clawsweeper re-review Landed as 2b263ad; #117051 is closed. Native merge verification and the required CI gate passed. The first merge attempt hit a shared |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
Closes #117051
What Problem This Solves
openclaw config validatecould accept a manual exec SecretRef command that startup later rejected because its path was missing, symlinked, writable by others, or not owned by the current user. James Churchill reported a symlinked command passing validation before a failed restart.Why This Change Was Made
Share the existing startup command-path trust check with config acceptance. The validator does not execute the provider and does not tighten startup policy.
The maintainer pass also removes the structures that let validation drift:
config set,config patch, andconfig unsetuse one mutation runner for preflight, validation, persistence, and apply hints. The maintainer refactor removed the duplicate unset flow; while proof ran, fix(config): preserve indexed and whole-list agent edits #131369 independently landed that consolidation for agent-roster edits. The rebased change uses its canonicalappliedOperations, preserving roster normalization and write topology.unset, preserving provider and SecretRef metadata. A patch that deletes a provider subfield can no longer bypass preflight.config validate --jsonretains its established failure envelope and{path, message}issue objects.User Impact
Explicit
config validatechecks every configured manual exec provider, including inactive providers. This is intentionally stricter than startup's active-surface selection. Targeted writes and dry runs check providers changed or referenced by the operation; replacing the provider collection checks every remaining provider. Unrelated dormant providers do not block repairs, and removing a broken provider remains possible.Run validation on the Gateway host: it inspects that host's filesystem. These are path trust checks, not a guarantee that a command can execute or return a valid secret. Startup checks again before execution. No config keys, environment options, manifest fields, or CLI flags were added. Plugin-integration materialized-command policy is unchanged.
Evidence
Validation ran on an isolated, secretless Linux AWS Crabbox, with a fresh temporary HOME, public networking, no Tailscale, no instance profile, and a verified IMDS credential absence. No contributor code ran on the maintainer host.
aef72f1052cece19a472e8fd6495c4816d1c93f2: three expected failures proved the malformed validation JSON and both normal/dry patch-deletion bypasses.src/cli/config-cli.test.ts,src/secrets/exec-provider-path-validation.test.ts,src/secrets/resolve.test.ts, andsrc/secrets/provider-integrations.test.ts.node --import ./scripts/tsx.mjs src/entry.ts config ...: unsafe JSON validation exited 1 with structured issues; deletingtrustedDirsvia patch exited 1 and left the file unchanged; safe-path validation exited 0; removing the broken provider exited 0. The provider execution marker stayed absent in every case.f7ffd235efef9e81952fc710736bc3f36f1931d8: 312 tests passed, addingsrc/cli/config-cli.integration.test.tsto the focused suite. All four real CLI scenarios passed again (AWSrun_be3ad1fcbad6).Focused command:
pnpm test src/cli/config-cli.test.ts src/secrets/resolve.test.ts src/secrets/exec-provider-path-validation.test.ts src/secrets/provider-integrations.test.ts.Production/test type checks and the complete changed-surface guard suite passed before rebase (AWS
run_67121eb28381) and again on the rebased head (AWSrun_be3ad1fcbad6), including lint, formatting, assertion safety, dead exports, plugin boundaries, storage rules, and runtime imports. Exact-head CI completed successfully forf7ffd235efef9e81952fc710736bc3f36f1931d8. Windows live CLI and macOS ownership edge cases were not exercised; Windows receipt behavior is covered by deterministic tests, and existing startup policy is preserved.Final diff against refreshed main: production +135/-168 (net -33); tests +563/-66 (net +497); docs +17/-5. Before the mainline overlap was absorbed, the maintainer pass reduced the incoming PR by 260 net production lines and 98 test lines. No assertion-baseline change remains because main already contains that shrink.
Best-fix verdict: shared startup policy plus one mutation flow. Separate command-specific guards were rejected because they already missed ordinary unset and patch deletions. A schema-only fix cannot perform these asynchronous filesystem checks. Tightening executable/Windows ownership policy is separate from this parity repair.
ClawSweeper rank-up move retained: strict all-provider manual-exec validation is documented; targeted writes preserve inactive-provider recovery. The latest review's production-growth risk is resolved by the refactor.
Thanks @SunnyShu0925 for the original fix and @jamesachurchill for the report.