Skip to content

AgentPrismSessionConflictException

Namespace AgentPrism · Assembly AgentPrism.Abstractions.dll

Thrown for the losing request when two concurrent first requests arrive for the same new session id.

public sealed class AgentPrismSessionConflictException : AgentPrismException, ISerializable

objectExceptionAgentPrismExceptionAgentPrismSessionConflictException

ISerializable

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()

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.

Creates a new error.

public AgentPrismSessionConflictException()

AgentPrismSessionConflictException(string)

Section titled “ AgentPrismSessionConflictException(string)”

Creates a new error.

public AgentPrismSessionConflictException(string message)

message string

The error message.

AgentPrismSessionConflictException(string, Exception)

Section titled “ AgentPrismSessionConflictException(string, Exception)”

Creates a new error.

public AgentPrismSessionConflictException(string message, Exception innerException)

message string

The error message.

innerException Exception

The underlying error.

The stable value written to AgentPrismException.ErrorType.

public const string SessionConflictErrorType = "session_conflict"

string

Gets the stable error type name written to the run record.

public override string ErrorType { get; }

string

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.

Gets the id of the conflicting session.

public string? SessionId { get; init; }

string?