Skip to content

Fix git clone timeout controls#573

Merged
whoiskatrin merged 3 commits intomainfrom
fix/git-clone-timeout
Apr 10, 2026
Merged

Fix git clone timeout controls#573
whoiskatrin merged 3 commits intomainfrom
fix/git-clone-timeout

Conversation

@whoiskatrin
Copy link
Copy Markdown
Collaborator

@whoiskatrin whoiskatrin commented Apr 10, 2026

Summary

  • raise the default gitCheckout() clone timeout from 2 minutes to 10 minutes so larger or slower repositories stop failing on the current hard limit
  • add an explicit cloneTimeoutMs override that is threaded through the SDK, transport layer, request types, container handler, and git service
  • validate timeout input early and preserve sub-second precision when formatting the underlying timeout command so the API matches what the subprocess actually does

Why

Users on 0.8.7 and 0.8.8 can hit a hardcoded 120 second timeout in the clone path behind gitCheckout(), even with depth: 1. This change fixes the immediate product issue and makes the timeout user-controlled without broadening the API beyond the existing checkout primitive.

Testing

  • npm test -w @cloudflare/sandbox -- git-client.test.ts sandbox.test.ts
  • bun test tests/handlers/git-handler.test.ts tests/services/git-service.test.ts tests/managers/git-manager.test.ts
  • npm run typecheck:e2e
  • git push pre-push hook: npm run typecheck

Reviewer Notes

  • cloneTimeoutMs is intentionally scoped to the git clone subprocess. It does not try to represent total wall-clock time including cold start or container readiness retries, which keeps the API semantics explicit.
  • The transport changes are there to support per-request request timeouts, especially in WebSocket mode, so clone requests can outlive the old 120 second client timeout without changing global request behavior.

Open with Devin

Raise the default clone timeout to 10 minutes and let callers
override the git clone subprocess timeout per checkout.

Thread the override through the SDK and container layers so
validation, transport behavior, and timeout reporting stay aligned.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 10, 2026

🦋 Changeset detected

Latest commit: e8752d2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cloudflare/sandbox Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 10, 2026

Open in StackBlitz

npm i https://pkg.pr.new/cloudflare/sandbox-sdk/@cloudflare/sandbox@573

commit: e8752d2

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 10, 2026

🐳 Docker Images Published

Variant Image
Default cloudflare/sandbox:0.0.0-pr-573-e8752d2
Python cloudflare/sandbox:0.0.0-pr-573-e8752d2-python
OpenCode cloudflare/sandbox:0.0.0-pr-573-e8752d2-opencode
Musl cloudflare/sandbox:0.0.0-pr-573-e8752d2-musl
Desktop cloudflare/sandbox:0.0.0-pr-573-e8752d2-desktop

Usage:

FROM cloudflare/sandbox:0.0.0-pr-573-e8752d2

Version: 0.0.0-pr-573-e8752d2


📦 Standalone Binary

For arbitrary Dockerfiles:

COPY --from=cloudflare/sandbox:0.0.0-pr-573-e8752d2 /container-server/sandbox /sandbox
ENTRYPOINT ["/sandbox"]

Download via GitHub CLI:

gh run download 24241616049 -n sandbox-binary

Extract from Docker:

docker run --rm cloudflare/sandbox:0.0.0-pr-573-e8752d2 cat /container-server/sandbox > sandbox && chmod +x sandbox

Comment thread packages/sandbox-container/src/services/git-service.ts Outdated
Comment thread packages/sandbox-container/src/services/git-service.ts Outdated
Copy link
Copy Markdown
Contributor

@aron-cf aron-cf left a comment

Choose a reason for hiding this comment

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

Looks good 👍

whoiskatrin and others added 2 commits April 10, 2026 12:53
Co-authored-by: Aron <263346377+aron-cf@users.noreply.github.com>
Co-authored-by: Aron <263346377+aron-cf@users.noreply.github.com>
@whoiskatrin whoiskatrin merged commit cc14fc7 into main Apr 10, 2026
27 of 29 checks passed
@whoiskatrin whoiskatrin deleted the fix/git-clone-timeout branch April 10, 2026 12:23
@sandy-bonk sandy-bonk Bot mentioned this pull request Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants