Skip to content

junior-github: cloneRepository 120s timeout is hardcoded and discards the partial clone #1547

Description

@sergical

cloneRepository hardcodes a 120s abort — clone-repository.ts:143:

signal: commandSignal(options.signal, 2 * 60_000),

On abort, removePartialClone deletes the destination, so everything transferred is lost.

getsentry/static-sites is ~2.1 GB at HEAD (committed images, no LFS), so the existing --depth=1 does not help — the weight is at the tip, not in history. Measured through the sandbox egress proxy, the clone takes 112–115s. That is a coin flip against the 120s cap.

Production trace from getsentry/marky: the tool aborted at 119,957ms, the partial clone was deleted, and the agent re-cloned by hand through bash (5 min cap), which took another 112s.

cloneRepository abort 122.8s (discarded)
manual git clone retry 112.3s
whole turn 405s

Cloning was 56% of a 7-minute turn that edited one line of MDX.

Suggested, roughly in order of value:

  1. Add --filter=blob:none and let callers pass a sparse-checkout path, so blobs that are never read are never fetched.
  2. Make the timeout configurable instead of a fixed 2 * 60_000.
  3. Do not rm -rf on timeout — a partial clone can be resumed with git fetch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions