Skip to content

Commit fdbe276

Browse files
authored
feat: enable Codex CLI as a first-class agent alongside Claude Code (#153)
* feat: enable Codex CLI as a first-class agent alongside Claude Code Full dual-agent support so Codex CLI users get the same Pilot Shell experience as Claude Code users across all Console features. Sessions: CodexSessionReader parses ~/.codex/sessions/ JSONL files, merged with Claude sessions in Dashboard and Sessions views with agent badge and All/Claude/Codex filter toggle. Usage: Codex cost tracking via codex-parser with model-specific pricing, aggregated into daily/monthly charts with agent filtering. Memories: Hook pipeline fixed for Codex (hookSpecificOutput passthrough instead of systemMessage, context handler enabled, no ugly display), all memory lifecycle hooks added (session-init, observation, summarize, session-end), agent column migration on sdk_sessions, observations API agent filter, Memories UI toggle. Extensions: Codex extensions discovery and display alongside Claude extensions in the Extensions view. Quality hooks: file_checker (with apply_patch format support), tool_token_saver, context_monitor (transcript estimation fallback), spec_stop_guard — all ported to codex_hooks.json. Installer: codex_files step installs hooks, skills, MCP config, and AGENTS.md for Codex CLI. Agent runtime detection for both CLIs. Docs: Codex CLI getting-started guide, updated hooks/extensions/MCP docs for dual-agent coverage. * fix: address code review findings from xhigh + ultrareview - PaginationHelper: use COALESCE(s.agent, 'claude') so orphan observations aren't dropped when agent filter is applied (LEFT JOIN → INNER JOIN bug) - file_checker: strip trailing whitespace/CR from regex-captured paths to handle Windows line endings in apply_patch content - Memories UI: wrap JSON.parse of facts/concepts in safe helper to prevent render crash on malformed data - hook-command: restore suppressOutput:true in error handler else branch - codex_hooks.json: remove no-op context hook (handler early-returns for codex) - installer codex_files: restrict TOML key detection to top-level scope, catch _TomlStructureError, remove dead regexes, cleanup * fix: address PR #153 review findings from CodeRabbit, Cubic, and Claude - Fix CI: add command_exists early-exit to install_pbt_tools - Fix fish shell %self not expanding in concatenation (use $fish_pid) - Fix silent exception swallowing in codex_files skill builder - Add CODEX_HOME absolute path validation - Remove unreachable else branch in license_check.py - Fix HeroSection whitespace-nowrap clipping on mobile - Fix MCP tool naming (underscores → hyphens) in PRD skill - Fix test_codex_rules local_mode mock (was truthy, skipping Path.home path) - Add missing test assertions for dependency orchestration - Update installation.md step count (7 → 8) with Codex files row - Update codex-cli.md hooks section to match actual coverage - Fix hooks.md count (19 → 18) to match table rows - Add language tags to fenced code blocks in extensions.md * fix: update Codex docs, enable mem-search MCP and memory context injection - Installer post-steps: show all 6 Codex skills (was 3), remove Claude Code Only section - Enable mem-search MCP for Codex: remove _CODEX_SKIP_MCP entirely - Enable memory context injection for Codex: remove early-return in context handler, restore context hook in codex_hooks.json - codex-cli.md: remove Console Views table (all ✅), update MCP list (all 7 servers), remove memory/context from Claude Code-only table, update hooks section - README: update Codex skill list (all 6), remove persistent memory from limitations - prerequisites.md: update Codex description - FAQSection.tsx: remove persistent memory from limitations - Test updates: add benchmark/setup-rules/create-skill to Codex skill safety tests, update invocation regex, fix context handler test to expect injection - create-skill: simplify allowed-tools examples to pass Codex safety checks - Codex rules audit: all rules properly adapted via CC-ONLY/CODEX blocks * fix: Codex context handler returns compact stderr instead of hookSpecificOutput Codex CLI doesn't support Claude Code's additionalContext protocol — returning hookSpecificOutput causes 'invalid session start JSON output' error. Instead: - Return { continue: true } (valid Codex JSON) - Write compact one-liner to stderr: '[pilot] Memory loaded for [project]' - mem-search MCP still available for on-demand memory lookups * fix: ensure all skills and rules work with both Claude Code and Codex - Add CC-ONLY/CODEX blocks to 5 Skill() calls in spec-verify and spec-bugfix-verify that would break the verify→implement loop in Codex - Add orchestrator-level Codex AskUserQuestion handling to fix, prd, benchmark, and setup-rules skills - Add CODEX blocks to mcp-servers.md (ToolSearch → tool_search) and browser-automation.md (Chrome tool detection) - Fix wrong CodeGraph tool names in spec-implement (trace_call_path → codegraph_callers/callees, search_graph → codegraph_search) - Add CODEX blocks to spec-plan step 00 and setup-rules step 01 for AskUserQuestion consistency * fix: treat Codex CLI as first-class agent alongside Claude Code - README + Docusaurus restructured: prerequisites, examples, and feature pages treat Claude Code and Codex as equals (drop Claude-only framing). - Console: dashboard / sessions / memories / requirements show consistent agent badges; settings page agent styling matches across the app. - Console Help page renamed to Documentation and moved below Settings; vim-style G-sequence shortcuts removed; sidebar ordering: Usage → Settings → Documentation. - Console screenshot assets renamed help.webp → documentation.webp (full, _sm, thumbs) and surfaced in marketing site. - Codex usage cost calculation fixed — parser now reads model from JSONL turn_context.payload.model instead of relying on the brittle ~/.codex/state_5.sqlite lookup. Previously all Codex sessions resolved to model='unknown' and total cost = $0. - Codex skill migration: skills, hooks, and installer support both agents via shared .pilot/hooks layout and Codex agent skills under ~/.agents/skills/. uninstall.sh cleans Codex artifacts too. - Statusline simplified to surface only Pilot Shell updates (Claude/Codex CLI updates removed — agents manage their own update prompts). - Website SEO updated: index.html keywords, HowTo schema, FAQ schema, noscript fallback, SEO component defaults, and Docusaurus config (blog/RSS descriptions, metadata keywords) all include Codex/GPT-5. - pilot/scripts and pilot/ui bundles rebuilt against the new console source. * fix: split installer file steps; detect agents instead of installing them - Add cmd_install agent prerequisite gate (EXIT 1 with README links when neither Claude Code nor Codex CLI detected) - Remove install_claude_code + upstreams.yaml entry: installer no longer installs either agent (README contract) - Three sibling file steps with clear separation: * PilotFilesStep — always; ~/.pilot/* runtime + canonical skill source + ~/.pilot/rules/ raw sources read by Codex adapter * ClaudeFilesStep — gated on is_claude_installed(); ~/.claude/{rules, agents,settings.json} + Claude post-install merges * CodexFilesStep — gated on is_codex_installed(); ~/.agents/skills/ + ~/.codex/*, per-category output mirroring Claude - Fix is_claude_installed paths to launcher canonical set (~/.claude/local/bin/claude + Claude.app bundle) - Unify agent detection: dependencies._init_rtk and codex_files now use platform_utils.is_*_installed - PilotFilesStep switches inheritance → composition over ClaudeFilesStep to avoid LSP violation - CodexFilesStep output via _CodexReport accumulator + label formatters - Promote cache keys to named constants; remove dead _post_install_processing and dead _get_cached_pilot_files fallback - Update README, Docusaurus installation guide, installer patterns rule * fix: address codex hook and review feedback
1 parent ac59664 commit fdbe276

313 files changed

Lines changed: 8420 additions & 1989 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,18 +243,21 @@ benchmarks/**
243243
skill-creator
244244
spec-annotate
245245
changes-header
246+
review-output.json
246247
apm.yml
247248
.playwright-*/
248249
.apm
249250
.agents
250251
.codegraph
251252
.vercel
252253
.codex
254+
.review
253255
.mypy_cache
254256
.mcp.json
255257
demo
256258
skills-lock.json
257259
sx.json
260+
context-hud
258261
.env**
259262
playwright/
260263
.claude.backup.*

README.md

Lines changed: 133 additions & 489 deletions

console/src/cli/adapters/codex.ts

633 Bytes
Binary file not shown.

console/src/cli/adapters/index.ts

96 Bytes
Binary file not shown.
409 Bytes
Binary file not shown.
85 Bytes
Binary file not shown.

console/src/cli/hook-command.ts

-183 Bytes
Binary file not shown.
843 Bytes
Binary file not shown.
798 Bytes
Binary file not shown.
45 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)