Repository navigation
Codex CLI Agent Adapter [Spec + Impl] - #12
Conversation
Add three layers of hallucination mitigation: 1. Server-side: Send anti-hallucination parameters (temperature=0, entropy/logprob thresholds, beam_size=1) on every whisper-server request. 2. VAD: Add MinSpeechDuration (default 0.3s) that requires minimum above-threshold audio before emitting an utterance. Drops noise spikes (clicks, door slams) that previously triggered hallucinated transcriptions. 3. Post-transcription: Detect asterisk-enclosed artifacts (*sigh*), 14-phrase YouTube hallucination blocklist (Thank you for watching, etc.), and repetition loop detector for stuck decoder output. Assisted-By: 🤖 Claude Code
Whisper sometimes outputs a leading hyphen when it interprets audio as dialogue or subtitle continuation from its YouTube training data. Strip the leading "- " or "-" prefix before further processing. Assisted-By: 🤖 Claude Code
Whisper hallucinates subtitle-style speaker labels ("-Name." or
"- Name:") at the start of utterances from its YouTube training data.
Detect the pattern (dash + capitalized word + punctuation) and strip
it along with the dash, keeping only the actual speech content.
Assisted-By: 🤖 Claude Code
Change default command phrases from single words to two-word phrases: - submit: "send" -> "send it" - attend: "next" -> "go next" - submit_attend: "ship" -> "ship it" Two-word phrases improve Whisper recognition accuracy and stay comfortably above the 300ms MinSpeechDuration threshold. Users can still configure single-word commands via custom command maps. Assisted-By: 🤖 Claude Code
Assisted-By: 🤖 Claude Code
Assisted-By: 🤖 Claude Code
Implement virtual two-zone partitioning in the sidebar: active (non-paused) sessions appear above a visual separator line, paused sessions below it. Recently-unpaused sessions are placed at the end of the active zone for predictable, minimal movement. The manual three-tier sort (S key) continues to work within the active zone when auto-sort is enabled. Configurable via the `auto_sort` KDL plugin parameter (default: true). When disabled, sidebar behavior is identical to pre-feature state. Spec: 080-sidebar-auto-sort Deep Review: 10/10 findings fixed (3 Critical, 7 Important) Tests: 385 passed across 3 suites Assisted-By: 🤖 Claude Code
Use cols.min(40) for the auto-sort pause zone separator, matching the header separator width instead of cols-2 which was narrower. Assisted-By: 🤖 Claude Code
Assisted-By: 🤖 Claude Code
Assisted-By: 🤖 Claude Code
|
Warning Review limit reached
Next review available in: 37 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
📝 WalkthroughWalkthroughThis PR adds Codex CLI agent support, implements configurable active/paused sidebar auto-sorting with separators, and updates voice detection, transcription, command handling, and Whisper artifact filtering. ChangesCodex CLI agent integration
Sidebar auto-sort
Voice pipeline
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| "hit the bell", | ||
| "leave a comment", | ||
| "bye bye", | ||
| "goodbye", |
There was a problem hiding this comment.
🟡 Single-word hallucination filter silently discards legitimate voice dictation containing "goodbye"
Any dictated text containing the word "goodbye" is silently dropped as a whisper artifact (strings.Contains(lower, "goodbye") at cc-deck/internal/voice/stopword.go:78-79), because "goodbye" was added as a single-word entry to the hallucination list alongside multi-word phrases, so dictation like "say goodbye to that approach" is permanently lost.
Impact: Users dictating sentences that naturally contain the word "goodbye" will have their speech silently discarded with no feedback.
Substring matching on a common single word causes false positives
The whisperHallucinations list at cc-deck/internal/voice/stopword.go:10-25 contains entries like "thank you for watching" and "please subscribe" which are multi-word phrases unlikely to appear in legitimate coding dictation. However, "goodbye" (line 24) is a single common English word.
The check at lines 77-80 uses strings.Contains(lower, phrase), which means any sentence containing "goodbye" as a substring matches:
- "say goodbye to that approach" → filtered
- "goodbye for now" → filtered
- "we can say goodbye to manual testing" → filtered
All other hallucination entries are multi-word phrases (2+ words) that are extremely unlikely in coding dictation context. The single-word "goodbye" breaks this pattern.
The existing test at cc-deck/internal/voice/stopword_test.go:35 ("So thank you for watching and goodbye") would pass even without "goodbye" in the list because "thank you for watching" also matches, so the "goodbye" entry has no independent test coverage for its intended case, and no test validates that legitimate sentences containing "goodbye" are preserved.
| "goodbye", | |
| "bye bye", |
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Actionable comments posted: 7
🧹 Nitpick comments (4)
cc-deck/internal/voice/transcriber_http.go (1)
64-74: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider making inference parameters configurable.
The five parameters (temperature, entropy_thold, logprob_thold, no_speech_thold, beam_size) are hardcoded. The struct already supports configurable
promptviaSetPrompt; inference parameters could follow the same pattern to allow tuning for different Whisper server configurations. The current defaults are sensible, so this can be deferred.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cc-deck/internal/voice/transcriber_http.go` around lines 64 - 74, The inference parameters in the multipart field-writing loop are hardcoded, preventing runtime tuning. Add configurable fields and setters to the transcriber configuration, following the existing SetPrompt pattern, while preserving the current values as defaults; update the loop to serialize the configured temperature, entropy_thold, logprob_thold, no_speech_thold, and beam_size values.cc-deck/internal/agent/codex_test.go (1)
10-507: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider adding tests for
IsInstalled()andDetectConfig().These are the only Agent methods without test coverage.
DetectConfigcan be tested by overridingcodexHooksPathFuncto point to a temp dir and verifying the returned path.IsInstalledis harder to test without mockingexec.LookPath, so it may be acceptable to skip.💚 Suggested test for DetectConfig
func TestCodexAgentDetectConfig(t *testing.T) { dir := t.TempDir() hooksPath := filepath.Join(dir, ".codex", "hooks.json") origFunc := codexHooksPathFunc codexHooksPathFunc = func() string { return hooksPath } defer func() { codexHooksPathFunc = origFunc }() a := &CodexAgent{} // Before creating ~/.codex, DetectConfig should return "" if cfg := a.DetectConfig(); cfg != "" { t.Errorf("DetectConfig() = %q before dir creation, want empty", cfg) } // Create ~/.codex dir if err := os.MkdirAll(filepath.Join(dir, ".codex"), 0o755); err != nil { t.Fatalf("mkdir: %v", err) } // After creating ~/.codex, DetectConfig should return the path want := filepath.Join(dir, ".codex") if cfg := a.DetectConfig(); cfg != want { t.Errorf("DetectConfig() = %q, want %q", cfg, want) } }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cc-deck/internal/agent/codex_test.go` around lines 10 - 507, Add test coverage for CodexAgent.DetectConfig by overriding codexHooksPathFunc to use a temporary hooks path, asserting it returns empty before the parent .codex directory exists and the expected directory path after creation. IsInstalled may remain untested because exec.LookPath is not mockable in the current design.cc-deck/internal/agent/codex.go (1)
131-153: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider renaming
CWDtoCwdfor consistency withNormalizedPayload.The
codexHookPayload.CWDfield uses all-caps whileNormalizedPayload.Cwduses CamelCase. Go's initialism convention allows all-caps for common acronyms (URL, ID, HTTP), butCWDis uncommon and the sharedNormalizedPayloadstruct already usesCwd. Aligning the naming improves readability at the assignment site (Cwd: hook.CwdvsCwd: hook.CWD).♻️ Proposed naming alignment
type codexHookPayload struct { SessionID string `json:"session_id,omitempty"` HookEvent string `json:"hook_event_name"` ToolName string `json:"tool_name,omitempty"` - CWD string `json:"cwd,omitempty"` + Cwd string `json:"cwd,omitempty"` }And update the assignment in
TranslateEvent:return &NormalizedPayload{ Agent: c.Name(), SessionID: hook.SessionID, HookEvent: hook.HookEvent, ToolName: hook.ToolName, - Cwd: hook.CWD, + Cwd: hook.Cwd, }, nil🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cc-deck/internal/agent/codex.go` around lines 131 - 153, Rename the codexHookPayload field CWD to Cwd and update its JSON-backed field reference in TranslateEvent, preserving the existing "cwd" JSON tag and normalized payload behavior.cc-zellij-plugin/src/sidebar_plugin/render.rs (1)
38-75: 📐 Maintainability & Code Quality | 🔵 TrivialConsider extracting the separator/viewport math into a testable helper.
This diff's pure index arithmetic (separator detection, effective-available sizing) has no unit test coverage in this cohort (only
render_broadcast.rs/state.rsare tested per the PR stack). Given the subtlety flagged above, extracting these calculations into a small pure function taking(sessions, payload, available, lines_per_session)would make them independently testable without needing a real terminal/ANSI harness.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cc-zellij-plugin/src/sidebar_plugin/render.rs` around lines 38 - 75, Extract the separator detection and viewport sizing logic from the render flow into a small pure helper accepting sessions, payload, available, and lines_per_session. Have the helper return the separator index plus the calculated effective availability/max-visible values, then use those results in the surrounding render function and add focused unit tests for the separator and sizing boundaries.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cc-deck/internal/agent/codex.go`:
- Around line 200-203: Update defaultCodexHooksPath to handle the error returned
by os.UserHomeDir, returning an empty string on failure like DetectConfig
instead of constructing a relative .codex/hooks.json path; preserve the existing
filepath.Join behavior when the home directory is available.
In `@cc-zellij-plugin/src/sidebar_plugin/render.rs`:
- Around line 70-75: Update the `effective_available` calculation to subtract
the separator row only when `visible_range` contains `separator_after_index`;
otherwise retain the full `available` value. Keep `max_visible` based on this
corrected capacity so pages without a rendered separator can display the
additional session.
In `@specs/080-sidebar-auto-sort/spec.md`:
- Around line 57-65: Update the paused-session handling in the hook logic within
hooks.rs so Working/PostToolUse events are processed before the paused-session
early return. Clear the session’s paused state and append its pane to
auto_sort_tail when it becomes active, while preserving the existing guard
behavior for events that should remain paused.
In `@specs/081-codex-adapter/spec.md`:
- Around line 52-53: Update the Codex credential-detection acceptance criteria
to use the implemented "openai" auth-mode name instead of "api" in both
scenarios, and align any related tests with this same mode identifier.
- Around line 118-123: Standardize the Codex hooks minimum version to v0.124.0
throughout the Codex adapter specification, including assumptions, tasks, and
configuration documentation. Replace inconsistent references such as v0.46.0,
v0.143+, and v0.1.2505+; mention any earlier experimental release separately
only if it remains relevant.
In `@specs/081-codex-adapter/tasks.md`:
- Around line 7-9: Update the fenced code block in the task flow diagram to
declare an appropriate language, such as text, while preserving the diagram
content unchanged.
- Around line 86-90: Update the Codex hook configuration documentation task in
the referenced section to require Codex CLI v0.124.0 instead of v0.143+,
preserving the location, auto-configuration, and registered-events details.
---
Nitpick comments:
In `@cc-deck/internal/agent/codex_test.go`:
- Around line 10-507: Add test coverage for CodexAgent.DetectConfig by
overriding codexHooksPathFunc to use a temporary hooks path, asserting it
returns empty before the parent .codex directory exists and the expected
directory path after creation. IsInstalled may remain untested because
exec.LookPath is not mockable in the current design.
In `@cc-deck/internal/agent/codex.go`:
- Around line 131-153: Rename the codexHookPayload field CWD to Cwd and update
its JSON-backed field reference in TranslateEvent, preserving the existing "cwd"
JSON tag and normalized payload behavior.
In `@cc-deck/internal/voice/transcriber_http.go`:
- Around line 64-74: The inference parameters in the multipart field-writing
loop are hardcoded, preventing runtime tuning. Add configurable fields and
setters to the transcriber configuration, following the existing SetPrompt
pattern, while preserving the current values as defaults; update the loop to
serialize the configured temperature, entropy_thold, logprob_thold,
no_speech_thold, and beam_size values.
In `@cc-zellij-plugin/src/sidebar_plugin/render.rs`:
- Around line 38-75: Extract the separator detection and viewport sizing logic
from the render flow into a small pure helper accepting sessions, payload,
available, and lines_per_session. Have the helper return the separator index
plus the calculated effective availability/max-visible values, then use those
results in the surrounding render function and add focused unit tests for the
separator and sizing boundaries.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 56e98126-4735-408c-8bb9-f0fd34c0f9b4
📒 Files selected for processing (36)
README.mdbrainstorm/00-overview.mdbrainstorm/080-sidebar-auto-sort.mdbrainstorm/081-codex-agent-adapter.mdcc-deck/internal/agent/codex.gocc-deck/internal/agent/codex_test.gocc-deck/internal/voice/audio.gocc-deck/internal/voice/relay.gocc-deck/internal/voice/relay_test.gocc-deck/internal/voice/stopword.gocc-deck/internal/voice/stopword_test.gocc-deck/internal/voice/transcriber_http.gocc-deck/internal/voice/vad.gocc-deck/internal/voice/vad_test.gocc-zellij-plugin/src/config.rscc-zellij-plugin/src/controller/actions.rscc-zellij-plugin/src/controller/events.rscc-zellij-plugin/src/controller/render_broadcast.rscc-zellij-plugin/src/controller/state.rscc-zellij-plugin/src/lib.rscc-zellij-plugin/src/sidebar_plugin/integration_tests.rscc-zellij-plugin/src/sidebar_plugin/render.rscc-zellij-plugin/src/sidebar_plugin/test_helpers.rsdocs/modules/reference/pages/configuration.adocdocs/modules/using/pages/configuration.adocspecs/080-sidebar-auto-sort/checklists/requirements.mdspecs/080-sidebar-auto-sort/plan.mdspecs/080-sidebar-auto-sort/research.mdspecs/080-sidebar-auto-sort/review-findings.mdspecs/080-sidebar-auto-sort/spec.mdspecs/080-sidebar-auto-sort/tasks.mdspecs/081-codex-adapter/checklists/requirements.mdspecs/081-codex-adapter/plan.mdspecs/081-codex-adapter/review-findings.mdspecs/081-codex-adapter/spec.mdspecs/081-codex-adapter/tasks.md
| func defaultCodexHooksPath() string { | ||
| home, _ := os.UserHomeDir() | ||
| return filepath.Join(home, ".codex", "hooks.json") | ||
| } |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Handle os.UserHomeDir() error in defaultCodexHooksPath.
DetectConfig (line 30-32) handles the error from os.UserHomeDir() and returns "" on failure. defaultCodexHooksPath silently ignores it with _, which produces a relative path (.codex/hooks.json) if HOME is unset. This could write to an unexpected location.
🛡️ Proposed fix
func defaultCodexHooksPath() string {
- home, _ := os.UserHomeDir()
+ home, err := os.UserHomeDir()
+ if err != nil {
+ return filepath.Join(os.TempDir(), ".codex", "hooks.json")
+ }
return filepath.Join(home, ".codex", "hooks.json")
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| func defaultCodexHooksPath() string { | |
| home, _ := os.UserHomeDir() | |
| return filepath.Join(home, ".codex", "hooks.json") | |
| } | |
| func defaultCodexHooksPath() string { | |
| home, err := os.UserHomeDir() | |
| if err != nil { | |
| return filepath.Join(os.TempDir(), ".codex", "hooks.json") | |
| } | |
| return filepath.Join(home, ".codex", "hooks.json") | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@cc-deck/internal/agent/codex.go` around lines 200 - 203, Update
defaultCodexHooksPath to handle the error returned by os.UserHomeDir, returning
an empty string on failure like DetectConfig instead of constructing a relative
.codex/hooks.json path; preserve the existing filepath.Join behavior when the
home directory is available.
| let effective_available = if separator_after_index.is_some() { | ||
| available.saturating_sub(1) | ||
| } else { | ||
| available | ||
| }; | ||
| let max_visible = effective_available.checked_div(lines_per_session).unwrap_or(0); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
file='cc-zellij-plugin/src/sidebar_plugin/render.rs'
echo '--- outline ---'
ast-grep outline "$file" --view expanded || true
echo '--- relevant lines ---'
sed -n '1,240p' "$file" | cat -n | sed -n '1,240p'
echo '--- search symbols ---'
rg -n "separator_after_index|visible_range|max_visible|lines_per_session|sep_idx|available" "$file"Repository: cc-deck/cc-deck
Length of output: 16198
🏁 Script executed:
#!/bin/bash
set -euo pipefail
file='cc-zellij-plugin/src/sidebar_plugin/render.rs'
echo '--- visible_range ---'
sed -n '524,571p' "$file" | cat -n
echo '--- tests around visible_range ---'
sed -n '846,955p' "$file" | cat -n
echo '--- quick behavior probe for capacity math ---'
python3 - <<'PY'
def max_visible(available, has_sep, lps=3):
effective = available - 1 if has_sep else available
return effective // lps
for available in range(0, 13):
if available % 3 == 0 and available > 0:
print(available, max_visible(available, True), max_visible(available, False))
PYRepository: cc-deck/cc-deck
Length of output: 6879
Separator row should only be reserved when it’s on the current page. effective_available subtracts 1 whenever an active/paused split exists, but visible_range can land entirely on one side of that split, so the separator never renders and the reserved row is wasted instead of showing another session. This drops one session whenever available is a multiple of lines_per_session.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@cc-zellij-plugin/src/sidebar_plugin/render.rs` around lines 70 - 75, Update
the `effective_available` calculation to subtract the separator row only when
`visible_range` contains `separator_after_index`; otherwise retain the full
`available` value. Keep `max_visible` based on this corrected capacity so pages
without a rendered separator can display the additional session.
| ### Edge Cases | ||
|
|
||
| - What happens when the last active session is paused? The separator disappears since all sessions are now in the paused zone. No empty active zone is shown. | ||
| - What happens when a new session is created while auto-sort is active? It appears at the end of the active zone (above the separator). | ||
| - What happens when a session is deleted while auto-sort is active? It is removed normally. If it was the only paused session, the separator disappears. | ||
| - What happens when a paused session receives an event that changes its status back to Working? It moves to the active zone (above the separator) at the bottom of the active zone, same as unpausing. | ||
| - What happens when the plugin starts and some sessions are already paused? Auto-sort immediately applies the two-zone split on the first render. Sessions already in the Paused state appear below the separator from the start. | ||
| - What happens if the auto-sort config value changes between plugin restarts? The new value takes effect on the next plugin load. No mid-session config reload is supported. | ||
|
|
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Search for event handling code that processes hook events for paused sessions.
# Look for where session.paused is set to false outside of handle_pause and handle_switch.
rg -nC5 'paused\s*=\s*false' cc-zellij-plugin/src/controller/ --type rustRepository: cc-deck/cc-deck
Length of output: 3360
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect the relevant controller code paths for paused-session transitions and tail management.
sed -n '1,220p' cc-zellij-plugin/src/controller/events.rs
printf '\n--- actions.rs ---\n'
sed -n '1,140p' cc-zellij-plugin/src/controller/actions.rs
printf '\n--- auto_sort_tail references ---\n'
rg -nC3 'auto_sort_tail|paused\s*=\s*false|last_event_ts' cc-zellij-plugin/src/controller/ --type rustRepository: cc-deck/cc-deck
Length of output: 45040
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect the hook transition logic around Working events and paused-session updates.
sed -n '100,240p' cc-zellij-plugin/src/controller/hooks.rs
printf '\n--- later hook transitions ---\n'
sed -n '240,420p' cc-zellij-plugin/src/controller/hooks.rs
printf '\n--- tests mentioning paused / Working / auto_sort_tail in hooks.rs ---\n'
rg -nC3 'Working|paused|auto_sort_tail' cc-zellij-plugin/src/controller/hooks.rs --type rustRepository: cc-deck/cc-deck
Length of output: 21031
Paused hook transitions never reach auto-sort
cc-zellij-plugin/src/controller/hooks.rs returns early for paused sessions, so a hook-driven Working event never clears paused or appends the pane to auto_sort_tail. If paused sessions should re-enter the active zone on Working/PostToolUse, handle that before the paused-session guard.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@specs/080-sidebar-auto-sort/spec.md` around lines 57 - 65, Update the
paused-session handling in the hook logic within hooks.rs so Working/PostToolUse
events are processed before the paused-session early return. Clear the session’s
paused state and append its pane to auto_sort_tail when it becomes active, while
preserving the existing guard behavior for events that should remain paused.
| ## Assumptions | ||
|
|
||
| - Codex CLI's hooks system (confirmed in source at `codex-rs/hooks/`, `codex-rs/config/src/hook_config.rs`) is available in recent versions. Users on older versions (e.g., v0.46.0) will need to upgrade for hooks support. | ||
| - The Codex hook JSON payload structure is compatible with the existing `NormalizedPayload` model. Fields like `session_id` and `cwd` map directly. | ||
| - The `~/.codex/hooks.json` format uses a `{"hooks": {EventName: [MatcherGroup]}}` structure where each `MatcherGroup` has a `hooks` array of handler configs with `type`, `command`, `async`, and optional `matcher` fields. | ||
| - The existing `cc-deck hook --agent <name>` command accepts any registered agent name, so `--agent codex` works with no changes to the hook command itself. |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🌐 Web query:
What Codex CLI version introduced hooks.json support, and what minimum version should cc-deck document?
💡 Result:
The Codex CLI introduced support for hooks.json files as the primary mechanism for configuring hooks early in its development, and the feature was later solidified with the graduation of hooks to stable status in Codex CLI version 0.124.0 [1]. Regarding cc-deck documentation, it should specify a minimum requirement of Codex CLI version 0.124.0 [1]. While hooks.json support existed prior to this, version 0.124.0 is the definitive release where hooks graduated from experimental to stable, enabling them by default when a hooks.json file is discovered and introducing standardized, production-grade configuration patterns [1]. Documentation targeting this version ensures compatibility with the stable feature set, including subsequent improvements to hook discovery, observation of MCP tools, and inline configuration support [1][2].
Citations:
- 1: https://codex.danielvaughan.com/2026/04/23/codex-cli-hooks-graduate-stable-v0124-mcp-observation-inline-config/
- 2: openai/codex@2b2de3f
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== Relevant version mentions ==\n'
rg -n "hooks support|hooks\.json|v0\.46\.0|0\.124\.0|minimum version|Codex CLI" specs . || true
printf '\n== Spec file excerpt ==\n'
sed -n '100,140p' specs/081-codex-adapter/spec.md
printf '\n== Candidate docs with Codex hooks ==\n'
fd -a -t f -g '*codex*' . || trueRepository: cc-deck/cc-deck
Length of output: 30157
🌐 Web query:
Codex CLI hooks support minimum version official docs release notes v0.46.0 v0.124.0 v0.143.0 v0.1.2505
💡 Result:
Codex CLI introduced experimental lifecycle hooks in version v0.114.0 (March 2026) [1][2][3]. These hooks transitioned to a stable, production-grade feature in version v0.124.0 (released April 23, 2026) [2][4][5]. Key details regarding Codex CLI hook versions and support: 1. Initial Release (Experimental): Hooks were first shipped in v0.114.0 [1][3]. During the experimental phase, users were required to manually enable the feature via the configuration flag codex_hooks = true in their config.toml [6][2]. 2. Graduated to Stable: As of v0.124.0, hooks are considered stable and are enabled by default when a hooks.json file is discovered [2][4][5]. Inline configuration within config.toml and requirements.toml was also introduced in this version [2][5]. 3. Version-Specific Hook Support: - v0.114.0: Introduced SessionStart and Stop hooks [6]. - v0.116.0: Introduced UserPromptSubmit hook [6]. - v0.117.0: Introduced PreToolUse and PostToolUse hooks [6]. - v0.122.0: Introduced PermissionRequest hook [6]. - v0.124.0: Stability update; added support for observing MCP tools and apply_patch [2][5]. - v0.130.0: Introduced PreCompact and PostCompact hooks [6]. The version v0.46.0 was released before the hook system existed, and v0.143.0 (released July 8, 2026) includes further general improvements but post-dates the stabilization of the hook system [7][8][4]. There is no official release version v0.1.2505; this identifier likely refers to a timestamp or internal build reference rather than a standard semver release [7][9]. Always consult the official changelog at developers.openai.com/codex/changelog for the most current information [7][4].
Citations:
- 1: https://symposium.dev/design/agent-details/codex-cli.html
- 2: https://codex.danielvaughan.com/2026/04/23/codex-cli-hooks-graduate-stable-v0124-mcp-observation-inline-config/
- 3: https://ai.sulat.com/codex-cli-has-hooks-now-stop-stuffing-agents-md-c181465fe271
- 4: https://developertoolkit.ai/en/codex/version-management/changelog/
- 5: https://www.gitclear.com/open_repos/openai/codex/release/rust-v0.124.0
- 6: shanraisshan/claude-code-best-practice@ac0d87d
- 7: https://developers.openai.com/codex/changelog
- 8: https://releases.sh/openai/openai-codex-changelog.md
- 9: https://github.com/openai/codex/releases
Standardize the Codex hooks minimum version.
Use v0.124.0 consistently across the spec, tasks, and configuration docs; the current mix of v0.46.0, v0.143+, and v0.1.2505+ is inconsistent. If the earlier experimental release matters, call it out separately.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@specs/081-codex-adapter/spec.md` around lines 118 - 123, Standardize the
Codex hooks minimum version to v0.124.0 throughout the Codex adapter
specification, including assumptions, tasks, and configuration documentation.
Replace inconsistent references such as v0.46.0, v0.143+, and v0.1.2505+;
mention any earlier experimental release separately only if it remains relevant.
| ``` | ||
| Task 1 (Agent implementation) ──> Task 2 (Tests) ──> Task 3 (Documentation) | ||
| ``` |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Add a language to the fenced code block.
This triggers markdownlint MD040. Use an appropriate language such as text.
Proposed fix
-```
+```text
Task 1 (Agent implementation) ──> Task 2 (Tests) ──> Task 3 (Documentation)
-```
+```📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ``` | |
| Task 1 (Agent implementation) ──> Task 2 (Tests) ──> Task 3 (Documentation) | |
| ``` |
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 7-7: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@specs/081-codex-adapter/tasks.md` around lines 7 - 9, Update the fenced code
block in the task flow diagram to declare an appropriate language, such as text,
while preserving the diagram content unchanged.
Source: Linters/SAST tools
| 2. In `docs/modules/reference/pages/configuration.adoc`, add a section documenting the Codex hook configuration: | ||
| - Location: `~/.codex/hooks.json` | ||
| - Auto-configured by `cc-deck config plugin install` | ||
| - Lists the registered events | ||
| - Notes that Codex CLI v0.143+ is required for hooks support |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🌐 Web query:
What Codex CLI version introduced hooks.json support, and what minimum version should cc-deck document?
💡 Result:
Codex CLI introduced hooks.json support in version 0.114.0, which was released in March 2026 [1][2]. While hooks were initially experimental and defined exclusively in hooks.json [1][3], they were later promoted to stable status in version 0.124.0, which added support for inline hook configuration in config.toml [3][4]. For documentation purposes, cc-deck should document a minimum version of v0.124.0 for Codex CLI [3]. This version is recommended as the baseline because it stabilized the hooks engine and resolved significant configuration issues—specifically, the transition from the experimental hooks.json-only model to the current stable format that supports both external files and inline configurations [3][5]. Documentation targeting version 0.124.0 ensures users are on a stable release where hooks are enabled by default and follow the standardized configuration schema [3].
Citations:
- 1: https://symposium.dev/design/agent-details/codex-cli.html
- 2: Hook would be a great feature openai/codex#2150
- 3: https://codex.danielvaughan.com/2026/04/23/codex-cli-hooks-graduate-stable-v0124-mcp-observation-inline-config/
- 4: https://developers.openai.com/codex/config-advanced
- 5: Codex 0.124.0 hook regression can leave GSD-installed Codex setups unable to start gsd-build/get-shit-done#2637
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n## Files mentioning Codex hooks or version constraints\n'
rg -n --hidden --glob '!**/.git/**' -e 'hooks\.json|0\.143|0\.124|Codex CLI' specs docs . || true
printf '\n## Target spec file around the cited lines\n'
sed -n '70,100p' specs/081-codex-adapter/tasks.md
printf '\n## Nearby docs configuration context if present\n'
fd -H -t f 'configuration.adoc' docs specs . | head -n 20Repository: cc-deck/cc-deck
Length of output: 50372
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n## Target spec excerpt\n'
sed -n '80,95p' specs/081-codex-adapter/tasks.md
printf '\n## Codex adapter spec references\n'
rg -n --hidden --glob '!**/.git/**' -e 'Codex CLI|hooks\.json|0\.143|0\.124|0\.114|v0\.' specs docs cc-deck | sed -n '1,200p'
printf '\n## Codex-related docs files\n'
fd -H -t f -g '*codex*' specs docs cc-deck | sed -n '1,200p'Repository: cc-deck/cc-deck
Length of output: 26565
Use v0.124.0 for Codex hooks support.
v0.143+ is higher than the hooks baseline used elsewhere in the spec; lower this so the docs do not overstate the required Codex CLI version.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@specs/081-codex-adapter/tasks.md` around lines 86 - 90, Update the Codex hook
configuration documentation task in the referenced section to require Codex CLI
v0.124.0 instead of v0.143+, preserving the location, auto-configuration, and
registered-events details.
Implement a Codex CLI adapter that enables cc-deck to detect and interact with OpenAI Codex CLI sessions. Adds codex.go with session detection, command execution, and configuration support, along with comprehensive unit tests. Updates documentation and README. Assisted-By: 🤖 Claude Code
Summary
Add Codex CLI agent adapter implementing the full Agent interface. Follows the same hooks-based pattern as Claude Code and OpenCode adapters.
Key changes:
codex.go(238 lines): CodexAgent struct with InstallHooks (writes ~/.codex/hooks.json), TranslateEvent, CredentialSpecs (OPENAI_API_KEY)codex_test.go(498 lines, 76 tests): Full coverage of all Agent methodsArtifacts
specs/081-codex-adapter/spec.mdspecs/081-codex-adapter/plan.mdspecs/081-codex-adapter/tasks.mdAssisted-By: 🤖 Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Documentation