Repository navigation
feat(sessions): list Codex conversations, and say why they don't move - #20
Merged
Merged
Conversation
gelzinn
force-pushed
the
feat/codex-sessions
branch
from
October 28, 2026 15:43
2736a0d to
5c8f255
Compare
seats sessions now lists Codex seats' conversations next to Claude's, the same ones codex resume lists there: archived ones, codex exec runs and subagents stay out. The title is the name given with /rename, else the first prompt, and the Id column shows the whole id, which codex resume needs. seats move refuses a Codex conversation and says why: Codex finds a copied rollout by its file name, but the conversation keeps reasoning encrypted for the account that ran it, which another account can refuse. The list points at seats run codex:<seat> resume <id> instead.
The hint under seats sessions now reads seats run <seat> resume <id>, so the Seat column's value goes in as it is, and the help for seats move says it copies Claude conversations.
gelzinn
force-pushed
the
feat/codex-sessions
branch
from
October 28, 2026 16:21
5c8f255 to
05b5ca1
Compare
3 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
seats sessionsandseats moveonly covered Claude. #18 gave Codex afindfor herdr and leftlistout because it wasn't known whether a copied rollout resumes on another account. This answers that from Codex's source (openai/codexatrust-v0.162.1, the installedcodex-cli 0.162.1) and a throwawayCODEX_HOME, then builds what the answer allows: Codex conversations are listed, andseats moverefuses them with the reason.What I found
codex resume <id>finds a copied rollout.find_thread_path_by_id_str_in_subdir(codex-rs/rollout/src/list.rs:1248-1410) asks the state DB (state_5.sqlite) first, falls back to scanningsessions/file names when it has no row, and then read-repairs the row into the DB. The id must be a whole UUID (list.rs:1254), so no prefixes.--lastmiss a copy until it has been opened once by id. Both query the state DB only and scan files only when the DB returns nothing (tui/src/lib.rs:836-857,tui/src/resume_picker.rs:1509). On a seat that already has history, a copied rollout stays out of them untilcodex resume <id>indexes it. seats never writes Codex's SQLite (it's versioned, in WAL mode, and a live codex may hold it open).CODEX_HOME, after the startup backfill, I added a synthetic rollout.codex exec resume <copied id>started a turn:thread.startedwith that id, then a 401 from the API because there's no auth. An unknown id failed withno rollout found for thread id ….exec resume --lastpicked the older indexed thread even though the copy's file was newer. The DB row for the copy appeared after the by-id resume.creator_user_idandcreator_account_idare written at creation (core/src/session/session.rs:1037) and only copied around afterwards.move: encrypted reasoning. Requests includereasoning.encrypted_content(core/src/client.rs:961), and the reasoning items saved in the rollout are sent back on resume. I found no handling for a server refusing them. A user report shows the API refusing exactly that after an auth switch:invalid_encrypted_content, "organization_id did not match the target organization" (community.openai.com). So a copy is found, but its first turn on another account may be refused. Per the brief, that keepsmoverefused.session_index.jsonlholds/renamenames (append-only, last entry wins). seats reads it for titles.history_base(thread-store/src/local/rollout_lineage.rs), so a copy would need the whole chain. That doesn't matter whilemoveis refused.history.jsonlis the prompt history for up-arrow and isn't needed to resume.What changed
list(src/providers/codex/sessions.ts):sessions/for id, file,cwd, title and mtime./renamename, else the firstevent_msg/user_message.response_itemuser messages are skipped because they also carry AGENTS.md and the environment context.session_metaline embeds the base instructions, so it can be longer than the 64 KBheadAndTailchunk Claude uses; a test covers a 200 KB meta line.codex resume.cliandvscodesources are listed;codex execruns and subagents are left out.seats healthalready runs with--ephemeral, so it adds none.codex resumelisting.…-<id>_<rollout id>.jsonl) is listed once, from its newest rollout.findnow takes the newest rollout for such a thread too..jsonl.zstrollouts are skipped.SeatSource.sessions.noMove: a reason string.moveSessionthrows it, after the cross-tool check, without copying anything. Codex sets it; the generic code has noif codex.seats sessions:seats sessions codexalready filters).codex resumetakes no prefix; the title column shrinks to make room.Codex conversations stay on their seat. Reopen one with seats run <seat> resume <id>.seats run codex:<seat> resume <id>, the hint above and feat(trust): share folder trust as it's given and resume herdr panes on their seat #18's herdr restore all go throughsupervise(). With auto-switch on, if that seat is at its limit at launch, it switches to another Codex seat that doesn't have the rollout, andcodex resumefails with "no rollout found". This was already the case before this PR; I left it alone because it's inrun.ts.seats sessionsline, the herdr note), HELP forseats sessionsandseats move, and tests: listing, titles and names, archived, non-interactive, malformed lines, long meta line, reverted threads, the move refusal, the cross-tool refusal andresumeArgs.bun run checkandbun src/cli.ts help.seats sessions --allandseats move <id> codex:personalwith a throwawayHOME, using the rollouts the realcodex0.162.1 had rewritten in the check above. The listing and hint print, the move exits 1 with the reason, and nothing is written to the target seat.Open
CODEX_HOME=<other seat> codex resume <id>, and send a prompt. If it works across accounts, droppingnoMoveenablesmove; that would also needhistory_baseprefixes copied for paginated threads.User-facing changes
BEGIN_COMMIT_OVERRIDE
feat(sessions): seats sessions lists Codex conversations too, with the command to reopen one on its seat
END_COMMIT_OVERRIDE
Type of change
Checklist
bun run checkpasses (Biome lint and format, typecheck, tests)bun src/cli.ts helpruns without errors--dry-runor a throwawayHOMEsrc/providers/<id>/and is listed insrc/providers/index.ts