Skip to content

login: treat provider auth refresh_interval_ms=0 as no auto-refresh#16480

Merged
bolinfest merged 1 commit intomainfrom
pr16480
Apr 1, 2026
Merged

login: treat provider auth refresh_interval_ms=0 as no auto-refresh#16480
bolinfest merged 1 commit intomainfrom
pr16480

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented Apr 1, 2026

Why

Follow-up to #16288: the new dynamic provider auth token flow currently defaults refresh_interval_ms to a non-zero value and rejects 0 entirely.

For command-backed bearer auth, 0 should mean "never auto-refresh". That lets callers keep using the cached token until the backend actually returns 401 Unauthorized, at which point Codex can rerun the auth command as part of the existing retry path.

What changed

  • changed ModelProviderAuthInfo.refresh_interval_ms to accept 0 and documented that value as disabling proactive refresh
  • updated the external bearer token refresher to treat refresh_interval_ms = 0 as an indefinitely reusable cached token, while still rerunning the auth command during unauthorized recovery
  • regenerated core/config.schema.json so the schema minimum is 0 and the new behavior is described in the field docs
  • added coverage for both config deserialization and the no-auto-refresh plus 401 recovery behavior

How tested

  • cargo test -p codex-protocol
  • cargo test -p codex-login
  • cargo test -p codex-core test_deserialize_provider_auth_config_

@bolinfest bolinfest changed the title login: allow provider auth refresh_interval_ms=0 login: treat provider auth refresh_interval_ms=0 as no auto-refresh Apr 1, 2026
@bolinfest
Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Keep it up!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@bolinfest bolinfest requested a review from etraut-openai April 1, 2026 21:40
@bolinfest bolinfest merged commit f83f3fa into main Apr 1, 2026
36 checks passed
@bolinfest bolinfest deleted the pr16480 branch April 1, 2026 22:30
@bolinfest bolinfest requested a review from pakrym-oai April 1, 2026 22:30
@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant