Discover model catalogs from HTTPS gateways (#63807)

## Why

A custom gateway can serve a Codex model catalog at its existing
`/models` route. Requiring a separate `model_catalog_url` leaves that
catalog undiscovered when only `base_url` is configured.

## What changed

Probe `/models` automatically for custom providers with a query-free
HTTPS base URL and no explicit catalog URL. Use a valid Codex catalog
as the model picker inventory. If discovery fails, keep the picker
usable with an available catalog or the bundled models. Gateway login
and token refresh errors still propagate.

## Testing

Add HTTPS app-server tests that verify the authenticated
`/v1/models` request, picker population from a Codex catalog, and
fallback to bundled models for a generic OpenAI model list or a
`403` response.

GitOrigin-RevId: 654095be1c221d79d932acde8b7289bc4cad0437
This commit is contained in:
smurching-oai
2026-11-25 02:29:04 +00:00
committed by copyberry
parent e5c2440d5e
commit 07963a34f2
6 changed files with 152 additions and 22 deletions
@@ -55,7 +55,7 @@ async fn invalid_models_response_reports_bounded_decode_metadata() {
let server = MockServer::start().await;
for (body, category, column_offset) in [
(
json!({ "data": [{ "id": "private-model" }] }).to_string(),
json!({ "object": "list", "data": [{ "id": "private-model" }] }).to_string(),
"Data",
0,
),