Class RedbApprovalStore
REDB-backed . One
row per decision; the approval id lives in _objects.value_string
(partial index on PostgreSQL/SQLite; MSSQL cannot index NVARCHAR(MAX)) and,
normalized, in _objects._value_unique — one approval id resolves to
exactly one recorded decision, first wins.
The store does not own an instance — each call
resolves one through IRouteContext.GetRedbService(name, exchange),
which honours the per-exchange scope cache. The redb name is read from
exchange.Properties[LlmKeys.RedbName] (set by the LLM endpoint URI),
falling back to the constructor-supplied default name and then to the host's
default unnamed instance.
public sealed class RedbApprovalStore : IApprovalStore
Inheritance
Implements
Methods
FindAsync(string, IExchange?, CancellationToken)
Looks up the previously-recorded decision for approvalId.
public Task<ApprovalRecord?> FindAsync(string approvalId, IExchange? exchange = null, CancellationToken ct = default)
RecordAsync(ApprovalRequest, ApprovalDecision, IExchange?, CancellationToken)
Records a decision against the pending request.
public Task RecordAsync(ApprovalRequest request, ApprovalDecision decision, IExchange? exchange = null, CancellationToken ct = default)
Constructors
RedbApprovalStore(IRouteContext, string?)
Creates the store. Scheme is synced by the host's redb.InitializeAsync().