Skip to content

fix(secrets): preflight exec provider command paths before config acceptance - #117128

Merged
steipete merged 2 commits into
openclaw:mainfrom
SunnyShu0925:fix/exec-secretref-path-preflight-117051
Aug 28, 2026
Merged

steipete merged 2 commits into
openclaw:mainfrom
SunnyShu0925:fix/exec-secretref-path-preflight-117051

Conversation

@SunnyShu0925

@SunnyShu0925 SunnyShu0925 commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Closes #117051

What Problem This Solves

openclaw config validate could 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, and config unset use 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 canonical appliedOperations, preserving roster normalization and write topology.
  • Patch deletions use the same operation constructor as unset, preserving provider and SecretRef metadata. A patch that deletes a provider subfield can no longer bypass preflight.
  • One provider collector handles existing plugin-integration materialization checks and manual exec path checks. It produces ordinary config issues, so config validate --json retains its established failure envelope and {path, message} issue objects.
  • The extracted startup validator drops obsolete symlink/readability switches, a one-use helper, and a redundant absolute-path predicate after path normalization. Windows permission failures keep their typed diagnostic.
  • Tests consolidate repeated fixtures and cases, replace copied Node binaries with small files where nothing executes, and make the Windows ACL-unavailable test deterministic on Windows too.

User Impact

Explicit config validate checks 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.

  • Original PR: 269 focused tests passed.
  • Added regressions against original head aef72f1052cece19a472e8fd6495c4816d1c93f2: three expected failures proved the malformed validation JSON and both normal/dry patch-deletion bypasses.
  • Before rebase, the refactored candidate passed 293 tests across src/cli/config-cli.test.ts, src/secrets/exec-provider-path-validation.test.ts, src/secrets/resolve.test.ts, and src/secrets/provider-integrations.test.ts.
  • Real CLI via node --import ./scripts/tsx.mjs src/entry.ts config ...: unsafe JSON validation exited 1 with structured issues; deleting trustedDirs via 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.
  • Rebased head f7ffd235efef9e81952fc710736bc3f36f1931d8: 312 tests passed, adding src/cli/config-cli.integration.test.ts to the focused suite. All four real CLI scenarios passed again (AWS run_be3ad1fcbad6).
  • Fresh Codex autoreview passed with no actionable findings at the helper's default P0 threshold; manual review and independent evidence inspection additionally covered the concrete JSON, deletion, and Windows-test defects.

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 (AWS run_be3ad1fcbad6), including lint, formatting, assertion safety, dead exports, plugin boundaries, storage rules, and runtime imports. Exact-head CI completed successfully for f7ffd235efef9e81952fc710736bc3f36f1931d8. 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.

@SunnyShu0925
SunnyShu0925 requested a review from a team as a code owner August 1, 2026 00:33
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime cli CLI command changes size: L labels Aug 1, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 27, 2026, 9:10 PM ET / August 28, 2026, 01:10 UTC.

ClawSweeper review

What this changes

The PR makes configuration validation and provider-changing writes preflight manual exec SecretRef command paths using the same non-executing checks as gateway startup.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this PR open for normal maintainer merge review: its fix is not on current main, and the previous non-dry config unset gap is now covered.

Priority: P1
Reviewed head: aef72f1052cece19a472e8fd6495c4816d1c93f2

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-backed repair with credible terminal proof and no remaining discrete correctness finding.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The PR body provides redacted after-fix Linux terminal evidence for validation and write rejection, valid-path acceptance, and startup parity.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body provides redacted after-fix Linux terminal evidence for validation and write rejection, valid-path acceptance, and startup parity.
Evidence reviewed 6 items Current-main gap: Current main validates the schema and then emits a successful config validate result without command-path preflight; startup still has a separate exec-path check.
Shared owner boundary: The introduced validator is called by startup resolution and by config validate; non-dry config unset now invokes the collector before persistence.
Regression coverage: Focused tests cover symlink rejection, valid paths, JSON validation output, targeted writes, dormant providers, and the previously missing non-dry unset path.
Findings None None.
Security None None.

