Repository navigation
fix(sessions): discover and read Codex paginated histories - #3442
Merged
Merged
Conversation
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.
Summary
Fix missing Codex sessions after their history moves from JSONL rollouts into SQLite paginated storage. Discovery now reads the state catalog and opening a session reads its projected history, while preserving legacy JSONL support and existing source identities.
Type and Areas
Type: Bug fix
Areas: Codex session adapter, external session history, Zcode verification, documentation
Motivation / Impact
The affected workspace contained 449 main Codex sessions but only 10 remaining JSONL files. Scanning files alone omitted the other sessions. Paginated threads now appear without requiring a rollout file, duplicate SQLite/JSONL records resolve to one logical thread, and previously saved file locators continue to work after migration.
History reads use bounded read-only SQLite transactions, include committed WAL data, and preserve turn order, explicit interruption states, text, reasoning, and tool results. Unsupported or incomplete source data fails explicitly. Large generated image results are stored once rather than duplicated between tool input and output.
Verification
pnpm run fmt:rs— passed.cargo test -p openbitfun-codex-adapter -p openbitfun-zcode-adapter --lib session::— 33 passed; 4 opt-in installed-source checks ignored. Repeated successfully after rebasing onto currentupstream/main.cargo clippy -p openbitfun-codex-adapter -p openbitfun-zcode-adapter --no-deps --lib -- -D warnings— passed.cargo test -p openbitfun-codex-adapter --lib inspect_installed_codex_paginated_workspace -- --ignored --nocapture— with no workspace filter, all 983 source main-session IDs matched discovery with no duplicates: 982 readable histories, 1 empty source session, 0 failures; 9,714 turns and 91,161 tool records.cargo test -p openbitfun-zcode-adapter --lib inspect_installed_zcode -- --ignored --nocapture— all 6 source main-session IDs matched discovery and pagination; all histories readable, containing 25 turns and 193 tool records. Nested tasks are excluded by the existing source contract.Reviewer Notes
Zcode production behavior is unchanged; its installed-source verification now checks the complete catalog and pagination against source IDs. No public wire DTO or native session storage format changes are introduced. Previously cached source views and native branches retain their existing lifecycle rules.
Validation covers local adapter tests and actual read-only source databases. Desktop UI interaction, remote workspaces, remote control, Peer Device Mode, and Detached Dispatch were not exercised; their existing capability gates remain unchanged. The PR contains one new commit above current
upstream/main, without the previously merged PR changes or unrelated working-tree edits.Checklist