PR: Add optional agentId to ruleTrigger for easy filtering on UI#1323
PR: Add optional agentId to ruleTrigger for easy filtering on UI#1323visagang wants to merge 9 commits intoSciSharp:masterfrom
Conversation
Review Summary by QodoAdd optional agentId filtering to rule triggers for UI display
WalkthroughsDescription• Add optional AgentIds property to IRuleTrigger interface for UI filtering • Implement new endpoint to retrieve rule triggers filtered by agent ID • Support backward compatibility with triggers having no agent associations Diagramflowchart LR
A["IRuleTrigger Interface"] -->|"Add AgentIds property"| B["AgentIds: string[]?"]
C["AgentController"] -->|"New endpoint"| D["GET /rule/triggers/{agentId}"]
D -->|"Filter by AgentIds"| E["Filtered RuleViewModel List"]
File Changes1. src/Infrastructure/BotSharp.Abstraction/Rules/IRuleTrigger.cs
|
Code Review by Qodo
1.
|
| public IEnumerable<AgentRuleViewModel> GetRuleTriggers(string agentId) | ||
| { | ||
| var triggers = _services.GetServices<IRuleTrigger>(); | ||
| triggers = triggers.Where(x => x.AgentIds == null || !x.AgentIds.Any() || x.AgentIds.Contains(agentId)); |
There was a problem hiding this comment.
Should remove || !x.AgentIds.Any()
No description provided.