Repository navigation
Bound MCP tool calls and environment setup commands - #16219
Merged
Merged
Conversation
Add a 30-minute logical MCP deadline with bounded cancellation and no ambiguous transport replay. Bound setup commands, report redacted command-specific failures, and retain postmortem history without keeping stalled processes alive. Co-Authored-By: Warp <agent@warp.dev>
seemeroland
marked this pull request as ready for review
September 30, 2026 23:34
seemeroland
approved these changes
Oct 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Upgrade rmcp and bound MCP tool calls and environment setup so unresolved operations cannot consume the full sandbox lifetime. The investigation found missing MCP results after broken response streams and unfinished setup iterations.
rmcpfrom 2.2.0 to 3.5.0, picking up upstream request-scoped error propagation when an SSE response terminates without a final result after supported recovery. The fix shipped in the 3.0 release line via rust-sdk#1000; no dependency fork is needed. Adapt OAuth metadata discovery, authorization requests, and client configuration to the 3.5 APIs.TransportClosedfailures. Warp resource-read retries remain unchanged; tests verify valid SSE resumption still succeeds.The MCP limit also applies to local native-agent sessions. These fixed limits can interrupt legitimate longer operations. Cancellation is best-effort and does not prove that the remote tool stopped.
Terminated response streams can fail without waiting for the 30-minute logical deadline. That deadline remains a safety net for calls that stay pending, including stalled connection or dispatch.
wait_for_eventsand parent orchestration behavior are unchanged.Review guide
Start with
Cargo.tomland the 3.5 compatibility changes incrates/mcp/src/oauth.rsandruntime.rs. Then reviewtool_call.rsfor the total deadline and bounded cancellation, followed by the setup timeout/teardown paths indriver/environment.rsanddriver.rs. Focus on prompt EOF failure versus deadline fallback, valid resumption without tool replay, command redaction, and avoiding renewed waits during cleanup.Companion server diagnostics: https://github.com/warpdotdev/warp-server/pull/18729
Linked Issue
ready-to-specorready-to-implement— no separate issue was created; investigation linked below.Testing
Manually tested setup command timeout

Validation during the rmcp upgrade
cargo nextest run -p mcppassed: 40 tests, including OAuth, deadline, EOF and resumption coverage.cargo check -p mcp --testsandcargo check -p warp --testspassed.cargo clippy -p mcp --all-targets --tests -- -D warningspassed.git diff --checkpassed.TransportClosedin released 3.0.0 and current upstream; successful-result controls pass in all three.Earlier deadline validation
Recorded before the dependency upgrade:
cargo nextest run --locked --lib --no-fail-fast -p warp -p mcp -E 'package(mcp) | test(setup_) | test(shell_exit_) | test(extend_shared_session_retention)'.cargo check --locked -p warp --lib --testspassed.cargo clippy --locked -p warp -p mcp --lib --tests -- -D warningspassed.git diff --checkpassed.Coverage includes empty/truncated SSE responses failing with the logical deadline disabled, successful SSE results followed by EOF, wrong-response-ID deadline fallback, valid resumption, concurrent calls, and bounded cancellation. Controlled-future setup tests cover start/exit waits, redaction, error classification, and retention bypass.
Agent Mode
CHANGELOG-BUG-FIX: MCP tool calls fail when a response stream ends without a result and time out instead of waiting indefinitely for unresponsive servers.
CHANGELOG-OZ: Cloud runs report which environment setup command timed out instead of waiting until the sandbox expires.
Context
Co-Authored-By: Warp agent@warp.dev