AgentPrismSessionConflictException
AgentPrism.Abstractions.dllThrown for the losing request when two concurrent first requests arrive for the same new session id.
public sealed class AgentPrismSessionConflictException : AgentPrismException, ISerializableInheritance
Section titled “Inheritance”object ← Exception ← AgentPrismException ← AgentPrismSessionConflictException
Implements
Section titled “Implements”Inherited Members
Section titled “Inherited Members”AgentPrismException.ErrorType, Exception.GetBaseException(), Exception.ToString(), Exception.GetType(), Exception.TargetSite, Exception.Message, Exception.Data, Exception.InnerException, Exception.HelpLink, Exception.Source, Exception.HResult, Exception.StackTrace, object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”while creating a new session,
AgentSessionManager.GetOrCreateSessionAsync attempts an atomic insert
through ISessionStore.TryCreateAsync. When a concurrent second request
for the same id loses that attempt, it cannot know whether the winner’s chat
history provider has produced its conversation id yet — that id is produced
only while the winner’s first turn runs. Had the loser run its own turn anyway,
it would have produced its own conversation id and the following save would have
silently overwritten the winner’s state; that was the actual defect. So the loser
gets an explicit conflict error instead; a retry takes the normal (race-free)
path and finds the winner’s record already in place.
Constructors
Section titled “Constructors”AgentPrismSessionConflictException()
Section titled “ AgentPrismSessionConflictException()”Creates a new error.
public AgentPrismSessionConflictException()AgentPrismSessionConflictException(string)
Section titled “ AgentPrismSessionConflictException(string)”Creates a new error.
public AgentPrismSessionConflictException(string message)Parameters
Section titled “Parameters”message string
The error message.
AgentPrismSessionConflictException(string, Exception)
Section titled “ AgentPrismSessionConflictException(string, Exception)”Creates a new error.
public AgentPrismSessionConflictException(string message, Exception innerException)Parameters
Section titled “Parameters”message string
The error message.
innerException Exception
The underlying error.
Fields
Section titled “Fields”SessionConflictErrorType
Section titled “ SessionConflictErrorType”The stable value written to AgentPrismException.ErrorType.
public const string SessionConflictErrorType = "session_conflict"Field Value
Section titled “Field Value”Properties
Section titled “Properties”ErrorType
Section titled “ ErrorType”Gets the stable error type name written to the run record.
public override string ErrorType { get; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”Defaults to the full name of the exception type, so today’s behaviour does
not change. A derived type overrides this member when the record has to be
machine readable — for example AgentPrismContentFilteredException
writes content_filtered. Reports and alert rules can rely on this
stable name instead of an assembly name.
The value is written to RunError.Type and carries no secret.
SessionId
Section titled “ SessionId”Gets the id of the conflicting session.
public string? SessionId { get; init; }