fix(codex): discover archived sessions - #55
Open
solkennedy wants to merge 2 commits into
Open
solkennedy wants to merge 2 commits into
solkennedy wants to merge 2 commits into
Conversation
CodexStore::discover() only walked sessions_dir. Codex's own /archive (TUI) and codex archive / codex unarchive (CLI) move a rollout out of that dated tree into a flat sibling directory, archived_sessions, which discover() never looked at. An archived Codex session was therefore invisible to txcript list --from codex / view / MCP list_sessions until it was unarchived. Give CodexStore an optional archived_sessions_dir, set by default_root() to the sibling archived_sessions directory, and walk it alongside sessions_dir in discover(). new() keeps its existing single-argument shape since it's also used to construct a store for writing a new session, which should always land in sessions_dir. Verified on a real machine: `txcript list --from codex` went from 671 to 1202 sessions (+531), matching the file count in ~/.codex/archived_sessions exactly. Fixes skillsynchq#54. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
NishantJoshi00
self-requested a review
September 17, 2026 21:21
Collaborator
|
Thanks for tracking this down! Could you also make One release detail for us: the new public field breaks callers using |
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.
Fixes #54.
What changed
CodexStore::discover()only walkedsessions_dir(~/.codex/sessionsor$CODEX_HOME/sessions). Codex's own/archive(TUI) andcodex archive/codex unarchive(CLI) move a rollout out of that datedYYYY/MM/DDtree into a flat sibling directory,archived_sessions, whichdiscover()never looked at. An archived Codex session was invisible totxcript list --from codex/view/ MCPlist_sessionsuntil it was unarchived back intosessions/.CodexStoregets an optionalarchived_sessions_dir, set bydefault_root()to the siblingarchived_sessionsdirectory.discover()walks it alongsidesessions_dirand merges the results.new()keeps its existing single-argument shape — it's also used to construct a store for writing a new session (seesrc/local.rs'scodex::CodexStore::newfactory reference), which should always land insessions_dir, neverarchived_sessions_dir.Testing
discover_includes_archived_sessions(active + archived rollouts both surface) anddiscover_without_archived_dir_only_finds_active_sessions(a hand-built store with no archived dir is unaffected) totests/integration/codex.rs.cargo test -p txcript --lib(60 passed),cargo test -p txcript --test integration(205 passed),cargo clippy -p txcript --lib --all-features(clean).txcript list --from codexwent from 671 to 1202 sessions (+531), matching the file count in~/.codex/archived_sessionsexactly, with no duplicate IDs and correct metadata (titles, cwd, timestamps) on the newly-surfaced rows going back to the very first session.Note: this is unrelated to #52/#53 (the ChatGPT-cloud harness's own separate
is_archivedbug) — see the correction comment on #52.