Skip to content

feat(code reviewer) use blobless clone for github and gitlab - #4847

Merged
St0rmz1 merged 4 commits into
mainfrom
fix/code-review-shallow-clone
Jul 29, 2026
Merged

feat(code reviewer) use blobless clone for github and gitlab#4847
St0rmz1 merged 4 commits into
mainfrom
fix/code-review-shallow-clone

Conversation

@St0rmz1

@St0rmz1 St0rmz1 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Cloud code review sessions now use a blobless partial clone (git clone --filter=blob:none) for GitHub and GitLab repositories, instead of a full clone. This keeps the initial clone bounded by the current working tree rather than full repository history, avoiding clone timeouts on large repos, while still fetching the full commit graph so incremental diffs and merge-base checks keep working (blobs are fetched lazily on demand).

Bitbucket review sessions, and any other/unrecognized git remote, keep a normal full clone.

Changes

  • Added isCodeReviewSession, isBitbucketReviewSession, and isBloblessReviewCloneEligible helpers in session-bootstrap.ts to gate the clone strategy by session platform and repo provider.
  • cloneRepository now clones with --filter=blob:none only for GitHub/GitLab code review sessions; if the server rejects the filter outright (rather than silently ignoring it), it retries once with a normal full clone so a review is never lost to the optimization.
  • sanitizeBitbucketCodeReviewRemote now reuses isBitbucketReviewSession instead of duplicating the same platform check inline.
  • Added tests covering: blobless clone for GitHub and GitLab, full clone for Bitbucket, full clone for an unrecognized git platform, and the retry-on-filter-rejection fallback.

Verification

  • [ ]

Visual Changes

N/A

Reviewer Notes

Bitbucket keeps a full clone as a deliberate tradeoff: enabling the blobless clone there would require adding outbound credential injection for Bitbucket to the sandbox's outbound proxy, which today only supports GitHub and GitLab. That's out of scope for this change.

Comment thread services/cloud-agent-next/wrapper/src/session-bootstrap.ts Outdated
@kilo-code-bot

kilo-code-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The blobless-clone allow-list is now scoped to GitHub/GitLab only, and a filter-rejection retry (with a covering test) resolves the previously flagged fallback gap.

Files Reviewed (2 files)
  • services/cloud-agent-next/wrapper/src/session-bootstrap.ts
  • services/cloud-agent-next/wrapper/src/session-bootstrap.test.ts
Previous Review Summary (commit 213d6ea)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 213d6ea)

Status: 1 Issue Found | Recommendation: Address before merge

Executive Summary

The blobless partial-clone optimization for GitHub/GitLab code review sessions removes the earlier fallback-on-failure logic without a test covering remotes that reject unsupported object filters.

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
services/cloud-agent-next/wrapper/src/session-bootstrap.ts 377 Blobless clone (--filter=blob:none) is applied to all non-Bitbucket code-review clones, including generic git sources with no recognized platform, with no fallback if the remote rejects the filter (the prior fallback-on-failure logic was removed and there's no test for the rejection case)
Files Reviewed (2 files)
  • services/cloud-agent-next/wrapper/src/session-bootstrap.ts - 1 issue
  • services/cloud-agent-next/wrapper/src/session-bootstrap.test.ts - 0 issues

Fix these issues in Kilo Cloud


Reviewed by claude-sonnet-5 · Input: 20 · Output: 3.6K · Cached: 396.4K

Review guidance: REVIEW.md from base branch main

@St0rmz1
St0rmz1 merged commit 59da39a into main Jul 29, 2026
16 checks passed
@St0rmz1
St0rmz1 deleted the fix/code-review-shallow-clone branch July 29, 2026 17:02
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