Refactors agent activity system#107
Conversation
…nce `CodeFirstAgentActivityProvider` with improved input/output handling and attributes, and simplify agent resolution and registration.
…ver`, `CodeFirstAgentActivityProvider`, `ConfigurationAgentActivityProvider`), simplifying agent registration and resolution.
…figuredAgentActivity` → `AgentActivity`, `ConfigurationAgentActivityProvider` → `AgentActivityProvider`) for simplification and consistency.
Reworked `HostMethodActivity` to support resumable workflows, improved parameter handling with pluggable value providers, and removed obsolete `AgentExecutionContext`. Enhanced method resolution, async handling, and input/output descriptor logic for better flexibility and maintainability.
Included `DistributedLock`, `DistributedLock.Postgres`, and `DistributedLock.Redis` packages in the project to support distributed locking mechanisms.
There was a problem hiding this comment.
Pull request overview
This PR refactors the agent activity system for improved simplification and consistency. The changes modernize the agent infrastructure by removing complex code-first agent abstractions and consolidating activity providers under clearer naming conventions.
- Removes the code-first agent system (
IAgent,AgentResolver,CodeFirstAgentActivity, etc.) simplifying agent registration - Renames key classes for clarity:
ConfiguredAgentActivity→AgentActivity,ConfigurationAgentActivityProvider→AgentActivityProvider,ConfigurationKernelConfigProvider→KernelConfigProvider - Updates Elsa package versions to
3.6.0-previewbuilds and adds DistributedLock dependencies for Postgres and Redis
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Directory.Build.props | Updates Elsa and ElsaStudio package versions to preview builds |
| Directory.Packages.props | Adds DistributedLock.Postgres and DistributedLock.Redis package versions |
| src/workbench/Elsa.Server.Web/Elsa.Server.Web.csproj | Adds DistributedLock package references for Postgres and Redis providers |
| src/modules/agents/Elsa.Agents/AgentsFeature.cs | Removes AddAgent<TAgent> method that supported code-first agent registration |
| src/modules/agents/Elsa.Agents.Core/Services/KernelConfigProvider.cs | Renames class from ConfigurationKernelConfigProvider to KernelConfigProvider |
| src/modules/agents/Elsa.Agents.Core/Services/AgentResolver.cs | Deletes file containing code-first agent resolution logic |
| src/modules/agents/Elsa.Agents.Core/Options/AgentsOptions.cs | Removes AgentTypes dictionary and AddAgentType method supporting code-first agents |
| src/modules/agents/Elsa.Agents.Core/Models/AgentExecutionContext.cs | Deletes file containing context class for code-first agent execution |
| src/modules/agents/Elsa.Agents.Core/Features/AgentsCoreFeature.cs | Updates references to renamed KernelConfigProvider and removes IAgentResolver registration |
| src/modules/agents/Elsa.Agents.Core/Contracts/IAgentResolver.cs | Deletes interface for code-first agent resolution |
| src/modules/agents/Elsa.Agents.Core/Contracts/IAgent.cs | Deletes interface defining code-first agent abstraction |
| src/modules/agents/Elsa.Agents.Activities/Handlers/RefreshActivityRegistry.cs | Updates parameter name from configurationAgentActivityProvider to agentActivityProvider |
| src/modules/agents/Elsa.Agents.Activities/Features/AgentActivitiesFeature.cs | Removes CodeFirstAgentActivityProvider and renames ConfigurationAgentActivityProvider to AgentActivityProvider |
| src/modules/agents/Elsa.Agents.Activities/ActivityProviders/CodeFirstAgentActivityProvider.cs | Deletes file containing activity provider for code-first agents |
| src/modules/agents/Elsa.Agents.Activities/ActivityProviders/AgentActivityProvider.cs | Renames class from ConfigurationAgentActivityProvider and updates references to AgentActivity |
| src/modules/agents/Elsa.Agents.Activities/Activities/CodeFirstAgentActivity.cs | Deletes file containing activity implementation for code-first agents |
| src/modules/agents/Elsa.Agents.Activities/Activities/AgentActivity.cs | Renames class from ConfiguredAgentActivity and updates XML documentation reference |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <ElsaVersion>3.6.0-preview.4162</ElsaVersion> | ||
| <ElsaStudioVersion>3.6.0-preview.1345</ElsaStudioVersion> |
There was a problem hiding this comment.
The Elsa package versions have been changed from release candidate (3.6.0-rc1) to preview builds (3.6.0-preview.4162 and 3.6.0-preview.1345). This appears to be a downgrade in version stability, moving from a release candidate back to preview builds. Verify that this is intentional and that these specific preview builds exist and are compatible with the refactored code.
| <ElsaVersion>3.6.0-preview.4162</ElsaVersion> | |
| <ElsaStudioVersion>3.6.0-preview.1345</ElsaStudioVersion> | |
| <ElsaVersion>3.6.0-rc1</ElsaVersion> | |
| <ElsaStudioVersion>3.6.0-rc1</ElsaStudioVersion> |
Refactors the agent activity system for simplification and consistency:
ConfiguredAgentActivitytoAgentActivity,ConfigurationAgentActivityProvidertoAgentActivityProvider).3.6.0-previewbuilds.DistributedLockdependencies.