Skip to content

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

Open
acarl005 wants to merge 1 commit intomasterfrom
oz-agent/fix-reset-grid-assert-on-restored-blocks
Open

fix: disable reset grid checks for restored blocks on Windows#9987
acarl005 wants to merge 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

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 <oz-agent@warp.dev>
@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

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.

1 participant