Skip to content

Add Codex CLI agent integration#172

Open
jcleira wants to merge 5 commits intomainfrom
minion/implement-implement
Open

Add Codex CLI agent integration#172
jcleira wants to merge 5 commits intomainfrom
minion/implement-implement

Conversation

@jcleira
Copy link
Copy Markdown
Member

@jcleira jcleira commented Apr 7, 2026

Summary

  • Add OpenAI Codex CLI (codex) as a supported AI agent alongside Claude Code
  • Introduce internal/agent/codex/ package with process detection, session directory lookup, and Detector implementation
  • Add pluggable detector registry (agent.Register/agent.NewDetector) so hooks select the detector based on the agent config setting
  • Update pre-commit and post-commit hooks to use the registry instead of hardcoding Claude Code
  • Add PARTIO_AGENT environment variable support for overriding the agent name
  • Add diagnostic logging for checkpoint linking failures
  • Table-driven unit tests for codex detector and registry

Why

Codex CLI is a widely used AI coding agent. Without this change, Codex-assisted commits are attributed as 100% human work and no session context is preserved. The agent.Detector interface was already designed to be pluggable — this PR delivers on that design.

Test plan

  • go test ./... passes
  • golangci-lint run passes
  • New tests cover codex detector (Name, IsRunning, FindSessionDir)
  • New tests cover registry (NewDetector with registered and unknown agents)
  • Manual: set PARTIO_AGENT=codex and verify partio status reports codex

🤖 Generated with Claude Code

minion[bot] and others added 2 commits April 7, 2026 07:06
Add a pluggable agent registry and implement the Codex CLI detector
alongside the existing Claude Code detector. The hooks now resolve
the detector from config rather than hardcoding Claude Code.

- internal/agent/registry.go: agent name → detector factory registry
- internal/agent/codex/: Codex CLI detector (process detection, session dir)
- internal/agent/claude/register.go: register claude-code detector
- Update pre-commit and post-commit hooks to use registry with fallback
- Fix flaky precommit_test timing (5ms → 50ms sleep)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add structured debug and warn logging in the post-commit hook to help
users diagnose why commits may not receive Partio-Checkpoint trailers.

- Warn-level logging at each early return explaining why no trailer was
  added (agent inactive, commit already processed, session condensed)
- Debug-level logging of commit file paths and session info for
  diagnosing path mismatch issues (visible with PARTIO_LOG_LEVEL=debug)
- Add git.DiffNameOnly helper to extract changed file paths from commits

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jcleira jcleira changed the title Add Codex CLI agent integration Add diagnostic logging for checkpoint linking failures Apr 7, 2026
minion[bot] and others added 3 commits April 7, 2026 12:44
## Objective

Update all workflows to use minions v0.0.5.

## Why

v0.0.5 fixes the root cause of all "no changes" failures —
Claude was unable to write files because bypassPermissions
mode was not set.

## How

Updated go install version tag in all workflow files.

Partio-Checkpoint: 0ecbe84f5950
Partio-Attribution: 100% agent
Upgrade early-exit log messages in the post-commit hook from Debug to
Warn level so users running PARTIO_LOG_LEVEL=debug (or default) can
immediately see why no Partio-Checkpoint trailer was added to a commit.

Each exit path now emits a structured "post-commit: no checkpoint created"
warning with the specific reason (no pre-commit state, no active agent,
commit already processed, session already condensed) and relevant context
(commit hash, session ID, state file path).

Also adds a Debug-level log after session lookup showing the resolved
session path, helping diagnose path mismatch issues.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Allow overriding the agent name via PARTIO_AGENT env var, completing
the documented environment variable support in CLAUDE.md.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jcleira jcleira changed the title Add diagnostic logging for checkpoint linking failures Add Codex CLI agent integration Apr 7, 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.

1 participant