Skip to content

docs(cli): clarify that exec-policy show and approvals get exclude per-session /exec overrides#94999

Merged
steipete merged 4 commits into
openclaw:mainfrom
hugenshen:codex/fix-79983-exec-policy
Jul 11, 2026
Merged

docs(cli): clarify that exec-policy show and approvals get exclude per-session /exec overrides#94999
steipete merged 4 commits into
openclaw:mainfrom
hugenshen:codex/fix-79983-exec-policy

Conversation

@hugenshen

@hugenshen hugenshen commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

docs(cli): clarify that exec-policy show and approvals get exclude per-session /exec overrides

What Problem This Solves

Running openclaw exec-policy show or openclaw approvals get to inspect effective exec policy shows config + host approvals state, but not per-session /exec overrides set in an active chat or cron session. Nothing in the CLI output or docs mentioned this gap. A user who had set /exec security=full ask=off in a session and then ran exec-policy show would see a different policy than what was actually in use, with no hint about why.

Why This Change Was Made

  • Both exec-policy show and approvals get build output from the config snapshot and host approvals file only — session state is never loaded in either path.
  • The existing effectivePolicy.note field is already rendered in both human-readable and --json output, so appending the caveat there is the minimal correct fix with no new surface.
  • docs/tools/exec-approvals.md, docs/cli/approvals.md, and docs/tools/permission-modes.md all describe these commands without mentioning the session override gap; a <Note> block in each keeps the docs aligned with CLI output.

Scope note: this PR is a diagnostic clarification only. The underlying runtime issue — SYSTEM_RUN_DISABLED despite effective policy showing security=full — is tracked separately in #79983 and requires a different fix path. Merging this should not close or de-prioritize that issue.

User Impact

Users running openclaw exec-policy show or openclaw approvals get now see the following appended to the policy note in both text and --json output:

Per-session /exec overrides are not included; send /exec in the target chat or cron session to inspect them.

Docs pages for exec approvals, approvals CLI, and permission modes carry a matching <Note> block.

No config, approval logic, or enforcement behavior is changed. No migration required.

Evidence

  • node scripts/run-vitest.mjs run src/cli/exec-policy-cli.test.ts src/cli/exec-approvals-cli.test.ts
    • Test Files 2 passed (2)
    • Tests 30 passed (30)

Real behavior proof

  • Behavior addressed:
    CLI diagnostics for exec-policy show and approvals get now warn that per-session /exec overrides are excluded, and docs match that caveat.

  • Real environment tested:
    Local OpenClaw source checkout on macOS with fresh temporary OPENCLAW_STATE_DIR, rebased on latest upstream/main.

  • Exact steps or command run after this patch:

tmpdir=$(mktemp -d)
export OPENCLAW_STATE_DIR="$tmpdir"

pnpm openclaw exec-policy preset yolo --json
pnpm openclaw exec-policy show --json
pnpm openclaw approvals get --json
pnpm openclaw approvals get

Session inspection path reference (no live chat required):

node scripts/run-vitest.mjs run src/auto-reply/reply/get-reply-run.exec-hint.test.ts
  • Evidence after fix:

exec-policy show --json / approvals get --json note excerpt:

Per-session /exec overrides are not included; send /exec in the target chat or cron session to inspect them.

approvals get text excerpt:

Precedence: Effective exec policy is the host approvals file intersected with requested tools.exec policy. Per-session /exec overrides are not included; send /exec in the target chat or cron session to inspect them.

Session-status hint contract (Vitest):

Current session exec defaults: host=gateway security=full ask=always node=worker-1.
  • Observed result after fix:
    Both CLI commands append the session caveat in JSON and text output; docs carry matching <Note> blocks; focused CLI tests pass.

  • What was not tested:
    No live chat /exec command in Telegram/Discord; no committed proof scripts.

@hugenshen
hugenshen requested a review from a team as a code owner June 19, 2026 15:22
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 19, 2026
@clawsweeper

clawsweeper Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 7, 2026, 12:21 PM ET / 16:21 UTC.

Summary
The branch appends a per-session /exec override caveat to exec-policy show and approvals get, adds matching docs notes, and updates focused CLI tests.

PR surface: Source +11, Tests +27, Docs +12. Total +50 across 7 files.

Reproducibility: yes. source-level: current main's CLI effective-policy notes omit the per-session /exec caveat, while current source and docs show no-argument /exec is the session-specific status path. I did not run the CLI locally because this was a read-only review.

Review metrics: 1 noteworthy metric.

  • Runtime enforcement changes: 0 enforcement paths changed. The PR references exec-runtime denial reports, so maintainers should see that it only changes diagnostics, docs, and tests.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Next step before merge

  • [P2] No repair lane is needed; the patch is correct and the remaining action is ordinary maintainer merge and exact-head CI review.

