Skip to content

fix: ensure fork remote in setup_workspace before implementation push#201

Closed
danchild wants to merge 2 commits into
forge-sdlc:mainfrom
danchild:fix/workspace-setup-ensure-fork-remote
Closed

fix: ensure fork remote in setup_workspace before implementation push#201
danchild wants to merge 2 commits into
forge-sdlc:mainfrom
danchild:fix/workspace-setup-ensure-fork-remote

Conversation

@danchild

Copy link
Copy Markdown
Contributor

Summary

Closes #200

  • setup_workspace now ensures the fork exists (via get_or_create_fork) and adds the "fork" git remote during workspace setup, even when fork_owner/fork_repo aren't already in workflow state
  • Persists fork_owner/fork_repo in returned state so downstream nodes have them available
  • Previously the fork was only created at PR creation time, but implement_bug_fix pushes before PR creation — causing push_to_fork() to fall back to origin (upstream) and fail with 403

Test plan

  • All existing test_workspace_setup.py tests pass with the new GitHubClient mock
  • Verify on a live workflow that the fork remote is configured before implementation push
  • Verify that re-entry (retry) still works correctly with fork state in checkpoint

🤖 Generated with Claude Code

…forge-sdlc#200)

setup_workspace now calls get_or_create_fork during workspace setup when
fork_owner/fork_repo aren't already in state, so the "fork" git remote
exists before implement_bug_fix tries to push. Previously the fork was
only ensured at PR creation time, causing push_to_fork to fall back to
origin and fail with 403.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@danchild
danchild force-pushed the fix/workspace-setup-ensure-fork-remote branch from ae3eb51 to a7ee831 Compare July 24, 2026 15:18
…n test

Wrap the GitHub client usage in try/finally so the HTTP client is always
closed, even if an unexpected exception propagates. Add a dedicated test
that verifies get_or_create_fork is called and fork_owner/fork_repo are
persisted in state when not already present.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@eshulman2

Copy link
Copy Markdown
Collaborator

Superseded by #207

@eshulman2 eshulman2 closed this Jul 26, 2026
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.

setup_workspace does not ensure fork remote before implementation push

2 participants