codex - 💡(How to fix) Fix Codex Desktop hides local history for custom Azure model provider after restart (e.g. corporate API key) [4 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#20184Fetched 2026-04-30 06:32:33
View on GitHub
Comments
4
Participants
3
Timeline
9
Reactions
0
Timeline (top)
labeled ×5commented ×4

Fix Action

Fix / Workaround

Failed Workarounds

This is not a viable workaround.

3. Patching app.asar

Code Example

Local testing showed:

- `thread/list` with `modelProviders: []` returned both `openai` and `azure` threads.
- `thread/list` with `modelProviders: null` could behave like a current-provider filter.
- The Desktop UI bundle contains `thread/list` calls with `modelProviders:null`.

This suggests the Desktop UI may be listing recent threads using provider filter semantics that exclude custom providers after restart, or it may be applying a UI-side provider filter that does not include custom providers.

## Additional Observations

`thread/list` without a `cwd` filter and with `modelProviders: []` returned mixed providers, including both:

---

`thread/list` with a `cwd` filter for Hercules and `modelProviders: []` also returned both `openai` and `azure` threads in that repo.

This further supports that the underlying app-server can return the data needed by the UI.

## Failed Workarounds

### 1. Duplicating Provider Definition Into Repo Config

Duplicating `[model_providers.azure]` into the repo-local `.codex/config.toml` did not fix Desktop history.

CLI still worked and reported:

---

But the Desktop GUI still did not show corporate/Azure chats after restart.

### 2. Trying To Override Built-In `openai` Provider

Attempting to configure built-in `openai` to point at Azure did not work. Codex still sent requests to:

---

This is not a viable workaround.

### 3. Patching `app.asar`

Two local experiments were attempted only to test the provider-filter hypothesis. Both are not viable and should not be used as a workaround.

First attempt:

- Extracted `app.asar`.
- Replaced `modelProviders:null` in JS.
- Repacked `app.asar`.
- Result: Codex Desktop crashed at startup with `EXC_BREAKPOINT (SIGTRAP)`.
- Likely cause: repacking lost original `app.asar.unpacked` metadata for native modules.

Second attempt:

- Performed an in-place byte-preserving edit:

---

to:

---

- Same byte length.
- No extract/repack.
- Updated affected asar integrity hashes in the header.
- Tested successfully on a `/tmp` copy with `@electron/asar list`.
- Result on the real installed app: Codex Desktop still crashed at startup with `EXC_BREAKPOINT (SIGTRAP)`.
- Likely cause: the installed app cannot tolerate mutation of `Resources/app.asar`, probably due to macOS/Electron code signing or resource seal validation.

Relevant crash reports:

---

`Resources/app.asar` is listed in:

---

So mutating the installed app bundle is not a practical workaround.

## Impact

This makes corporate/custom-provider usage unsafe and confusing:

- Work is not lost, but appears lost in the GUI.
- Users cannot reliably reopen or continue corporate Azure chats from Desktop history.
- Personal/default OpenAI history works, making the issue look provider-specific.
- The intended setup of “corporate provider for one repo, personal provider elsewhere” becomes hard to use in Desktop.
- Users may incorrectly assume their corporate chat history was deleted.

## Requested Fix

Please make Codex Desktop recent/history views include custom provider threads correctly.

Specifically:

1. Ensure `thread/list` calls intended to include all local threads use the correct provider filter semantics.
2. Treat `modelProviders: []` as “all providers” consistently, per the generated app-server protocol.
3. Ensure custom providers such as `azure` are visible in recent chat history after app restart.
4. Ensure opening/resuming a custom-provider thread renders existing turns instead of a blank UI.
5. Add regression coverage for local custom providers with:
   - `source = "vscode"`
   - `model_provider != "openai"`
   - repo-scoped config selecting a custom provider
   - persisted local rollout JSONL history

## Security Notes

- No API key is included in this report.
- The Azure endpoint is redacted.
- Corporate chat content examples are limited to short thread titles/previews.

### What steps can reproduce the bug?

## Reproduction

1. Configure a custom model provider named `azure` in `~/.codex/config.toml`.
2. Configure one repo with local `.codex/config.toml` selecting:

---

3. Open Codex Desktop in that repo.
4. Start one or more chats and verify that turns complete successfully through the Azure provider.
5. Restart Codex Desktop.
6. Check recent chat history.
7. Observe that Azure-provider chats are missing or fail to open correctly, while default `openai` chats remain visible.


### What is the expected behavior?

## Expected Behavior

1. Threads created in the Hercules repo with `model_provider = "azure"` should appear in Codex Desktop recent chat history.
2. After restarting Codex Desktop, those Azure threads should still appear.
3. Opening an Azure thread should render the existing conversation turns, same as `model_provider = "openai"` threads.
4. Personal/default OpenAI threads from other repositories should continue to appear and open normally.

## Actual Behavior

1. Azure/provider-specific chats are created and saved successfully.
2. They may appear temporarily in the Desktop GUI.
3. After restarting Codex Desktop, Azure chats disappear from GUI history or open to a blank screen.
4. Non-Azure/default OpenAI chats still appear and open normally.
5. The missing Azure chats are not deleted and are not archived.


### Additional information

---

These rows are present in:

---

Their rollout JSONL files also exist under:

---

## Evidence: Local App-Server Can Read The Threads

Using the local Codex app-server WebSocket API, both `thread/list` and `thread/read` can see/read the Azure threads.

Example `thread/read` for:

---

Returned:

---

This indicates that the backend/state layer can load the conversation and the data is not lost.

## Evidence: Provider Filter Semantics May Be Involved

Generated app-server TypeScript protocol says:

---

Local testing showed:

- `thread/list` with `modelProviders: []` returned both `openai` and `azure` threads.
- `thread/list` with `modelProviders: null` could behave like a current-provider filter.
- The Desktop UI bundle contains `thread/list` calls with `modelProviders:null`.

This suggests the Desktop UI may be listing recent threads using provider filter semantics that exclude custom providers after restart, or it may be applying a UI-side provider filter that does not include custom providers.

## Additional Observations

`thread/list` without a `cwd` filter and with `modelProviders: []` returned mixed providers, including both:

---

`thread/list` with a `cwd` filter for Hercules and `modelProviders: []` also returned both `openai` and `azure` threads in that repo.

This further supports that the underlying app-server can return the data needed by the UI.

## Failed Workarounds

### 1. Duplicating Provider Definition Into Repo Config

Duplicating `[model_providers.azure]` into the repo-local `.codex/config.toml` did not fix Desktop history.

CLI still worked and reported:

---

But the Desktop GUI still did not show corporate/Azure chats after restart.

### 2. Trying To Override Built-In `openai` Provider

Attempting to configure built-in `openai` to point at Azure did not work. Codex still sent requests to:

---

This is not a viable workaround.

### 3. Patching `app.asar`

Two local experiments were attempted only to test the provider-filter hypothesis. Both are not viable and should not be used as a workaround.

First attempt:

- Extracted `app.asar`.
- Replaced `modelProviders:null` in JS.
- Repacked `app.asar`.
- Result: Codex Desktop crashed at startup with `EXC_BREAKPOINT (SIGTRAP)`.
- Likely cause: repacking lost original `app.asar.unpacked` metadata for native modules.

Second attempt:

- Performed an in-place byte-preserving edit:

---

to:

---

- Same byte length.
- No extract/repack.
- Updated affected asar integrity hashes in the header.
- Tested successfully on a `/tmp` copy with `@electron/asar list`.
- Result on the real installed app: Codex Desktop still crashed at startup with `EXC_BREAKPOINT (SIGTRAP)`.
- Likely cause: the installed app cannot tolerate mutation of `Resources/app.asar`, probably due to macOS/Electron code signing or resource seal validation.

Relevant crash reports:

---

`Resources/app.asar` is listed in:
RAW_BUFFERClick to expand / collapse

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

26.422.71525

What subscription do you have?

personal + corporate AzureOpenAI API key

What platform is your computer?

26.0 (25A8353)

What issue are you seeing?

  • Optional provider filter; when set, only sessions recorded under these
  • providers are returned. When present but empty, includes all providers. */ modelProviders?: Array<string> | null

Local testing showed:

- `thread/list` with `modelProviders: []` returned both `openai` and `azure` threads.
- `thread/list` with `modelProviders: null` could behave like a current-provider filter.
- The Desktop UI bundle contains `thread/list` calls with `modelProviders:null`.

This suggests the Desktop UI may be listing recent threads using provider filter semantics that exclude custom providers after restart, or it may be applying a UI-side provider filter that does not include custom providers.

## Additional Observations

`thread/list` without a `cwd` filter and with `modelProviders: []` returned mixed providers, including both:

```text
openai | vscode | /Users/uberkinder/projects/bp/Hercules
azure  | vscode | /Users/uberkinder/projects/bp/Hercules
azure  | vscode | /Users/uberkinder/projects/bp/Hercules
azure  | vscode | /Users/uberkinder/projects/bp/Hercules

thread/list with a cwd filter for Hercules and modelProviders: [] also returned both openai and azure threads in that repo.

This further supports that the underlying app-server can return the data needed by the UI.

Failed Workarounds

1. Duplicating Provider Definition Into Repo Config

Duplicating [model_providers.azure] into the repo-local .codex/config.toml did not fix Desktop history.

CLI still worked and reported:

provider: azure

But the Desktop GUI still did not show corporate/Azure chats after restart.

2. Trying To Override Built-In openai Provider

Attempting to configure built-in openai to point at Azure did not work. Codex still sent requests to:

https://api.openai.com/v1/responses

This is not a viable workaround.

3. Patching app.asar

Two local experiments were attempted only to test the provider-filter hypothesis. Both are not viable and should not be used as a workaround.

First attempt:

  • Extracted app.asar.
  • Replaced modelProviders:null in JS.
  • Repacked app.asar.
  • Result: Codex Desktop crashed at startup with EXC_BREAKPOINT (SIGTRAP).
  • Likely cause: repacking lost original app.asar.unpacked metadata for native modules.

Second attempt:

  • Performed an in-place byte-preserving edit:

    modelProviders:null

    to:

    modelProviders:([])
  • Same byte length.

  • No extract/repack.

  • Updated affected asar integrity hashes in the header.

  • Tested successfully on a /tmp copy with @electron/asar list.

  • Result on the real installed app: Codex Desktop still crashed at startup with EXC_BREAKPOINT (SIGTRAP).

  • Likely cause: the installed app cannot tolerate mutation of Resources/app.asar, probably due to macOS/Electron code signing or resource seal validation.

Relevant crash reports:

/Users/uberkinder/Library/Logs/DiagnosticReports/Codex-2026-04-29-143709.ips
/Users/uberkinder/Library/Logs/DiagnosticReports/Codex-2026-04-29-143726.ips

Resources/app.asar is listed in:

/Applications/Codex.app/Contents/_CodeSignature/CodeResources

So mutating the installed app bundle is not a practical workaround.

Impact

This makes corporate/custom-provider usage unsafe and confusing:

  • Work is not lost, but appears lost in the GUI.
  • Users cannot reliably reopen or continue corporate Azure chats from Desktop history.
  • Personal/default OpenAI history works, making the issue look provider-specific.
  • The intended setup of “corporate provider for one repo, personal provider elsewhere” becomes hard to use in Desktop.
  • Users may incorrectly assume their corporate chat history was deleted.

Requested Fix

Please make Codex Desktop recent/history views include custom provider threads correctly.

Specifically:

  1. Ensure thread/list calls intended to include all local threads use the correct provider filter semantics.
  2. Treat modelProviders: [] as “all providers” consistently, per the generated app-server protocol.
  3. Ensure custom providers such as azure are visible in recent chat history after app restart.
  4. Ensure opening/resuming a custom-provider thread renders existing turns instead of a blank UI.
  5. Add regression coverage for local custom providers with:
    • source = "vscode"
    • model_provider != "openai"
    • repo-scoped config selecting a custom provider
    • persisted local rollout JSONL history

Security Notes

  • No API key is included in this report.
  • The Azure endpoint is redacted.
  • Corporate chat content examples are limited to short thread titles/previews.

What steps can reproduce the bug?

Reproduction

  1. Configure a custom model provider named azure in ~/.codex/config.toml.

  2. Configure one repo with local .codex/config.toml selecting:

    model_provider = "azure"
  3. Open Codex Desktop in that repo.

  4. Start one or more chats and verify that turns complete successfully through the Azure provider.

  5. Restart Codex Desktop.

  6. Check recent chat history.

  7. Observe that Azure-provider chats are missing or fail to open correctly, while default openai chats remain visible.

What is the expected behavior?

Expected Behavior

  1. Threads created in the Hercules repo with model_provider = "azure" should appear in Codex Desktop recent chat history.
  2. After restarting Codex Desktop, those Azure threads should still appear.
  3. Opening an Azure thread should render the existing conversation turns, same as model_provider = "openai" threads.
  4. Personal/default OpenAI threads from other repositories should continue to appear and open normally.

Actual Behavior

  1. Azure/provider-specific chats are created and saved successfully.
  2. They may appear temporarily in the Desktop GUI.
  3. After restarting Codex Desktop, Azure chats disappear from GUI history or open to a blank screen.
  4. Non-Azure/default OpenAI chats still appear and open normally.
  5. The missing Azure chats are not deleted and are not archived.

Additional information

019dd592-b080-7fc1-85d6-bb788ea20b45 | azure | vscode | /Users/uberkinder/projects/bp/Hercules | "ты можешь посмотреть пост..."
019dd59e-26bc-79d1-9c6b-209fc88805e6 | azure | vscode | /Users/uberkinder/projects/bp/Hercules | "открой в линеар кейс с Photon"
019dd399-904a-72a3-adcc-720754426b9f | azure | vscode | /Users/uberkinder/projects/bp/Hercules | "можешь в тимс ходить?"

These rows are present in:

/Users/uberkinder/.codex/state_5.sqlite

Their rollout JSONL files also exist under:

/Users/uberkinder/.codex/sessions/2026/04/29/

Evidence: Local App-Server Can Read The Threads

Using the local Codex app-server WebSocket API, both thread/list and thread/read can see/read the Azure threads.

Example thread/read for:

019dd592-b080-7fc1-85d6-bb788ea20b45

Returned:

{
  "id": "019dd592-b080-7fc1-85d6-bb788ea20b45",
  "modelProvider": "azure",
  "cwd": "/Users/uberkinder/projects/bp/Hercules",
  "source": "vscode",
  "turns": 20,
  "preview": "ты можешь посмотреть пост который я в Viva Engage закинул"
}

This indicates that the backend/state layer can load the conversation and the data is not lost.

Evidence: Provider Filter Semantics May Be Involved

Generated app-server TypeScript protocol says:

/**
 * Optional provider filter; when set, only sessions recorded under these
 * providers are returned. When present but empty, includes all providers.
 */
modelProviders?: Array<string> | null

Local testing showed:

  • thread/list with modelProviders: [] returned both openai and azure threads.
  • thread/list with modelProviders: null could behave like a current-provider filter.
  • The Desktop UI bundle contains thread/list calls with modelProviders:null.

This suggests the Desktop UI may be listing recent threads using provider filter semantics that exclude custom providers after restart, or it may be applying a UI-side provider filter that does not include custom providers.

Additional Observations

thread/list without a cwd filter and with modelProviders: [] returned mixed providers, including both:

openai | vscode | /Users/uberkinder/projects/bp/Hercules
azure  | vscode | /Users/uberkinder/projects/bp/Hercules
azure  | vscode | /Users/uberkinder/projects/bp/Hercules
azure  | vscode | /Users/uberkinder/projects/bp/Hercules

thread/list with a cwd filter for Hercules and modelProviders: [] also returned both openai and azure threads in that repo.

This further supports that the underlying app-server can return the data needed by the UI.

Failed Workarounds

1. Duplicating Provider Definition Into Repo Config

Duplicating [model_providers.azure] into the repo-local .codex/config.toml did not fix Desktop history.

CLI still worked and reported:

provider: azure

But the Desktop GUI still did not show corporate/Azure chats after restart.

2. Trying To Override Built-In openai Provider

Attempting to configure built-in openai to point at Azure did not work. Codex still sent requests to:

https://api.openai.com/v1/responses

This is not a viable workaround.

3. Patching app.asar

Two local experiments were attempted only to test the provider-filter hypothesis. Both are not viable and should not be used as a workaround.

First attempt:

  • Extracted app.asar.
  • Replaced modelProviders:null in JS.
  • Repacked app.asar.
  • Result: Codex Desktop crashed at startup with EXC_BREAKPOINT (SIGTRAP).
  • Likely cause: repacking lost original app.asar.unpacked metadata for native modules.

Second attempt:

  • Performed an in-place byte-preserving edit:

    modelProviders:null

    to:

    modelProviders:([])
  • Same byte length.

  • No extract/repack.

  • Updated affected asar integrity hashes in the header.

  • Tested successfully on a /tmp copy with @electron/asar list.

  • Result on the real installed app: Codex Desktop still crashed at startup with EXC_BREAKPOINT (SIGTRAP).

  • Likely cause: the installed app cannot tolerate mutation of Resources/app.asar, probably due to macOS/Electron code signing or resource seal validation.

Relevant crash reports:

/Users/uberkinder/Library/Logs/DiagnosticReports/Codex-2026-04-29-143709.ips
/Users/uberkinder/Library/Logs/DiagnosticReports/Codex-2026-04-29-143726.ips

Resources/app.asar is listed in:

/Applications/Codex.app/Contents/_CodeSignature/CodeResources

So mutating the installed app bundle is not a practical workaround.

Impact

This makes corporate/custom-provider usage unsafe and confusing:

  • Work is not lost, but appears lost in the GUI.
  • Users cannot reliably reopen or continue corporate Azure chats from Desktop history.
  • Personal/default OpenAI history works, making the issue look provider-specific.
  • The intended setup of “corporate provider for one repo, personal provider elsewhere” becomes hard to use in Desktop.
  • Users may incorrectly assume their corporate chat history was deleted.

extent analysis

TL;DR

The issue can be fixed by ensuring thread/list calls use the correct provider filter semantics, treating modelProviders: [] as “all providers” consistently, and making custom providers visible in recent chat history after app restart.

Guidance

  • Verify that the modelProviders parameter is correctly set to [] when fetching threads to include all providers.
  • Check the app-server protocol to ensure it handles modelProviders: [] and modelProviders: null correctly.
  • Test the thread/list endpoint with different modelProviders values to confirm the issue is resolved.
  • Review the code to ensure custom providers are properly handled and displayed in the Desktop UI.
  • Consider adding regression tests to cover local custom providers with different configurations.

Example

No code example is provided as the issue is related to the app's internal logic and protocol handling.

Notes

The issue seems to be related to the provider filter semantics and how custom providers are handled in the app. The fix should involve ensuring consistent handling of modelProviders and proper display of custom providers in the Desktop UI.

Recommendation

Apply a workaround by modifying the thread/list calls to use the correct provider filter semantics, or wait for an official fix from the developers that addresses the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Codex Desktop hides local history for custom Azure model provider after restart (e.g. corporate API key) [4 comments, 3 participants]