Skip to content

feat(skills): inject Codex availability for ralplan/plan/ralph, enhance Codex critic#2132

Closed
HelloAlexPan wants to merge 1 commit intoYeachan-Heo:mainfrom
HelloAlexPan:feat/codex-detection-ralplan-ralph
Closed

feat(skills): inject Codex availability for ralplan/plan/ralph, enhance Codex critic#2132
HelloAlexPan wants to merge 1 commit intoYeachan-Heo:mainfrom
HelloAlexPan:feat/codex-detection-ralplan-ralph

Conversation

@HelloAlexPan
Copy link
Copy Markdown

@HelloAlexPan HelloAlexPan commented Apr 3, 2026

Problem

When using --architect codex or --critic codex flags with /ralplan or ralph --critic=codex, the Claude agent reports "Codex is unavailable" and silently falls back to the default Claude-only reviewer — even when Codex CLI is installed, authenticated, and working correctly (codex --version succeeds, omc ask codex produces valid output).

Root cause: runtime-guidance.tsrenderSkillRuntimeGuidance() only injects Codex CLI availability signals for the deep-interview skill. The ralplan, omc-plan, plan, and ralph skills all hit the default: case which returns ''. Without any availability signal in the skill prompt, the Claude agent has no way to know Codex is installed and defaults to "unavailable."

Additionally, when the Codex critic path does activate (e.g., via workaround), the ralph skill only asks Codex to verify acceptance criteria — the same shallow pass the Claude architect already does. As Codex can run GPT-5.4 at max reasoning effort, this underutilizes the external critic.

Expected Result

  1. When Codex CLI is installed, /ralplan --critic codex and ralph --critic=codex should detect it and route the critic pass through omc ask codex without requiring manual workarounds.
  2. The Codex critic prompt should maximize the value of the external review by evaluating optimality (not just correctness) and reviewing all related code (not just changed files).

Solution

Change 1: src/features/builtin-skills/runtime-guidance.ts

Added renderPlanRuntimeGuidance() — mirrors the existing renderDeepInterviewRuntimeGuidance() pattern. Checks availability.codex and injects a clear directive into the skill prompt: "Codex CLI is installed and available. Do NOT report Codex as unavailable."

Added case 'ralplan', case 'omc-plan', case 'plan', case 'ralph' to the renderSkillRuntimeGuidance() switch, routing them to the new render function.

This bridges the gap: the isCliAvailable('codex') detection already works correctly at the TypeScript level — the missing piece was propagating that signal into the skill prompt text that the Claude agent actually reads.

Change 2: skills/ralph/SKILL.md

Enhanced the --critic=codex instructions in Step 7 (Reviewer verification) and Tool_Usage. The Codex critic prompt now MUST include:

  1. Full acceptance criteria from prd.json
  2. An optimality directive — evaluate whether a meaningfully simpler, faster, or more maintainable approach exists
  3. A related-code review directive — review callers, callees, shared types, and adjacent modules, not only directly modified files
  4. The list of files changed during the ralph session

This preserves the existing ralph design (PRD loop, story tracking, verification flow) while extracting maximum value from the GPT-5.4 xhigh-effort Codex pass.

Test plan

  • Verify codex --version succeeds → renderPlanRuntimeGuidance returns non-empty guidance
  • Verify codex --version fails → function returns '' (graceful fallback preserved)
  • Run /ralplan --critic codex "trivial task" → Codex critic is invoked, not skipped
  • Run ralph --critic=codex → Step 7 sends optimality + related-code review prompt to Codex
  • Existing deep-interview Codex detection is unaffected

🤖 Generated with Claude Code

…hance Codex critic prompt

runtime-guidance.ts only injected Codex CLI availability signals for
the deep-interview skill. The ralplan, omc-plan, plan, and ralph skills
hit the default case which returned empty string — no availability info
was injected into the skill prompt. Without this signal, the Claude
agent defaults to reporting Codex as unavailable even when it is
installed and working.

Additionally, the ralph --critic=codex path only asked Codex to verify
acceptance criteria. Since Codex runs GPT-5.4 at max effort, the prompt
now also requests optimality evaluation and full related-code review to
maximize the value of the external critic pass.

Constraint: Must preserve existing ralph PRD loop and verification flow
Rejected: Modifying the critic agent prompt directly | would affect all critic invocations, not just Codex path
Confidence: high
Scope-risk: narrow

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Yeachan-Heo
Copy link
Copy Markdown
Owner

Thanks for the PR. Closing this because OMC PRs must target dev, not main. Please retarget/reopen against dev and we can review it there.


[repo owner's gaebal-gajae (clawdbot) 🦞]

@Yeachan-Heo Yeachan-Heo closed this Apr 3, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a4cba4760e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +58 to +62
case 'ralplan':
case 'omc-plan':
case 'plan':
case 'ralph':
return renderPlanRuntimeGuidance(availability ?? detectSkillRuntimeAvailability());
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Handle external-LLM lockout before probing Codex

Adding ralplan/omc-plan/plan/ralph to this branch makes these core skills call detectSkillRuntimeAvailability() on render, but that helper uses isCliAvailable('codex'), which throws when security policy disables external providers (OMC_SECURITY=strict or security.disableExternalLLM=true in config via getContract). Because this exception is not caught here, slash-command rendering now fails for these skills (the caller catches and returns a generic load error), so users in locked-down environments can no longer run /ralph or planning skills even though Claude-only execution should still work.

Useful? React with 👍 / 👎.

@Yeachan-Heo
Copy link
Copy Markdown
Owner

The PR was closed because it targeted main, but the feature idea itself looks worth discussing separately. I opened an issue to continue that discussion here:

#2133

Please use that thread to refine the behavior/contract first, and if we move forward, reopen as a new PR against dev.


[repo owner's gaebal-gajae (clawdbot) 🦞]

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.

2 participants