codex - 💡(How to fix) Fix Codex Desktop external-agent import makes imported chats look new and hides existing project history [1 comments, 2 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#21376Fetched 2026-05-07 03:40:56
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

Root Cause

This was extremely disruptive because the UI looked like prior Codex work had been lost. The local Codex data was still present, but the Desktop sidebar/project list was polluted and filtered in a way that hid existing native chats for projects that did not receive imported chats.

Fix Action

Fix / Workaround

  • The import created 50 new Codex thread records from external agent history.

  • All 50 imported threads were written with created_at / updated_at equal to the import time, not the original conversation time.

  • The imported threads appeared at the top of recent/project history as if they were brand-new Codex conversations.

  • Projects that did not receive imported external-agent chats showed "No chats", even though their native Codex threads still existed in ~/.codex/state_5.sqlite and their rollout .jsonl files still existed under ~/.codex/sessions/.

  • Marking the imported threads as archived directly in state_5.sqlite was not enough. On app restart, Codex reindexed the imported .jsonl files still present under ~/.codex/sessions/... and reactivated the imported threads.

  • The durable local workaround was to move the 50 imported rollout .jsonl files out of the active ~/.codex/sessions/ tree, remove their entries from session_index.jsonl, and archive their thread rows again.

  • Imported external-agent chats should preserve their original conversation timestamps, or at least be clearly marked and grouped by import source/date instead of being inserted into recent history as brand-new chats.

  • Imported chats should not displace or hide native Codex project chats.

  • Projects with existing native Codex threads should never display "No chats" just because they did not receive imported external-agent chats.

  • The import should have a clear undo/revert action.

  • Archiving imported threads should persist across app restarts.

  • Reindexing should respect archived/imported state and should not silently reactivate imported history from files under ~/.codex/sessions/.

  • Ideally, external-agent imports should be quarantined or staged before being merged into the normal Codex session tree.

Manual workaround used:

RAW_BUFFERClick to expand / collapse

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

26.429.61741

What subscription do you have?

Pro

What platform is your computer?

macOS / Darwin arm64

What issue are you seeing?

Codex Desktop's "Import configuration from another agent" / external agent import flow imported third-party agent chats into the main Codex history as if they were created today, which displaced native Codex project history and made several existing projects appear to have "No chats".

This was extremely disruptive because the UI looked like prior Codex work had been lost. The local Codex data was still present, but the Desktop sidebar/project list was polluted and filtered in a way that hid existing native chats for projects that did not receive imported chats.

Observed behavior:

  • The import created 50 new Codex thread records from external agent history.
  • All 50 imported threads were written with created_at / updated_at equal to the import time, not the original conversation time.
  • The imported threads appeared at the top of recent/project history as if they were brand-new Codex conversations.
  • Projects that did not receive imported external-agent chats showed "No chats", even though their native Codex threads still existed in ~/.codex/state_5.sqlite and their rollout .jsonl files still existed under ~/.codex/sessions/.
  • Marking the imported threads as archived directly in state_5.sqlite was not enough. On app restart, Codex reindexed the imported .jsonl files still present under ~/.codex/sessions/... and reactivated the imported threads.
  • The durable local workaround was to move the 50 imported rollout .jsonl files out of the active ~/.codex/sessions/ tree, remove their entries from session_index.jsonl, and archive their thread rows again.

Local evidence from the incident:

  • Import registry: ~/.codex/external_agent_session_imports.json
  • Imported records: 50
  • Import window: approximately 2026-05-06 13:18:44 to 13:19:02 local time
  • Imported target projects:
    • 41 threads into one existing local workspace
    • 6 threads into the home workspace
    • 3 threads into another existing project
  • Existing native projects affected by the sidebar displaying "No chats" still had active rows and files, for example:
    • one project had 9 active native Codex chats
    • another workspace had 12 active native Codex chats
    • another project had 3 active native Codex chats
  • Those native rollout files existed on disk and matched the rollout_path values in SQLite.

The external import also modified user configuration by enabling a third-party marketplace/plugin, but this issue is specifically about history/sidebar corruption and lack of a safe undo path.

What steps can reproduce the bug?

  1. Use Codex Desktop on macOS with existing native Codex project history across multiple projects.
  2. Open Settings and click the prompt similar to "Import configuration from another agent" / "Codex found useful configuration in another local agent app".
  3. Confirm/import the external agent configuration/history.
  4. Observe that imported external-agent chats appear in Codex recent/project history as if they were created at the import time.
  5. Observe that some existing projects that did not receive imported external-agent chats show "No chats" in the sidebar, despite having native Codex threads on disk/in SQLite.
  6. Inspect local state:
    • ~/.codex/external_agent_session_imports.json lists imported thread IDs.
    • ~/.codex/state_5.sqlite contains both the imported threads and the pre-existing native Codex threads.
    • pre-existing native rollout_path files still exist under ~/.codex/sessions/.
  7. Try to archive only the imported threads in SQLite.
  8. Restart Codex Desktop.
  9. Observe that the imported threads become active again because their imported .jsonl files remain under the active ~/.codex/sessions/ tree and are reindexed.

What is the expected behavior?

The external agent import flow should not make existing Codex history appear lost.

Expected behavior:

  • Imported external-agent chats should preserve their original conversation timestamps, or at least be clearly marked and grouped by import source/date instead of being inserted into recent history as brand-new chats.
  • Imported chats should not displace or hide native Codex project chats.
  • Projects with existing native Codex threads should never display "No chats" just because they did not receive imported external-agent chats.
  • The import should have a clear undo/revert action.
  • Archiving imported threads should persist across app restarts.
  • Reindexing should respect archived/imported state and should not silently reactivate imported history from files under ~/.codex/sessions/.
  • Ideally, external-agent imports should be quarantined or staged before being merged into the normal Codex session tree.

Additional information

This was user-visible as apparent data loss and required manual local repair.

Manual workaround used:

  1. Back up ~/.codex/state_5.sqlite, session_index.jsonl, and external_agent_session_imports.json.
  2. Use external_agent_session_imports.json as the source of truth for the 50 imported thread IDs.
  3. Move the corresponding imported rollout .jsonl files out of ~/.codex/sessions/ into a recovery/quarantine folder.
  4. Remove the imported IDs from session_index.jsonl.
  5. Mark the imported thread rows as archived in state_5.sqlite.
  6. Verify after waiting/restarting that imported active count remains 0 and native project chats are still present.

Related but not exact issues found before filing:

  • #21076: Recent conversation history hidden/stale despite local DB containing threads
  • #18364: Mac app hides older local conversations after update because bogus sessions flood recent history
  • #17354: Recent thread history wiped in app, present in CLI
  • #14389: Desktop App does not display existing local sessions from shared CODEX_HOME

This report is specifically about the external-agent import flow creating normal active Codex threads with import-time timestamps and the app reindexing/reactivating those imported threads on restart.

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 external-agent import makes imported chats look new and hides existing project history [1 comments, 2 participants]