Skip to content

fix(parser): parse memory context from turn_context for Codex v0.135.0#95

Merged
delexw merged 2 commits into
mainfrom
fix-issue-85
Jun 3, 2026
Merged

fix(parser): parse memory context from turn_context for Codex v0.135.0#95
delexw merged 2 commits into
mainfrom
fix-issue-85

Conversation

@delexw
Copy link
Copy Markdown
Contributor

@delexw delexw commented May 31, 2026

Summary

Codex v0.135.0 (PR #24591) migrated memory runtime state from file-based storage to a dedicated SQLite database. Active memories are now injected into context at the start of each turn and emitted into the JSONL session file via the turn_context event under a memories array field.

This PR adds parsing support for that field so codex-trace correctly exposes memory context in traces produced by v0.135.0+ sessions.

Changes

  • src-tauri/src/parser/turn.rs: Added memories: Vec<String> field to CodexTurn. Updated handle_turn_context to extract the memories array from the turn_context JSONL payload. Pre-v0.135.0 sessions with no memories field default to an empty Vec gracefully.
  • shared/types.ts: Added memories?: string[] to the CodexTurn TypeScript interface (optional so existing test fixtures remain valid; the Rust backend always serialises it as [] or with values).
  • src-tauri/src/parser/entry.rs: Added v0.135.0 regression tests verifying turn_context entries with a memories array parse correctly through RawEntry.
  • src-tauri/src/parser/session.rs: Added full-session tests confirming memories appear on turns and that pre-v0.135.0 sessions produce an empty memories Vec without error.
  • src-tauri/src/parser/turn.rs (tests): Added three tests covering: memories parsed correctly, pre-v0.135.0 no-memories path, and memories preserved independently per turn across a multi-turn session.

Testing

  • 138 Rust lib tests pass (including 7 new tests for this change)
  • 128 frontend vitest tests pass (no regressions)
  • tsc --noEmit clean
  • cargo clippy -- -D warnings clean
  • HTTP API smoke test: POST /api/sessions returns 200

Fixes

Fixes #85

delexw and others added 2 commits May 31, 2026 13:44
Codex v0.135.0 (PR #24591) moved memory runtime state from file-based
storage to a dedicated SQLite database. Active memories are now injected
into the context at turn start and written into the turn_context JSONL
event under a `memories` array field.

Add `memories: Vec<String>` to `CodexTurn` (Rust) and `memories?: string[]`
to the TypeScript `CodexTurn` interface. Update `handle_turn_context` to
extract the field. Pre-v0.135.0 sessions with no memories field produce
an empty Vec gracefully.

Fixes #85
@delexw delexw merged commit 0b35835 into main Jun 3, 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.135.0: Memory state moved from file-based storage to dedicated SQLite database

2 participants