Skip to content

Fix Codex argument injection and prompt command references#651

Closed
zxfxpower wants to merge 2 commits into
Fission-AI:mainfrom
zxfxpower:fix/codex-arguments-from-1.1.1
Closed

Fix Codex argument injection and prompt command references#651
zxfxpower wants to merge 2 commits into
Fission-AI:mainfrom
zxfxpower:fix/codex-arguments-from-1.1.1

Conversation

@zxfxpower

@zxfxpower zxfxpower commented Feb 3, 2026

Copy link
Copy Markdown

Summary

  • Inject $ARGUMENTS into Codex prompt output so /prompts:opsx-* <args> works as expected.
  • Convert /opsx:* and /opsx-* references in prompt bodies to Codex format /prompts:opsx-*.
  • Add tests for Codex command reference transformation.
  • Ignore .idea/ in repo.

Context

Issue #649 reports Codex prompts ignore arguments and contain incorrect command references. This PR fixes both at the generator level.

Testing

  • pnpm test -- test/core/command-generation/adapters.test.ts test/utils/command-references.test.ts

Summary by CodeRabbit

Release Notes

  • New Features

    • Command references in generated output are now transformed to a new standardized format.
    • Added $ARGUMENTS marker to formatted output.
  • Chores

    • Updated gitignore configuration.

@zxfxpower zxfxpower requested a review from TabishB as a code owner February 3, 2026 04:20
@coderabbitai

coderabbitai Bot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The PR introduces a new transformToCodexCommands utility function that converts /opsx: and /opsx- command patterns to /prompts:opsx- format. This function is integrated into the Codex adapter, which now includes a $ARGUMENTS placeholder in YAML frontmatter and transforms command references in the output body.

Changes

Cohort / File(s) Summary
Codex Adapter with Command Transformation
src/core/command-generation/adapters/codex.ts
Added import and invocation of transformToCodexCommands to transform command references in the formatted output body. Introduced $ARGUMENTS placeholder in the YAML frontmatter.
Command Reference Utilities
src/utils/command-references.ts
New transformToCodexCommands(text: string) function that converts both /opsx: and /opsx- patterns to /prompts:opsx- format using chained string replacements.
Public API Exports
src/utils/index.ts
Exported the new transformToCodexCommands function alongside the existing transformToHyphenCommands export.
Test Coverage
test/core/command-generation/adapters.test.ts, test/utils/command-references.test.ts
Added test cases validating the transformToCodexCommands function behavior (colon form, hyphen form, multiple references, backtick-quoted commands) and updated adapter tests to expect $ARGUMENTS placeholder and transformed command patterns.
Project Configuration
.gitignore
Added JetBrains .idea/ directory to ignored files.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers

  • TabishB

Poem

🐰 Hop along, dear Codex friend,
With /prompts:opsx- at journey's end,
$ARGUMENTS marked with care,
Pattern transformations everywhere!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: fixing Codex argument injection (via $ARGUMENTS) and transforming prompt command references (/opsx: to /prompts:opsx-).
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@zxfxpower

Copy link
Copy Markdown
Author

@TabishB thanks for taking a look — this PR addresses #649 (Codex args + command hints). Happy to adjust if you want any changes.

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