File tree Expand file tree Collapse file tree
src/seclab_taskflow_agent Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -773,10 +773,8 @@ async def _deploy(ra: dict, pp: str) -> bool:
773773 session .mark_finished ()
774774 await render_model_output (f"** 🤖✅ Session { session .session_id } completed\n " )
775775
776- # Force-exit after successful completion only: asyncio.run() cleanup
777- # spins on dangling tasks/connections from the responses API path.
778- # Failure paths (must_complete break, personality mode) use normal exit.
779- if taskflow_path and session is not None and session .finished :
780- sys .stdout .flush ()
781- sys .stderr .flush ()
782- os ._exit (0 )
776+ # Force-exit to prevent asyncio event loop spin on dangling
777+ # tasks/connections from the responses API path. Flush first.
778+ sys .stdout .flush ()
779+ sys .stderr .flush ()
780+ os ._exit (0 if (session is None or session .finished ) else 1 )
You can’t perform that action at this time.
0 commit comments