Skip to content

feat: add ExecApprovalsCoordinator and ICanPresentEvaluator#471

Merged
shanselman merged 2 commits into
openclaw:masterfrom
AlexAlves87:feat/exec-approvals-coordinator
May 21, 2026
Merged

feat: add ExecApprovalsCoordinator and ICanPresentEvaluator#471
shanselman merged 2 commits into
openclaw:masterfrom
AlexAlves87:feat/exec-approvals-coordinator

Conversation

@AlexAlves87
Copy link
Copy Markdown
Contributor

@AlexAlves87 AlexAlves87 commented May 19, 2026

Summary

Adds ExecApprovalsCoordinator, which implements the full exec approval
pipeline for the Windows port. The previous IExecApprovalV2Handler
implementation was a null stub. This wires the existing building
blocks — validator, normalizer, store, evaluator, and prompt handler —
into the correct two-pass flow: validate, build evaluation context,
first pass, prompt or fallback, second pass, final decision.

What changed

  • ExecApprovalsCoordinator: coordinator implementing IExecApprovalV2Handler
  • ICanPresentEvaluator: interface for the UI availability check, with two stubs for testing
  • ExecApprovalV2Result: InternalError and Allow codes with IsAllow property

Testing

  • dotnet test tests/OpenClaw.Shared.Tests --filter "ExecApproval" — 430 passed
  • 28 new tests covering all decision branches, env injection guard,
    log injection prevention, lock release, and concurrent requests

Notes

Allowlist entry persistence and use recording are stubs — they belong
to the next step. The coordinator is not wired into production in this
change; a test enforces that invariant.

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

AlexAlves87 and others added 2 commits May 20, 2026 01:11
Wires the full two-pass approval pipeline: validate → normalize →
buildContext → evaluate(pass1) → prompt/fallback → evaluate(pass2).
ICanPresentEvaluator keeps the coordinator UI-free and testable without
Win32 APIs. SemaphoreSlim serializes prompt and second pass for
concurrent requests. Allowlist persistence and use recording are stubs.
Coordinator not wired in production; enforced by test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ected exceptions

Without an outer catch, exceptions from ResolveReadOnly, CanPresent,
FallbackDecision, or an out-of-range prompt outcome escaped HandleAsync
untyped, breaking the fail-closed contract. Any unhandled exception now
returns InternalError("unexpected-exception") with an Error-level log
instead of propagating to the caller. Regression test added.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@shanselman shanselman merged commit 12416d2 into openclaw:master May 21, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants