feat: add ExecApprovalsCoordinator and ICanPresentEvaluator#471
Merged
shanselman merged 2 commits intoMay 21, 2026
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
ExecApprovalsCoordinator, which implements the full exec approvalpipeline for the Windows port. The previous
IExecApprovalV2Handlerimplementation 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 implementingIExecApprovalV2HandlerICanPresentEvaluator: interface for the UI availability check, with two stubs for testingExecApprovalV2Result:InternalErrorandAllowcodes withIsAllowpropertyTesting
dotnet test tests/OpenClaw.Shared.Tests --filter "ExecApproval"— 430 passedlog 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