Security
Cleared: Cleared: the diff changes CLI diagnostic strings, docs, and tests only; it does not alter exec authorization, approvals resolution, dependencies, workflows, or secret handling.

Review details

Best possible solution:

Merge this as a non-closing diagnostic clarification after ordinary maintainer and exact-head CI review; leave the runtime exec-enforcement bugs on their separate tracks.

Do we have a high-confidence way to reproduce the issue?

Yes, source-level: current main's CLI effective-policy notes omit the per-session /exec caveat, while current source and docs show no-argument /exec is the session-specific status path. I did not run the CLI locally because this was a read-only review.

Is this the best way to solve the issue?

Yes for the narrow diagnostic clarification: appending the caveat to the existing rendered note fields and matching docs is the smallest maintainable surface. It is not a runtime fix for the related exec-denial reports, which should stay separate.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 453f5968bbca.

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. Sufficient: the PR body now includes exact post-patch commands and copied output excerpts for exec-policy show and approvals get showing the new caveat.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Sufficient: the PR body now includes exact post-patch commands and copied output excerpts for exec-policy show and approvals get showing the new caveat.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P3: This is a low-risk docs/CLI diagnostic clarification with focused tests and no exec enforcement change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Sufficient: the PR body now includes exact post-patch commands and copied output excerpts for exec-policy show and approvals get showing the new caveat.
  • proof: sufficient: Contributor real behavior proof is sufficient. Sufficient: the PR body now includes exact post-patch commands and copied output excerpts for exec-policy show and approvals get showing the new caveat.
Evidence reviewed

PR surface:

Source +11, Tests +27, Docs +12. Total +50 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 2 16 5 +11
Tests 2 29 2 +27
Docs 3 12 0 +12
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 57 7 +50

What I checked:

  • Current main exec-policy note omits session caveat: buildLocalExecPolicyShowPayload() builds the current exec-policy show effective-policy note from config plus the local approvals snapshot and does not mention per-session /exec overrides. (src/cli/exec-policy-cli.ts:226, 453f5968bbca)
  • Current main approvals note omits session caveat: buildEffectivePolicyReport() builds approvals get effective-policy notes from config plus local/gateway/node approvals data and does not load session state or mention per-session overrides. (src/cli/exec-approvals-cli.ts:356, 453f5968bbca)
  • Existing session inspection path supports the caveat: No-argument /exec resolves session defaults through resolveExecDefaults() and returns the current host, effective host, security, ask, and node values. (src/auto-reply/reply/directive-handling.impl.ts:304, 453f5968bbca)
  • PR diff adds the caveat without changing enforcement: The diff adds SESSION_EXEC_OVERRIDES_NOTE to the two CLI note builders and changes docs/tests only; no exec authorization or approval resolver path is changed. (src/cli/exec-policy-cli.ts:72, 9fffef2bb7fa)
  • Real behavior proof updated: The PR body now lists exact post-patch commands and copied output excerpts for both exec-policy show and approvals get showing the caveat. (9fffef2bb7fa)
  • Related runtime bugs remain separate: The linked runtime-denial reports and candidate fix concern exec enforcement/resolver behavior, while this branch is a diagnostic clarification and does not close them.

Likely related people:

  • vincentkoc: Current-main blame on the relevant CLI note builders points to the recent refactor carrying these surfaces forward. (role: recent area contributor; confidence: medium; commits: 098b471143c1; files: src/cli/exec-policy-cli.ts, src/cli/exec-approvals-cli.ts, docs/tools/exec-approvals.md)
  • Takhoffman: The local exec-policy CLI and related approvals documentation appear to date to the feature commit for that command. (role: introduced CLI surface; confidence: high; commits: 4bf94aa0d669; files: src/cli/exec-policy-cli.ts, src/cli/exec-policy-cli.test.ts, docs/cli/approvals.md)
  • gumadeiras: The effective exec approvals reporting path used by approvals get traces to the unified reporting commit. (role: effective-policy reporting contributor; confidence: high; commits: ba735d015809; files: src/cli/exec-approvals-cli.ts, docs/tools/exec-approvals.md)
  • steipete: The /exec session override behavior that the new caveat points users toward appears to date to this feature commit. (role: session override feature author; confidence: medium; commits: 8f7f7ee7dc04; files: src/auto-reply/reply/directive-handling.impl.ts, src/auto-reply/reply/exec/directive.ts, docs/tools/exec.md)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (2 earlier review cycles)
  • reviewed 2026-06-24T15:32:38.362Z sha a410f9a :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-04T17:52:04.810Z sha a410f9a :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 19, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 20, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jun 20, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. label Jun 21, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: S and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. size: XS labels Jun 22, 2026
@hugenshen
hugenshen force-pushed the codex/fix-79983-exec-policy branch 2 times, most recently from 2af384f to a410f9a Compare June 24, 2026 15:22
@hugenshen hugenshen changed the title fix-79983-exec-policy docs(cli): clarify that exec-policy show and approvals get exclude per-session /exec overrides Jun 24, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Jun 24, 2026
@clawsweeper

