openai / openai/codex

Side chat doesn't restore the parent thread's model_provider, so it fails with invalid_encrypted_content

Open
#46,379 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app app-server azure bug custom-model
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

What version of the Codex App are you using (From “About Codex” dialog)?

26.911.61220

What subscription do you have?

Pro

What platform is your computer?

Darwin 25.6.0 arm64 arm

What issue are you seeing?

Opening a side chat on a thread created on the ChatGPT plan fails on the first message once the default provider is Azure:

{
  "error": {
    "message": "The encrypted content for item rs_...79a could not be verified. Reason: Encrypted content could not be decrypted or parsed.",
    "type": "invalid_request_error",
    "param": null,
    "code": "invalid_encrypted_content"
  }
}

The side chat's first request goes to the Azure endpoint (POST https://<resource>.openai.azure.com/openai/responses?api-version=2025-04-01-preview400 Bad Request). That request carries reasoning item rs_...79a, which the parent thread received from the ChatGPT backend.

What steps can reproduce the bug?
  1. With model_provider = "openai" (ChatGPT sign-in), start a thread in Codex Desktop and run a few turns with a reasoning model so the history contains encrypted reasoning items.
  2. Add a custom Azure provider (wire_api = "responses"), set model_provider = "azure", and restart the app.
  3. Reopen the thread from step 1. It resumes on openai, as expected.
  4. Open a side chat on that thread and send any message.

Result: the first turn fails with invalid_encrypted_content, and the request goes to the Azure endpoint.

What is the expected behavior?

A side chat should run on its parent thread's provider unless the client explicitly asks for a different one. This is the rule thread/resume followed since #19287. If the client does explicitly switch providers, encrypted reasoning and compaction items from the other provider should be dropped, not sent to an endpoint that can't decrypt them.

Additional information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing side-chat creation and the thread/resume provider-handling path, using the rule described in #19287 as a comparison. Done means a side chat inherits its parent provider by default, while an explicit provider switch does not send incompatible encrypted reasoning or compaction items to the new endpoint.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.