Skip to content

fix(ai): retry unavailable Codex upstreams#330

Draft
minpeter wants to merge 1 commit into
code-yeongyu:mainfrom
minpeter:fix/upstream-unavailable-retry-main
Draft

fix(ai): retry unavailable Codex upstreams#330
minpeter wants to merge 1 commit into
code-yeongyu:mainfrom
minpeter:fix/upstream-unavailable-retry-main

Conversation

@minpeter

@minpeter minpeter commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • classify transient upstream_unavailable Codex websocket proxy failures as retryable
  • preserve the existing bounded retry policy and retry event contract
  • replace stale fix(ai): retry upstream availability failures #323 cleanly from current main without force-pushing history

RED -> GREEN

  • RED: the reported Error: upstream_unavailable: ... ConnectionClosedOK classified as non-retryable
  • GREEN: classifier and full coding-agent retry event-contract suites pass
  • real print-mode CLI surface: first local Responses request failed with the exact error, second recovered; exit 0, 2 requests, recovered output, unchanged real auth

Validation

  • packages/ai/test/retry.test.ts: 7 passed
  • packages/coding-agent/test/suite/retry-fallback-engine.test.ts: 10 passed
  • root npm run build: passed
  • root npm run check: passed
  • git diff --check: passed

Supersedes #323, which was based on pre-#310 main and conflicts only in the rewritten retry fixture.


Summary by cubic

Classifies Codex upstream_unavailable websocket proxy errors as transient so they retry under the existing bounded policy. Prevents immediate failure on disconnects and allows automatic recovery.

  • Bug Fixes
    • Mark "upstream_unavailable" provider errors as retryable in utils/retry.ts.
    • Add tests in packages/ai and packages/coding-agent to cover Codex websocket disconnects.
    • Preserve current retry limits and retry event contract.

Written for commit f6c3f65. Summary will update on new commits.

Review in cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant