-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Ability to include arguments in custom prompts #3164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this 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".
…al completed slash selection
Hey, this is great! |
I would potentially agree, but personally I would prefer to do this as a follow up PR rather than hold up this one longer. Happy to work on it though. |
No I do not believe so. As previously highlighted, this only allows for one $ARGUMENTS value so a slash command like
would result in
if the contents of
Based on your issue, you seem to require multiple named arguments which would not be supported. Even claude's recent updates wouldn't give you what you require as the arguments are numbered. e.g. (with claude)
would output
if the contents of
|
Thx for the explanation. Claude Code slash command can set My workaround so far is to define ## Inputs
- Ask user for Literal ACCOMPLISHMENT_PATH (strip one leading @ if present). |
I see.. I'm happy to open another PR to address this at a later date. |
Been using this for a while, works well. $ARGUMENTS works well, please don't switch to $PROMPT_ARGUMENT just to name it differently. |
@3rd I have no intention of changing this to $PROMPT_ARGUMENT - It doesn't make sense to do so as cross compatibility with other services is something that should be strived for in my opinion. |
This pull request introduces support for argument substitution in custom slash-style prompt invocations, enabling users to write commands like
/name args...
and have$ARGUMENTS
replaced by the provided arguments. It also integrates this behavior into the chat composer UI and adds comprehensive tests to ensure correctness.Custom prompt argument substitution:
expand_prompt_invocation_for_tests
incodex-rs/core/src/custom_prompts.rs
to parse slash-style commands and substitute$ARGUMENTS
with the raw text following the command name.codex-rs/core/src/custom_prompts.rs
to verify correct argument substitution, including handling multiple occurrences and empty arguments.Integration with chat composer:
codex-rs/tui/src/bottom_pane/chat_composer.rs
to useexpand_prompt_invocation_for_tests
when handling custom prompt invocations, ensuring$ARGUMENTS
is expanded both when a user selects a prompt from the popup and when submitting text directly. [1] [2]codex-rs/tui/src/bottom_pane/chat_composer.rs
to verify that argument substitution occurs correctly when submitting a slash-style prompt.