Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Update Assistant action settings guidance

rcourtmanf5a59661fe67
diff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.md
index c3da28372e..9ca2e74dce 100644
--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md
+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md
@@ -135,6 +135,10 @@ runtime cost control, and shared AI transport surfaces.
`ActionPlan.Preflight` dry-run boundary through
`internal/ai/tools/action_audit.go` rather than leaving dry-run availability
as chat-only text.
+ When the shared registry blocks a control tool in read-only mode, its
+ operator guidance must point to Assistant & Patrol settings and the Pulse
+ Assistant Permissions Control mode, not legacy Pulse Assistant settings
+ paths.
9. Keep self-hosted Patrol messaging aligned with the v6 GA product contract:
ordinary self-hosted installs use BYOK or local providers, and the runtime
must not surface retired managed-model credits, trial prompts, account-backed
diff --git a/internal/ai/tools/executor_setters_test.go b/internal/ai/tools/executor_setters_test.go
index cf4fddeb90..9abdb0afe1 100644
--- a/internal/ai/tools/executor_setters_test.go
+++ b/internal/ai/tools/executor_setters_test.go
@@ -210,6 +210,30 @@ func TestToolRegistry_ListTools(t *testing.T) {
assert.Equal(t, "hidden in read-only mode; approval required in controlled mode", governance[1].ApprovalPolicy)
}
+func TestToolRegistry_ExecuteControlToolReadOnlyUsesAssistantAndPatrolGuidance(t *testing.T) {
+ registry := NewToolRegistry()
+ registry.Register(RegisteredTool{
+ Definition: Tool{Name: "control"},
+ RequireControl: true,
+ Handler: func(ctx context.Context, e *PulseToolExecutor, args map[string]interface{}) (CallToolResult, error) {
+ t.Fatal("control handler should not run in read-only mode")
+ return NewTextResult("unexpected"), nil
+ },
+ })
+
+ exec := NewPulseToolExecutor(ExecutorConfig{})
+ exec.SetControlLevel(ControlLevelReadOnly)
+
+ result, err := registry.Execute(context.Background(), exec, "control", nil)
+ require.NoError(t, err)
+ require.Len(t, result.Content, 1)
+ text := result.Content[0].Text
+ assert.Equal(t, assistantControlToolsDisabledMessage, text)
+ assert.Contains(t, text, "Assistant & Patrol settings")
+ assert.Contains(t, text, "Pulse Assistant Permissions > Control mode")
+ assert.NotContains(t, text, "Settings > Pulse Assistant")
+}
+
func containsTool(tools []Tool, name string) bool {
for _, tool := range tools {
if tool.Name == name {
diff --git a/internal/ai/tools/registry.go b/internal/ai/tools/registry.go
index 404cc0548e..7749dd8608 100644
--- a/internal/ai/tools/registry.go
+++ b/internal/ai/tools/registry.go
@@ -15,6 +15,8 @@ const (
ToolActionWrite ToolActionMode = "write"
)
+const assistantControlToolsDisabledMessage = "Control tools are disabled. Open Assistant & Patrol settings, then set Pulse Assistant Permissions > Control mode to Controlled before using action tools."
+
// ToolGovernance records the operator-facing governance contract for a tool.
type ToolGovernance struct {
ActionMode ToolActionMode
@@ -149,7 +151,7 @@ func (r *ToolRegistry) Execute(ctx context.Context, e *PulseToolExecutor, name s
// Centralized control level check
if tool.RequireControl {
if e.controlLevel == ControlLevelReadOnly || e.controlLevel == "" {
- return NewTextResult("Control tools are disabled. Enable them in Settings > Pulse Assistant > Control Level."), nil
+ return NewTextResult(assistantControlToolsDisabledMessage), nil
}
}