Skip to content

Restore persisted model provider on thread resume#19287

Merged
etraut-openai merged 1 commit intomainfrom
etraut/restore-model-provider
Apr 25, 2026
Merged

Restore persisted model provider on thread resume#19287
etraut-openai merged 1 commit intomainfrom
etraut/restore-model-provider

Conversation

@etraut-openai
Copy link
Copy Markdown
Collaborator

@etraut-openai etraut-openai commented Apr 24, 2026

Fixes #15219.

Why

thread/resume should continue a persisted thread with the same model provider that created the thread. The app server already restores the persisted model and reasoning effort before resuming, but it was leaving model_provider unset. If a user created a thread with one provider and later switched their active profile to another provider, resumed encrypted history could be sent to the wrong endpoint and fail with invalid_encrypted_content.

The thread metadata already records the original provider, so resume should apply it when the caller has not explicitly requested a different model/provider/reasoning configuration.

What changed

This updates merge_persisted_resume_metadata in app-server/src/codex_message_processor.rs to copy ThreadMetadata::model_provider into ConfigOverrides::model_provider alongside the persisted model.

The existing resume metadata tests now also assert that:

  • the persisted provider is restored for normal resume
  • explicit model, provider, or reasoning-effort overrides still prevent persisted resume metadata from being applied
  • a thread with no persisted model or reasoning effort still resumes with its persisted provider

Verification

  • cargo test -p codex-app-server passed the app-server unit tests, including the updated resume metadata coverage. The broader integration portion of that command failed in an unrelated environment-sensitive skills-budget warning assertion, where this run saw 8 omitted skills instead of the expected 7.
  • just fix -p codex-app-server completed successfully.

@etraut-openai etraut-openai changed the title Restore model provider on thread resume Restore persisted model provider on thread resume Apr 24, 2026
@etraut-openai etraut-openai merged commit bce74c7 into main Apr 25, 2026
25 checks passed
@etraut-openai etraut-openai deleted the etraut/restore-model-provider branch April 25, 2026 19:40
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

thread/resume does not restore model_provider from persisted metadata — breaks cross-provider conversation continuation

2 participants