Skip to content

Fix environment checkout hanging during shell bootstrap - #16661

Merged
seemeroland merged 2 commits into
masterfrom
roland/fix-clone-repo-hang
Oct 29, 2026
Merged

seemeroland merged 2 commits into
masterfrom
roland/fix-clone-repo-hang

Conversation

@seemeroland

@seemeroland seemeroland commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fix environment setup hanging after repositories finish cloning. Pending commands could run after the Bootstrapped hook but before the final bootstrap prompt replaced the active block. The driver then waited for completion of the wrong block.

The fix uses the existing pending-command mechanism rather than dropping the command or adding a polling loop:

  • execute_command_or_set_pending() saves the command in the input buffer and sets has_pending_command before attempting execution.
  • execute_pending_command() now waits for PostBootstrapPrecmd. Its early return leaves the saved command and pending flag intact.
  • Existing terminal event handlers retry execution: BootstrapPrecmdDone retries directly, and AfterBlockCompleted schedules a retry after the existing short delay.
  • Once bootstrap is complete, the retry executes the saved command and clears the pending flag. The driver caller awaits command start and completion throughout; its block tracking is unchanged.

Separately, add a 30-minute deadline around the checkout helper, covering command start and completion. This reports stalled checkout as an error; it does not trigger the retry or terminate the helper process.

Linked Issue

No linked issue; diagnosed from reproducible local Oz runs.

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

Testing

I was able to consistently repro the issue before this fix, and now it doesn't happen after this fix

  • Author tested the fix against the local Oz stack and confirmed the previously reproducible hang is resolved.

  • 13 focused tests passed, including bootstrap readiness, checkout timeout, and existing driver lifecycle coverage.

  • Broader input/environment suite: 251/252 passed. teamless_cloud_mode_host_selector_ignores_team_worker_cache fails a host-selector visibility assertion, including in isolation; it does not exercise command execution.

  • cargo check -p warp --lib passed.

  • cargo clippy -p warp --lib --tests -- -D warnings passed.

  • ./script/format completed after validation.

  • Full integration coverage omitted by author choice; regression unit tests and local end-to-end verification cover this change.

  • I have manually tested my changes locally with ./script/run — Author confirmed local Oz verification; the exact launch command was not recorded.

Agent Mode

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

CHANGELOG-OZ: Fixed environment setup getting stuck after cloning repositories and added a timeout for stalled repository checkouts.

Co-Authored-By: Warp agent@warp.dev

@cla-bot cla-bot Bot added the cla-signed label Oct 28, 2026
@seemeroland
seemeroland marked this pull request as ready for review October 28, 2026 00:23
@seemeroland
seemeroland merged commit 5a55a2a into master Oct 29, 2026
53 of 54 checks passed
@seemeroland
seemeroland deleted the roland/fix-clone-repo-hang branch October 29, 2026 01:00
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.

2 participants