Add opt-in model discovery for OpenAI API keys (#44392)

## What changed

Add the default-off `api_key_model_discovery` feature and expose it through app-server experimental feature enablement, respecting user configuration overrides.

When enabled, fetch OpenAI API-key model metadata from the Codex backend, honoring explicit provider base URLs. Treat remote catalogs containing visible models as authoritative. When disabled at startup, skip discovery requests and cached catalogs and retain bundled models.

## Testing

Add coverage for feature enablement and user overrides, cached catalogs across sessions, provider routing, and API-key `model/list` results. Extend coverage for remote instructions and auth-specific cache isolation.

GitOrigin-RevId: 4b189c37c615a7f808cb6ff5f0858a9a55f36ebc
This commit is contained in:
andrewgu-oai authored and copyberry committed 2026-09-10 03:18:28 +00:00
1 parent 5a9eb145c4
commit ea53c8d4f7
13 files changed
+465 -54

No files matched your search

+6
View File
@@ -631,6 +631,9 @@
"default": null,
"description": "Optional feature toggles scoped to this profile.",
"properties": {
"api_key_model_discovery": {
"type": "boolean"
},
"apply_patch_freeform": {
"type": "boolean"
},
@@ -6123,6 +6126,9 @@
"default": null,
"description": "Centralized feature flags (new). Prefer this over individual toggles.",
"properties": {
"api_key_model_discovery": {
"type": "boolean"
},
"apply_patch_freeform": {
"type": "boolean"
},