.NET API
SessionRecord
Tracon.Abstractions.dllA stored session.
public sealed record SessionRecord : IEquatable<SessionRecord>Inheritance
Section titled “Inheritance”Implements
Section titled “Implements”Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
Section titled “Constructors”SessionRecord()
Section titled “ SessionRecord()”public SessionRecord()Properties
Section titled “Properties”AgentName
Section titled “ AgentName”The agent the session belongs to.
public required string AgentName { get; init; }Property Value
Section titled “Property Value”CreatedAt
Section titled “ CreatedAt”The creation time (UTC).
public required DateTimeOffset CreatedAt { get; init; }Property Value
Section titled “Property Value”The session identifier.
public required string Id { get; init; }Property Value
Section titled “Property Value”OwnerId
Section titled “ OwnerId”The user the session belongs to, or null when the session is unowned.
public string? OwnerId { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”This is a SECOND, NARROWER boundary drawn UNDER the tenant, not a replacement for it: SessionRecord.TenantId still answers “whose data is this”, and this answers “which user inside that tenant”. Do not confuse it with ISessionStore.GetOwnerTenantIdAsync, whose “owner” is the owning TENANT.
The value is an opaque string with the same meaning IRunAttributionContext.UserId carries, bounded by RunLabels.MaxUserIdLength. Tracon neither resolves nor validates it; the consumer decides what it identifies. It is never read from a request body — a body field naming the owner would let any client write a session under someone else’s name.
null means the session is unowned: every row written before ownership tracking existed, and every row written by an application that leaves TraconSessionOwnershipOptions.Enabled off. An unowned row is never returned by an owner-filtered SessionQuery.OwnerId query; it stays visible to a management listing that applies no owner filter.
Assigned once. A store must not let a later write clear an owner that is already set: the identity that opened a session keeps it, and “set → unset” is never a legitimate transition here. Writing a DIFFERENT owner onto an owned row is equally not a transition Tracon performs — a derived session (a branch, a Responses chain) carries the SOURCE session’s owner, not the caller’s.
The serialized session state. Microsoft Agent Framework’s
SerializeSessionAsync output, treated as opaque.
public required JsonElement State { get; init; }Property Value
Section titled “Property Value”StateMafVersion
Section titled “ StateMafVersion”The Microsoft Agent Framework package version that produced
State.
public string? StateMafVersion { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”null means the row was written before this field existed. Tracon does not promise that a session written by one Microsoft Agent Framework version can be restored by a different one; this value lets a failed restore report exactly which version wrote the state instead of guessing.
StateSchemaVersion
Section titled “ StateSchemaVersion”The Tracon schema generation that wrote State.
public int StateSchemaVersion { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”Every row carries a value; Tracon has stamped this generation on
every session since the very first release, so there is no
“unstamped” era for this field the way there is for
StateMafVersion. It advances only when Tracon
changes how it structures the stored row, never when the Microsoft
Agent Framework version changes.
A record built to be saved does not need to set this — the store stamps the current generation regardless of what the caller provides.
TenantId
Section titled “ TenantId”The tenant identifier.
public string? TenantId { get; init; }Property Value
Section titled “Property Value”UpdatedAt
Section titled “ UpdatedAt”The last-updated time (UTC).
public required DateTimeOffset UpdatedAt { get; init; }Property Value
Section titled “Property Value”Version
Section titled “ Version”The record’s write generation, used for optimistic concurrency.
public long Version { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”A record read from a store carries the stored value; a record built to
be written carries whatever the caller sets, and stores ignore it on
ISessionStore.SaveAsync and
ISessionStore.TryCreateAsync — only
ISessionStore.TryUpdateAsync reads it, through its own
expectedVersion parameter.
The first stored version is 1. A row written before this field existed reads back as 1 as well, so a session that survives the upgrade takes part in concurrency control from its next write onward.
Methods
Section titled “Methods”Equals(object?)
Section titled “ Equals(object?)”public override bool Equals(object? obj)Parameters
Section titled “Parameters”obj object?
Returns
Section titled “Returns”Equals(SessionRecord?)
Section titled “ Equals(SessionRecord?)”public bool Equals(SessionRecord? other)Parameters
Section titled “Parameters”other SessionRecord?
Returns
Section titled “Returns”GetHashCode()
Section titled “ GetHashCode()”public override int GetHashCode()Returns
Section titled “Returns”ToString()
Section titled “ ToString()”public override string ToString()Returns
Section titled “Returns”Operators
Section titled “Operators”operator ==(SessionRecord?, SessionRecord?)
Section titled “ operator ==(SessionRecord?, SessionRecord?)”public static bool operator ==(SessionRecord? left, SessionRecord? right)Parameters
Section titled “Parameters”left SessionRecord?
right SessionRecord?
Returns
Section titled “Returns”operator !=(SessionRecord?, SessionRecord?)
Section titled “ operator !=(SessionRecord?, SessionRecord?)”public static bool operator !=(SessionRecord? left, SessionRecord? right)Parameters
Section titled “Parameters”left SessionRecord?
right SessionRecord?