Automatisierungsvorschlaege nur mit n8n-Anbindung (#726)

An instance without n8n has no use for workflow proposals. New instance
setting automation.enabled ("this instance works with n8n"), off by default:
- off: automation_find/automation_propose refuse, no candidates are put to
  agents, and the escalation tool does not mention proposals at all;
- the switch sits in the settings card for external MCP servers; the
  approvals view says proposals are off instead of standing empty.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard
2026-10-01 20:29:19 +02:00
co-authored by Claude Opus 5.5
parent 184a507e3d
commit a17ac2957f
12 changed files with 124 additions and 4 deletions
@@ -24,7 +24,20 @@ public sealed class EscalationTool : IAgentTool
{
public string Name => CaseDesk.ToolName;
public string Description => """
/// <summary>
/// #726: Whether the instance works with n8n. Only then are agents told about workflow
/// proposals — an instance without n8n has no use for them. Set by the host.
/// </summary>
public Func<bool>? AutomationEnabled { get; set; }
private const string AutomationHint =
"\nRoutine you do the same way again and again may not need a model: automation_find (is there a proposal for it, and why was one rejected?), " +
"then automation_propose (purpose, trigger, tasks it replaces, services, risks, workflow as n8n JSON, test_guide; justification if it runs code). " +
"A human decides and imports it — you never create workflows yourself.";
public string Description => AutomationEnabled?.Invoke() == true ? BaseDescription + AutomationHint : BaseDescription;
private const string BaseDescription = """
Escalate what you cannot decide, and decide what is escalated to you.
- find_decisions: decisions that bind you and answer a question. escalate shows them anyway.
- escalate: you cannot get on and it is not yours to decide. Goes to your lead (or a human). Name the task you are stuck on; it waits for the answer.
@@ -41,7 +54,6 @@ public sealed class EscalationTool : IAgentTool
spot_checks lists the runs picked for you, with what the audit log shows; inspect_run (run) shows one run in full;
check_done (check, verdict ok|finding, note) closes a check. propose_measure (agent, measure, reasoning, check) puts a measure to a human:
sharpen_task, change_model, adjust_rights, suspend — or security, if you suspect the agent is steered from outside.
Routine you do the same way again and again may not need a model: automation_find (is there a proposal for it, and why was one rejected?), then automation_propose (purpose, trigger, tasks it replaces, services, risks, workflow as n8n JSON, test_guide; justification if it runs code). A human decides and imports it — you never create workflows yourself.
As a voter: list_ballots shows the calls you are asked to vote on; cast_vote (vote, choice yes|no, reasoning, evidence) — check against your own data, with source and time. You never see the other votes.
""";
@@ -355,6 +367,8 @@ public sealed class EscalationTool : IAgentTool
{
if (context.Automations is not { } automations)
return ToolResult.Fail("Automation proposals are not available in this instance.");
if (!automations.Enabled)
return ToolResult.Fail(Core.Automation.AutomationProposals.DisabledMessage);
if (Get(input, "action") == "automation_find")
{