Method StopAsync
- Namespace
- MailFathom.Application.Agent.Conversations
- Assembly
- MailFathom.Application.dll
StopAsync(AgentConversationId, UserId, AgentMessageId, CancellationToken)
Ends the answer being composed where it stands, and has the agent say so.
public Task<AgentRunStopping> StopAsync(AgentConversationId conversation, UserId user, AgentMessageId run, CancellationToken cancellationToken)
Parameters
conversationAgentConversationIdThe conversation holding the answer.
userUserIdThe person stopping it.
runAgentMessageIdThe answer to stop.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task<AgentRunStopping>
Whether the answer was stopped here, was not running, or this person holds no such conversation.
Remarks
Nothing is rolled back: every block, source, and proposal already written stays, the answer ends as stopped, and the agent writes a line of its own saying so and asking where to pick it up. The line is a turn rather than a mark on the answer, because it is the agent speaking about the run rather than part of what the run composed.
The ending is a condition on the conversation's row, so it lands on whichever replica this request reached and the run meets it as a refused write wherever it is executing. The ending and the note are written together, in places a full conversation keeps for them, so neither is ever written without the other.