Skip to content

Fix verification agent: check for existing PR before creating a new one#16789

Merged
matthewp merged 3 commits into
mainfrom
fix-verification-dedup
May 19, 2026
Merged

Fix verification agent: check for existing PR before creating a new one#16789
matthewp merged 3 commits into
mainfrom
fix-verification-dedup

Conversation

@matthewp

Copy link
Copy Markdown
Contributor

Changes

  • Before creating a PR, the fix-verification agent now checks if one already exists for the flue/fix-{issueNumber} branch. If a PR exists, it posts a comment linking to it instead of failing with a 422 from the GitHub API.
  • Adds a findPullRequest helper to .flue/lib/github.ts that queries open PRs by head branch.

Testing

  • No automated tests; this is CI workflow glue code. Verified the logic matches the GitHub Pulls API behavior.

Docs

  • No docs needed — internal CI change only.

@changeset-bot

changeset-bot Bot commented May 19, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 5bf301d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@matthewp matthewp marked this pull request as ready for review May 19, 2026 13:12
Comment thread .flue/lib/github.ts Outdated
Comment on lines +176 to +179
const res = await fetch(
`https://api.github.com/repos/${REPO}/pulls?head=withastro:${encodeURIComponent(head)}&state=open`,
{ headers: headers(GITHUB_TOKEN_BASE) },
);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handle the runtime error with a try catch

@matthewp matthewp merged commit 70b7348 into main May 19, 2026
22 checks passed
@matthewp matthewp deleted the fix-verification-dedup branch May 19, 2026 14:30
ematipico pushed a commit that referenced this pull request May 20, 2026
…ne (#16789)

* Check for existing PR before creating in fix-verification agent

* Verify pulls response is an array before indexing

* Wrap findPullRequest in try/catch with better error message
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.

2 participants