mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-04-28 11:30:15 +00:00
- Add ExecutePatrolStream method to chat.Service for patrol-specific execution - Create chat_service_adapter.go to bridge chat.Service to ai.ChatServiceProvider - Remove standalone patrol.go and patrol_test.go from chat package - Add PatrolRequest/PatrolResponse types to chat service - Add context injection for recent message context This allows patrol to use an isolated agentic loop with its own system prompt while leveraging the common chat infrastructure.
40 lines
1,004 B
Go
40 lines
1,004 B
Go
package chat
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/rcourtman/pulse-go-rewrite/internal/ai/tools"
|
|
)
|
|
|
|
func TestServiceSettersAndAutonomousMode(t *testing.T) {
|
|
executor := tools.NewPulseToolExecutor(tools.ExecutorConfig{})
|
|
loop := &AgenticLoop{}
|
|
service := &Service{
|
|
executor: executor,
|
|
agenticLoop: loop,
|
|
}
|
|
|
|
service.SetIncidentRecorderProvider(nil)
|
|
service.SetEventCorrelatorProvider(nil)
|
|
service.SetTopologyProvider(nil)
|
|
service.SetKnowledgeStoreProvider(nil)
|
|
|
|
service.SetAutonomousMode(true)
|
|
if !service.autonomousMode {
|
|
t.Fatalf("expected autonomousMode true")
|
|
}
|
|
if !loop.autonomousMode {
|
|
t.Fatalf("expected agentic loop to be autonomous")
|
|
}
|
|
}
|
|
|
|
func TestServiceExecuteCommand_NoExecutor(t *testing.T) {
|
|
service := &Service{}
|
|
_, _, err := service.ExecuteCommand(context.Background(), "ls", "")
|
|
if err == nil {
|
|
t.Fatalf("expected error when executor is unavailable")
|
|
}
|
|
}
|
|
|
|
// TestPatrolServiceSessionLifecycle was removed: it tested the deleted chat/patrol.go bridge.
|