Sessions¶
An EveSession tracks three independent values:
ContinuationTokensends the next user turn.SessionIdidentifies the durable runtime stream.StreamIndexcounts events already consumed.
Persist state¶
Consume the response before saving the fully advanced cursor:
EveMessageResponse response = await session.SendAsync(
"Create a checklist.",
cancellationToken);
await response.GetOutcomeAsync(cancellationToken);
await SaveAsync(session.State, cancellationToken);
Resume state¶
EveSession resumed = client.CreateSession(savedState);
EveMessageResponse response = await resumed.SendAsync(
"Shorten the checklist.",
cancellationToken);
When only a continuation token was persisted:
Terminal behavior¶
session.waiting preserves the conversation for another turn. By default,
session.completed and session.failed reset the local cursor. Set
PreserveCompletedSessions when completed sessions should remain resumable.