Skip to content

Agent abstraction Phase C: ship OpenAI Codex MVP #168

@dhilgaertner

Description

@dhilgaertner

Summary

Phase C of the agent-abstraction work scoped by #150. Implement OpenAICodexAgent in a new CrowCodex Swift package, enable the per-session selector for Codex, and deliver end-to-end Codex session creation.

Context

Full design in docs/agent-abstraction-spec.md §3, §7, §12 Phase C.

Codex has native hooks (feature-flagged), an AGENTS.md context file analog, and a notify command as a fallback signal source. The spec calls for a two-tier state-signal approach: Codex hooks as Tier 1 (when codex_hooks = true) and notify as the always-on Tier 2 fallback.

Checklist

  • Create Packages/CrowCodex/ Swift package (symmetric to CrowClaude)
  • OpenAICodexAgent with binary resolver: /opt/homebrew/bin/codex, /usr/local/bin/codex, ~/.local/bin/codex, plus a which codex PATH fallback (see spec §13.4)
  • Codex prompt template with a "plan-first" preamble (no /plan, no dangerouslyDisableSandbox directives)
  • CodexHookConfigWriter writing .codex/hooks.json for the 5 supported events (SessionStart, PreToolUse, PostToolUse, UserPromptSubmit, Stop); each event invokes crow hook-event --agent codex --event <Name>
  • CodexSignalSource Tier 1 (hooks) + Tier 2 (notify fallback)
  • Scaffolder writes .codex/config.toml (with [features] codex_hooks = true and notify = ["crow", "codex-notify", "--session", "<uuid>"]), AGENTS.md, and a .agents/skills/… placeholder
  • crow hook-event CLI gains --agent <kind> flag (default claudeCode); new crow codex-notify subcommand (or reuse of crow hook-event --agent codex --event Notification)
  • Enable Codex option in the New Session selector; gate behind codex binary presence on the machine
  • Codex-flavored crow-workspace skill authored, or explicitly documented as Claude-only for this phase
  • supportsRemoteControl = false for Codex; UI hides the remote-control badge for Codex sessions
  • End-to-end verification: create a Codex session, submit a prompt, observe AgentActivityState transitioning .idle → .working → .done via the notify fallback. If the user enables codex_hooks, confirm the hook path produces the same transitions with finer resolution. Claude sessions continue to behave identically.

Non-goals

  • Codex remote control (Phase D)
  • Per-agent notification sounds / icons (Phase D)
  • Mid-session agent switching (out of scope per spec §14)

Parent: #150 · Blocked by: #166 (Phase A), #167 (Phase B) · Blocks: #169 (Phase D)

Metadata

Metadata

Assignees

Labels

refactorCode refactoring and cleanup

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions