Repository navigation
Keep start from following redirected Git destinations - #1604
Conversation
Architecture-Review: unchanged; Start still fetches the configured base and creates the task checkout. It now binds both preparation writes to their intended Git destinations. Co-Authored-By: Codex <noreply@openai.com>
Architecture-Review: unchanged; start still fetches the configured base before creating the checkout. Co-Authored-By: Codex <noreply@openai.com>
Architecture-Review: unchanged; the new shared Git directory arguments retain the same destination guard. Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
loopzero primary review by claude on 24e942737303c91f2afa31e3bc9efbe5e01a4fe7, 53.0s: approve (0 critical, 0 important, 3 suggestion)
Settings per native call (launch configuration and CLI claims, not backend attestation):
- Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)
Native Claude output is retained in the restricted local review receipt.
| base, _, ref = advertised.partition("\t") | ||
| if ref != remote_ref: | ||
| raise GitError(("git", *lookup), f"origin did not report a unique {remote_ref}") | ||
| _git(repo_root, "fetch", "--quiet", "--no-tags", "--no-write-fetch-head", "--refmap=", "origin", base) |
There was a problem hiding this comment.
suggestion: Fetching the ls-remote SHA can fail if origin moves between the two calls
Start now looks up the tip with ls-remote, then makes a second connection to fetch that SHA. If refs/heads/<base> moves between the two calls, the old SHA is no longer an advertised tip. A protocol-v0 server without uploadpack.allowReachableSHA1InWant (or allowAnySHA1InWant) then rejects the want ('not our ref'), and start fails with a raw fetch error. Protocol-v2 servers such as GitHub accept it, so this is an uncommon transient failure, not a correctness bug. Smallest fix: if the SHA fetch fails, redo the lookup and fetch once more, or say in the error that the base moved and start can be retried.
| advertised = _git(repo_root, *lookup) | ||
| base, _, ref = advertised.partition("\t") | ||
| if ref != remote_ref: | ||
| raise GitError(("git", *lookup), f"origin did not report a unique {remote_ref}") |
There was a problem hiding this comment.
suggestion: Missing-base message says 'unique' when origin has no such branch
When the base branch does not exist on origin, ls-remote succeeds with empty output, and the user sees origin did not report a unique refs/heads/<base>. The common case is that the branch is missing, not that it is ambiguous, so 'unique' is misleading. Smallest fix: when advertised is empty, report something like origin has no branch <base>; check [repo] base_branch, and keep the 'unique' wording only when several lines match.
| repo = checkout | ||
| invoke = worktree._git | ||
| invoke, local_head = worktree._git, worktree.head(repo) | ||
| def interleave(path, *args, **kwargs): |
There was a problem hiding this comment.
suggestion: The interleaving fetch in the test is now dead weight
interleave fetches another branch after start's fetch. Its job was to overwrite FETCH_HEAD and prove start did not read it. Start now passes --no-write-fetch-head and uses the SHA from ls-remote, so this hook no longer exercises a real race. Either remove it, or make it push a new commit to origin's main between ls-remote and fetch. The second option would show that start branches from the commit it looked up and would cover the race in the first finding.
|
@Mergifyio queue |
✅ Merged into
|
|
No description provided. |
Keep start from following redirected Git destinations
Context and goal
Closes #1539
Closes #1540
Acceptance
Base
main @ 9c42f8a
Base: 9c42f8a
Notes
This draft supersedes #1591 and includes the missing-base diagnostic fix.
Validation
Recorded for
24e942737303uv run --group dev ruff check src tests: exit 0uv run --group dev tach check: exit 0uv run --python 3.14 python scripts/check_architecture_docs.py: exit 0scripts/size_budget.sh: exit 0uv run --group dev pytest -q: exit 0Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Review