Skip to content

fix(providers): preserve Codex SSE error details - #268

Open
fancyboi999 wants to merge 1 commit into
EverMind-AI:mainfrom
fancyboi999:fix/codex_sse_error_details
Open

fix(providers): preserve Codex SSE error details#268
fancyboi999 wants to merge 1 commit into
EverMind-AI:mainfrom
fancyboi999:fix/codex_sse_error_details

Conversation

@fancyboi999

Copy link
Copy Markdown

Summary

  • Preserve bounded type, code, and message details from Codex error and response.failed SSE events.
  • Map Codex capacity failures into the existing transient server classification so the normal retry and fallback ladder applies.
  • Ignore nested payload fields, remove control characters, and bound logged values instead of serializing the full remote event.

Type

  • Fix
  • Feature
  • Docs
  • CI / tooling
  • Refactor
  • Other

Verification

  • uv run pytest tests/test_openai_codex_provider.py tests/test_error_classification.py tests/test_provider_fallback_chain.py -q: 53 passed.

  • uv run --all-extras pytest -q --deselect tests/test_cli_theme.py::test_bold_accent_renders_styled_not_bare: 5158 passed, 30 skipped, 14 deselected, 2 warnings.

  • uv run --extra dev ruff check raven/providers/openai_codex_provider.py tests/test_openai_codex_provider.py: passed.

  • uv run --extra dev ruff format --check raven/providers/openai_codex_provider.py tests/test_openai_codex_provider.py: passed.

  • uv run pre-commit run --files raven/providers/openai_codex_provider.py tests/test_openai_codex_provider.py: passed.

  • Live OAuth call through OpenAICodexProvider.chat_with_retry() using an account-advertised Codex model returned finish_reason=stop and the expected RAVEN_E2E_OK response.

  • make ci reaches one pre-existing tests/test_cli_theme.py::test_bold_accent_renders_styled_not_bare failure reproduced unchanged on a clean origin/main worktree. The remaining TUI tests and builds passed when run separately.

  • Relevant tests pass locally

  • Relevant lint / type checks pass locally

  • User-facing docs or screenshots are updated when needed

No user-facing documentation describes this internal error representation, so no documentation or screenshots were changed.

Risk

  • Error output changes from a fixed generic string to bounded structured fields for Codex SSE failures.

  • Unrelated and malformed failures retain non-retryable or generic behavior, and the change can be rolled back by reverting this PR.

  • Security impact considered

  • Backward compatibility considered

  • Rollback path is clear for risky changes

Related Issues

Fixes #234

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.

bug(openai_codex): preserve SSE error details and retry server_is_overloaded failures

1 participant