Skip to content

Add Codex CLI agent integration#153

Open
jcleira wants to merge 1 commit intomainfrom
minion/implement-implement
Open

Add Codex CLI agent integration#153
jcleira wants to merge 1 commit intomainfrom
minion/implement-implement

Conversation

@jcleira
Copy link
Copy Markdown
Member

@jcleira jcleira commented Apr 3, 2026

Summary

  • Add internal/agent/codex/ package with Detector implementation, process detection (pgrep -f codex), and session directory discovery (~/.codex/)
  • Register the Codex detector in the detection chain via resolveDetector() in the hooks package, selecting the detector based on the Agent config field
  • Update pre-commit and post-commit hooks to use the resolver instead of hardcoded claude.New(), with Claude-specific session parsing (JSONL, plans) guarded behind type assertions
  • Wire up the PARTIO_AGENT environment variable in config (was documented in CLAUDE.md but not implemented in env.go)

Test plan

  • make test passes — new table-driven tests for interface compliance, pgrep output parsing, and session directory discovery
  • make lint passes — zero issues
  • Manual: set PARTIO_AGENT=codex, run codex, commit — verify checkpoint is created with agent: codex
  • Manual: verify default behavior (Claude Code) is unchanged

🤖 Generated with Claude Code

Extend agent detection to recognise OpenAI Codex CLI alongside the
existing Claude Code integration. This ensures Codex-assisted commits
are properly attributed and session context is preserved.

- Add internal/agent/codex/ package with Detector, process detection
  via pgrep, and session directory discovery (~/.codex/)
- Add resolveDetector() in hooks to select detector based on config
- Update pre-commit and post-commit hooks to use the resolver, with
  Claude-specific session parsing guarded behind type assertions
- Wire up PARTIO_AGENT env var in config (was documented but missing)
- Table-driven tests for interface compliance, pgrep output parsing,
  and session directory discovery

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 7b4ba254c30e
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