Add inline exec approval flow#751
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 24, 2026, 10:19 PM ET / 02:19 UTC. Summary Reproducibility: not applicable. this is a feature PR rather than a current-main bug report. Source inspection shows current main still uses the native prompt-only path, and the PR screenshots show the proposed inline behavior. Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Merge only after maintainer signoff accepts the inline approval boundary, exact allow-rule persistence, legacy exec-policy round-trip behavior, and final green validation. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a feature PR rather than a current-main bug report. Source inspection shows current main still uses the native prompt-only path, and the PR screenshots show the proposed inline behavior. Is this the best way to solve the issue? Yes with maintainer approval: session-key threading, native-chat routing only when available, timeout expiry, and native fallback are a maintainable path. The remaining question is maintainer acceptance of the command-approval UX and policy compatibility contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9f4d23804122. Label changesLabel justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
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 re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Maintainer note: this is a substantial exec-approval UI flow and it is currently conflicting. Given the size and the security boundary involved, I don't think this is safe to resolve opportunistically during triage. Please rebase on current |
Route local exec approval prompts into the active chat timeline when session context is available, including allow-once, always-allow, deny, resolved-state stamping, and local prompt cancellation handling. Preserve native prompt fallback for requests without chat context. Thread session keys through node.invoke request/event paths and system.run approvals while preserving trusted envelope metadata over command args. Keep legacy policy compatibility by accepting ask/prompt/numeric action values and preserving stable ChatPermissionDecision enum values. Update the permissions UI to use canonical prompt actions, upsert exact duplicate command patterns, safely coalesce duplicate loaded rules without changing first-match semantics, and refresh localized approval copy for allow-once versus always-allow behavior. Add regression coverage for inline approval decisions, session-key propagation, duplicate policy rule handling, legacy policy deserialization, enum stability, and action-button fallback behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep Permissions editing the same exec policy enforced by the node, preserve policy fields, add pending approval notifications, and make inline approvals expire with the gateway timeout. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove a duplicate Show() call introduced while hardening the inline exec approval tray chat flow. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
5537a3f to
ae301c0
Compare
Summary
This PR routes local
system.runexec-approval prompts into the native chat timeline when an interactive native chat surface is available, while preserving the native approval dialog as the fallback when chat is not visible/available.Key behavior:
exec-policy.jsonwhen the command can be safely represented exactly.agent:main:main; raw keys are kept only for routing.Policy and compatibility fixes
node.invokeandsystem.runapproval paths so local prompts can route to the correct chat session.prompt, legacyask, and numeric enum action values.ChatPermissionDecisionenum values.exec-policy.jsonpath thatNodeServiceenforces, including isolatedOPENCLAW_TRAY_DATA_DIRruns.shells,description,enabled) on explicit save.enabled: trueon save while preservingenabled: false.promptrules/defaults show approval UI.Review-driven fixes addressed
Proof screenshots
Type of (cut-off) UI that moved inline into chat history:
Existing inline approval style for comparison:
Resulting inline approval UI:
After clicking Deny once:
After clicking Allow once:
After clicking Always allow:
Then subsequent matching requests do not require re-approval:
Permissions rule action dropdown fix:
Testing and review
Latest validation:
./build.ps1passed.dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restorepassed (2374 passed, 29 skipped).dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restorepassed (1149 passed).LocalizationValidationTestspassed; new resource keys are present across supported locales with placeholder parity.Manual testing performed with an isolated data directory:
exec-policy.jsonenforced by the node.promptpolicy triggers inline approval fortasklist.Review notes:
codexCLI is not installed in this environment; the run reported no accepted/actionable findings.