Skip to content

Conversation

@icedac
Copy link

@icedac icedac commented Sep 22, 2025

What

  • Add support for passing arguments to custom prompts executed via slash commands and custom commands.
  • Expose the raw argument string to the template as the $ARGUMENTS (and $0...$9) placeholder so it can be rendered inside the .md file.
  • Use the frontmatter YAML property named 'description' to display descriptions in the slash popup.
  • Keep behavior fully backward-compatible when no arguments are provided.

Why

How

  • Thread the user-provided argument string from the slash/custom command invocation through the execution pipeline and expose it to the renderer as $ARGUMENTS, $0, $1 ... $9
  • Fallbacks:
    • If the argument string is empty, nothing happens.
  • This also fixes custom prompts to work with history, making them usable (previously this was not working properly).

Prompt with Arguments

CleanShot 2025-09-22 at 18 50 43

Description Showing in Slash Popup

CleanShot 2025-09-22 at 19 08 01

Works as Expected!

CleanShot 2025-09-22 at 19 08 28

Backward Compatibility

  • No breaking changes. Existing prompts without $ARGUMENTS continue to work unchanged.

Notes

I have read the CLA Document and I hereby sign the CLA

@github-actions
Copy link

github-actions bot commented Sep 22, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@icedac
Copy link
Author

icedac commented Sep 22, 2025

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Sep 22, 2025
Copy link
Contributor

@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 suggestions.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

@icedac icedac force-pushed the feat/tui-custom-prompt-args branch 2 times, most recently from 5826777 to a02b19e Compare September 22, 2025 10:30
@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. Breezy!

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

@MaurUppi
Copy link

MaurUppi commented Sep 23, 2025

Interested to know what's diff vs. #3565
btw, the team seems to rarely accept feat. proposal.

@icedac
Copy link
Author

icedac commented Sep 23, 2025

Interested to know what's diff vs. #3565 btw, the team seems to rarely accept feat. proposal.

I think almost same but have different view for that issue, OAI team let the history navigation doesn't works with it so they disabled history nav with custom promtps so I fixed it to works with this pr.

@chatgpt-codex-connector
Copy link
Contributor

Note

To use Codex here, create an environment for this repo.

1 similar comment
@chatgpt-codex-connector
Copy link
Contributor

Note

To use Codex here, create an environment for this repo.

…TS, $0..$9)

Implements token substitution when submitting a selected custom prompt via the slash popup.

- Adds parsing of positional args from the composer first line.
- Supports $ARGUMENTS (joined args), $0 (prompt name), and $1..$9 (positionals).
- Leaves tokens intact when a referenced positional is missing.
- Includes unit tests for joined, positional, and missing cases.

Note: handling of history overrides and typed slash commands without popup are deferred to a later commit.
Core: parse minimal front matter and capture description (if present), stripping it from the body.\nProtocol: extend CustomPrompt with optional description.\nTUI: display prompt.description in the command popup (fallback to default when absent).\nTests: updated to include description: None for constructed prompts.
Composer: capture raw input when submitting a custom prompt, and set a one-shot history override. Also block history navigation for '/ ' contexts until prompts finish loading, and expand typed custom prompts even when the popup is not used.
BottomPane: expose take_next_history_override for ChatWidget.
ChatWidget: persist history using override text when present, keeping conversation text unchanged.
fix: Substite $ARGUMENTS with all multiline inputs.
@icedac icedac force-pushed the feat/tui-custom-prompt-args branch from a02b19e to cd402d7 Compare September 23, 2025 10:16
@withakay
Copy link

Is this a duplicate of PR #3164 ?

@icedac
Copy link
Author

icedac commented Sep 23, 2025

Is this a duplicate of PR #3164 ?

I think not exactly but have common to support $ARGUMENTS.

I think this issue has been around for 3 weeks, so there are more than 3 PRs for this one. I created this for my own use and to help get OAI working.

@icedac
Copy link
Author

icedac commented Sep 23, 2025

@codex review
@claude review

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. Nice work!

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

@x22x22
Copy link

x22x22 commented Sep 23, 2025

I can't wait for this demand any longer.

@0xdevalias
Copy link

0xdevalias commented Oct 1, 2025

I think this issue has been around for 3 weeks, so there are more than 3 PRs for this one.

Recent updates:

Hey guys, coming soon! @evandavid1's PR was merged into a feat branch, and I'll combine it with some named params and submit for a PR & review this week.

Originally posted by @dedrisian-oai in #2890 (comment)

Numbered args ($1, $2, $3, $ARGUMENTS) has been merged. Named args coming next!

Originally posted by @dedrisian-oai in #2890 (comment)

Both numbered args and named args have been merged! It will be released in the next version :)

Originally posted by @dedrisian-oai in #2890 (comment)

I believe it should be in 0.43.0 when released:

@etraut-openai
Copy link
Collaborator

Thanks for the contribution, and apologies for the slow response. We've received many PRs, and we don't have the bandwidth on the codex team to review all of them.

I think this PR is no longer needed. The linked feature request is marked as completed.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 30, 2025
@openai openai unlocked this conversation Oct 30, 2025
@openai openai locked and limited conversation to collaborators Oct 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants