Skip to content

feat: add provider-aware model fallback to thread start#29942

Draft
celia-oai wants to merge 1 commit into
mainfrom
dev/cc/new-bedrock-fallback
Draft

feat: add provider-aware model fallback to thread start#29942
celia-oai wants to merge 1 commit into
mainfrom
dev/cc/new-bedrock-fallback

Conversation

@celia-oai

@celia-oai celia-oai commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Why

Helper threads such as task title generation can request a model ID that is valid for the default OpenAI provider but unavailable from the active provider. With Amazon Bedrock, gpt-5.4-mini is rejected while the provider static catalog exposes Bedrock model IDs such as openai.gpt-5.5 and openai.gpt-5.4. This causes repeated background 404s and can surface a misleading turn error even when the main turn succeeds.

Clients need an explicit way to ask app-server to resolve an unavailable helper model to the active provider default. That fallback must remain limited to providers with an authoritative static catalog so custom or dynamically discovered model IDs are not rewritten based on an incomplete catalog.

Fixes #28741.

What changed

  • Add the experimental allowProviderModelFallback option to thread/start, defaulting to false to preserve existing behavior.
  • Thread the option through thread creation and model selection.
  • When enabled for a static model manager, preserve requested models present in the catalog and replace unavailable models with the provider default.
  • Continue preserving explicit model IDs for dynamic model managers without fetching a catalog solely to validate them.
  • Document the new thread/start behavior in the app-server API overview.

Test

Temporary test-client harness:

ThreadStartParams {
    model: Some("gpt-5.4-mini".to_string()),
    allow_provider_model_fallback: true,
    ..Default::default()
}

Command:

CODEX_HOME=/tmp/codex-bedrock-thread-start-home \
CODEX_E2E_BEDROCK_THREAD_START_ONLY=1 \
./target/debug/codex-app-server-test-client \
  --codex-bin ./target/debug/codex \
  -c 'model_provider="amazon-bedrock"' \
  send-message-v2 --experimental-api ignored

Relevant output:

> "method": "thread/start",
> "params": {
>   "model": "gpt-5.4-mini",
>   "modelProvider": null,
>   "allowProviderModelFallback": true,
>   ...
> }

< "result": {
<   "model": "openai.gpt-5.5",
<   "modelProvider": "amazon-bedrock",
<   ...
< }

@celia-oai celia-oai requested a review from a team as a code owner June 25, 2026 01:25
@celia-oai celia-oai marked this pull request as draft June 25, 2026 01:25
@celia-oai celia-oai force-pushed the dev/cc/new-bedrock-fallback branch 5 times, most recently from 816b0eb to beedaa2 Compare June 25, 2026 04:54
@celia-oai celia-oai changed the title changes app-server: add provider-aware model fallback to thread start Jun 25, 2026
@celia-oai celia-oai changed the title app-server: add provider-aware model fallback to thread start feat: add provider-aware model fallback to thread start Jun 25, 2026
@celia-oai celia-oai force-pushed the dev/cc/new-bedrock-fallback branch from beedaa2 to d05ebd9 Compare June 25, 2026 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bedrock: task title generation still uses unsupported gpt-5.4-mini after #26288 fix (memory path only)

1 participant