Live Verification

Command: pnpm build

Result: FAIL (failed) — step 1 run proof_dir=$(mktemp -d) && ln -s "$(command -v node)" "$proof_dir/node-link" && printf '{secrets:{providers:{execmain:{source:"exec",command:"%s"}}}}\n' "$proof_dir/node-link" › "$proof_dir/openclaw.json5" && (OPENCLAW_CONFIG_PATH="$proof_dir/openclaw.json5" pnpm openclaw config validate; proof_status=$?; rm -rf "$proof_dir"; test "$proof_status" -eq 1): terminal run was blocked by the previous command: terminal proof exceeded its configured time budget

[failure]
terminal run was blocked by the previous command: terminal proof exceeded its configured time budget

[command 1 combined output]
$ node --import ./scripts/tsx.mjs scripts/build-all.mts
[build-all] plugins:assets:build
$ node --import ./scripts/tsx.mjs scripts/bundled-plugin-assets.mts --phase build
[canvas] build: node scripts/bundle-a2ui.mjs
[log] ‹DIR›/a2ui.bundle.js  chunk │ size: 399.96 kB
[log] ‹DIR›/a2ui-v0.9.bundle.js  chunk │ size: 615.66 kB
[log]
[success] rolldown v1.2.0 Finished in 116.52 ms
[diffs] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts curated
[diffs-language-pack] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts full
[discord] build: node --import tsx ../../scripts/build-discord-activity-sdk.mts
[build-all] plugins:assets:build done in 2.19s
[build-all] tsdown-ai
[PLUGIN_TIMINGS] Your build spent significant time in plugins. Here is a breakdown:
  - tsdown:deps (48%)
  - rolldown-plugin-dts:generate (22%)
  - rolldown-plugin-dts:fake-js (19%)
See https://rolldown.rs/reference/InputOptions.checks#plugintimings for more details.

[tsdown-build] invocation 1/1 finished in 5.0s
[build-all] tsdown-ai done in 5.67s
[build-all] tsdown-packages
[tsdown-build] invocation 1/1 finished in 23.9s
[build-all] tsdown-packages done in 24.5s
[build-all] tsdown-unified
node_modules/playwright-core/lib/coreBundle.js (65821:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65821:29 ]
       │
 65821 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─  
       │                               ╰─── Use of direct ˋevalˋ here.
       │ 
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/playwright-core/lib/coreBundle.js (65828:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65828:29 ]
       │
 65828 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─  
       │                               ╰─── Use of direct ˋevalˋ here.
       │ 
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2343:30) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2343:31 ]
      │
 2343 │           ASM_CONSTS[start] = eval(func);
      │                               ──┬─  
      │                                 ╰─── Use of direct ˋevalˋ here.
      │ 
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2366:32) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2366:33 ]
      │
 2366 │           moduleExports[name] = eval(func);
      │                                 ──┬─  
      │                                   ╰─── Use of direct ˋevalˋ here.
      │ 
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

[tsdown-build] invocation 1/9 finished in 15.9s
[tsdown-build] still running pid=10161; no output for 30s

Assertions:

  • FAIL expect_output: OpenClaw config is invalid:
  • FAIL expect_output: must not be a symlink

How this fits together

Config 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]
Loading

Before merge

  • Resolve merge risk (P1) - config validate will newly fail for any configured unsafe manual exec provider, including inactive ones; this intentional strict behavior can affect existing validation automation.
  • Resolve merge risk (P1) - The bug fix is production net +142 lines after the resolver extraction; the added CLI boundary integrations need to remain limited to the shared validator.
Agent review details

Security

None.

PR surface

Source +142, Tests +594, Docs +22. Total +758 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 5 243 101 +142
Tests 2 646 52 +594
Docs 4 34 12 +22
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 11 923 165 +758

Review metrics

