Skip to content

fix: read model provider from config on session resume#164

Open
xiatg wants to merge 1 commit into
agentclientprotocol:mainfrom
xiatg:revert-pr-139
Open

fix: read model provider from config on session resume#164
xiatg wants to merge 1 commit into
agentclientprotocol:mainfrom
xiatg:revert-pr-139

Conversation

@xiatg
Copy link
Copy Markdown

@xiatg xiatg commented May 28, 2026

Summary

  • Reverts PR fix: explicitly pass model provider on session resume #139 which introduced getResumeModelProvider() with a hardcoded fallback to "openai"
  • The previous change forced the model provider to default to "openai" when none was explicitly passed, overriding the user's configured provider in ~/.codex/config.toml
  • Per the official configuration guide, users can set their model provider in ~/.codex/config.toml — the hardcoded fallback bypasses this

🤖 Generated with Claude Code

@xiatg xiatg force-pushed the revert-pr-139 branch 2 times, most recently from 093cafd to 35da4cb Compare May 28, 2026 19:59
@AlexandrSuhinin AlexandrSuhinin self-requested a review June 2, 2026 08:22
Copy link
Copy Markdown
Collaborator

@AlexandrSuhinin AlexandrSuhinin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proper fix should set provider from the config then. Reverting this PR will break resume on sessions if provider was changed.

Use getCurrentModelProvider() in getResumeModelProvider() so that
resumed sessions read model_provider from the config as a fallback,
instead of only checking the environment variable.
@xiatg xiatg changed the title Revert "fix: explicitly pass model provider on session resume (#139)" fix: read model provider from config on session resume Jun 2, 2026
@xiatg
Copy link
Copy Markdown
Author

xiatg commented Jun 2, 2026

Updated to use getCurrentModelProvider() in getResumeModelProvider(), which reads model_provider from the config as a fallback instead of only checking the environment variable. The "openai" fallback is kept for the case where no provider is configured anywhere.

@xiatg xiatg requested a review from AlexandrSuhinin June 2, 2026 14:43
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.

2 participants