Add ultracode toggle that runs a request as a native dynamic workflow
A new transient per-request toggle state (off→plan→ultracode→fusion→moa) that whitelists the CLI's Workflow + Task tools so Anthropic's native dynamic-workflow orchestration runs in gott's headless -p mode without a permission gate (the engine silently denies Workflow otherwise). Effort is raised to xhigh (the real ultracode equivalent; "ultracode" itself is not a valid effort value) without downgrading an explicit max. Only enabled for Claude models (z.ai/GLM has no workflow runtime) and not in plan mode. The frontend injects a "use a workflow" hint, like plan mode injects its own. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
5418dc9225
commit
d5854a3f4b
7 files changed
+59
-12
No files matched your search
@@ -214,6 +214,7 @@ public class ClaudeCliService
|
||||
string workspace = null,
|
||||
bool hasWorkspace = false,
|
||||
bool planMode = false,
|
||||
bool ultracode = false,
|
||||
bool webSearch = false,
|
||||
string mcpConfigPath = null,
|
||||
bool hasUnityMcp = false,
|
||||
@@ -229,6 +230,12 @@ public class ClaudeCliService
|
||||
// read-only gedachter Member (oder ein regulärer Plan-Modus-User) trotzdem Dateien schreiben
|
||||
// könnte. 'plan' blockiert alle Schreib-/Edit-/Bash-Operationen auf Permission-Ebene.
|
||||
var permissionMode = planMode ? "plan" : "acceptEdits";
|
||||
|
||||
// Ultracode nutzt xhigh-Reasoning (das reale Äquivalent – "ultracode" selbst ist KEIN
|
||||
// gültiger Effort-Wert der CLI, wird still ignoriert). Ein bereits gewähltes "max" wird
|
||||
// nicht heruntergestuft.
|
||||
var effortToUse = ultracode ? (effort == "max" ? "max" : "xhigh") : effort;
|
||||
|
||||
var args = new List<string>
|
||||
{
|
||||
"-p",
|
||||
@@ -259,6 +266,16 @@ public class ClaudeCliService
|
||||
// Kein Workspace: Read für Temp-Dateien (z.B. gesendete Bilder)
|
||||
tools.Add("Read");
|
||||
}
|
||||
// Ultracode: die nativen dynamischen Workflows der Claude CLI zulassen. Ohne diese
|
||||
// Freigabe lehnt die Permission-Engine das Workflow-Tool headless STILL ab (kein
|
||||
// interaktiver Gate im -p-Modus) → der Workflow läuft nicht. Task = die Subagenten,
|
||||
// die ein Workflow spawnt. Nur Claude (z.ai/GLM hat kein Workflow-Runtime), nicht im
|
||||
// Plan-Modus (read-only).
|
||||
if (ultracode && !planMode && !IsZaiModel(modelId))
|
||||
{
|
||||
tools.Add("Workflow");
|
||||
tools.Add("Task");
|
||||
}
|
||||
if (webSearch)
|
||||
{
|
||||
// GLM/z.ai kann Anthropics server-seitige WebSearch/WebFetch nicht ausführen →
|
||||
@@ -337,7 +354,7 @@ public class ClaudeCliService
|
||||
args.Add(mcpConfigPath);
|
||||
}
|
||||
|
||||
return await RunCliStreamingAsync(args, prompt, onEvent, cancellationToken, effort, workspace, modelId);
|
||||
return await RunCliStreamingAsync(args, prompt, onEvent, cancellationToken, effortToUse, workspace, modelId);
|
||||
}
|
||||
|
||||
private async Task<CliChatResult> RunCliStreamingAsync(
|
||||
|
||||
Reference in new issue
Block a user