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: stale review; fresh review needed. Summary Next step Review history (16 earlier review cycles; latest 8 shown)
|
|
You're right on both P2s — verified in-tree just now:
Fix pushed as |
f1e9298 to
29a10a0
Compare
|
Real end-to-end proof from this branch source ( Text: JSON ( alsoAllow exception: Repro notes: canonical config at |
|
Both P2s fixed in
Gates: 8/8 new tests, 19/19 related doctor tests, oxlint + oxfmt + diff-check clean. Full transcript in body. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Fresh evidence on current head
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Update on current head |
|
P2 doc finding addressed in @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Hi @jerome-queck — thank you for the careful proof and for keeping authorship on 99e3d45. I have pasted your Linux refreshed-integration run into the Evidence section above, clearly credited as your run with your permission, plus a note that my own refreshed-branch run follows after the rebase. Status on my side: head 99e3d45 predates the current main refactors (workshop policy removal, mcp transport, utility warnings, heartbeat-owner removal), Proposal: keep #147490 for the validate warning, keep #190269 as the doctor-note alternative, maintainer picks the surface, the other closes in favour. If you prefer to carry the doctor approach here instead, say so and I will close this one in favour of #190269 with joint credit. Requesting a fresh review after the Evidence update: @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Thanks so much @Navras98, and thanks for crediting the run in the Evidence section! Your proposal sounds great to me: keep #147490 as the primary validate-warning path and #190269 as the bounded doctor-note alternative, let the maintainers pick the surface, and close the other in favour with joint credit. Happy to be co-author on your rebased commits, and I'll do the same for you on #190269 if that's the one that lands. Ping me anytime if a hand with the rebase would help. |
99e3d45 to
8737271
Compare
|
Rebased and pushed: head 87372713 on current main, same branch feat/validate-empty-allow-warn, co-authored with @jerome-queck. What changed vs the old head: collector re-applied onto the new structure (validation-core plus wiring in validation-plugin-rules), no heartbeat code, docs callout kept. Real runs on this tree: 8/8 tests pass in empty-allow-policy-warnings, CLI validate shows 9 warnings on the all-empty config and stays silent for subagents allow plus alsoAllow and for omitted allow, oxfmt and oxlint clean. Full transcript is in the new Evidence section above. CI on the pushed head is running. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Remove the test-only collectConfigValidationWarnings wrapper. Tests now exercise validateConfigObjectWithPlugins with fixed plugin metadata, so they fail if the wiring in validation-plugin-rules is removed. Base run is red by behavior (0 warnings), branch run is green. Refs openclaw#147342. Co-authored-by: jerome-queck <[email protected]>
8737271 to
d12da06
Compare
|
Re-review feedback addressed and pushed: head d12da06, same branch, co-authored with @jerome-queck. What changed: removed the test-only collectConfigValidationWarnings wrapper from validation-core. Production wiring is now the single call to collectEmptyAllowPolicyWarnings in validation-plugin-rules. Tests exercise the real production owner validateConfigObjectWithPlugins with fixed plugin metadata, following validation.policy.test.ts, so they go red if the wiring is removed. Real runs on this head: 8/8 tests pass through the production owner. Same test file on clean main: 6 warn cases fail with 0 warnings and 2 silence cases pass, true behavioral red. CLI validate shows the 9 warnings in text and json, silent on the narrowing and omit cases. oxfmt and oxlint clean. Full transcript is in the new Evidence section above. CI on the pushed head is running. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Stay silent when a non-empty deny or alsoAllow accompanies allow: [], so the warning targets only configs that read as deny-all but restrict nothing. Refs openclaw#147342. Builds on Navras98's openclaw#147490. Co-authored-by: Andrea Sforna <[email protected]>
Doctor now reports bare allow: [] on provider, sender, sandbox, agent, and channel tool policies, and stays quiet only where alsoAllow actually narrows the list. Config validate is unchanged so openclaw#147490 keeps that surface. Refs openclaw#147342. Co-authored-by: Jerome <[email protected]>
What Problem This Solves
An explicit
allow: []in a tool policy reads as deny-all but the matcher treats it as allow-all — identical to omittingallow.openclaw config validatereportedConfig validwith no warning. Field case: WhatsApp sender policies documented as restricted withallow: []while every non-denied tool stayed allowed.Changes
Warn-only; matcher semantics, exit codes and JSON shape unchanged:
src/config/validation-core.ts:pushEmptyAllowWarningnow takesalsoAllowNarrows— suppression applies only totools.subagents.tools, the single scope wheremergeConfiguredSubagentAllow(src/agents/agent-tools.policy.ts:87-89) narrows[] + alsoAllowto the alsoAllow list. Global/sandbox stay permissive (pickSandboxToolPolicymaps to["*", ...alsoAllow]persrc/agents/sandbox-tool-policy.test.ts:39-48;mergeAllowlistinsrc/agents/sandbox/tool-policy.ts:54-62preserves[]), so they still warn. Collector now also visitstools.byProvider.*,agents.entries.*.tools.byProvider.*(consumed atsrc/agents/agent-tools.policy.ts:391/396viaCommonToolPolicyFields.byProvideratsrc/config/zod-schema.agent-runtime.ts:631) andagents.entries.*.tools.sandbox.tools(AgentToolsSchema.sandboxat:722-726).src/config/validation.ts:264: wires the combined collector into the existing snapshot warnings channel (validate already prints and JSON-serializes warnings; no CLI plumbing needed).docs/tools/subagents/tool-policy.md: sole-exception wording — onlytools.subagents.toolsnarrows withalsoAllow; all other scopes warn.src/config/empty-allow-policy-warnings.test.ts: 8 tests (global, per-sender, agent entries, subagents/sandbox, subagent-only silence, global+sandbox warn with alsoAllow, byProvider + nested sandbox coverage, omit silence).Correction: the original blanket
alsoAllowexception was wrong — withdrawn (see concession comments withsandbox-tool-policy.test.ts+tool-policy.tsrefs). Now scope-aware.Evidence
Branch-source run from this head (
21684cda) viacollectConfigValidationWarnings(thevalidation.ts:264snapshot path):Notably absent:
tools.subagents.toolswith{ allow: [], alsoAllow: ["read"] }stays silent (narrowing proven), whiletoolsandtools.sandbox.toolswith the same pair warn (still permissive). Both P2 findings resolved through the validation boundary.Gates on this head:
src/config/empty-allow-policy-warnings.test.ts: 8/8 passsrc/commands/doctor/shared/empty-allowlist-policy.test.ts+channel-doctor.test.ts: 19/19 pass[email protected]: 0 warnings 0 errors;[email protected] --check: clean;git diff --check: cleanmainhas zerocollectEmptyAllowPolicyWarningswarnings forbyProvider/nested sandbox; branch adds them.4cd90aa9(run34838344387+34838344518): touched-area gates green (8/8 new tests, 19/19 doctor tests, lint/format/diff-check clean, Critical Quality config-boundary pass). 5 remaining fails are upstream/unrelated, zero file overlap with this PR's 4 touched files — verified 2026-09-14:changed-extensions-config-54(qa-lab coverage timeout 60s),compact-large-12(src/state/openclaw-agent-db-module-identitytimeout 45s, byte-identical on feat(skills): add requires.anyEnv alternate credentials (sag accepts SAG_API_KEY) #147455),compact-small-12(docker-build-helperclawhub-fixture assertion, already failing on clean main per feat(skills): add requires.anyEnv alternate credentials (sag accepts SAG_API_KEY) #147455 thread),dependency-guard-detect(500 Internal Server Error, infra),ci-gate(aggregate). Local re-proof on this head: collector 8 warnings withtools.subagents.toolssilent, 8/8 unit replications pass, oxlint 0, oxfmt + diff-check clean. These shards need a maintainer re-run, not a code fix.Evidence update 2026-11-02 — refreshed integration proof, credit jerome-queck with permission
Head
99e3d45predates current main refactors,gh pr update-branchreports conflicts, rebase is planned. To unblock the reviewer request for real output from the refreshed integration path (validation-plugin-rules.ts), pasting below the Linux run jerome-queck captured on the equivalent logic merged onto current main, with his permission from the 2026-11-01 comment. This run is his, not mine. My own refreshed-branch run will follow after the rebase.Config under test:
allow: []at every level (tools,toolsBySender,byProvider,subagents.tools,sandbox.tools, and the same underagents.entries.chat.tools). Run method: source (node --import ./scripts/tsx.mjs src/entry.ts), isolated HOME per case. His branch head884b51c; before is the same tree withsrc/config/validation-core.tsandsrc/config/validation-plugin-rules.tsreset toorigin/main 2c0ab86fa41.Before on main:
openclaw config validateprints Config valid with exit 0,--jsonreturns valid true with warnings []. After on branch: Config valid with 9 warnings, one per scope listed above. JSON returns valid true with 9 warning entries with the same message. Exit stays 0 in both cases. No-warn cases identical on main and branch: subagentsallow: [] + alsoAllow: ["read"]stays silent, allow omitted or non-empty stays silent. Tests on that tree:src/config/empty-allow-policy-warnings.test.ts8 failed on main sources (collectConfigValidationWarningsnot exported on main), 8 passed on branch.oxfmt --checkclean on 4 files,oxlint0 errors,git diff --checkclean, TruffleHog filesystem scan of the 4 touched files 0 verified and 0 unverified.Full terminal transcript is in jerome-queck's 2026-11-01 comment on this PR. Keeping this PR as the primary validate-warning implementation. The companion doctor-note PR #190269 stays as the alternative surface; maintainer decides which surface to land. Happy to add jerome-queck as co-author on the rebased commits.
Risk
Warn-only addition. Suppression is now scope-aware (subagents only). No matcher, exit-code, or JSON-contract change. Worst case: a warning an operator disagrees with — actionable guidance included.
Rollback
Revert the branch commits; validate returns to prior behavior with no migration.
Follow-ups (out of scope)
doctorsurfacing anemptyAllowPoliciescountRefs #147342.
Evidence update 2026-11-02 — rebased run on current main (mine)
Branch rebased: head 87372713 on current main, forced update of feat/validate-empty-allow-warn. Previous conflict on update-branch is resolved by re-applying the collector onto the new structure. Co-authored with jerome-queck.
Fresh runs from this rebased tree, source via node --import ./scripts/tsx.mjs src/entry.ts, isolated HOME per case:
Config with allow [] at every level (tools, toolsBySender, byProvider, subagents tools, sandbox tools, same under agents entries chat tools):
openclaw config validate prints Config valid with 9 warnings, one per scope, exit 0. openclaw config validate --json returns valid true with 9 warning entries with the same message, exit 0.
No-warn cases on the same tree: subagents allow [] paired with alsoAllow read stays silent, Config valid with no warnings. Allow omitted or non-empty stays silent, Config valid with no warnings.
Tests on this tree: src/config/empty-allow-policy-warnings.test.ts 8 passed out of 8. oxfmt check clean on the 3 touched source and test files. oxlint clean on the same files. git diff check clean for the 4 touched files.
CI on the pushed head is running. Requesting fresh review:
@clawsweeper re-review
Evidence update 2026-11-03 — review feedback addressed (mine)
Removed the test-only
collectConfigValidationWarningswrapper fromvalidation-core.ts. Production wiring stays as the single call invalidation-plugin-rules.tstocollectEmptyAllowPolicyWarnings. The test file now exercises the real production ownervalidateConfigObjectWithPluginswith fixed plugin metadata, followingvalidation.policy.test.ts, so the assertions fail if the wiring is removed.Fresh runs on head d12da06, source via node --import ./scripts/tsx.mjs src/entry.ts with isolated HOME per case, plus vitest:
Targeted tests: src/config/empty-allow-policy-warnings.test.ts 8 passed out of 8 through the production owner. Base behavior proof on clean main with the same test file: 6 warn cases fail with 0 warnings, 2 silence cases pass, which is the true behavioral red. CLI validate on the all-empty config prints Config valid with 9 warnings, exit 0. CLI validate --json returns valid true with 9 warning entries, exit 0. Subagents allow plus alsoAllow stays silent, allow omitted stays silent. oxfmt check clean and oxlint clean on the 3 touched source and test files.
CI on the pushed head is running. Requesting fresh review:
@clawsweeper re-review