mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-05-09 19:32:24 +00:00
test(ai): keep recovery storage visible through prompt filtering
This commit is contained in:
parent
6e9de3188d
commit
90bef80aa5
1 changed files with 20 additions and 0 deletions
|
|
@ -147,6 +147,26 @@ func TestFilterToolsForPrompt_BroadInfraKeepsStorage(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestFilterToolsForPrompt_RecoveryOnlyKeepsStorage(t *testing.T) {
|
||||
exec := tools.NewPulseToolExecutor(tools.ExecutorConfig{
|
||||
RecoveryPointsProvider: &fakeRecoveryPointsProvider{points: []recovery.RecoveryPoint{{
|
||||
ID: "pve-snapshot:before-upgrade",
|
||||
Provider: recovery.ProviderProxmoxPVE,
|
||||
Kind: recovery.KindSnapshot,
|
||||
Mode: recovery.ModeLocal,
|
||||
Outcome: recovery.OutcomeSuccess,
|
||||
}}},
|
||||
ControlLevel: tools.ControlLevelControlled,
|
||||
})
|
||||
|
||||
svc := &Service{executor: exec}
|
||||
toolsList := svc.filterToolsForPrompt(context.Background(), "list recovery snapshots for guest 100", false, false)
|
||||
set := toolNameSet(toolsList)
|
||||
if !set["pulse_storage"] {
|
||||
t.Fatalf("expected storage tool to be kept when recovery points are the only storage source")
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterToolsForPrompt_AutonomousNonPatrol(t *testing.T) {
|
||||
exec := tools.NewPulseToolExecutor(tools.ExecutorConfig{
|
||||
StateProvider: fakeStateProvider{},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue