Skip to content

Add Codex session support#104

Merged
jayparikh merged 3 commits into
mainfrom
codex-support
May 26, 2026
Merged

Add Codex session support#104
jayparikh merged 3 commits into
mainfrom
codex-support

Conversation

@jayparikh
Copy link
Copy Markdown
Owner

@jayparikh jayparikh commented May 26, 2026

Summary

  • Add first-class Codex rollout JSONL parsing and format detection
  • Discover Codex sessions from ~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl with strict path allowlisting
  • Add Codex landing labels, docs, synthetic fixtures, parser tests, route tests, and golden format coverage

Stacked cleanup note

  • This branch is based on v2-cleanup, so it also includes the intentional live-banner cleanup that removes the redundant streaming-state Go to Review action and normalizes related button label casing.
  • The screenshot artifacts were regenerated in the stacked v2-cleanup commit before this branch was created.

Review follow-up

  • Restored ATIF / Harbor in the parseSession.ts supported-format comment
  • Removed an unreachable metadata-only Codex warning
  • Reindexed Codex turns after filtering empty lifecycle turns, with regression coverage

Validation

  • npm run build
  • npm run typecheck
  • npm test (54 files, 870 tests)
  • Privacy audit for real Codex sample data
  • Security review and follow-up code review

jayparikh and others added 2 commits May 25, 2026 20:14
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class Codex rollout JSONL support to AGENTVIZ, including format detection, parsing into the normalized event/turn model, and local auto-discovery from ~/.codex/sessions/... alongside existing Claude Code / Copilot / VS Code sources.

Changes:

  • Add Codex rollout JSONL parser + wire it into detectFormat() / parseSession() and supported-format messaging.
  • Add backend discovery + strict allowlisting for Codex rollout files, plus preview extraction and route tests.
  • Update landing filters/docs/fixtures/golden coverage for the new codex format (and adjust some UI copy casing).
Show a summary per file
File Description
src/lib/sessionTypes.ts Extends SessionFormat union with codex.
src/lib/sessionParsing.ts Updates supported-formats error text to include Codex.
src/lib/parseSession.ts Adds Codex detection + parsing route; expands tool-call pairing candidate IDs.
src/lib/landingSessions.js Adds Codex landing filter option + label formatting.
src/lib/codexParser.ts New Codex rollout JSONL parser with detection, normalization, token usage, and privacy elision.
src/components/v2/V2Header.jsx Capitalizes “Path” button label.
src/components/v2/LiveSessionBanner.jsx Changes which actions render based on live/completed state.
src/components/v2/FindPortfolio.jsx Capitalizes several button labels (Clear/Load).
src/components/QADrawer.jsx Capitalizes “Clear” button label.
src/components/InboxView.jsx Capitalizes several button labels (Clear/Load/Compare).
src/components/app/CompareLandingState.jsx Capitalizes “Cancel” button label.
src/tests/v2Shell.test.jsx Updates assertions for new button casing and LiveSessionBanner behavior.
src/tests/sessionsRoute.test.js Adds Codex discovery/preview tests + Codex allowlist tests.
src/tests/landingSessions.test.js Adds Codex landing label/options tests.
src/tests/fixtures/v2-golden-formats.expected.json Adds Codex golden-format expectations.
src/tests/fixtures/test-codex.jsonl Adds a synthetic Codex rollout fixture.
src/tests/codexParser.test.ts Adds Codex parser/detection/unit tests incl. tool pairing + elision.
src/tests/appRegression.test.jsx Updates tests for “Load a demo session” casing.
routes/sessions.js Adds Codex discovery, preview parsing, and strict path allowlisting.
README.md Documents Codex support + discovery path and updates UI copy casing in docs.
CLAUDE.md Updates architecture/file-tree docs to include Codex support.
.github/skills/sync-artifacts/SKILL.md Updates screenshot instructions copy casing.
.github/copilot-instructions.md Updates screenshot instructions copy casing.

Copilot's findings

  • Files reviewed: 23/32 changed files
  • Comments generated: 5

Comment thread src/lib/parseSession.ts
Comment on lines 4 to 8
* Supported formats:
* - Codex rollout JSONL (producer: codex-* under ~/.codex/sessions)
* - Copilot CLI JSONL (producer: "copilot-agent")
* - VS Code Copilot Chat JSON (version + requests + sessionId)
* - VS Code Copilot prompt exports (copilot_all_prompts_*.json)
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 761869e: restored ATIF / Harbor in the supported-formats comment so it matches the actual router and supported-formats error text.

Comment thread src/lib/codexParser.ts Outdated
Comment on lines +431 to +434
if (events.length === 0 && records.some(function (record) { return record.type === "session_meta"; })) {
warnings.push("Codex session contained metadata but no displayable events");
}

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 761869e: removed the unreachable metadata-only warning. Metadata-only Codex logs still return null under the parser contract instead of creating a warning users could never see.

Comment thread src/lib/codexParser.ts Outdated
if (event.isError) turn.hasError = true;
}

return turns.filter(function (turn) { return turn.eventIndices.length > 0; });
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 761869e: after filtering empty lifecycle turns, the parser now reassigns contiguous turn indexes and updates every event turnIndex. Added a regression test for an empty turn followed by a real turn.

Comment on lines +84 to 88
{completed && (
<div style={{ display: "flex", alignItems: "center", gap: theme.space.sm, flexShrink: 0 }}>
<ToolbarButton onClick={onReview} style={{ color: theme.accent.primary, borderColor: theme.accent.primary }}>
Review summary
</ToolbarButton>
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentional. This PR is stacked on v2-cleanup, where we removed the redundant streaming-state Go to Review action after discussing it. Review remains available from the workflow rail, and the PR body now calls out the stacked cleanup explicitly.

Comment on lines 382 to 386
padding: 0,
}}
>
load a demo session
Load a demo session
</button>
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This UI copy change is from the stacked v2-cleanup commit. That commit regenerated the screenshot artifacts and this branch includes those updated screenshots. I also updated the PR body to make the stacked cleanup context explicit.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jayparikh jayparikh merged commit 5dd24bd into main May 26, 2026
1 check passed
@jayparikh jayparikh deleted the codex-support branch May 26, 2026 10:37
spboyer added a commit to spboyer/agentviz that referenced this pull request May 26, 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.

2 participants