core-agent-ide/codex-cli/src/utils
Scott Leibrand ee6e1765fa
agent-loop: minimal mid-stream #429 retry loop using existing back-off (#506)
As requested by @tibo-openai at
https://github.com/openai/codex/pull/357#issuecomment-2816554203, this
attempts a more minimal implementation of #357 that preserves as much as
possible of the existing code's exponential backoff logic.

Adds a small retry wrapper around the streaming for‑await loop so that
HTTP 429s which occur *after* the stream has started no longer crash the
CLI.

Highlights
• Re‑uses existing RATE_LIMIT_RETRY_WAIT_MS constant and 5‑attempt
limit.
• Exponential back‑off identical to initial request handling. 

This comment is probably more useful here in the PR:
// The OpenAI SDK may raise a 429 (rate‑limit) *after* the stream has
// started. Prior logic already retries the initial `responses.create`
        // call, but we need to add equivalent resilience for mid‑stream
        // failures.  We keep the implementation minimal by wrapping the
// existing `for‑await` loop in a small retry‑for‑loop that re‑creates
        // the stream with exponential back‑off.
2025-04-22 11:02:10 -04:00
..
agent agent-loop: minimal mid-stream #429 retry loop using existing back-off (#506) 2025-04-22 11:02:10 -04:00
logger chore: improve storage/ implementation; use log(...) consistently (#473) 2025-04-21 09:51:34 -04:00
singlepass refactor: improve performance of renderFilesToXml using Array.join (#127) 2025-04-16 16:14:57 -07:00
storage chore: improve storage/ implementation; use log(...) consistently (#473) 2025-04-21 09:51:34 -04:00
approximate-tokens-used.ts fix(cli): ensure /clear resets context and exclude system messages from approximateTokenUsed count (#443) 2025-04-20 08:52:14 -07:00
auto-approval-mode.js Initial commit 2025-04-16 12:56:08 -04:00
auto-approval-mode.ts Initial commit 2025-04-16 12:56:08 -04:00
bug-report.ts fix: /bug report command, thinking indicator (#381) 2025-04-18 18:13:34 -07:00
check-in-git.ts Initial commit 2025-04-16 12:56:08 -04:00
check-updates.ts refactor(updates): fetch version from registry instead of npm CLI to support multiple managers (#446) 2025-04-21 00:00:20 -07:00
compact-summary.ts fix: inconsistent usage of base URL and API key (#507) 2025-04-22 10:51:26 -04:00
config.ts fix: inconsistent usage of base URL and API key (#507) 2025-04-22 10:51:26 -04:00
extract-applied-patches.ts feat: /diff command to view git diff (#426) 2025-04-19 16:23:27 -07:00
file-system-suggestions.ts feat: tab completions for file paths (#279) 2025-04-20 22:34:27 -07:00
get-diff.ts feat: /diff command to view git diff (#426) 2025-04-19 16:23:27 -07:00
input-utils.ts Add fallback text for missing images (#397) 2025-04-18 22:55:24 -07:00
model-utils.ts fix: inconsistent usage of base URL and API key (#507) 2025-04-22 10:51:26 -04:00
package-manager-detector.ts refactor(updates): fetch version from registry instead of npm CLI to support multiple managers (#446) 2025-04-21 00:00:20 -07:00
parsers.ts Removes computeAutoApproval() and tightens up canAutoApprove() as the source of truth (#126) 2025-04-16 15:39:41 -07:00
providers.ts feat: support multiple providers via Responses-Completion transformation (#247) 2025-04-20 20:59:34 -07:00
responses.ts feat: support multiple providers via Responses-Completion transformation (#247) 2025-04-20 20:59:34 -07:00
session.ts bump(version): 0.1.2504220136 (#518) 2025-04-22 01:45:30 -07:00
short-path.ts Initial commit 2025-04-16 12:56:08 -04:00
slash-commands.ts feat: /diff command to view git diff (#426) 2025-04-19 16:23:27 -07:00
terminal-chat-utils.ts chore: consolidate model utils and drive-by cleanups (#476) 2025-04-21 12:33:57 -04:00
terminal.ts fix: /clear now clears terminal screen and resets context left indicator (#425) 2025-04-21 12:39:46 -04:00