Enable API-key model discovery by default (#49807)

## What changed

- Mark `api_key_model_discovery` as stable and enable it by default, while preserving explicit user opt-outs and provider catalog requirements.
- Fall back to bundled models when discovery is disabled at runtime, including when a remote catalog has already been loaded.

## Testing

Extend model-list coverage for default enablement, app overrides, and user configuration precedence. Add a regression assertion that runtime opt-outs hide loaded catalogs without additional fetches, and update daemon compatibility tests for the new default.

GitOrigin-RevId: feaf732757792cc58063f21a5327d0e633f079f4
This commit is contained in:
andrewgu-oai
2026-10-01 01:38:27 +00:00
committed by copyberry
parent a5d56d8120
commit 7d4c7a0767
10 changed files with 59 additions and 34 deletions
+3 -5
View File
@@ -210,12 +210,10 @@ async fn daemon_startup(command: &str) -> Result<()> {
steps.push_back(("GPT-5.6-Terra", b"\x14"));
"Runningwithoutthesharedbackgroundserver:thisWindowslauncher"
} else if mismatch {
args.extend(if persisted {
["--disable".into(), "api_key_model_discovery".into()]
} else if disabling {
args.extend(if disabling && !persisted {
["--disable".into(), "auth_elicitation".into()]
} else {
["--enable".into(), "api_key_model_discovery".into()]
["--disable".into(), "api_key_model_discovery".into()]
});
let input: &[u8] = match command {
"mismatch-cancel" => b"\x03",
@@ -325,7 +323,7 @@ async fn daemon_startup(command: &str) -> Result<()> {
let previous_pid = existing_daemon.as_ref().context("missing original daemon PID")?;
ensure!((fs::read(&pid_file)? != *previous_pid) == restart);
if command == "mismatch-cancel" {
ensure!(text.contains("Cannotusethesharedbackgroundserver:Thissessionrequiresapi_key_model_discoverytobeenabled."));
ensure!(text.contains("Cannotusethesharedbackgroundserver:Thissessionrequiresapi_key_model_discoverytobedisabled."));
} else {
ensure!(text.contains("Server:Localbackgroundserver") == restart);
}