clawsweeper Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

@hugenshen thanks for the PR. ClawSweeper is still waiting on real behavior proof before this can move forward.

Useful proof can be a screenshot, short video, terminal output, copied live output, linked artifact, or redacted logs that show the changed behavior after the fix. Please redact private tokens, phone numbers, private endpoints, customer data, and anything else sensitive.

Once proof is added to the PR body or a comment, ClawSweeper or a maintainer can re-check it.

@hugenshen

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 7, 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: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 7, 2026
@steipete steipete self-assigned this Jul 11, 2026
@steipete
steipete force-pushed the codex/fix-79983-exec-policy branch from 9fffef2 to 99ca9e2 Compare July 11, 2026 09:45
@steipete

Copy link
Copy Markdown
Contributor

Maintainer prep is complete at exact head 99ca9e2b06ad0a52e53bad20538d5e1050a510cc.

  • Refactored the caveat to one shared effective-policy constant and preserved unavailable, native-policy, timeout, and legacy-node branches.
  • Added local, gateway, node, JSON, and rendered-output coverage. Final focused run: 2 files, 34 tests passed.
  • Fresh structured autoreview: clean, no actionable findings (0.98 confidence). Independent exact-diff review also clean after fixing the modern node fixture it identified.
  • Sanitized AWS user-path proof: exact --fresh-pr head, public networking, no Tailscale, no instance role, no credential hydration. The built CLI ran exec-policy show and approvals get in text and JSON modes; the session-override caveat appeared exactly once in all four outputs. Run: https://crabbox.openclaw.ai/portal/runs/run_f87988dd6481
  • Exact-head hosted evidence: CI 29148248149, CodeQL 29148248173, Critical Quality 29148248145, Workflow Sanity 29148248154, and OpenGrep 29148248150; 67 successful checks and no failures.
  • git diff --check passed. Changelog is not required for this diagnostic/docs clarification.

Ready to land. Thank you, @hugenshen.

@steipete
steipete merged commit 98fb858 into openclaw:main Jul 11, 2026
97 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

vincentkoc added a commit that referenced this pull request Jul 11, 2026
* origin/main:
  fix(cron): abort superseded reconciliation hooks (#104368)
  ci(release): expose Telegram runtime preflight stage (#104387)
  fix(status): avoid false shell-wrapper audit warnings (#81778)
  fix: retry live Gateway readiness proof (#104374)
  fix(exec-approval): stop misattributing Allow Always unavailability to policy (#97740)
  fix: preserve Mac bundle during live builds (#104376)
  chore(docs): translate with GPT-5.6 xhigh
  test: wire Control UI suite into CI, fix its broken tests, drop dead harness surface (#104361)
  fix(ui): hide group submenu separator when New group is the only entry (#104370)
  fix(discord): reset progress drafts across queued turns (#102341)
  docs(cli): clarify that exec-policy show and approvals get exclude per-session /exec overrides (#94999)
  fix(discord): single-source thread-binding default placement and guard artifact parity (#104342)
  fix(agents): add tool-activity heartbeat to keep subagent alive during tool calls (#95536)
  fix(maint): reuse recent same-PR hosted gates (#104355)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 12, 2026
…r-session /exec overrides (openclaw#94999)

* docs(cli): clarify exec-policy show and approvals get exclude per-session /exec overrides

* refactor(cli): centralize session exec override note

* test(cli): cover node exec override note

* test(cli): use complete node policy fixture

---------

Co-authored-by: NIO <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 12, 2026
* origin/main:
  fix(cron): abort superseded reconciliation hooks (openclaw#104368)
  ci(release): expose Telegram runtime preflight stage (openclaw#104387)
  fix(status): avoid false shell-wrapper audit warnings (openclaw#81778)
  fix: retry live Gateway readiness proof (openclaw#104374)
  fix(exec-approval): stop misattributing Allow Always unavailability to policy (openclaw#97740)
  fix: preserve Mac bundle during live builds (openclaw#104376)
  chore(docs): translate with GPT-5.6 xhigh
  test: wire Control UI suite into CI, fix its broken tests, drop dead harness surface (openclaw#104361)
  fix(ui): hide group submenu separator when New group is the only entry (openclaw#104370)
  fix(discord): reset progress drafts across queued turns (openclaw#102341)
  docs(cli): clarify that exec-policy show and approvals get exclude per-session /exec overrides (openclaw#94999)
  fix(discord): single-source thread-binding default placement and guard artifact parity (openclaw#104342)
  fix(agents): add tool-activity heartbeat to keep subagent alive during tool calls (openclaw#95536)
  fix(maint): reuse recent same-PR hosted gates (openclaw#104355)
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 P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants