Skip to content

Conversation

@Priya-753
Copy link
Contributor

Summary of Changes

What?
Fix for slash commands (e.g., /prompts:code-review) not being recognized when large content (>3000 chars) is pasted.
Bug Report
Why?
With large pastes, slash commands were ignored, so custom prompts weren't expanded and were submitted as literal text.

How?
Refactored the early return block in handle_key_event_without_popup (lines 957-968).
Instead of returning early after replacing placeholders, the code now replaces placeholders in the textarea and continues to the normal submission flow.
This reuses the existing slash command detection and custom prompt expansion logic (lines 981-1047), avoiding duplication.

Changes:
Modified codex-rs/tui/src/bottom_pane/chat_composer.rs: refactored early return block to continue to normal flow instead of returning immediately
Added test: custom_prompt_with_large_paste_expands_correctly to verify the fix

Code Quality:
No lint warnings
Code follows existing patterns and reuses existing logic
Atomic change focused on the bug fix

@Priya-753
Copy link
Contributor Author

Priya-753 commented Nov 23, 2025

Also fixes #7093

@etraut-openai
Copy link
Collaborator

@codex review

@chatgpt-codex-connector
Copy link
Contributor

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

ℹ️ 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
  • 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 address that feedback".

@aibrahim-oai aibrahim-oai merged commit 523dabc into openai:main Nov 24, 2025
25 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 24, 2025
@etraut-openai
Copy link
Collaborator

Thanks for the contribution!

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.

3 participants