Skip to content

fix: allow model invocation for codex commands except review#227

Open
BastianZim wants to merge 2 commits intoopenai:mainfrom
BastianZim:fix/allow-model-invocation-for-codex-commands
Open

fix: allow model invocation for codex commands except review#227
BastianZim wants to merge 2 commits intoopenai:mainfrom
BastianZim:fix/allow-model-invocation-for-codex-commands

Conversation

@BastianZim
Copy link
Copy Markdown

@BastianZim BastianZim commented Apr 14, 2026

Summary

  • Remove disable-model-invocation: true from adversarial-review, cancel, result, and status commands so Claude can route explicit user requests and skills/workflows can invoke them
  • Keep the flag on review intentionally — it's a heavyweight Codex call most at risk of proactive invocation
  • Add explicit guardrail to adversarial-review preventing Claude from running it on its own initiative
  • Fix pre-existing test regression from fix: quote $ARGUMENTS in cancel, result, and status commands #168 where quoted $ARGUMENTS was not reflected in the test regex
  • Add new "model invocation policy" test that locks in the intentional asymmetry across all 5 commands

Closes #211
Supersedes #156 #157

Context

disable-model-invocation: true conflates two concerns: preventing proactive model invocation and hiding commands from Claude entirely. With the flag set, Claude cannot invoke the command even when the user explicitly asks for it in a message, and other skills/workflows cannot compose with it. There is no native Claude Code frontmatter option that separates "known" from "invokable" (confirmed in docs).

The fix removes the flag from 4 of 5 affected commands. review keeps the flag because it's expensive and takes no user-supplied focus text, making it the most likely target for unwanted proactive invocation. adversarial-review gets an explicit prompt-level guardrail instead.

Test plan

  • commands.test.mjs passes 9/9 (was 8/9 before — pre-existing $ARGUMENTS quoting regression fixed)
  • Verify /codex:adversarial-review appears in Claude's skill list after plugin reload
  • Verify /codex:status, /codex:result, /codex:cancel can be invoked by Claude when user asks in a message
  • Verify /codex:review remains user-only (typing it in a message should not route)
  • Verify Claude does not proactively invoke adversarial-review without being asked

🤖 Generated with Claude Code

)

Remove `disable-model-invocation: true` from adversarial-review, cancel,
result, and status commands so Claude can route explicit user requests
and other skills/workflows can invoke them.

The flag is intentionally kept on `review` to prevent proactive Codex
spend on the heavyweight native review. An explicit guardrail is added
to adversarial-review telling Claude to only run it when explicitly
asked.

Also fixes a pre-existing test regression from openai#168 where the quoted
`$ARGUMENTS` pattern was not reflected in the test regex.

Closes openai#211
Supersedes openai#156 openai#157

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@BastianZim BastianZim requested a review from a team April 14, 2026 17:18
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: 0115b09eab

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

cancel is destructive — it terminates a running Codex job and with no
job-id it auto-resolves to the single active job. Add a prompt-level
guardrail matching the one on adversarial-review to prevent proactive
invocation.

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

If this restriction is deliberate that's completely understandable, but since there is a lot of debate around out, I wanted to put in a PR so we can at least have it documented somewhere.

Thank you!

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.

disable-model-invocation hides commands from skill list, blocking user-initiated invocation

1 participant