Skip to content

feat(skill): add --coder codex reversed-roles support#286

Merged
wwind123 merged 2 commits into
fix/skill-invocation-docsfrom
codex/issue-285-reversed-roles-skill
Jun 9, 2026
Merged

feat(skill): add --coder codex reversed-roles support#286
wwind123 merged 2 commits into
fix/skill-invocation-docsfrom
codex/issue-285-reversed-roles-skill

Conversation

@wwind123

@wwind123 wwind123 commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds --role {reviewer,coder} argument to helpers/run_external.py so Codex can be invoked for coder (plan-writing) turns, not just reviewer turns
  • Dry-run path for --role coder produces a valid plan_state stub (markdown + <!-- AGENT_PLAN_STATE: approved -->)
  • Documents the reversed-roles flow in a new Reversed roles section in SKILL.md
  • Updates .claude/commands/coding-review-agent-loop.md to accept --coder codex and route to the reversed-roles flow
  • Adds a test (test_dry_run_coder_role_exits_zero_and_writes_plan_state_stub) that validates the dry-run stub passes plan_state validation

Closes #285

Test plan

  • pytest tests/test_skill_helpers.py — all 12 tests pass
  • New test covers --role coder --dry-run exit 0 and plan_state validation of the stub output

🤖 Generated with Claude Code

Add --role coder to run_external.py so Codex can be invoked for plan
writing turns. Document the reversed-roles flow in SKILL.md and update
the slash command to accept --coder codex. Add a dry-run test covering
the new coder role path.

Closes #285

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@wwind123

wwind123 commented Jun 8, 2026

Copy link
Copy Markdown
Owner Author

Review verdict: Blocking

Reversed-role dry-run support is added, but the documented skill flow does not configure Claude as the reviewer for resume/approval tracking.

Blocking issues

  • SKILL.md:221 and .claude/commands/coding-review-agent-loop.md:8 leave Step 1 and reviewer parsing on the normal reviewers set even when --coder codex switches Step 6 to a Claude review. Resume matching only counts metadata whose agent is in configured_reviewers (src/coding_review_agent_loop/round_state.py:515), so a posted --agent Claude review is ignored under the documented/default reviewer config (gemini, or any external reviewer list). That means reruns will not recognize Claude's completed review and the reversed-role loop can repeat review turns or fail to reach a stable approved state. The reversed-role instructions need to explicitly configure/pass claude as the reviewer for build-resume and approval tracking, or otherwise adapt the helper flow to recognize the host Claude review.

-- OpenAI Codex

@wwind123

wwind123 commented Jun 8, 2026

Copy link
Copy Markdown
Owner Author

Review verdict: Approved

The PR successfully implements support for using Codex (or Gemini) as the coder agent, enabling the 'reversed roles' flow (Codex as coder, Claude as reviewer) as described in Issue #285. The orchestrator has been effectively refactored to be agent-agnostic, and the Skill mode helpers now correctly handle these alternative configurations. Test coverage is comprehensive, including new integration tests for the reversed roles flow.

Future follow-ups

  • Consider adding session resumption support (session_id) to CodexBackend if the Codex CLI introduces a corresponding --resume or --session flag.

-- Google Gemini

Codex's blocking review (PR #286) identified that SKILL.md documented the
reversed-roles flow without specifying --reviewers claude in the build-resume
call. Without that, build-resume ignores Claude's posted review on any
subsequent resume attempt, causing the loop to repeat review turns.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@wwind123

wwind123 commented Jun 8, 2026

Copy link
Copy Markdown
Owner Author

Review verdict: Approved

Round 2 review found no blocking issues; the reversed-role resume tracking fix now configures Claude as the reviewer.

Prior unresolved item dispositions

  • [item-1] Blocking issue from OpenAI Codex, round 1: missing --reviewers claude in reversed-roles build-resume -> resolved

-- OpenAI Codex

@wwind123

wwind123 commented Jun 8, 2026

Copy link
Copy Markdown
Owner Author

Review verdict: Approved

Verified that item-1 from round 1 has been addressed. SKILL.md and the Claude command instructions now correctly specify --reviewers claude for the build-resume step when using reversed roles, ensuring that Claude's review turns are properly tracked and resumed. The implementation is consistent with the existing agent mapping logic.

Prior unresolved item dispositions

  • [item-1] Blocking issue from OpenAI Codex, round 1: missing --reviewers claude in reversed-roles build-resume -> resolved

-- Google Gemini

@wwind123 wwind123 merged commit b92ae63 into fix/skill-invocation-docs Jun 9, 2026
1 check passed
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