Skip to content

Fix startup draft recovery for pending Vim Replace keys - #53148

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/97fada635ad9f0f01042b8e96020372d6df9d951
Oct 11, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/97fada635ad9f0f01042b8e96020372d6df9d951

Conversation

@copyberry

@copyberry copyberry Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Fix startup draft recovery for pending Vim Replace keys

Why

Startup recovery treated a buffered Vim Replace key as an insertion, so the recovered unsent text could differ from the eventual edit. Replacing the first character of abcd with X should recover Xbcd, not Xabcd.

What changed

Preserve the distinction between held typed keys and buffered pastes when building recovery snapshots. Apply Vim Replace semantics to held keys, including mouse selections and the bash-mode prefix offset, without consuming live pending input. Keep buffered pastes literal so the live paste path retains responsibility for large-paste and image classification.

Testing

Add regression tests for recovery after startup draft handoff and replacement of mouse-selected text with and without the bash-mode prefix. Verify that taking a recovery snapshot leaves live input unchanged and that flushing the held key produces the same text.

## Why

Startup recovery treated a buffered Vim Replace key as an insertion, so the recovered unsent text could differ from the eventual edit. Replacing the first character of `abcd` with `X` should recover `Xbcd`, not `Xabcd`.

## What changed

Preserve the distinction between held typed keys and buffered pastes when building recovery snapshots. Apply Vim Replace semantics to held keys, including mouse selections and the bash-mode prefix offset, without consuming live pending input. Keep buffered pastes literal so the live paste path retains responsibility for large-paste and image classification.

## Testing

Add regression tests for recovery after startup draft handoff and replacement of mouse-selected text with and without the bash-mode prefix. Verify that taking a recovery snapshot leaves live input unchanged and that flushing the held key produces the same text.

GitOrigin-RevId: 97fada635ad9f0f01042b8e96020372d6df9d951
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/97fada635ad9f0f01042b8e96020372d6df9d951 branch from 833d79e to 97c1f62 Compare October 11, 2026 15:38
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
πŸ“ Code Review πŸ”„ Running since 2026-10-11T15:38:54.993444Z 833d79e PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with πŸ‘€ while any review is running, comments if it has suggestions, and reacts with πŸ‘ once all reviews finish with no findings.

@copyberry
copyberry Bot merged commit 97c1f62 into main Oct 11, 2026
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/97fada635ad9f0f01042b8e96020372d6df9d951 branch October 11, 2026 15:39
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 11, 2026
@poting-lin
poting-lin deployed to issue-triage October 11, 2026 15:45 — with Image GitHub Actions Active
@poting-lin
poting-lin deployed to issue-triage October 11, 2026 15:45 — with Image GitHub Actions Active
@poting-lin
poting-lin deployed to issue-triage October 11, 2026 15:45 — with Image GitHub Actions Active
@poting-lin
poting-lin deployed to issue-triage October 11, 2026 15:46 — with Image GitHub Actions Active

This branch was successfully deployed

1 active deployment
issue-triage β€” 97c1f628 Deployed Oct 11, 2026 by poting-lin via Identify potential duplicates (open issues fallback) #54438
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.

2 participants