Metric Value Why it matters
Production versus test delta production +142, tests +594, docs +22 The shared validator replaces 92 resolver lines; the remaining production growth integrates it at validate and write boundaries.

Merge-risk options

Maintainer options:

  1. Accept strict validation scope (recommended)
    Land with the documented behavior that config validate rejects unsafe manual exec providers even when they are inactive.
  2. Preserve prior automation behavior
    Narrow the new validation scope if compatibility with existing inactive-provider validation automation outweighs restart-safety parity.

Technical review

Best 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.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body provides redacted after-fix Linux terminal evidence for validation and write rejection, valid-path acceptance, and startup parity.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, 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:

  • P1: The PR addresses an accepted configuration that can turn into a gateway startup outage on restart.
  • merge-risk: 🚨 compatibility: Strict validation gains filesystem checks for configured manual exec providers, which can change results for existing automation and inactive provider entries.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body provides redacted after-fix Linux terminal evidence for validation and write rejection, valid-path acceptance, and startup parity.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides redacted after-fix Linux terminal evidence for validation and write rejection, valid-path acceptance, and startup parity.

Evidence

What I checked:

  • Current-main gap: Current main validates the schema and then emits a successful config validate result without command-path preflight; startup still has a separate exec-path check. (src/cli/config-cli.ts:404, 2026a7b47b1b)
  • Shared owner boundary: The introduced validator is called by startup resolution and by config validate; non-dry config unset now invokes the collector before persistence. (src/cli/config-cli.ts:301, aef72f1052ce)
  • Regression coverage: Focused tests cover symlink rejection, valid paths, JSON validation output, targeted writes, dormant providers, and the previously missing non-dry unset path. (src/cli/config-cli.test.ts:4943, aef72f1052ce)
  • Introduction ownership: The verified test merge differs from its pinned main parent only on the eleven PR paths, including the validator, CLI integration, tests, and documentation. (src/secrets/exec-provider-path-validation.ts:49, ddab748bd481)
  • History and ownership: Blame attributes the surrounding startup and config-command implementation to the recent shared CLI/secrets work, with the PR introducing the new calls and validator. (src/secrets/resolve.ts:441, 29d07131e8d8)
  • After-fix behavior proof: The PR body supplies redacted Linux terminal output for rejected symlink paths, accepted valid paths, blocked writes, and matching cold-start behavior; it reports focused suites passing. (aef72f1052ce)

Likely related people:

  • Peter Steinberger: Current surrounding config-command and resolver code is attributed to his recent shared implementation work. (role: recent CLI and secrets-area contributor; confidence: high; commits: 29d07131e8d8, 8dd0434f86f2; files: src/cli/config-cli.ts, src/cli/config-cli-validation.ts, src/secrets/resolve.ts)
  • Vincent Koc: History includes the Windows ACL diagnostic preservation work that this extracted validator preserves. (role: adjacent secret-path diagnostics contributor; confidence: medium; commits: 38039f5ea825, fd1662f49cc3; files: src/secrets/resolve.ts, src/secrets/resolve.test.ts)

Rank-up moves

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

  • Maintain the documented strict validation scope when rebasing and completing normal maintainer review.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (50 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-22T09:59:29.395Z sha 42bd62e798c462fc8d347bc4fcd9a03ba6fe046f :: found issues before merge. :: [P1] Keep the extracted validator at current startup parity
  • reviewed 2026-08-22T10:42:33.783Z sha 2a0f58a4b02a8b20a3ef40670d88cf03cb422216 :: needs changes before merge. :: [P2] Correct the documented exec-provider requirements
  • reviewed 2026-08-22T11:24:43.848Z sha 4ab42ab267cf5891bdac9b317917a719689f430d :: found issues before merge. :: [P2] Retain the existing provider compatibility contract
  • reviewed 2026-08-22T16:57:19.813Z sha 2c10854244dc541ec055d8fdff4c3278f8e728a0 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-22T17:16:42.071Z sha 2c10854244dc541ec055d8fdff4c3278f8e728a0 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-27T12:06:49.746Z sha 572d0378e9600f2588bef08cbe575ef2a9e647e8 :: found issues before merge. :: [P1] Preserve targeted config writes for inactive providers
  • reviewed 2026-08-27T14:02:44.617Z sha dfa15acaa38e51bb09f2c7a7dd365f9b0c5ad040 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-27T16:08:55.302Z sha 3e14eb120be1b944fdf78623a9e7485443ed688b :: needs changes before merge. :: [P2] Preflight ordinary config unset writes

@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@SunnyShu0925
SunnyShu0925 force-pushed the fix/exec-secretref-path-preflight-117051 branch from e8c85a6 to 57c6ea8 Compare August 1, 2026 02:15
@clawsweeper clawsweeper Bot added 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: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 1, 2026
@vincentkoc vincentkoc self-assigned this Aug 1, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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. labels Aug 2, 2026
@clawsweeper clawsweeper Bot added the rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. label Aug 5, 2026
@SunnyShu0925
SunnyShu0925 force-pushed the fix/exec-secretref-path-preflight-117051 branch from 3e04a39 to a5a79f3 Compare August 5, 2026 06:11
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 5, 2026
@RomneyDa
RomneyDa force-pushed the fix/exec-secretref-path-preflight-117051 branch from a5a79f3 to b67be86 Compare August 5, 2026 12:45
@RomneyDa
RomneyDa force-pushed the fix/exec-secretref-path-preflight-117051 branch from b67be86 to 989e0ba Compare August 5, 2026 12:46
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. label Aug 5, 2026
@RomneyDa
RomneyDa force-pushed the fix/exec-secretref-path-preflight-117051 branch from caf8dd1 to eb07e8b Compare August 5, 2026 13:10
@clawsweeper

clawsweeper Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@RomneyDa

RomneyDa commented Aug 6, 2026

Copy link
Copy Markdown
Member

@clawsweeper re-review — rebased head 3002dbd887563dc42125d7c034970f6025b131ae keeps config preflight on manifest assignments and bundled public artifacts, adds throwing external channel/web-provider regressions, and documents the POSIX owner-execute requirement.

@clawsweeper

clawsweeper Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@openclaw-barnacle

Copy link
Copy Markdown

Please don’t spam-ping multiple maintainers at once. Be patient, or join our community Discord for help: https://discord.gg/clawd

@clawsweeper

clawsweeper Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

SunnyShu0925 and others added 2 commits August 27, 2026 22:08
…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]>
@steipete

steipete commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Maintainer review and refactor completed on f7ffd235efef9e81952fc710736bc3f36f1931d8.

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 config validate --json failure envelope and patch-null deletion bypass, and made the Windows ACL-unavailable test independent of whether the host has icacls.

The unset consolidation overlapped with #131369 landing during proof. The conflict is resolved on its canonical mutation runner and normalized appliedOperations, preserving agent-roster edits and write topology. Final delta against the refreshed base: production +135/-168 (net -33), tests +563/-66 (net +497), docs +17/-5. Startup trust policy and plugin-integration materialization policy remain unchanged; no new config or environment surface.

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 run_be3ad1fcbad6). Rejections left config bytes unchanged; every path-only scenario left the provider execution marker absent. Safe validation and removal of a broken provider succeeded. The CLI integration suite also exercises real persistence, no-op handling, conflict detection, and explicit --allow-exec behavior. Fresh Codex autoreview found no actionable findings at its default P0 threshold; the manual review covered the concrete P1/P2 defects above.

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 origin/main fetch race with another task; after proving the failed process had exited, the exact stale operation lock was recovered and the native merge succeeded unchanged. Tooling follow-up: make concurrent PR-workflow fetches tolerate this remote-ref compare-and-swap race.

@clawsweeper

clawsweeper Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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.

[Bug]: config validate can accept an exec SecretRef command that cold start rejects as a symlink

4 participants