Skip to content

Add Codex provider support#3

Open
lakshya-dhariwal wants to merge 1 commit into
shivamstaq:masterfrom
lakshya-dhariwal:add-codex-provider
Open

Add Codex provider support#3
lakshya-dhariwal wants to merge 1 commit into
shivamstaq:masterfrom
lakshya-dhariwal:add-codex-provider

Conversation

@lakshya-dhariwal

Copy link
Copy Markdown

Summary

Adds Codex CLI as a first-class ccview provider alongside Claude Code and OpenCode.

The implementation reads Codex's portable local data layout rather than machine-specific paths:

  • ~/.codex/sessions/YYYY/MM/DD/*.jsonl for rollout message history
  • latest ~/.codex/state_*.sqlite for thread metadata, project grouping, token totals, git branch, model info, and subagent edges
  • ~/.codex/session_index.jsonl as a title/timestamp fallback
  • ~/.codex/shell_snapshots/*.sh as optional linked shell snapshot files

Features

  • Adds a CodexProvider that implements the existing provider interface.
  • Groups Codex sessions by cwd/project and sorts by recent activity.
  • Renders Codex user/assistant messages, reasoning summaries, function calls, custom tools, web search calls, image generation calls, tool outputs, and token usage.
  • Maps Codex thread-spawn edges to ccview subagents, matching the existing Claude/OpenCode subagent UX.
  • Shows Codex token totals and shell snapshot badges in the TUI and web UI.
  • Makes provider discovery and web tree merging generic across Claude Code, OpenCode, and Codex.
  • Allows direct --file/--export usage for Codex rollout JSONL files.
  • Updates docs with the Codex data footprint using version-tolerant state_*.sqlite / goals_*.sqlite patterns.

Notes

The Codex provider treats SQLite/thread metadata and shell snapshots as optional. If a Codex installation only has rollout JSONL files, ccview still loads conversation history and degrades gracefully.

Testing

  • go build -o ccview .
  • go test ./...
  • Local smoke test with ./ccview --web --port 3334
    • verified /api/tree includes Codex projects/conversations/subagents/token totals/shell snapshots
    • verified /api/messages?source=codex renders Codex messages, token usage, and tool cards
    • verified ./ccview --export /tmp/ccview-codex-export.html --file <codex-rollout.jsonl>

@lakshya-dhariwal lakshya-dhariwal marked this pull request as ready for review June 7, 2026 15:37
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.

1 participant