Skip to content

fix(sessions): discover and read Codex paginated histories - #3442

Merged
kev1n77 merged 1 commit into
GCWing:mainfrom
kev1n77:fmy/compatibility
Oct 18, 2026
Merged

kev1n77 merged 1 commit into
GCWing:mainfrom
kev1n77:fmy/compatibility

Conversation

@kev1n77

@kev1n77 kev1n77 commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator

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 current upstream/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.
  • Fixture coverage includes legacy schemas and locators, cross-page discovery, stale rollout deduplication, committed/uncommitted WAL reads, unchanged source DB/WAL bytes, malformed/unknown records, orphan items, compaction fallback, ordering, and image-generation states.

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

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

@kev1n77
kev1n77 merged commit 810f32b into GCWing:main Oct 18, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant