Repository navigation
fix(sync): open the sync PR through the GitHub REST API, so it also opens from a cloud session - #59
Merged
Merged
Conversation
…pens from a cloud session `gh pr create` runs on GraphQL, which the GitHub proxy of a Claude cloud session refuses with a 403. The sync now posts to repos/<owner>/<repo>/pulls with `gh api` (owner and repo from origin, or gh's own placeholders when origin is not a GitHub URL). When the create fails, it looks up an open PR for the same branch and prints the manual step as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolves the import conflict in sync.ts with #58: alignments imports from main, getGitHubBaseUrl from this branch. Co-Authored-By: Claude Opus 5.5 <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.
In a Claude cloud session
gh pr creategets a 403, because the GitHub proxy there serves only the REST API. The sync now opens its PR withgh api repos/{owner}/{repo}/pulls -X POST, which works locally too and keeps the body the sync builds. When the create fails (a PR for the branch already exists returns a 422), it looks up the open PR for the head branch and prints the existing fallback and manual step.Conflicts with #58 in the import block of
src/services/sync.ts: keep both imports.Verification
pnpm check,pnpm test(30 files, 296 tests).{owner}/{repo}placeholders return the right PR URL, and a refused create (head equals base) exits 1 with a 422. Nothing was created.Size
createPrinutils/gh.ts, the REST create plus the lookup of an existing PR; 7 comment lines. No test: one asserting thegharguments would only mirror the code.🤖 Generated with Claude Code