Table of Contents

Class AgentConversationEntry

Namespace
MailFathom.Application.Agent.Conversations
Assembly
MailFathom.Application.dll

One thing that happened in a conversation, named against it and placed in its order.

[JsonPolymorphic(TypeDiscriminatorPropertyName = "entry")]
[JsonDerivedType(typeof(AgentMessageWritten), "message")]
[JsonDerivedType(typeof(AgentAnswerStarted), "answerStarted")]
[JsonDerivedType(typeof(AgentStatusReported), "status")]
[JsonDerivedType(typeof(AgentCitationDeclared), "citation")]
[JsonDerivedType(typeof(AgentBlockComposed), "block")]
[JsonDerivedType(typeof(AgentActionProposed), "proposal")]
[JsonDerivedType(typeof(AgentAnswerEnded), "answerEnded")]
[JsonDerivedType(typeof(AgentProposalResolved), "resolution")]
[JsonDerivedType(typeof(AgentToolCalled), "toolCall")]
[JsonDerivedType(typeof(AgentToolAnswered), "toolResult")]
[JsonDerivedType(typeof(AgentModelCharged), "charge")]
[JsonDerivedType(typeof(AgentConversationCompacted), "compaction")]
public abstract record AgentConversationEntry : IEquatable<AgentConversationEntry>
Inheritance
AgentConversationEntry
Implements
Derived
Inherited Members

Remarks

A conversation is written as it happens rather than composed and saved: a question is one entry, the answer opening is another, and every block, source, status line, proposal, and ending after it is one more. The hierarchy is closed by a private protected constructor, so the entries declared beside it are the whole of it and a reader that handles those handles every conversation this build writes.

Every entry carries its place, and the place is the conversation's rather than the answer's. The sequence starts at one, increases by one, and is assigned where the row is written rather than by whatever composed the entry — so a client renders in arrival order without sorting, and one holding a cursor asks for everything after the last sequence it read. That cursor is why an answer survives a lost connection, a second screen of the same person, and the replica composing it going away: ADR 0035 is that decision, and the recovery is a property of this record rather than of any connection.

Most of it is mail-derived and sensitive throughout. A question is somebody's own words, a block quotes their correspondence, a source names the message it was drawn from, and a scope names what they asked about. All of it belongs in these rows and in the response that reads them back, and nowhere else — never in a log line, a span attribute, an exception message, or the signal that says a conversation advanced.

Properties

ComposedInto

Gets the answer this entry is part of, and null where it belongs to no answer being composed.

ConversationId

Gets the conversation this happened in.

EndsTheAnswer

Gets whether this entry ends the answer a run was composing, after which nothing further is written into it.

EntryName

Gets the name this entry is written under, which is the value the type discriminator carries.

History

Gets which of the conversation's two readings this entry belongs to.

OpensTheAnswer

Gets whether this entry opens the answer a run composes, after which that answer is the conversation's.

Sequence

Gets the place this holds in the conversation, counted from one.