fix: recover scout searches after repo transfers - #20
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: efa981f7ed
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| async function resolveSearchRepositoryQualifiers({ query, installationId, signal }) { | ||
| const repositories = [...new Set( | ||
| [...String(query || "").matchAll(/(?:^|\s)repo:([A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+)(?=\s|$)/g)] |
There was a problem hiding this comment.
Match repository qualifiers case-insensitively
When a query uses a valid mixed-case qualifier such as Repo:old-owner/old-repo, the initial search can still return 422, but this case-sensitive matcher finds no repositories, so resolution.query remains unchanged and the transfer recovery immediately rethrows the error. Since normalizeOpenIssueSearchQuery preserves qualifier spelling and already treats qualifiers case-insensitively, make both the extraction and replacement regexes case-insensitive so these queries receive the canonical-name retry.
Useful? React with 👍 / 👎.
Problem
A bounded serious-scout run failed closed with GitHub 422 when a
repo:qualifier used the former name of a transferred repository. The error was correct but opaque, and the operator had to discover and repair the repository identity manually.Changes
repo:qualifiers through GitHub repository identityfull_namechangedNo GitHub write path, candidate scoring, overlap policy, or rate-limit behavior changes.
Validation
invariantlabs-ai/mcp-scantosnyk/agent-scannpm run ci:gates— 281/281 tests, 77/77 benchmark cases, 29/29 hostile cases, maintainer demo PASSgit diff --checkAI assistance
Codex assisted with reproduction, the focused implementation, regression tests, and verification. I reviewed the exact diff and command outputs before submission.