Skip to content

fix(codex): handle Responses stream failures#2089

Open
nguyenha935 wants to merge 2 commits into
decolua:masterfrom
nguyenha935:fix/codex-responses-semantic-failure
Open

fix(codex): handle Responses stream failures#2089
nguyenha935 wants to merge 2 commits into
decolua:masterfrom
nguyenha935:fix/codex-responses-semantic-failure

Conversation

@nguyenha935

@nguyenha935 nguyenha935 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • detect retryable OpenAI Responses SSE failures returned inside HTTP 200 before client-visible output, so combos can fall back to the next model/account
  • avoid retrying after Responses output has already started, because fallback is no longer safe once the client has seen stream content
  • mark late terminal Responses failures as failed request details/account failures instead of recording them as successful streams

Tests

  • npm --prefix tests test -- unit/stream-complete-callback.test.js unit/stream-terminal-outcome.test.js unit/responses-semantic-failure.test.js unit/codex-sse-capacity.test.js unit/combo-semantic-failure.test.js
  • npm run build

Local runtime verification on tiny

  • Applied temporary production patch under /opt/9router without resetting existing local patches.
  • Ran existing production targeted tests: unit/responses-semantic-failure.test.js, unit/codex-sse-capacity.test.js, unit/combo-semantic-failure.test.js.
  • Built /opt/9router, refreshed standalone runtime links, restarted 9router.
  • Verified service active, /login 200, /providers/gemini.png 200, and a Next static asset 200.

@nguyenha935 nguyenha935 changed the title fix(codex): fallback on retryable Responses SSE failures fix(codex): handle Responses stream failures Jun 25, 2026
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