Skip to content

Fix Codex input echo lag after synchronized output - #4708

Merged
Jinwoo-H merged 1 commit into
mainfrom
Jinwoo-H/codex-input-lag
Jun 5, 2026
Merged

Jinwoo-H merged 1 commit into
mainfrom
Jinwoo-H/codex-input-lag

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • fix Codex input echo lag after harmless synchronized-output endings
  • keep hazardous wrong-row cursor frames coalesced until a cursor restore arrives
  • add scheduler coverage for both paths

Validation

  • pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/pane-manager/pane-terminal-output-scheduler.test.ts
  • pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-connection.test.ts src/renderer/src/lib/pane-manager/windows-pty-compatibility.test.ts src/renderer/src/components/terminal-pane/terminal-conpty-device-attributes.test.ts
  • pnpm run typecheck:web
  • pnpm exec playwright test -c tests/playwright.config.ts tests/e2e/terminal-codex-cursor-jitter-repro.spec.ts --project=electron-headful --grep queued-message
  • repro artifact check: logicalVisible=0, rasterWorkingCursor=0

@Jinwoo-H
Jinwoo-H merged commit 2db0dc8 into main Jun 5, 2026
2 checks passed
@Jinwoo-H
Jinwoo-H deleted the Jinwoo-H/codex-input-lag branch June 5, 2026 19:17
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
nwparker added a commit to STiFLeR7/orca that referenced this pull request Nov 30, 2026
On native Windows ConPTY panes, a DEC 2026 frame end always took the
cursor-restore coalesce wait (up to 1 s, or the 250 ms hold safety for
split frames), so a ~20 fps synchronized animation froze and then jumped.
That wait exists for frames that toggle cursor visibility and send the
restore later (stablyai#4669, stablyai#4708). A frame with no ?25h/?25l owes no restore.

Track whether an open frame has toggled cursor visibility across every
chunk it spans, using the carried marker tail to catch a ?25h/?25l split
at a chunk boundary. Cursor-free frames, whole or split by ConPTY's
8 KiB reads, now present at their end marker. Frames that toggle the
cursor, and frames whose start the pane did not see, keep the existing
restore wait.

Refs stablyai#52839

Co-authored-by: STiFLeR7 <[email protected]>
nwparker added a commit to STiFLeR7/orca that referenced this pull request Nov 30, 2026
On native Windows ConPTY panes, every DEC 2026 frame end took the
cursor-restore coalesce wait (up to 1 s, or the 250 ms hold safety for
split frames), so a ~20 fps synchronized animation froze and then
jumped. That wait exists for frames that toggle cursor visibility and
send the restore later (stablyai#4669, stablyai#4708). A frame with no ?25h/?25l is
treated as owing no restore.

Track whether the open frame has toggled cursor visibility across every
chunk it spans, using the carried marker tail to catch a ?25h/?25l split
at a chunk boundary. Scope that flag to frame boundaries, so a chunk
that closes one frame and opens the next starts the new frame clean.
Cursor-free frames, whole or split by ConPTY reads, now present at their
end marker. Frames that toggle the cursor, frames whose start the pane
did not see, and unmatched end markers keep the existing restore wait.

Partial: frames that toggle the cursor (Codex, Claude Code native
cursor) still wait for the restore fallback.

Refs stablyai#52839

Co-authored-by: STiFLeR7 <[email protected]>
nwparker added a commit that referenced this pull request Nov 30, 2026
#52969)

On native Windows ConPTY panes, every DEC 2026 frame end took the
cursor-restore coalesce wait (up to 1 s, or the 250 ms hold safety for
split frames), so a ~20 fps synchronized animation froze and then
jumped. That wait exists for frames that toggle cursor visibility and
send the restore later (#4669, #4708). A frame with no ?25h/?25l is
treated as owing no restore.

Track whether the open frame has toggled cursor visibility across every
chunk it spans, using the carried marker tail to catch a ?25h/?25l split
at a chunk boundary. Scope that flag to frame boundaries, so a chunk
that closes one frame and opens the next starts the new frame clean.
Cursor-free frames, whole or split by ConPTY reads, now present at their
end marker. Frames that toggle the cursor, frames whose start the pane
did not see, and unmatched end markers keep the existing restore wait.

Partial: frames that toggle the cursor (Codex, Claude Code native
cursor) still wait for the restore fallback.

Refs #52839

Co-authored-by: Neil <[email protected]>
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.

1 participant