Class InMemoryAgentStateStore
- Namespace
- Emissary
- Assembly
- Emissary.dll
Process-local IAgentStateStore — suitable for tests and single-node apps.
public sealed class InMemoryAgentStateStore : IAgentStateStore
- Inheritance
-
InMemoryAgentStateStore
- Implements
- Inherited Members
Methods
DeleteAsync(Guid, CancellationToken)
Removes a suspended run, returning true if this call is the one that removed it and false if it was already gone.
public Task<bool> DeleteAsync(Guid conversationId, CancellationToken cancellationToken = default)
Parameters
conversationIdGuidcancellationTokenCancellationToken
Returns
Remarks
The return value is how a caller claims a run: resuming executes the privileged tool call a human just approved, so two concurrent approvals of the same run must not both proceed. Implementations must make the check-and-remove atomic — one winner, whatever the concurrency.
LoadAsync(Guid, CancellationToken)
Loads a suspended run, or null if none exists for the id.
public Task<SuspendedRun?> LoadAsync(Guid conversationId, CancellationToken cancellationToken = default)
Parameters
conversationIdGuidcancellationTokenCancellationToken
Returns
SaveAsync(SuspendedRun, CancellationToken)
Saves a suspended run, keyed by its conversation id.
public Task SaveAsync(SuspendedRun run, CancellationToken cancellationToken = default)
Parameters
runSuspendedRuncancellationTokenCancellationToken