OpenSpec icon indicating copy to clipboard operation
OpenSpec copied to clipboard

Codex prompts generated by OpenSpec do not inject arguments ($ARGUMENTS missing)

Open zxfxpower opened this issue 10 months ago • 9 comments

Codex prompts generated by OpenSpec do not inject arguments ($ARGUMENTS missing)

zxfxpower avatar Feb 02 '26 11:02 zxfxpower

Additional analysis (regression evidence):

In pre‑1.0 versions (e.g. v0.23.0), the Codex slash command generator explicitly injected $ARGUMENTS in the prompt frontmatter/body.

Reference:

  • v0.23.0: src/core/configurators/slash/codex.ts
    • getFrontmatter() returns YAML frontmatter followed by $ARGUMENTS for proposal/apply/archive
    • This was required for Codex argument injection and was covered by tests

In v1.0+ (current v1.1.1), the new Codex adapter in src/core/command-generation/adapters/codex.ts only emits frontmatter + body, but does not include $ARGUMENTS. As a result, arguments passed in /prompts:opsx-ff <...> are not visible to the prompt and it asks for input again.

This appears to be a regression introduced during the migration from legacy slash commands to the new skills/command-generation system.

zxfxpower avatar Feb 02 '26 11:02 zxfxpower

Additional issue (Codex command hints):

In Codex prompt files (opsx-*.md), the instructions and examples often reference /opsx:apply, /opsx:ff, etc. However, in Codex the correct invocation format is /prompts:opsx-apply, /prompts:opsx-ff, etc.

This mismatch is confusing and leads to failed command invocation in Codex.

Suggested fix:

  • Update Codex prompt templates to use /prompts:opsx-* in all examples and hints (or render command references via a tool-aware formatter).

zxfxpower avatar Feb 02 '26 11:02 zxfxpower

Requesting triage / priority: This blocks Codex users from using opsx-ff/opsx-apply with arguments (input ignored). Fix seems small: inject $ARGUMENTS (or $1..$9) into Codex prompt templates (adapters/codex.ts). Happy to test a patch if you have a branch.

zxfxpower avatar Feb 03 '26 03:02 zxfxpower

Likely not intentional. During the 1.0 migration, the new Codex adapter was introduced without $ARGUMENTS support (#556), and the legacy configurator that did include $ARGUMENTS was later removed in #565. There’s no explicit design note in #565 saying “drop arguments,” and the specs still mention $ARGUMENTS, so this looks like a regression from the migration rather than a deliberate change.

zxfxpower avatar Feb 04 '26 14:02 zxfxpower

@TabishB hi! Friendly ping on this regression. The args worked pre‑1.0 and appear to have been dropped during the 1.0 adapter migration (#556/#565). I have a fix ready in PR #651 (adds $ARGUMENTS + Codex command reference transform). Appreciate a quick look when you have a chance—happy to adjust if needed.

zxfxpower avatar Feb 05 '26 03:02 zxfxpower

still missing in version 1.2

fengyunzaidushi avatar Feb 28 '26 03:02 fengyunzaidushi

@fengyunzaidushi Thanks for confirming this is still missing in v1.2.0. As a temporary workaround, I’m currently not using the generated /prompts:opsx-* commands. I now use OpenSpec skills directly in Codex, and it has been stable for daily use. You may want to try the same approach until this issue is fixed.

zxfxpower avatar Mar 03 '26 02:03 zxfxpower

I encountered the same problem. /prompts:opsx-ff ->newline add a new action "partitioned storage" on the device list page

zc0982 avatar Mar 05 '26 04:03 zc0982

Same to me. The args will not be injected into prompts.

carpediemtal avatar Mar 21 '26 01:03 carpediemtal