Skip to content

fix: disable reset grid checks for restored blocks on Windows#9987

Merged
acarl005 merged 1 commit intomasterfrom
oz-agent/fix-reset-grid-assert-on-restored-blocks
May 4, 2026
Merged

fix: disable reset grid checks for restored blocks on Windows#9987
acarl005 merged 1 commit intomasterfrom
oz-agent/fix-reset-grid-assert-on-restored-blocks

Conversation

@acarl005
Copy link
Copy Markdown
Contributor

@acarl005 acarl005 commented May 3, 2026

Closes #10068

Description

Fix a Windows-only debug assert panic ("Grid received input but did not receive Reset Grid OSC") that fires when viewing a conversation on Web is handed off to the native client.

On Windows, ConPTY maintains an internal grid model that must be kept in sync with Warp's grids via a Reset Grid OSC. A debug_assert! in GridHandler::input() verifies this OSC was received before any character input is processed.

When a conversation is handed off from Web to native, the blocks are created from serialized data rather than from ConPTY output. Since no actual commands execute through ConPTY, the Reset Grid OSC is never sent, causing the assert to fire.

Fix: Call disable_reset_grid_checks() on restored blocks after start(), matching the existing pattern already used for background blocks. This is applied in two code paths:

  • restore_block() — used for session restoration, shared session scrollback, and web-to-native conversation handoff
  • create_restored_command_block() — used for AI conversation command blocks

Linked Issue

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).

Testing

This is a targeted fix that disables a debug assert for code paths that don't go through ConPTY. The existing pattern (start_background already calls disable_reset_grid_checks) validates the approach. The code compiles and passes cargo fmt checks.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Conversation: https://staging.warp.dev/conversation/c1ffab67-45e7-4b0c-8641-ac6508585a21
Run: https://oz.staging.warp.dev/runs/019def4c-a123-716d-8018-4c82964c8137

This PR was generated with Oz.

@cla-bot cla-bot Bot added the cla-signed label May 3, 2026
On Windows, ConPTY maintains an internal grid that must be kept in sync
with Warp's grids via a Reset Grid OSC. A debug assert in
GridHandler::input() verifies this OSC was received before any input.

When a conversation is handed off from Web to native (or blocks are
restored from serialized data), the block content is parsed from
serialized bytes rather than from ConPTY output, so the Reset Grid OSC
is never sent. This caused the debug assert to fire with the panic
message 'Grid received input but did not receive Reset Grid OSC'.

Fix: call disable_reset_grid_checks() on restored blocks after start(),
matching the existing pattern used for background blocks. This applies
to both restore_block() (session restoration, shared session scrollback,
web-to-native handoff) and create_restored_command_block() (AI
conversation command blocks).

Co-Authored-By: Oz <[email protected]>
@acarl005 acarl005 force-pushed the oz-agent/fix-reset-grid-assert-on-restored-blocks branch from 71c1327 to 7c56cdb Compare May 3, 2026 19:40
@acarl005 acarl005 marked this pull request as ready for review May 3, 2026 21:35
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 3, 2026

@acarl005

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@acarl005 acarl005 requested a review from abhishekp106 May 3, 2026 21:36
Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR exposes the existing reset-grid-check disable helper within the terminal model module and applies it to restored non-background blocks before serialized command/output bytes are replayed. That matches the existing background-block behavior for code paths that reconstruct grids without ConPTY output.

Concerns

  • No correctness, security, or error-handling concerns found in the changed lines.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@abhishekp106 abhishekp106 left a comment

Choose a reason for hiding this comment

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

Makes sense to me!

@acarl005 acarl005 merged commit a9a5b6a into master May 4, 2026
36 checks passed
@acarl005 acarl005 deleted the oz-agent/fix-reset-grid-assert-on-restored-blocks branch May 4, 2026 17:49
@peicodes peicodes added this to the 2026 Week 19 (May 4 - 8) milestone May 4, 2026
Leejaywell added a commit to Leejaywell/warp that referenced this pull request May 5, 2026
Cherry-picked from upstream:
- fix: highlight C++ header extensions (warpdotdev#9388)
- Run executable shell scripts in the terminal (warpdotdev#9503)
- Revert schema generator binary recompilation fix (warpdotdev#9676)
- Remove stray backticks from Windows installer README (warpdotdev#9691)
- Fix chord shortcuts on Windows non-Latin keyboard layouts (warpdotdev#9476)
- Scroll output with Page Up/Down from prompt (warpdotdev#9624)
- Respect Markdown Viewer setting for .md links in AI rules/facts panel (warpdotdev#9699)
- fix: disable reset grid checks for restored blocks on Windows (warpdotdev#9987)
- add RedirectionGuard=no to windows-installer.iss (warpdotdev#9863)
- Windows quake mode window correctly sized (warpdotdev#9891)
- fix: update rand to 0.9.4 (GHSA-cq8v-f236-94qc) (warpdotdev#10060)
- Fix diff button when Show code review button toggle is off (warpdotdev#9600)
- Fix freshly cloned repo stuck in loading state (warpdotdev#9998)
- Fix terminal text selection not auto-scrolling when dragging (warpdotdev#9448)
- Resolve conflict markers from 3f0ac51 and edac651
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable reset grid checks for restored blocks on Windows

3 participants