Skip to content

fix: use configured model provider on session resume#224

Open
david-melville wants to merge 1 commit into
agentclientprotocol:mainfrom
david-melville:fix-resume-model-provider-config
Open

fix: use configured model provider on session resume#224
david-melville wants to merge 1 commit into
agentclientprotocol:mainfrom
david-melville:fix-resume-model-provider-config

Conversation

@david-melville

Copy link
Copy Markdown

Problem

When resuming or loading a session, ACP's getResumeModelProvider() returned "openai" as a hardcoded fallback whenever MODEL_PROVIDER was not set in the environment — even if ~/.codex/config.toml explicitly set model_provider = "azure".

This is a v1.0.0 regression: Codex itself reads the config correctly (verified via config/read), but the ACP adapter overrode it on resume/load.

Fix

getResumeModelProvider() now awaits an async lookup of the configured provider (via config/read) before falling back to "openai". Both resumeSession and loadSession pass the resolved provider.

Testing

  • Added a dedicated test: uses configured model provider when resuming sessions without an explicit provider
  • All existing tests pass (48 focused, 222 full suite)
  • Typecheck and build clean

Related: #164

When resuming or loading a session, getResumeModelProvider() now reads
the model_provider value from Codex config (config/read) before falling
back to "openai". This fixes a v1.0.0 regression where sessions resumed
via ACP always used OpenAI even when ~/.codex/config.toml specified
model_provider = "azure".
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.

1 participant