Summary
When updating an OAuth auth file through the management upload flow, the top-level priority field is written to the JSON file, but it is not consistently propagated to the runtime auth Attributes["priority"].
As a result, scheduler selection can still treat the uploaded auth as priority 0, even though the file already contains a higher priority value.
Affected flow
Management auth file upload / rewrite flow:
POST /v0/management/auth-files
Expected behavior
If an uploaded auth file contains:
{
"type": "codex",
"email": "user@example.com",
"priority": 98
}
then the runtime auth used by the scheduler should also have:
Metadata["priority"] = 98
Attributes["priority"] = "98"
so scheduler priority selection matches the file content.
Actual behavior
The JSON file is updated correctly, but runtime auth can miss Attributes["priority"], so selection still behaves as if priority is 0.
Reproduction
- Create or upload an OAuth auth file with top-level
"priority": 98
- Keep another credential available with lower configured priority, for example
priority: 9
- Send requests to a model both credentials support
- Observe that the lower-priority credential is still selected
Root cause
The management upload/rebuild path does not use the same file-to-auth synthesis logic as the watcher file-loading path, so auth-file-derived runtime fields like priority are not consistently translated into runtime auth attributes.
Fix
PR: #2923
Summary
When updating an OAuth auth file through the management upload flow, the top-level
priorityfield is written to the JSON file, but it is not consistently propagated to the runtime authAttributes["priority"].As a result, scheduler selection can still treat the uploaded auth as priority
0, even though the file already contains a higher priority value.Affected flow
Management auth file upload / rewrite flow:
POST /v0/management/auth-filesExpected behavior
If an uploaded auth file contains:
{ "type": "codex", "email": "user@example.com", "priority": 98 }then the runtime auth used by the scheduler should also have:
Metadata["priority"] = 98Attributes["priority"] = "98"so scheduler priority selection matches the file content.
Actual behavior
The JSON file is updated correctly, but runtime auth can miss
Attributes["priority"], so selection still behaves as if priority is0.Reproduction
"priority": 98priority: 9Root cause
The management upload/rebuild path does not use the same file-to-auth synthesis logic as the watcher file-loading path, so auth-file-derived runtime fields like
priorityare not consistently translated into runtime auth attributes.Fix
PR: #2923