Checkpointing is used by the WorkflowHostAgent to be able to support resume from a provided thread. When a CheckpointManager is not specified, we use the InMemoryCheckpointManager and serialize its state into the thread's Serialize()ed JsonElement.
At some point InMemoryCheckpointManager became not serializable, breaking this behaviour. This change restores serializability, and adds a test.
* Improve conformance of OpenAI Responses API serving
* Update dotnet/src/Microsoft.Agents.AI.Hosting.OpenAI/Responses/AgentRunResponseExtensions.cs
Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Update dotnet/src/Microsoft.Agents.AI.Hosting.OpenAI/Responses/AgentRunResponseExtensions.cs
Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Sort packages
* Relax adherence where acceptable
* nit
* PromptCacheKey is not obsolete
* format
---------
Co-authored-by: Stephen Toub <stoub@microsoft.com>
* use extension methods from A2A package for converting between MEAI and A2A model classes.
* Update dotnet/tests/Microsoft.Agents.AI.A2A.UnitTests/A2AAgentTests.cs
Co-authored-by: Stephen Toub <stoub@microsoft.com>
* remove unused using
---------
Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Fix handoff function naming
We don't need the agent's name or a guid in the handoff name... we can just use simple numbering. There's a possibility that someone built an agent with a built-in function tool named "handoff_to_x"; if that turns out to be an issue, we could add back some longer bit of randomness.
* Update dotnet/src/Microsoft.Agents.AI.Workflows/Specialized/HandoffAgentExecutor.cs
---------
Co-authored-by: Chris <66376200+crickman@users.noreply.github.com>
Remove input type checking in favour of explicit `.DescribeProtocolAsync()` flow. Also removes `.AsAgentAsync()` as the validation happens at workflow run time. This makes it easier to use Workflows with DI without resorting to async-over-sync.
* Add support for getting and creating Assistant and Foundry agents with ChatClientAgentOptions
* Fix options cloning and agent creation
* Fix inconsistency
* Add support for mapping more tools and integration tests for ensuring CreateAIAgent works with those tools.
* Add support for additional openai tools with tests.
* Remove special casing for function tools, since it's either not supported yet, or requires a lot of code duplication.
* Removed unused using.
* Fix broken unit tests
* Change integration test to reduce flakiness.
* unit test for using create agent option by constructor
* remove this for prevent duplicate when ChatClientAgentOption and ChatOption has same Instruction
* update unit test for ChatClientAgentOptions
* refactor: remove unused internals
* feat: Execution Mode for sharing a workflow among concurrent runs
* feat: Update WorkflowHostAgent to support concurrent execution
* Also update AsAgent APIs to support injecting a CheckpointManager and an IWorkflowExecutionEnvironment
* fix: Make Read logic consistent in DeclarativeWorkflowContext
WorkflowHostAgent was initially implemented before Checkpointing was available. This meant that in order to support resuming, the WorkflowHostAgent needed to keep the runs around, which broke it when stricter rules about concurrent sharing of workflows during execution were introduced.
This change updates the hosting logic to release the underlying StreamingRun when the RunStreamingAsync or RunAsync are invoked, in favour of keeping the checkpointing information in the WorkflowThread to enable resumption.