Skip to content

[#34]: skip non-full view_mode entries (Codex v0.130.0 compat)#38

Merged
delexw merged 1 commit intomainfrom
fix-issue-34
May 10, 2026
Merged

[#34]: skip non-full view_mode entries (Codex v0.130.0 compat)#38
delexw merged 1 commit intomainfrom
fix-issue-34

Conversation

@delexw
Copy link
Copy Markdown
Contributor

@delexw delexw commented May 10, 2026

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), and full (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 returns None for any JSONL entry where view_mode is present but not "full". Entries without a view_mode field (all pre-v0.130.0 sessions) are unaffected.

if let Some(vm) = v.get("view_mode").and_then(|t| t.as_str()) {
    if vm != "full" {
        return None;
    }
}

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 discarded
  • view_mode_summary_returns_none — summary stubs are discarded
  • view_mode_full_is_parsed_normally — full entries parse as before
  • absent_view_mode_is_parsed_normally — legacy entries (no field) are unaffected
  • multi_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 placeholders

All 64 Rust tests and 122 frontend tests pass.

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
@delexw delexw merged commit e06f569 into main May 10, 2026
1 check 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.

[Compat] Codex v0.130.0: thread turns endpoint now paginated with unloaded/summary/full view modes

1 participant