fix: use origin remote when fork is not yet configured#197
Open
danchild wants to merge 2 commits into
Open
Conversation
prepare_workspace() defaulted to remote="fork" unconditionally, but on first implementation (before PR creation) the clone only has "origin". This caused git fetch fork to fail, falling back to recreation which also failed due to missing fork_owner/fork_repo state — triggering the retry loop. Now determines the effective remote based on whether fork state exists, and raises directly on origin sync failures instead of attempting the impossible fork recreation path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Three new tests for the no-fork-state paths: - uses "origin" remote when fork_owner/fork_repo are not set - raises directly on origin sync failure instead of attempting fork recreation - raises ValueError when workspace is missing and fork is not configured Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Fixes #181
Summary
prepare_workspace()defaulted toremote="fork"unconditionally, but on first implementation (before PR creation) the clone only has an "origin" remotegit fetch forkfailed, falling back to_recreate_workspace_from_fork()which also failed due to missingfork_owner/fork_repoin stateretry_countincrement (see fix: increment retry_count when prepare_workspace fails #196), this caused an unbounded retry loop (404 iterations in ~20s on AISOS-2273)Test plan
test_workspace_setup.py— 7/7,test_implementation.py— 12/12)🤖 Generated with Claude Code