This commit is contained in:
team3
2026-06-22 06:07:22 +02:00
parent bf9eea967b
commit b54f5e23f3
4 changed files with 30 additions and 5 deletions

View File

@@ -18,7 +18,7 @@ import shutil
import subprocess
from pathlib import Path
from agents import kill_process
from agents import kill_process, cancel_scope, clear_scope
from config import KONSENS_GRACE, KONSENS_MAX_RUNDEN, DEFAULT_PROVIDER
from fsutil import atomic_write_text, atomic_write_json
from jsonio import read_json_file as _json_datei
@@ -243,7 +243,8 @@ def cancel_bausteine(topic: str) -> bool:
if topic not in _bausteine_progress:
return False
_bausteine_cancelled.add(topic)
kill_process(f"bausteine-{topic}-")
cancel_scope(f"bausteine-{topic}-") # wartende Agenten bailen vorm Spawn
kill_process(f"bausteine-{topic}-") # laufende Subprozesse killen
return True
@@ -1473,3 +1474,4 @@ async def generate_bausteine(topic: str, instructions: str = "", provider: str =
_bausteine_progress.pop(topic, None)
_bausteine_step.pop(topic, None)
_bausteine_cancelled.discard(topic)
clear_scope(f"bausteine-{topic}-") # Scope leeren → Neustart blockiert nicht