rulesync icon indicating copy to clipboard operation
rulesync copied to clipboard

Feature Request: map root disable-model-invocation to the codexcli agents/openai.yaml invocation policy

Open acelarski opened this issue 2 months ago • 0 comments

Problem

The root-level disable-model-invocation skill flag is a shared default for most targets, but not for codexcli. From docs/reference/file-formats.md (v17.0.0):

shared default for tools that support the flag — claudecode, copilot, copilotcli, crush, cursor, zed, pi, qwencode, grokcli, factorydroid, dsh, and commandcode.

For Codex the equivalent control lives only in the agents/openai.yaml sidecar, and the sidecar is emitted only from an explicit codexcli section — same file:

When codexcli.interface, codexcli.policy, or codexcli.dependencies is present, Rulesync emits .agents/skills/<name>/agents/openai.yaml and reads it back on import.

In the source, buildOpenaiYamlObject in src/features/skills/codexcli-skill.ts receives only the codexcli section and returns early without it:

const hasSidecarFields = Boolean(codexcli.interface || codexcli.policy || codexcli.dependencies);
if (!hasSidecarFields) {
  return undefined;
}

So a skill written once as user-only:

---
name: release-notes
description: Draft release notes from the merged pull requests
targets: ["*"]
disable-model-invocation: true
---

is user-only in Claude Code, Copilot, Cursor and the other listed targets, and implicitly invocable in Codex: no sidecar is written, and Codex's SKILL.md frontmatter carries only name and description, so nothing else can express the policy. The author has to know about the gap and repeat the intent in a Codex-specific form on every such skill:

codexcli:
  policy:
    allow_implicit_invocation: false

In a repository where some pipeline steps run in Claude Code and others in Codex, the same skill then behaves differently depending on which harness picks it up.

Proposed solution

Treat root disable-model-invocation as a shared default for codexcli as well, mapped onto policy.allow_implicit_invocation in the sidecar.

The root flag already maps onto a target whose native form differs from a boolean key — devin "also reads this root value (true maps onto a user-only triggers list)" — so a mapping onto a sidecar field fits the existing design. #1770 introduced the sidecar and #1928 introduced the root flag with per-target overrides; this request connects the two for codexcli.

Desired behaviour

  1. Root disable-model-invocation: true with no codexcli.policy.allow_implicit_invocation → the sidecar is emitted with policy.allow_implicit_invocation: false, even if the skill has no other codexcli field.
  2. An explicit codexcli.policy.allow_implicit_invocation wins over the root flag, as the other targets' own sections do today.
  3. Root disable-model-invocation: false or absent, with no codexcli sidecar fields → no sidecar, exactly as today.
  4. On import, a sidecar whose only content is policy.allow_implicit_invocation: false round-trips to root disable-model-invocation: true rather than to a codexcli.policy block, or the choice between the two is documented.

Reference

Read at tag v17.0.0: docs/reference/file-formats.md (the root disable-model-invocation flag, the codexcli section and the Codex sidecar note) and src/features/skills/codexcli-skill.ts (buildOpenaiYamlObject). Related: #1741, #1770, #1928.

acelarski avatar Sep 23 '26 07:09 acelarski