Skip to content

The agent that grows with you

fix: drop the redundant _request_is_current() from the first-event stamp guard

teknium1658424219057
diff --git a/agent/codex_runtime.py b/agent/codex_runtime.py
index 0329c1164de..3b3ad330959 100644
--- a/agent/codex_runtime.py
+++ b/agent/codex_runtime.py
@@ -879,9 +879,9 @@ def run_codex_stream(agent, api_kwargs: dict, client: Any = None, on_first_delta
def _on_event(event: Any) -> None: # TTFB/activity touch — once per SSE event.
now = time.time()
# Lifecycle frames can precede text, so the first accepted parsed event is the Responses
- # equivalent of Chat Completions' first chunk. Preserve the per-attempt reset and never let
- # a retired worker overwrite the timestamp owned by a newer request.
- if getattr(agent, "_last_api_first_chunk_at", None) is None and _request_is_current():
+ # equivalent of Chat Completions' first chunk. Preserve the per-attempt reset; the ``_fenced``
+ # wrapper around this callback already keeps a retired worker from overwriting a newer request.
+ if getattr(agent, "_last_api_first_chunk_at", None) is None:
agent._last_api_first_chunk_at = now
has_progress = _codex_event_has_content(event)
if watchdog_state is not None: