Skip to content

fix: support current Codex session JSONL schema - #2750

Closed
anirishrnbsinger wants to merge 1 commit into
garrytan:mainfrom
anirishrnbsinger:rish/vil-512-parkafterce-04-repair-codex-global-retro-scanner
Closed

anirishrnbsinger wants to merge 1 commit into
garrytan:mainfrom
anirishrnbsinger:rish/vil-512-parkafterce-04-repair-codex-global-retro-scanner

Conversation

@anirishrnbsinger

@anirishrnbsinger anirishrnbsinger commented Aug 31, 2026 •

Copy link
Copy Markdown

Summary

  • replace the first-line/128 KiB Codex heuristic with a bounded 1 MiB JSONL record parser
  • recognize current event_msg, response_item, compacted, and related envelopes while emitting at most one session per file
  • report root/subagent counts plus explicit malformed, unknown, missing-metadata, truncated-prefix, and read-error diagnostics
  • use local-calendar boundaries for day/week audit windows
  • add synthetic current, legacy, subagent, unknown, >128 KiB metadata, truncation, and time-boundary fixtures
  • preserve the existing CODEX_SESSIONS_DIR test override and the current untracked-build-binary policy

Why

Current Codex session_meta records on the audited machine are 18–29 KiB, and the session stream now contains multiple typed envelopes. While main now covers the original 4 KiB truncation with a 128 KiB first-line read, that remains a heuristic and does not provide schema diagnostics or root/subagent accounting. This change makes the global retro audit repeatable against the current JSONL schema.

Verification

  • CI-pinned Bun 1.3.10 (Linux container): 31 focused tests passed
  • local Bun 1.2.19 with bun absent from PATH: 31 focused tests passed
  • live 15-day scan at head 082ddba: 211 Codex sessions (155 root, 56 subagent), 10 repos, zero parse diagnostics
  • deterministic start date: 2026-08-16
  • git diff --check

Linear: https://linear.app/viltrumempire/issue/VIL-512

@trunk-io

trunk-io Bot commented Aug 31, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@anirishrnbsinger
anirishrnbsinger force-pushed the rish/vil-512-parkafterce-04-repair-codex-global-retro-scanner branch from ce44644 to 5f171a1 Compare August 31, 2026 14:44
@capy-ai

capy-ai Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Thanks for the careful work and fixtures, @anirishrnbsinger. Main already handles current Codex session_meta sizes (a 128 KiB first-line read since v1.69.0.0, which covers the 18-29 KiB records you measured), and day/week windows are already local-midnight aligned, so /retro's discovery works on today's schema. We'd rather not take on the larger parser and diagnostics without a consumer for them. Closing as superseded; if a future Codex release breaks discovery, an issue with a sample record would be very welcome.

@capy-ai capy-ai Bot closed this Oct 8, 2026
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