From 2ca9882d1199f8943f7ef50acf0a559228019bd7 Mon Sep 17 00:00:00 2001 From: Ahmed Ibrahim Date: Mon, 8 Jun 2026 19:09:48 -0700 Subject: [PATCH] Stop failed goal rollover work --- sdk/python/src/openai_codex/client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdk/python/src/openai_codex/client.py b/sdk/python/src/openai_codex/client.py index 1d059ca8a2..3fdcc9f3eb 100644 --- a/sdk/python/src/openai_codex/client.py +++ b/sdk/python/src/openai_codex/client.py @@ -514,6 +514,7 @@ class CodexClient: ) -> None: """Persist the terminal status for a failed physical goal turn.""" self.thread_goal_set(state.thread_id, status=status) + self._interrupt_goal_operation(state) def cancel_goal_operation(self, state: _GoalOperationState) -> None: """Best-effort cleanup after a logical goal operation is cancelled.""" @@ -521,6 +522,9 @@ class CodexClient: self.pause_goal(state.thread_id) except Exception: pass + self._interrupt_goal_operation(state) + + def _interrupt_goal_operation(self, state: _GoalOperationState) -> None: turn_id = state.current_turn() if turn_id is None: return