Skip to content
Tracon

ToolApprovalPresenterRunner

Namespace Tracon · Assembly Tracon.Core.dll

Calls the registered IToolApprovalPresenter for every pending approval request and turns its fail-open contract into an actual guarantee.

public sealed class ToolApprovalPresenterRunner

objectToolApprovalPresenterRunner

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

This is decoration, not a gate. Unlike IToolAuthorizationHandler and IToolArgumentsValidator, a presenter never blocks a call: a thrown exception, a call that overruns TraconToolOptions.ApprovalPresentationTimeout, or no presenter registered at all all resolve to null — the approval request is published either way, with its raw arguments intact.

Called once per request from both the queue path (AgentRunJobHandler, to populate PendingApproval.Presentation) and the recording path (RunRecordingAgent, to build the closing run event’s payload) — through the SAME resolution, not two separate calls: RunRecordingAgent resolves once and hands the result to TraconRunOptions.BeforePendingApprovalIsPublished.

ToolApprovalPresenterRunner(IToolApprovalPresenter, IOptionsMonitor<TraconOptions>, ILogger<ToolApprovalPresenterRunner>)

Section titled “ ToolApprovalPresenterRunner(IToolApprovalPresenter, IOptionsMonitor<TraconOptions>, ILogger<ToolApprovalPresenterRunner>)”

Calls the registered IToolApprovalPresenter for every pending approval request and turns its fail-open contract into an actual guarantee.

public ToolApprovalPresenterRunner(IToolApprovalPresenter presenter, IOptionsMonitor<TraconOptions> options, ILogger<ToolApprovalPresenterRunner> logger)

presenter IToolApprovalPresenter

options IOptionsMonitor<TraconOptions>

logger ILogger<ToolApprovalPresenterRunner>

This is decoration, not a gate. Unlike IToolAuthorizationHandler and IToolArgumentsValidator, a presenter never blocks a call: a thrown exception, a call that overruns TraconToolOptions.ApprovalPresentationTimeout, or no presenter registered at all all resolve to null — the approval request is published either way, with its raw arguments intact.

Called once per request from both the queue path (AgentRunJobHandler, to populate PendingApproval.Presentation) and the recording path (RunRecordingAgent, to build the closing run event’s payload) — through the SAME resolution, not two separate calls: RunRecordingAgent resolves once and hands the result to TraconRunOptions.BeforePendingApprovalIsPublished.

ResolveAllAsync(IReadOnlyList<ToolApprovalRequestContent>, string, string?, CancellationToken)

Section titled “ ResolveAllAsync(IReadOnlyList<ToolApprovalRequestContent>, string, string?, CancellationToken)”

Resolves a presentation for every request, keyed by RequestId.

public ValueTask<IReadOnlyDictionary<string, ToolApprovalPresentation?>> ResolveAllAsync(IReadOnlyList<ToolApprovalRequestContent> requests, string tenantId, string? agentName, CancellationToken cancellationToken)

requests IReadOnlyList<ToolApprovalRequestContent>

The pending requests found in the run’s response.

tenantId string

The calling tenant.

agentName string?

The agent that made the calls, when known.

cancellationToken CancellationToken

The cancellation token.

ValueTask<IReadOnlyDictionary<string, ToolApprovalPresentation?>>