From 1d2248a56bd05efacd21bade491651735f63d026 Mon Sep 17 00:00:00 2001 From: Onur Gumus Date: Sun, 15 Feb 2026 16:22:48 +0100 Subject: [PATCH 1/2] Update to Microsoft.Agents.AI 260212.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - AgentThread removed → use CreateSessionAsync/AgentSession - RunAsync signature: added AgentRunOptions and CancellationToken params - InProcessExecution.RunAsync: use Lockstep environment, added runId and CT params - Run changed from IDisposable to IAsyncDisposable - Bump Microsoft.Extensions.AI.Abstractions from 10.2.0 to 10.3.0 Co-Authored-By: Claude Opus 4.6 --- src/AgentNet.Interop/AgentNet.Interop.csproj | 2 +- src/AgentNet.Tests/AgentNet.Tests.fsproj | 2 +- src/AgentNet/AgentFramework.fs | 8 +++++--- src/AgentNet/AgentNet.fsproj | 6 +++--- src/AgentNet/Workflow.InProcess.fs | 12 +++++++----- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/AgentNet.Interop/AgentNet.Interop.csproj b/src/AgentNet.Interop/AgentNet.Interop.csproj index 122ebb7..0814040 100644 --- a/src/AgentNet.Interop/AgentNet.Interop.csproj +++ b/src/AgentNet.Interop/AgentNet.Interop.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/AgentNet.Tests/AgentNet.Tests.fsproj b/src/AgentNet.Tests/AgentNet.Tests.fsproj index 5db3c44..f791b86 100644 --- a/src/AgentNet.Tests/AgentNet.Tests.fsproj +++ b/src/AgentNet.Tests/AgentNet.Tests.fsproj @@ -21,7 +21,7 @@ - + diff --git a/src/AgentNet/AgentFramework.fs b/src/AgentNet/AgentFramework.fs index a741bd9..0dca09e 100644 --- a/src/AgentNet/AgentFramework.fs +++ b/src/AgentNet/AgentFramework.fs @@ -1,6 +1,7 @@ namespace AgentNet open System.Collections.Generic +open System.Threading open Microsoft.Agents.AI open Microsoft.Extensions.AI @@ -40,16 +41,17 @@ module MAF = /// Builds a fully functional ChatAgent from config and chat client let build (chatClient: IChatClient) (config: ChatAgentConfig) : ChatAgent = let mafAgent = createAgent chatClient config - let thread = mafAgent.GetNewThread() { Config = config Chat = fun message -> task { - let! response = mafAgent.RunAsync(message, thread) + let! session = mafAgent.CreateSessionAsync(CancellationToken.None) + let! response = mafAgent.RunAsync(message, session, null, CancellationToken.None) return response.Text } ChatFull = fun message -> task { - let! response = mafAgent.RunAsync(message, thread) + let! session = mafAgent.CreateSessionAsync(CancellationToken.None) + let! response = mafAgent.RunAsync(message, session, null, CancellationToken.None) // Return the user message and assistant response let messages : AgentNet.ChatMessage list = [ { Role = AgentNet.ChatRole.User; Content = message } diff --git a/src/AgentNet/AgentNet.fsproj b/src/AgentNet/AgentNet.fsproj index da64eab..02d7561 100644 --- a/src/AgentNet/AgentNet.fsproj +++ b/src/AgentNet/AgentNet.fsproj @@ -40,9 +40,9 @@ - - - + + + diff --git a/src/AgentNet/Workflow.InProcess.fs b/src/AgentNet/Workflow.InProcess.fs index 549a0a7..c35d12f 100644 --- a/src/AgentNet/Workflow.InProcess.fs +++ b/src/AgentNet/Workflow.InProcess.fs @@ -963,8 +963,7 @@ module Workflow = let mafWorkflow = toMAF workflow // Run via InProcessExecution - let! run = MAFInProcessExecution.RunAsync(mafWorkflow, input :> obj) - use _ = run + let! run = MAFInProcessExecution.Lockstep.RunAsync(mafWorkflow, input :> obj, null, System.Threading.CancellationToken.None) // Find the last ExecutorCompletedEvent - it should be the workflow output let mutable lastResult: obj option = None @@ -974,6 +973,8 @@ module Workflow = lastResult <- Some completed.Data | _ -> () + do! run.DisposeAsync() + match lastResult with | Some data -> return convertToOutput<'output> data | None -> return failwith "Workflow did not produce output. No ExecutorCompletedEvent found." @@ -985,9 +986,8 @@ module Workflow = let tryRun<'input, 'output, 'error> (input: 'input) (workflow: WorkflowDef<'input, 'output, 'error>) : Task> = task { let mafWorkflow = toMAF workflow - let! run = MAFInProcessExecution.RunAsync(mafWorkflow, input :> obj) - use _ = run - + let! run = MAFInProcessExecution.Lockstep.RunAsync(mafWorkflow, input :> obj, null, System.Threading.CancellationToken.None) + let mutable completed = None let mutable earlyExit = None @@ -1001,6 +1001,8 @@ module Workflow = | _ -> () + do! run.DisposeAsync() + match completed, earlyExit with | _, Some error -> return Error (unbox<'error> error) From ba15094be2bca1bb7cda46cd4a1836591b5c3dd4 Mon Sep 17 00:00:00 2001 From: Onur Gumus Date: Sun, 15 Feb 2026 16:30:17 +0100 Subject: [PATCH 2/2] Rename package to AgentNet.Unofficial for nuget.org publish Co-Authored-By: Claude Opus 4.6 --- src/AgentNet/AgentNet.fsproj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/AgentNet/AgentNet.fsproj b/src/AgentNet/AgentNet.fsproj index 02d7561..27b4f4e 100644 --- a/src/AgentNet/AgentNet.fsproj +++ b/src/AgentNet/AgentNet.fsproj @@ -8,14 +8,14 @@ - AgentNet - 1.0.0-alpha.3 - Jordan Marr - A beautiful F# library for building AI agents on .NET. Wraps Microsoft Agent Framework with idiomatic F# APIs using quotation-based tools, pipeline-style agents, and computation expression workflows. + AgentNet.Unofficial + 1.0.0-alpha.4 + Jordan Marr;Onur Gumus + Unofficial fork of AgentNet updated for Microsoft.Agents.AI 260212.1. An F# library for building AI agents on .NET, wrapping Microsoft Agent Framework with idiomatic F# APIs. fsharp;ai;agents;llm;microsoft-agent-framework;workflows MIT - https://github.com/JordanMarr/Agent.NET - https://github.com/JordanMarr/Agent.NET + https://github.com/OnurGumus/Agent.NET + https://github.com/OnurGumus/Agent.NET git README.md