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()
|
terminal.close()
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
terminated_tasks.discard(task_id)
|
|
||||||
room_sids = sub_agent_rooms.pop(task_id, set())
|
room_sids = sub_agent_rooms.pop(task_id, set())
|
||||||
for sid in list(room_sids):
|
for sid in list(room_sids):
|
||||||
sub_agent_connections.pop(sid, None)
|
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:
|
if client_sid and client_sid in stop_flags:
|
||||||
stop_flags[client_sid]["stop"] = True
|
stop_flags[client_sid]["stop"] = True
|
||||||
|
|
||||||
|
terminated_tasks.add(task_id)
|
||||||
terminal = sub_agent_terminals.get(task_id)
|
terminal = sub_agent_terminals.get(task_id)
|
||||||
if terminal:
|
if terminal:
|
||||||
try:
|
try:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user