You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(server): agent clones are no longer cut off after 2 minutes - #27588
An agent cloning through the t3_project_clone MCP tool is killed after 120 s, because the tool calls cloneRepository with no options and inherits the deadline meant for the synchronous clone RPC. The failure message doesn't mention the timeout: runClone builds the detail from git's last stderr lines (the reporter got remote: Total 7514 (delta 2859), … pack-reused …) or falls back to "The repository could not be cloned.", so the user and agent suspect credentials or the remote. The UI's "Add project → Git URL" clone of the same repository has no deadline and finishes.
A local smart-HTTP remote throttled so a clone takes about 145 s.
A Codex thread asked to call t3_project_clone against that remote.
The remote saw the client hang up at 119.9 s and the tool returned "The repository could not be cloned.". This happened on both runs.
The UI "Git URL" clone of the same remote finished in 145.1 s.
Change
t3_project_clone has no deadline: it now passes timeoutMs: null, as the UI's tracked clone already does. T3's providers give its MCP tools a 65-minute call budget, and interrupting the call interrupts git.
The deadline moves into runClone: git runs with no driver deadline, and runClone applies the budget with Effect.timeoutOrElse.
A clone that hits its deadline says so: the failure detail is "The clone timed out after 2m." instead of the stderr tail. Only the synchronous sourceControlCloneRepository RPC still has a deadline (120 s, unchanged).
Unchanged: interrupting git.execute closes the scope that owns the git process, the same way the driver's own timeout did. Real git failures keep the stderr-tail detail. A timeout is not treated as an SSH rejection, so it never starts the HTTPS retry.
Focused tests. Both fail on the test-only commit 787ed2b and pass at the fix commit:
handlers.test.ts, "an agent's clone is not cut off while git is still transferring". On main it fails with OrchestratorMcpFailure: The repository could not be cloned. after the test clock advances 10 minutes.
SourceControlRepositoryService.test.ts, "says a clone that ran out of time timed out, not git's last remote line". On main the detail is remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0.
handlers.test.ts, SourceControlRepositoryService.test.ts and ProjectCloneTracker.test.ts pass 45/45, and vp run check:changed passes (format, lint, knip, typecheck, tests).
Runtime transcript. This is a server-only fix with no rendered surface, so the evidence is a real run, not screenshots. Each side ran on a fresh dev server with the same agent prompt and the same throttled remote. Server trace spans:
runGitCommand 120001 ms Interrupted → GitCommandError … Git command timed out. → tool result "The repository could not be cloned."; destination empty
runGitCommand 145464 ms Success → tool result {"cwd":"…/clones/mcp-fix","remoteUrl":"http://127.0.0.1:18432/slow.git","repository":null}; checkout present
UI "Git URL" clone, same remote
runGitCommand 145494 ms Success
the fix does not change this path; not rerun
Not checked:
The timeout wording of the synchronous RPC (mobile and older clients) is covered by the unit test only, not a live run.
Not tested: whether every provider's MCP client cancels a call on abort.
Not tested: forwarded clones over T3 Connect. They still meet the edge's own idle limit, and that predates this change.
Synthetic slow remote used for the run (not committed)
These tests reproduce #27567 and fail on main:
- t3_project_clone fails a clone that is still transferring after 10
minutes, because the 120s sync-RPC deadline applies to agent clones.
- A clone that hits its deadline reports git's last remote line
instead of saying it timed out.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
t3_project_clone used the 120s deadline meant for the synchronous clone
RPC, so an agent's clone of a large or slow remote was killed mid-transfer.
The MCP clone now runs without a deadline, like the tracked UI clone; the
provider's MCP call budget and an aborted call still interrupt git.
A clone that hits its deadline now says it timed out instead of showing
git's last remote line. runClone applies the deadline itself, so the
timeout is a distinct failure and never triggers the SSH-to-HTTPS retry.
Fixes#27567
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Macroscope's review found this PR requires human approval — Agent clones now run beyond the previous two-minute deadline, while other callers retain it and receive clearer timeout errors. Human review is required for this default-behavior change to rely on MCP call limits and cancellation.
No code changes detected at fda8222. Prior analysis still applies.
You can add or adjust custom eligibility rules. Learn more.
Reviewing files that changed from the base of the PR and between a1cb3b9 and fda8222.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The repository service now applies clone timeouts outside the Git command. The MCP project clone call disables that deadline. Tests cover timeout errors and clones that remain active beyond ten minutes.
runClone disables the Git command timeout and applies the configured deadline around clone execution. A null timeout disables the deadline. The test checks that expiration reports a timeout.
The clone timeout change is mergeable after normal checks; the unverified cleanup and cancellation paths remain worth checking during rollout.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title clearly and concisely describes the main change: preventing agent repository clones from being interrupted after two minutes.
Description check
The description is complete and directly related to the change. It explains the problem, implementation, scope, focused verification, runtime results, and known limitations. It references the linked i…
Linked Issues check
Issue [#27567] requires the MCP clone path to run beyond 120 seconds and to identify clone timeouts. t3_project_clone now passes { timeoutMs: null }. runClone disables the Git driver deadline, a…
Out of Scope Changes check
The production changes are limited to the MCP clone option and the shared clone timeout/error handling required by [#27567]. The added tests verify these behaviors. No unrelated feature or unrelated c…
Full details: Description check
Explanation
The description is complete and directly related to the change. It explains the problem, implementation, scope, focused verification, runtime results, and known limitations. It references the linked issue, although it does not include explicit maintainer approval or a detailed approval exemption rationale.
Full details: Linked Issues check
Explanation
Issue [#27567] requires the MCP clone path to run beyond 120 seconds and to identify clone timeouts. t3_project_clone now passes { timeoutMs: null }. runClone disables the Git driver deadline, applies the selected deadline with Effect.timeoutOrElse, and returns The clone timed out after ... on expiry. The default remains 120 seconds for callers that omit timeoutMs. The added MCP and service tests cover long-running MCP clones and timeout error text.
Full details: Out of Scope Changes check
Explanation
The production changes are limited to the MCP clone option and the shared clone timeout/error handling required by [#27567]. The added tests verify these behaviors. No unrelated feature or unrelated code change is shown.
Finishing Touches
Generate docstrings
Commit to this branch
Create a new PR
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
Real T3 servers, fresh isolated databases, identical 145-second Git smart-HTTP transfers. Initialize MCP; call t3_project_clone, WebSocket sourceControl.cloneRepository, and the tracked projectClone.start control into three fresh destinations. Verify returned results and checked-out Git HEAD.
Base MCP fails at 120.5s; head MCP succeeds at 145.5s. The retained WebSocket deadline changes from generic failure to The clone timed out after 2m. The tracked control completes on both. All transfers use byte-identical upload-pack data, and all successful checkouts have the same Git HEAD. Opening requests remain visible in both stills. Videos render the actual runtime transcripts at original timing; they are not browser captures.
AI-assisted; verified with the tests and tools listed above.
Not shown:
No provider turn or web UI interaction was captured; the real MCP and WebSocket endpoints were driven directly. The tracked Add project control was exercised through its RPC.
Explicit user cancellation and MCP budget exhaustion were not exercised; the runs demonstrate completion beyond 120 seconds and the retained deadline's explicit timeout response.
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
bugfixFix PR opened by an issue lead; enters the PR looppr:needs-juliusNeeds Julius: route gate, unverifiable surface, or blockedsize:S10-29 changed lines (additions + deletions).vouch:trustedPR author is trusted by repo permissions or the VOUCHED list.
1 participant
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.
Problem
An agent cloning through the
t3_project_cloneMCP tool is killed after 120 s, because the tool callscloneRepositorywith no options and inherits the deadline meant for the synchronous clone RPC. The failure message doesn't mention the timeout:runClonebuilds the detail from git's last stderr lines (the reporter gotremote: Total 7514 (delta 2859), … pack-reused …) or falls back to "The repository could not be cloned.", so the user and agent suspect credentials or the remote. The UI's "Add project → Git URL" clone of the same repository has no deadline and finishes.How it was reproduced:
t3_project_cloneagainst that remote."The repository could not be cloned.". This happened on both runs.Change
t3_project_clonehas no deadline: it now passestimeoutMs: null, as the UI's tracked clone already does. T3's providers give its MCP tools a 65-minute call budget, and interrupting the call interrupts git.runClone: git runs with no driver deadline, andrunCloneapplies the budget withEffect.timeoutOrElse.sourceControlCloneRepositoryRPC still has a deadline (120 s, unchanged).git.executecloses the scope that owns the git process, the same way the driver's own timeout did. Real git failures keep the stderr-tail detail. A timeout is not treated as an SSH rejection, so it never starts the HTTPS retry.Scope and approval
Fixes #27567
Triaged via the automated issue flow.
Verification
Focused tests. Both fail on the test-only commit 787ed2b and pass at the fix commit:
handlers.test.ts, "an agent's clone is not cut off while git is still transferring". On main it fails withOrchestratorMcpFailure: The repository could not be cloned.after the test clock advances 10 minutes.SourceControlRepositoryService.test.ts, "says a clone that ran out of time timed out, not git's last remote line". On main the detail isremote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0.handlers.test.ts,SourceControlRepositoryService.test.tsandProjectCloneTracker.test.tspass 45/45, andvp run check:changedpasses (format, lint, knip, typecheck, tests).Runtime transcript. This is a server-only fix with no rendered surface, so the evidence is a real run, not screenshots. Each side ran on a fresh dev server with the same agent prompt and the same throttled remote. Server trace spans:
t3_project_clonerunGitCommand120001 ms Interrupted →GitCommandError … Git command timed out.→ tool result"The repository could not be cloned."; destination emptyrunGitCommand145464 ms Success → tool result{"cwd":"…/clones/mcp-fix","remoteUrl":"http://127.0.0.1:18432/slow.git","repository":null}; checkout presentrunGitCommand145494 ms SuccessNot checked:
Synthetic slow remote used for the run (not committed)
Serve a bare repository with about 2.6 MB of random data at 18000 B/s:
slow_git_http.py <root> 18432 18000.Claude Opus 5.5 (claude-opus-5-5) via Claude Code in T3 Code; reviewed by GPT-6.1-sol (Codex) and Claude Opus 5.5.
🤖 Generated with Claude Code