Skip to content

Custom prompts fail when using $arguments with truncated clipboard input #7047

@BobbyWang0120

Description

@BobbyWang0120

What version of Codex is running?

codex-cli 0.61.0

What subscription do you have?

Pro

Which model were you using?

No response

What platform is your computer?

No response

What issue are you seeing?

I created a custom prompt that uses the $ARGUMENTS placeholder to dynamically embed user input text. When I invoke this prompt with a slash command (e.g. /a) and paste a long text after the command, the CLI truncates the pasted text and displays it as [N] chars (where N is the number of characters). When that happens, Codex does not resolve the slash command into my custom prompt. Instead the slash command is treated as plain text and the prompt does not run. For example, typing /a followed by a 3 000 -character input causes /a to remain as literal text rather than invoking my a prompt with the arguments.

Steps to reproduce:

  1. Create a custom prompt file (e.g. a.md) in ~/.codex/prompts that contains a prompt using $ARGUMENTS.
  2. Start Codex CLI.
  3. Invoke the prompt by entering /a and then paste a long string (around 3 000 characters). Codex will show the length indicator [Pasted Content 3000 chars] instead of the full text.
  4. Observe that the slash command is not resolved to the custom prompt; the command appears as plain text and the dynamic arguments are not substituted.

What steps can reproduce the bug?

  1. Create a custom prompt file (for example, a.md) in ~/.codex/prompts that uses the $arguments placeholder to embed dynamic text.
  2. Start Codex CLI.
  3. Call the prompt by typing /a and then paste a very long string (around 3 000 characters). After pasting, the input area will show an indicator like [Pasted Content 3000 chars] instead of displaying the full text.
  4. Observe that Codex does not recognize /a as a slash command anymore. The command stays as literal text and the custom prompt is never expanded with the arguments.

What is the expected behavior?

Codex should expand the slash command into the custom prompt and insert the full contents of $ARGUMENTS, even when the pasted input is very long and displayed as [N] chars. The slash command should continue to function and not be converted to plain text merely because the input was truncated for display purposes.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions