fix #97069: [Bug]: Approval prompt wrongly says effective policy requires approval for one-shot commands#97188
Conversation
…ent in approval messages resolveExecApprovalAllowedDecisions() removes allow-always from allowed decisions when the command is not persistable (e.g., shell redirection), but the user-facing message always said 'the effective policy requires approval every time.' This misled users whose actual policy is ask=on-miss into thinking their policy was misconfigured. Fix: check params.ask (or request.request.ask) — if ask is 'always', show the policy message. Otherwise, show a one-shot message explaining that the command cannot be persisted. Fixes openclaw#97069
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close in favor of the broader proof-positive sibling PR: this branch fixes two renderer messages, but it is still a partial landing candidate and is superseded by an open mergeable PR that covers the same approval-copy bug across production surfaces with sufficient Telegram proof. Canonical path: Use #97077 as the canonical landing candidate after maintainer review, then close or supersede the narrower overlapping branches. So I’m closing this here and keeping the remaining discussion on #97077. Review detailsBest possible solution: Use #97077 as the canonical landing candidate after maintainer review, then close or supersede the narrower overlapping branches. Do we have a high-confidence way to reproduce the issue? Yes. Current main source removes Allow Always for both Is this the best way to solve the issue? No. This is a useful partial fix, but the best landing path is the broader proof-positive sibling branch that carries the needed context through production prompt surfaces and preserves the missing-ask fallback. Security review: Security review cleared: The diff changes approval prompt text and tests only; no dependency, workflow, secret, permission, package, or supply-chain surface changed. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 7bbd09047bd7. |
Mantis Telegram Desktop ProofSummary: Mantis captured native Telegram Desktop before/after GIFs showing the exec approval wording change for a one-shot command.
Motion-trimmed clips: |
|
ClawSweeper applied the proposed close for this PR.
|




Summary
allow-alwaysis unavailable because the command is one-shot (e.g., shell redirection2>&1), the approval prompt misleadingly says "the effective approval policy requires approval every time" — even when the actual policy isask=on-miss. This confuses users into thinking their policy is misconfigured ([Bug]: Approval prompt wrongly says effective policy requires approval every time for non-persistable redirected command #97069).asksetting in the message builder. Ifask === "always", show the existing policy message. Otherwise, show a message explaining the command cannot be persisted.exec-approval-reply.tsandexec-approval-forwarder.ts— conditional messages in 3 locations. Two new tests.allow-alwaysbutton still correctly disappears for one-shot commands.Maintainer checklist
Real behavior proof
Behavior or issue addressed:
Approval prompt wrongly says "effective policy requires approval every time" for one-shot commands (shell redirection).
Real environment tested:
Exact steps or command run after the patch:
After-fix evidence:
Observed result after fix:
What was not tested: