Commit Graph

12 Commits

  • .NET: Fix off-thread RunStatus race where GetStatusAsync can return Running after ResumeAsync halts (#5412)
    * Fix off-thread RunStatus race where GetStatusAsync can return Running after ResumeAsync halts
    
    * Apply suggestion from @Copilot
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
    
    * Simplify test comment.
    
    ---------
    
    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
  • .NET: fix: Add session support for Handoff-hosted Agents (#5280)
    * fix: Add session support for Handoff-hosted Agents
    
    In order to better support using `Workflows` hosted as `AIAgents` inside of Handoff workflows, we need to make proper use of AgentSession. This causes potential issues around checkpointing and making sure that we properly compute only the new incoming messages for each agent invocation.
    
    * fix: AgentSession checkpointing using AIAgent's Serialize/Deserialize methods
    
    We cannot rely on implicit serialization through `HandoffHostState` because we are missing type information.
    
    * fix: Thread safety issue in `MultiPartyConversation.AllMessages`
    
    * fix: Enable unwrapping of FunctionResultContent when ExternalRequest was wrapped into FunctionCallContent
  • [BREAKING] .NET: Decouple Checkpointing from Run/StreamAsync APIs (#4037)
    * [BREAKING] refactor: Decouple Checkpointing and Execution APIs
    
    With this change, Checkpointing becomes an property of an IWorkflowExecutionEnvironment. This lets environments that are tightly-coupled to their CheckpointManager avoid needing to present APIs that would not work (e.g. taking in an InMemory CheckpointManager for Durable Tasks, for example)
    
    * refactor: Normalize IsCheckpointingEnabled naming
  • .NET: Add tests for subworkflow shared state behavior (#3444)
    Adds tests documenting current shared state behavior in subworkflows:
    
    - State works correctly within a subworkflow
    
    - State is isolated across parent/subworkflow boundaries
    
    Related to #2419
  • .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.
  • fix: Subworkflows do not work well with HostAsAgent (#3240)
    Subworkflows run into issues with Checkpointing and the Chat Protocol:
    
    * The concurrency rework made subtle changes in behaviour that introduced a hang when using subworkflows with ChatProtocol and streaming execution.
    * The ResetAsync() implementation in WorkflowHostExecutor was improperly resetting the joinContext - this was happening on restore checkpoint _after_ the join context was attached when
    * Subworkflows cannot be used as the start node when hosted AsAgent due to inability to treat Catch-All as a Chat Protocol
    * Subworkflow ownership issue when used in non-concurrent mode after finishing a run
    
    Also fixes:
    * When ChatMessages are output by executors that are not agents, there is no corresponding AgentResponseUpdate/AgentResponse event
    
    Breaking Changes
    * [BREAKING CHANGE] It is possible to provide the wrong RunId when resuming from CheckpointInfo (even though the data already exists on CheckpointInfo)
  • .NET: [BREAKING] Unify ExecutorIsh and ExecutorRegistration, unify/simplify APIs (#1637)
    * refactor: Unify ExecutorIsh and ExecutorRegistration => ExecutorBinding
    
    * Switch to more modern Record type-tree for Sum Types
    * Unify APIs for getting ExecutorBinding
    * Fix an issue where workflows consisting entirely of cross-run shareable executors which are not instance-resettable do not properly clear state when running non-concurrently.
    
    * feat: Simplify function-to-executor pattern
    
    * refactor: Normalize API naming
  • fix: .NET: Concurrency Support for Orchestrations (#1689)
    Concurrent run support was recently added to workflows, but Orchestrations did not fully update to support it. A few executors were missing Cross-Run Shareable annotations, and the ConcurrentEnd executor needed to be factory-instantiated.
    
    This also ports the fix for #1613 from #1637, to avoid waiting on that PR.
  • .NET: [BREAKING] Enable sharing of workflow instances across concurrently executing runs (#1464)
    * 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
  • [BREAKING] .NET: Workflow Off-Thread Execution Mode (#1233)
    * Updates to async run loop.
    
    * fix: Workflow Onwership can be release by nonowner
    
    * fix: Incorrect handling of blockOnPending in StreamingRun
    
    Depending on whether we are running in streaming on non-streaming mode, we may be using the StreamingRun in different ways. Unfortunately, the only place we can really know what is the actual state of execution is in the RunEventStream implementations.
    
    This resulted in blocking where blocking was unneeded and occasionally not-blocking when blocking was needed.
    
    The fix is to move the logic of handling this blocking into RunEventStream implementations.
    
    * fix: Fix cleanup on error and end run
    
    This ensures we clean up the background resources correctly.
    
    * fix: Ensure we let the run loop proceed when shutting down
    
    * fix: Add timeout for Input Waiting
    
    * fix: Make the samples properly clean up `Run`s and `StreamingRun`s
    
    * fix: Simplify Declarative Workflow Run disposal pattern
    
    * Also fixes missing .Disposal() in Integration tests
    
    ---------
    
    Co-authored-by: Ben Thomas <ben.thomas@microsoft.com>
  • .NET: Add support for Subworkflows and many threading fixes (#1066)
    * feat: Add support for Workflow-as-Executor
    
    * Fixes routing of 'object' compile-typed variables to properly take in type information
    * Fixes a concurrency issue in StepTracer
    
    * fix: Make Subworkflow ExternalRequests work properly
    
    * fix: Threading and Concurrency fixes; prep for OffThread Mode
    
    * refactor: Remove dead code around OffStreamRunEventStream
    
    Currently not used, and will be replaced with a rewrite when brought back, so having it in the change is not valuable.
    
    * ci: Work around issues with dotnet-format not properly analyzing the source
    
    * fix: Fix the logic of AsyncCoordinator and AsyncBarrier
    
    * Prevent individual wait cancellations from canceling the entire barrier
    * Propagate information about whether the wait was completed or cancelled, and whether any waiters were present when released
    
    * fix: Remove superfluous acces to .Keys in InProcStepTracer
    
    * refactor: Clean up AsyncCoordinator's use of AsyncBarrier
  • .NET: Rename workflows projects (#975)
    * Renaming Microsoft.Agent.Workflows to Microsoft.Agents.AI.Workflows
    
    * Removing local settings.
    
    * Removing remining old files from merge.