fix(auth): stop exhausted pools falling through to singleton auth - #27448
fix(auth): stop exhausted pools falling through to singleton auth#27448Qwinty wants to merge 1 commit into
Conversation
|
CI note: the remaining failing This PR is based on
Both report The tests directly covering this PR pass locally:
|
|
Follow-up from another live pool investigation: this PR still looks correct for the exhausted-pool -> singleton-auth fallthrough, but I found an adjacent native pool bug that is not covered here. Using only Hermes' own Two changes are needed separately from this PR:
I have this validated locally: after live reconciliation, |
f7af90a to
ae498cd
Compare
|
Post-rebase CI update: the branch is now rebased on current upstream/main and the merge conflict is resolved; GitHub reports it as mergeable. All non- |
083efe4 to
9ed7998
Compare
|
Scope update after another live Codex pool reproduction: this PR still covers the narrow exhausted-pool -> singleton-auth fallthrough bug. I split the broader Codex pool recovery stack into draft PR #31032 because the live stale-pool fix needs additional pieces that are not present in this branch: selected credential id propagation, live usage reconciliation, bounded usage-limit cooldowns, invalid-token quarantine, and quota-identity grouping for shared ChatGPT workspaces.\n\nKeeping this PR narrow is still useful if maintainers prefer incremental merge order. If the preference is one cohesive Codex pool fix, #31032 can supersede this one. |
|
Closing this as superseded by draft PR #31032. This branch was useful as the narrow exhausted-pool -> singleton-auth fallback fix, but it is also the PR that mostly changed the user-facing pool-exhaustion error path. The live Codex issue turned out to need the fuller stack in #31032: selected credential id propagation, live Codex usage reconciliation, bounded usage-limit holds, invalid-token quarantine, and workspace quota-identity grouping. Keeping both open would make review noisier and duplicate the auth surface. |
Summary
credential_pool_exhaustedauth failure.No Codex credentials storedmessage.autoprovider fallthrough by skipping the exhausted singleton provider and trying environment/default providers instead.Context
Related to #12058 and follow-up to #17929. #17929 fixed an init-time fallback path, but runtime provider resolution could still hit
pool.has_credentials() == truepluspool.select() is None, then continue into singleton auth and misreport the failure as missing Codex credentials.Test Plan
python -m pytest tests/hermes_cli/test_runtime_provider_resolution.py -qpython -m pytest tests/gateway/test_auth_fallback.py tests/gateway/test_session_model_override_routing.py::test_gateway_auth_fallback_uses_fallback_model_from_config -q