Remote-Keep-Alive gegen 180s-Timeout + System-Prompt via Datei
Task 1 – Remote-Befehle laufen nicht mehr in einen starren 180s-Timeout:
- RemoteConnectionManager.ExecuteCommand nutzt jetzt einen INAKTIVITÄTS-
Timeout (Watchdog auf LastProgressAt) statt hartem Wall-Clock-Limit; ein
Befehl darf beliebig lange laufen, solange der Client Progress-Frames sendet.
- RemoteEndpoint: neuer "progress"-Case setzt die Frist zurück.
- InternalEndpoint (MCP-Pfad remote_execute): hartes CancellationTokenSource(180s)
entfernt → nutzt konfigurierbares ExecuteTimeout-Setting + RequestAborted.
- remote.ps1 / remote.sh: senden während laufender Befehle alle 15s ein
{"type":"progress"}-Keep-Alive; async stdout/stderr-Lesen gegen Pipe-Deadlocks.
- ToolService: Tool-Beschreibungen erklären den Inaktivitäts-Timeout.
Task 2 – System-Prompt über --system-prompt-file statt CLI-Argument:
- ClaudeCliService schreibt den vollen System-Prompt in eine Temp-Datei und
übergibt --system-prompt-file, um das Windows-Kommandozeilen-Längenlimit zu
umgehen. Cleanup im finally. Agent-Verhalten unverändert (MEMORY.md bleibt inline).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
9db9bd4cc7
commit
ace5036f00
7 files changed
+118
-26
No files matched your search
+14
-2
@@ -127,10 +127,22 @@ try {
|
||||
$proc.StartInfo.UseShellExecute = $false
|
||||
$proc.StartInfo.CreateNoWindow = $true
|
||||
$proc.Start() | Out-Null
|
||||
# stderr async lesen um Deadlocks zu vermeiden
|
||||
# stdout+stderr async lesen um Pipe-Deadlocks zu vermeiden
|
||||
$stdoutTask = $proc.StandardOutput.ReadToEndAsync()
|
||||
$stderrTask = $proc.StandardError.ReadToEndAsync()
|
||||
$stdout = $proc.StandardOutput.ReadToEnd()
|
||||
# Auf Prozessende warten und dabei periodisch ein Keep-Alive senden,
|
||||
# damit lange Befehle nicht in den Server-Inaktivitaets-Timeout laufen.
|
||||
$lastProgress = [DateTime]::UtcNow
|
||||
while (-not $proc.HasExited) {
|
||||
Start-Sleep -Milliseconds 500
|
||||
if (([DateTime]::UtcNow - $lastProgress).TotalSeconds -ge 15) {
|
||||
try { Send-WsMessage $ws '{"type":"progress"}' $ct } catch { }
|
||||
$lastProgress = [DateTime]::UtcNow
|
||||
}
|
||||
}
|
||||
$stdoutTask.Wait()
|
||||
$stderrTask.Wait()
|
||||
$stdout = $stdoutTask.Result
|
||||
$stderr = $stderrTask.Result
|
||||
$proc.WaitForExit()
|
||||
$exitCode = $proc.ExitCode
|
||||
|
||||
Reference in new issue
Block a user