Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions codex-rs/codex-api/src/endpoint/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ impl<T: HttpTransport, A: AuthProvider> ModelsClient<T, A> {

let separator = if req.url.contains('?') { '&' } else { '?' };
req.url = format!("{}{}client_version={client_version}", req.url, separator);

add_auth_headers(&self.auth, req)
if self.auth.account_id().is_some() {
add_auth_headers(&self.auth, req)
} else {
req
Comment on lines +51 to +54
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore auth headers when account id is absent

The new guard around add_auth_headers means /models requests skip the Authorization header whenever account_id is None (models.rs lines 51-54). Providers that still supply a bearer token but have no account id—for example API-key based auth via CoreAuthProvider in core/src/api_bridge.rs, which sets token and leaves account_id as None—will now call /models unauthenticated and receive 401s, so model discovery fails even though credentials are available.

Useful? React with 👍 / 👎.

}
};

let resp = run_with_request_telemetry(
Expand Down
Loading