[#34]: skip non-full view_mode entries (Codex v0.130.0 compat)#38
Merged
[#34]: skip non-full view_mode entries (Codex v0.130.0 compat)#38
Conversation
Codex v0.130.0 (PR #21566) added thread pagination to the app-server with three turn item view modes: unloaded (metadata-only stub), summary (partial), and full (complete). JSONL session files may now contain entries with a view_mode field; any entry where view_mode is present but not "full" carries incomplete turn data and must be skipped. Without this guard, sessions with stub entries would yield silently truncated turns — the original bug described in issue #34. Changes: - entry.rs: return None for entries where view_mode is present and != "full" - entry.rs: four new tests (unloaded, summary, full, absent/legacy) - turn.rs: multi_page_thread test verifying stubs are dropped and all complete turns survive across pages
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 #34
What
Codex v0.130.0 (upstream PR #21566) introduced three view modes for thread turn items written into JSONL session files:
unloaded(metadata-only stub),summary(partial data), andfull(complete data). Without handling these, codex-trace would silently process placeholder stubs as real turn entries, producing truncated or phantom turns for any session recorded with v0.130.0+.How
Added a guard in
RawEntry::parse(src-tauri/src/parser/entry.rs) that returnsNonefor any JSONL entry whereview_modeis present but not"full". Entries without aview_modefield (all pre-v0.130.0 sessions) are unaffected.This sits alongside the existing
record_type: "state"guard and follows the same pattern: unknown/incomplete placeholders are dropped at the earliest parse stage so the rest of the pipeline never sees them.Tests
view_mode_unloaded_returns_none— unloaded stubs are discardedview_mode_summary_returns_none— summary stubs are discardedview_mode_full_is_parsed_normally— full entries parse as beforeabsent_view_mode_is_parsed_normally— legacy entries (no field) are unaffectedmulti_page_thread_all_turns_present_stubs_ignored— end-to-end: a session with stubs interspersed across pages yields exactly the complete turns and none of the stub placeholdersAll 64 Rust tests and 122 frontend tests pass.