Add Codex session support#104
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
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
codexformat (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
| * 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) |
There was a problem hiding this comment.
Fixed in 761869e: restored ATIF / Harbor in the supported-formats comment so it matches the actual router and supported-formats error text.
| if (events.length === 0 && records.some(function (record) { return record.type === "session_meta"; })) { | ||
| warnings.push("Codex session contained metadata but no displayable events"); | ||
| } | ||
|
|
There was a problem hiding this comment.
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.
| if (event.isError) turn.hasError = true; | ||
| } | ||
|
|
||
| return turns.filter(function (turn) { return turn.eventIndices.length > 0; }); |
There was a problem hiding this comment.
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.
| {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> |
There was a problem hiding this comment.
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.
| padding: 0, | ||
| }} | ||
| > | ||
| load a demo session | ||
| Load a demo session | ||
| </button> |
There was a problem hiding this comment.
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>
Summary
~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonlwith strict path allowlistingStacked cleanup note
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.v2-cleanupcommit before this branch was created.Review follow-up
parseSession.tssupported-format commentValidation
npm run buildnpm run typechecknpm test(54 files, 870 tests)