Windows Shell-Ausführung: Temp-Script statt stdin/ShellArguments, background_execute Tool, konfigurierbarer Timeout

Execute-Tools (execute, background_execute, SessionEndpoint.HandleExec):
- Windows: Befehl in temp .cmd-Datei statt cmd.exe stdin (interaktiver Modus,
  &-Parsing, Mehr?-Prompt) oder ShellArguments (falsches \"-Escaping für cmd.exe)
- Linux: weiterhin stdin an /bin/bash (funktioniert zuverlässig)
- Script-Cleanup in allen Codepfaden (Success, Timeout, Error)

Neues Tool background_execute:
- Startet Prozesse losgelöst ohne Warten, gibt PID zurück
- Temp-Script-Ansatz: funktioniert auch mit mehrzeiligen Befehlen
- Windows: .cmd mit del "%~f0" (Selbstlöschung)
- Linux: .sh mit rm -f (Selbstlöschung)

Konfigurierbarer Execute-Timeout:
- Neues Server-Setting ExecuteTimeout (Default: 180s)
- IConfiguration in ToolService injected
- Tool-Description zeigt aktuellen Timeout dynamisch an

SessionEndpoint.HandleExec (foreground):
- Pipe-Deadlock-Fix: ReadToEndAsync vor WaitForExitAsync
- Gleicher Temp-Script-Ansatz wie ToolService

WorkspaceHelper.ShellArguments() entfernt (keine Aufrufer mehr)
This commit is contained in:
Meleki committed 2026-03-09 18:45:26 +01:00
1 parent 3e590a6d03
commit d6d7b6c04f
5 files changed
+102 -20

No files matched your search

+1
View File
@@ -27,6 +27,7 @@ public static class ServerSettingsEndpoint
new SettingDefinition("MaxIterations", "int", 100, "Max Tool-Loop Iterationen pro Chat", "number"),
new SettingDefinition("MaxHistory", "int", 120, "Max History-Messages pro Request", "number"),
new SettingDefinition("ReminderInterval", "int", 30, "System-Prompt Reminder alle N Messages (0 = deaktiviert)", "number"),
new SettingDefinition("ExecuteTimeout", "int", 180, "Timeout für Shell-Befehle in Sekunden", "number"),
new SettingDefinition("PayloadLogging", "bool", false, "API-Payloads loggen (Debug)", "toggle"),
new SettingDefinition("PayloadLoggingGzip", "bool", false, "Payload-Logs als .gz komprimieren", "toggle"),
new SettingDefinition("KreaToken", "string", "", "Krea API Token", "password"),