Skip to content

fix(auth): show Codex device retry guidance - #6225

Draft
ehz0ah wants to merge 1 commit into
volcengine:mainfrom
ehz0ah:fix/codex-device-retry-after-6224
Draft

ehz0ah wants to merge 1 commit into
volcengine:mainfrom
ehz0ah:fix/codex-device-retry-after-6224

Conversation

@ehz0ah

@ehz0ah ehz0ah commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Description

When the initial Codex device-code request is rate-limited, OpenViking currently reports only the HTTP status. This change preserves valid Retry-After guidance from the response so users know when to try again. It does not retry automatically or invent a delay when the server omits the header.

Human Involvement

  • A human participated in the implementation or review loop
  • This PR was generated entirely by AI agents without human participation in the loop

Related Issue

Fixes #6224

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update

Changes Made

  • Parse standard Retry-After delta-seconds and HTTP-date values.
  • Append valid retry timing to the initial Codex device-login error.
  • Keep the existing status-only error for missing or invalid headers.

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows

Commands:

uv run --native-tls --isolated --no-default-groups --with pytest --with pytest-cov --with pytest-asyncio python -m pytest -q -o addopts='' tests/unit/test_codex_vlm.py -k device_login_reports_valid_retry_after
uv run --native-tls --isolated --no-default-groups --with pytest --with pytest-cov --with pytest-asyncio python -m pytest -q -o addopts='' tests/unit/test_codex_vlm.py
uv tool run --native-tls ruff@0.14.14 check openviking/models/vlm/backends/codex_auth.py tests/unit/test_codex_vlm.py
uv tool run --native-tls ruff@0.14.14 format --check openviking/models/vlm/backends/codex_auth.py tests/unit/test_codex_vlm.py

Results: 5 focused cases passed, all 34 Codex VLM unit tests passed, and Ruff check and format passed.

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Screenshots (if applicable)

Not applicable.

Additional Notes

The motivating external report is anomalyco/opencode#56499. The OpenViking change is independently implemented and limited to the supported openviking-server init Codex login path.

This branch has not been deployed

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

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

[Bug]: Codex device login drops Retry-After guidance on HTTP 429

1 participant