Skip to content

fix windows paste behavior and add more test#9350

Open
occurrent wants to merge 6 commits intoopenai:mainfrom
occurrent:improve-windows-paste
Open

fix windows paste behavior and add more test#9350
occurrent wants to merge 6 commits intoopenai:mainfrom
occurrent:improve-windows-paste

Conversation

@occurrent
Copy link
Contributor

@occurrent occurrent commented Jan 16, 2026

A regression slipped in after #8021, and our existing tests did not catch it. This PR fixes that regression, tightens the PasteBurst / ChatComposer heuristics around Windows key-event pastes, and adds targeted regression tests to prevent similar breakages.

changes

  • Improve classification of Windows "key-event pastes", including slower initial inter-key gaps that previously caused pastes to be split or treated as normal typing.
  • Preserve ordering for multiline pastes when the first ASCII char is temporarily held (pending_first_char) and an early Enter arrives, avoiding mid-stream submit or dropped newlines.
  • Fix burst timeout accounting when Enter promotes a pending-first-char into an active burst, preventing premature flush and paste chunking.
  • Narrowly scope any widened Enter/newline decision window to the single-ASCII-char (hold-capable) path, to avoid IME / non-ASCII behavior regressions.

User-visible impact

  • Windows: multiline key-event pastes are less likely to be submitted accidentally; Enter is more consistently treated as newline within the paste.
  • Non-Windows (and environments where bracketed paste works): no intended behavior change.

Tests and docs

  • Add Windows-gated regression tests covering Char -> Enter slow-gap classification, ordering, Enter/newline boundaries, and large paste placeholder paths (no stray prefix chars).
  • Update docs/tui-chat-composer.md and relevant docstrings to reflect the refined heuristics and rationale.

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 automated review suggestions for this pull request.

Reviewed commit: 837f5672e8

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

@occurrent occurrent force-pushed the improve-windows-paste branch from 61166c1 to af59417 Compare February 1, 2026 00:02
@occurrent
Copy link
Contributor Author

@etraut-openai This PR has been up for a while, could take a look?

@occurrent occurrent closed this Feb 3, 2026
@etraut-openai
Copy link
Collaborator

@occurrent, sorry it has taken so long to get to this. The Codex team has been incredibly busy lately preparing for the recent Codex App launch. I'm still interested in this PR if you're willing to give us a bit more time.

@occurrent occurrent reopened this Feb 4, 2026
@occurrent
Copy link
Contributor Author

@codex review

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 automated review suggestions for this pull request.

Reviewed commit: 446d27e749

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

@occurrent
Copy link
Contributor Author

@codex review

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 automated review suggestions for this pull request.

Reviewed commit: ba1b456cb1

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

@occurrent
Copy link
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. What shall we delve into next?

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

@occurrent
Copy link
Contributor Author

I have manually tested the compiled program on the Windows platform, and so far, the scenarios I designed are behaving as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants