Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion agent/chat_completion_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,10 +594,11 @@ def _call():
and getattr(agent, "_codex_stream_last_event_ts", None) is None
):
_deadline = min(_deadline, _ttfb_timeout)
_deadline_text = "no limit" if _deadline == float("inf") else f"{int(_deadline)}s"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_deadline == float("inf") fixes the reported case, but use math.isfinite(_deadline) and omit the auto-reconnect suffix when it is false. nan is accepted by the current timeout coercion and also fails under int(), while an infinite stale timeout never reaches the reconnect branch.

agent._emit_wait_notice(
f"⏳ waiting on {api_kwargs.get('model', 'the provider')} — "
f"{int(_elapsed)}s with no response yet (provider may be slow "
f"or overloaded; auto-reconnect at {int(_deadline)}s)"
f"or overloaded; auto-reconnect at {_deadline_text})"
)

_elapsed = time.time() - _call_start
Expand Down
Loading