.NET: [BREAKING] Rename AgentThread to AgentSession (#3430)

* Rename AgentThread to AgentSession

* Add more renames

* Update readme files

* Revert nullable variable change and further fixes.

* Revert change in header name

* Fix some comments and tests

* Update changelog.

* Address PR feedback.

* Fixing code review comments.

* Fix new errors after merging latest code.
This commit is contained in:
westey
2026-01-26 16:30:25 +00:00
committed by GitHub
Unverified
parent bbe096a764
commit a3a9147e61
223 changed files with 2529 additions and 2542 deletions
@@ -24,17 +24,17 @@ internal sealed class ServerFunctionApprovalAgent : DelegatingAIAgent
protected override Task<AgentResponse> RunCoreAsync(
IEnumerable<ChatMessage> messages,
AgentThread? thread = null,
AgentSession? session = null,
AgentRunOptions? options = null,
CancellationToken cancellationToken = default)
{
return this.RunCoreStreamingAsync(messages, thread, options, cancellationToken)
return this.RunCoreStreamingAsync(messages, session, options, cancellationToken)
.ToAgentResponseAsync(cancellationToken);
}
protected override async IAsyncEnumerable<AgentResponseUpdate> RunCoreStreamingAsync(
IEnumerable<ChatMessage> messages,
AgentThread? thread = null,
AgentSession? session = null,
AgentRunOptions? options = null,
[EnumeratorCancellation] CancellationToken cancellationToken = default)
{
@@ -43,7 +43,7 @@ internal sealed class ServerFunctionApprovalAgent : DelegatingAIAgent
// Run the inner agent and intercept any approval requests
await foreach (var update in this.InnerAgent.RunStreamingAsync(
processedMessages, thread, options, cancellationToken).ConfigureAwait(false))
processedMessages, session, options, cancellationToken).ConfigureAwait(false))
{
yield return ProcessOutgoingApprovalRequests(update, this._jsonSerializerOptions);
}