Date: 2026-06-01
Explore whether an existing Codex Desktop thread can be reassigned from a projectless/public space into a saved project while preserving the same thread id and future execution behavior.
Target thread discussed by the user:
019e7fad-654e-7283-b280-0152cce172f7- Current recorded cwd:
/Users/keeran/Documents/Codex/2026-05-31/i-need-you-to-create-a - Desired project cwd:
/Users/keeran/src/codex-flight-recorder
Primary durable thread index. Relevant table: threads.
Important columns:
idrollout_pathcwdtitlearchivedgit_shagit_branchgit_origin_urlcreated_at_msupdated_at_ms
Changing threads.cwd and git columns alone is not enough. The database row changed, but read_thread continued to show the old cwd until JSONL metadata was also edited.
This is not just transcript history; it carries execution context.
Relevant records:
- First line
session_meta.payload.cwd - First line
session_meta.payload.git - Per-turn
turn_context.payload.cwd - User-visible
<environment_context><cwd>...</cwd></environment_context>response items
Updating only session_meta made read_thread and list_threads report the new cwd. It did not make future tool execution run in the new cwd.
Relevant keys:
electron-saved-workspace-rootsproject-orderactive-workspace-rootsprojectless-thread-idsthread-workspace-root-hintsthread-projectless-output-directories
Project threads do not appear to need per-thread entries here. Projectless threads do.
Removing a lab thread from projectless-thread-ids, thread-workspace-root-hints, and thread-projectless-output-directories was not enough to make future execution run inside the target project. The app later re-added projectless mappings.
Contains trusted project path entries, but adding a [projects."..."] entry manually did not make create_thread accept that path as a saved project in the running app.
The thread tool's saved-project list appears to come from app state, not a hot reload of this TOML file.
Contains title and update timestamp by thread id. No project/cwd association found.
Logs are keyed by thread_id, with no project/cwd association found.
Projectless lab thread:
019e807b-1d50-7440-b3a5-ae3db1641bcf
Project lab thread:
019e807b-1e2a-7561-917a-1dca21cc5f4e
The project lab thread was created in /Users/keeran/src/codex-flight-recorder using the supported create_thread project target.
For the projectless lab thread, I changed:
state_5.sqlite.threads.cwdstate_5.sqlitegit metadata columnssession_meta.payload.cwdsession_meta.payload.git- prior structured
turn_context.payload.cwd - prior
<environment_context>cwd text - removed projectless side mappings from
.codex-global-state.json
Observed behavior:
- After updating SQLite only,
read_threadstill showed old cwd. - After updating JSONL
session_meta,read_threadandlist_threadsshowed new cwd. - Continuing the thread still executed in the original projectless cwd.
- Updating prior
turn_contextrecords did not fix execution while the thread was already loaded. - Archive/unarchive unloaded the thread, but unarchive and later continuation re-derived projectless mappings.
- A later continuation ran in a generated projectless fallback directory with read-only sandboxing, not in the desired project.
There are at least two separate concepts:
- Display/index placement, controlled by SQLite, JSONL metadata, and global projectless indexes.
- Future execution placement, controlled by live app/runtime state that is not fully represented by the stores edited during this lab, or is not hot-reloaded safely.
A cosmetic move is possible by editing the durable stores. A reliable live move that preserves the thread id and makes future turns execute in the destination project was not proven safe.
Do not perform a live reassignment of 019e7fad-654e-7283-b280-0152cce172f7 from inside a running Codex Desktop session.
The lowest-risk supported approach remains:
- Create a new thread in the desired project.
- Seed it with the important context from the old thread.
- Archive or leave the old thread as the source record.
An offline/cold reassignment may be possible after fully quitting Codex Desktop, backing up all stores, editing SQLite, JSONL, and global state together, then relaunching. That path was not executed because it would cross the stability line for this active setup.