The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(codex): drop the stale 'watchdog tripped' retirement cause and re-scope the reset test
teknium19cb1a65978e5
diff --git a/agent/codex_runtime.py b/agent/codex_runtime.pyindex ca3092ed6b9..28254a50f3e 100644--- a/agent/codex_runtime.py+++ b/agent/codex_runtime.py@@ -490,7 +490,8 @@ def run_codex_app_server_turn(agent, *, user_message: str, original_user_messagefinal_response=f"Codex app-server turn failed: {exc}. Fall back to default runtime with `/codex-runtime auto`.",)interrupt = _consume_user_interrupt(agent, turn.interrupted)- # Wedged client (deadline blown, watchdog tripped, OAuth refresh died, subprocess exited): retire it.+ # Wedged client (turn deadline blown, OAuth refresh died, subprocess exited): retire it. Post-tool+ # silence alone no longer retires — it only logs a warning (#112928).if getattr(turn, "should_retire", False):logger.warning("codex app-server session retired (turn error: %s)", turn.error)_close_codex_session(agent)diff --git a/tests/agent/transports/test_codex_app_server_session.py b/tests/agent/transports/test_codex_app_server_session.pyindex da1e318f177..65b2d1fe190 100644--- a/tests/agent/transports/test_codex_app_server_session.py+++ b/tests/agent/transports/test_codex_app_server_session.py@@ -791,9 +791,9 @@ class TestSessionRetirement:assert not any(method == "turn/interrupt" for method, _ in client.requests)assert any("no events for" in rec.getMessage() for rec in caplog.records)- def test_post_tool_watchdog_resets_on_further_activity(self):- """A tool completion followed by an agent message should NOT trip- the watchdog — further activity = codex still alive."""+ def test_post_tool_activity_clears_the_quiet_timer_and_never_retires(self):+ """A tool completion followed by an agent message completes normally: further activity clears+ the post-tool quiet timer, and even when it expires it only warns, never retires."""client = FakeClient()client.queue_notification("item/completed",@@ -805,7 +805,7 @@ class TestSessionRetirement:},threadId="t", turnId="tu1",)- # Non-tool activity immediately after — resets watchdog.+ # Non-tool activity immediately after — clears the quiet timer.client.queue_notification("item/completed",item={"type": "agentMessage", "id": "m1", "text": "tool finished"},@@ -821,7 +821,7 @@ class TestSessionRetirement:notification_poll_timeout=0.01,post_tool_quiet_timeout=0.05,)- # Tool ran, then text reset the watchdog, then turn/completed.+ # Tool ran, then text cleared the quiet timer, then turn/completed.# Should NOT be a retirement case.assert r.tool_iterations == 1assert r.final_text == "tool finished"