Repository navigation
Fix clone abort cleanup ownership - #2981
Merged
Jinwoo-H merged 3 commits intoMay 28, 2026
Merged
Conversation
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
Jinwoo-H
deleted the
Jinwoo-H/bug-clone-abort-can-recursively-delete-an-unowne
branch
May 28, 2026 08:17
4 of 5 tasks
9 tasks done
9 tasks done
nwparker
added a commit
to AmoabaKelvin/orca
that referenced
this pull request
Oct 6, 2026
A clone of a repository with no commits leaves HEAD unborn, which `rev-parse --verify HEAD` rejects exactly like the `refs/heads/.invalid` HEAD a killed clone leaves. The saved-project check read both as "not a finished clone", so cloning a brand-new empty repo a second time — a double-clicked Clone, a re-run `orca project setup-clone`, or stablyai#2981's queued retry — fell through to git and died on "destination path already exists and is not an empty directory". Ask the two questions apart when `--verify` fails: `symbolic-ref HEAD` resolves an unborn branch but not a killed clone's HEAD. It is already on the relay's read-only allowlist. Probes also short-circuit once the clone is cancelled, so no probe after Cancel spawns git.
nwparker
added a commit
that referenced
this pull request
Oct 6, 2026
* fix(repos): reuse a saved project only when git shows it's this clone A saved project outlived its folder, so Clone reported success without running git. Fixes #23563 * fix(repos): let a repeat clone of an empty repository reuse its project A clone of a repository with no commits leaves HEAD unborn, which `rev-parse --verify HEAD` rejects exactly like the `refs/heads/.invalid` HEAD a killed clone leaves. The saved-project check read both as "not a finished clone", so cloning a brand-new empty repo a second time — a double-clicked Clone, a re-run `orca project setup-clone`, or #2981's queued retry — fell through to git and died on "destination path already exists and is not an empty directory". Ask the two questions apart when `--verify` fails: `symbolic-ref HEAD` resolves an unborn branch but not a killed clone's HEAD. It is already on the relay's read-only allowlist. Probes also short-circuit once the clone is cancelled, so no probe after Cancel spawns git. * fix(repos): prepare the worktree root after re-cloning a project's folder The branch that re-clones into a saved project's folder returned the project without the two steps every sibling branch runs: the worktree root that vanished with the deleted folder is never re-created, and the authorized-roots cache keeps the answers it cached while the folder was missing. Creating a worktree or reading files in the recovered project then fails on a root that is not there. * fix(ssh): register the root after re-cloning a saved project's folder `addRemoteRepoFromPath` returns an existing project before it notifies `session.registerRoot`, which was unreachable before the saved-project check could re-clone into a project's own path. The relay therefore never learned the folder came back, so sessions under it stayed unregistered. Notify from the clone, mirroring the folder-to-git upgrade beside it. * fix(repos): say which reason refused a clone over a saved project One message covered both "that project holds a different repository" and "Orca has no record of what that project held", which need different things from the user. Name the recorded URL when there is one, and say plainly that there is no record when there isn't — the second is the case a project predating remote-identity enrichment lands in, and the user cannot act on it without being told why. Also drops the `upstream` remote-name check into a named binding: `origin` is the only stored remote that names a project's own repo, because `Repo.upstream` and the GitHub avatar derived from it both name the repo a fork came from. * fix(repos): bound saved-clone probes and prove empty clone completion * fix(repos): keep clone validation host-scoped and locale independent --------- Co-authored-by: Neil <[email protected]> Co-authored-by: Neil <[email protected]>
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
Co-authored-by: Orca <[email protected]>
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.
Summary
Design / Review Evidence
design-docs/clone-abort-ownership.md(ignored, not included in product diff).auto-design-review-fixcompleted 2 iterations; direction confirmed; no unresolved P0/P1 findings. The design changed from direct abort-handler deletion to atomic target ownership plus close/failure-path cleanup.cloneRepo, normal git failures, spawn errors/sync throws, same-target clone serialization, and WSL-aware dedupe keys after review findings.posix.basename, host-absolute destination validation, and focused tests.Review Loop
birthtimeMsso fast remove/recreate cycles cannot be mistaken for the operation-owned directory even if an inode pair is reused.Brennan Test Changes
land.Electron Validation
127.0.0.1:9335and renderer on127.0.0.1:5174.window.api.app.getIdentity()confirmed branchJinwoo-H/bug-clone-abort-can-recursively-delete-an-unowneand the expected worktree root.window.api.repos.clone({ url: 'file:///tmp/.../source/.', destination })rejected withInvalid repository name derived from URL; the pre-existing destination sentinel remained intact and no clone directory was created.file:///tmp/.../sourcesucceeded, createddestination/source/README.md, and added the repo to app state./tmp/orca-pr-2981-electron.png; the branch-specific Dock tile was also visible via macOS Accessibility.Tests
pnpm vitest run --config config/vitest.config.ts src/main/git/repo-clone-path.test.ts src/main/ipc/repos-remote.test.ts src/main/runtime/orca-runtime.test.tspnpm run typecheckpnpm run lintgit diff --check --cachedgit diff --checkverifycheck: passed on run26562823598.Note: local commands emitted the existing engine warning because this shell is Node v26 while the repo wants Node 24. A local full
pnpm testrun failed one unrelatedlocal-pty-shell-readyzsh environment assertion in this Orca-hosted shell; the PR's GitHubverifyfull test run passed on Node 24.Made with Orca 🐋