mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-24 20:52:51 +00:00
refactor(ai): convert patrol to agentic tool-based execution
- Replace output-parsing approach with tool-based finding creation - PatrolService now uses runAIAnalysis with proper scope handling - Add tool event streaming (tool_start, tool_end) to patrol events - Expose GetExecutor() on chat.Service for patrol integration - Remove regex-based finding extraction in favor of patrol tools The patrol now uses the same agentic loop as chat, with the LLM calling patrol_report_finding to create findings rather than outputting JSON that gets parsed. This is more reliable and consistent with the tool model.
This commit is contained in:
@@ -798,6 +798,14 @@ func (s *Service) GetBaseURL() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// GetExecutor returns the underlying tool executor so callers (e.g. patrol)
|
||||
// can set session-scoped state like the PatrolFindingCreator before executing.
|
||||
func (s *Service) GetExecutor() *tools.PulseToolExecutor {
|
||||
s.mu.RLock()
|
||||
defer s.mu.RUnlock()
|
||||
return s.executor
|
||||
}
|
||||
|
||||
// Provider setter methods
|
||||
|
||||
func (s *Service) SetAlertProvider(provider MCPAlertProvider) {
|
||||
|
||||
+559
-1227
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user