fix: ensure terminate stops running sub agent
This commit is contained in:
parent
f2bfa3f377
commit
45ba4f5a49
@ -270,7 +270,6 @@ def _purge_sub_agent_task(task_id: str):
|
||||
terminal.close()
|
||||
except Exception:
|
||||
pass
|
||||
terminated_tasks.discard(task_id)
|
||||
room_sids = sub_agent_rooms.pop(task_id, set())
|
||||
for sid in list(room_sids):
|
||||
sub_agent_connections.pop(sid, None)
|
||||
@ -2145,6 +2144,7 @@ def force_terminate_sub_agent(task_id: str) -> Dict[str, Any]:
|
||||
if client_sid and client_sid in stop_flags:
|
||||
stop_flags[client_sid]["stop"] = True
|
||||
|
||||
terminated_tasks.add(task_id)
|
||||
terminal = sub_agent_terminals.get(task_id)
|
||||
if terminal:
|
||||
try:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user