Skip to content

[codex] Fix TUI large paste placeholder numbering after Ctrl+C#21091

Merged
canvrno-oai merged 1 commit intomainfrom
codex/large-paste-placeholder-numbering
May 5, 2026
Merged

[codex] Fix TUI large paste placeholder numbering after Ctrl+C#21091
canvrno-oai merged 1 commit intomainfrom
codex/large-paste-placeholder-numbering

Conversation

@canvrno-oai
Copy link
Copy Markdown
Contributor

Fixes #19940.

Large-paste placeholder numbering was backed by a per-size counter, so clearing a draft with Ctrl+C left numbering state behind even though the active pending paste state was gone. This updates the composer to derive the next placeholder suffix from active pending pastes instead, which keeps simultaneous same-size pastes distinct while letting fresh drafts reuse the base label. This is also a small code cleanup: pending paste state is now the source of truth instead of maintaining a separate counter.

Credit to @Sungyoun-Kim for the issue report, root-cause notes, and fork with the proposed fix, and to @charley-oai for the earlier related #10032 proposal.

Changes:

  • Remove the monotonic large-paste counter from the composer.
  • Compute suffixes from currently active pending paste placeholders.
  • Document large-paste placeholder behavior in the composer module docs.
  • Add regression coverage for Ctrl+C clearing and deletion/reset behavior.

Testing:

  • just fmt
  • git diff --check

@canvrno-oai canvrno-oai changed the title Fix TUI large paste placeholder numbering after Ctrl+C [codex] Fix TUI large paste placeholder numbering after Ctrl+C May 4, 2026
@canvrno-oai
Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ 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".

@canvrno-oai canvrno-oai marked this pull request as ready for review May 4, 2026 23:16
Copy link
Copy Markdown
Contributor

@fcoury-oai fcoury-oai left a comment

Choose a reason for hiding this comment

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

Replicated the issue on stable Codex and was confirmed the behavior was fixed with this branch.

Code looks good, approved.

@canvrno-oai canvrno-oai merged commit 1feaa7d into main May 5, 2026
26 checks passed
@canvrno-oai canvrno-oai deleted the codex/large-paste-placeholder-numbering branch May 5, 2026 17:33
@github-actions github-actions Bot locked and limited conversation to collaborators May 5, 2026
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.

TUI large paste placeholder number increments after Ctrl+C clears draft

2 participants