fix(github): search repositories by name - #8340
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
There was a problem hiding this comment.
Effect service conventions review of the changed source-control service code. One finding: a fabricated Error is used to satisfy the required cause field on a pure domain failure in GitHubCli.ts. Everything else (namespace subpath imports, inline Context.Service interface, make/layer exports, dependency acquisition via yield* in make, the new GitHubServices layer composition, and error wrapping at the provider boundary) matches the conventions.
Posted via Macroscope — Effect Service Conventions
There was a problem hiding this comment.
Reviewed the Effect service changes (GitHubCli, GitHubServices, SourceControlProvider*, SourceControlRepositoryService, RPC/contract wiring). Layer composition, dependency acquisition (yield* VcsProcess.VcsProcess, yield* GitHubGraphQlBudget.GitHubGraphQlBudget), namespace imports, and the new searchRepositories error translation all follow the conventions. One finding below.
Posted via Macroscope — Effect Service Conventions
a38333f to
927db59
Compare
There was a problem hiding this comment.
One finding on the new GraphQL budget dependency wiring in GitHubCli.layer. Also note that the previously flagged synthetic new Error(...) used only to satisfy the required cause field (now at apps/server/src/sourceControl/GitHubCli.ts:443) is still present; see the check summary rather than a duplicate inline comment.
Posted via Macroscope — Effect Service Conventions
| return []; | ||
| } | ||
|
|
||
| const slashIndex = query.indexOf("/"); |
There was a problem hiding this comment.
🟠 High sourceControl/GitHubCli.ts:518
searchRepositories cannot resolve a normal GitHub URL such as https://github.com/octocat/Hello-World; it splits it into owner === "https:" and repositoryName === "github.com/octocat/Hello-World", then sends invalid repository(owner:, name:) variables. Parse supported GitHub URLs before the slash branch, or preserve the existing URL lookup path.
🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/server/src/sourceControl/GitHubCli.ts around line 518:
`searchRepositories` cannot resolve a normal GitHub URL such as `https://github.com/octocat/Hello-World`; it splits it into `owner === "https:"` and `repositoryName === "github.com/octocat/Hello-World"`, then sends invalid `repository(owner:, name:)` variables. Parse supported GitHub URLs before the slash branch, or preserve the existing URL lookup path.
There was a problem hiding this comment.
One finding in apps/web/src/components/CommandPalette.tsx: in the new GitHub repository-search step, the Enter key handler bypasses the highlighted search result whenever the typed query looks like owner/repo.
Posted via Macroscope — UI Consistency
927db59 to
35fa9d1
Compare
There was a problem hiding this comment.
Reviewed the web UI changes in apps/web/src/components/CommandPalette.tsx (the only in-scope changed file). No shared-primitive or Tailwind/CSS ownership problems: the new result rows reuse the palette's item contract and ITEM_ICON_CLASS, and no new styling was introduced. Two interaction/affordance issues in the new GitHub search step are noted inline.
Posted via Macroscope — UI Consistency
35fa9d1 to
d7a485d
Compare
|
|
||
| if (provider === "github" && !isGitHubRepositoryShorthand(rawRepository)) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
GitHub field drops URL lookup
Medium Severity
Pasting a GitHub URL or SSH remote into the GitHub repository field no longer opens the repo. Search splits on the first /, so a host is treated as the owner, and exact lookup is skipped because the input is not owner/repo shorthand. gh repo view previously accepted these values.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit d7a485d. Configure here.
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — GitHub repository search is a substantial cross-layer feature adding debounced authenticated GraphQL requests, new RPC and authorization plumbing, and new web/mobile clone-flow state while changing existing lookup behavior. Unresolved findings cover URL regressions, duplicate navigation, loading and cache handling, and sparse GraphQL responses, warranting focused human review. Not approved because:
Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more. |
| <ListRow | ||
| key={repository.nameWithOwner} | ||
| title={repository.nameWithOwner} | ||
| subtitle={repository.url} | ||
| icon={<SourceControlIcon kind="github" size={18} color={String(iconColor)} />} | ||
| isFirst={index === 0} | ||
| onPress={() => selectRepository(repository)} | ||
| /> |
There was a problem hiding this comment.
🟠 High projects/AddProjectScreen.tsx:810
Repository rows remain tappable while lookupRepository is resolving, so pressing Enter and then tapping a result dispatches two StackActions.push("AddProjectDestination") actions and leaves two clone flows on the navigation stack. Disable the result rows while isSubmitting is true.
| <ListRow | |
| key={repository.nameWithOwner} | |
| title={repository.nameWithOwner} | |
| subtitle={repository.url} | |
| icon={<SourceControlIcon kind="github" size={18} color={String(iconColor)} />} | |
| isFirst={index === 0} | |
| onPress={() => selectRepository(repository)} | |
| /> | |
| <ListRow | |
| key={repository.nameWithOwner} | |
| title={repository.nameWithOwner} | |
| subtitle={repository.url} | |
| icon={<SourceControlIcon kind="github" size={18} color={String(iconColor)} />} | |
| isFirst={index === 0} | |
| disabled={isSubmitting} | |
| onPress={() => selectRepository(repository)} | |
| /> |
🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/mobile/src/features/projects/AddProjectScreen.tsx around lines 810-817:
Repository rows remain tappable while `lookupRepository` is resolving, so pressing Enter and then tapping a result dispatches two `StackActions.push("AddProjectDestination")` actions and leaves two clone flows on the navigation stack. Disable the result rows while `isSubmitting` is true.
| loading={isSubmitting} | ||
| /> | ||
| )} | ||
| {source === "github" && isRepositorySearchPending ? ( |
There was a problem hiding this comment.
GitHub lookup shows no loading state
Medium Severity
The GitHub spinner now follows isRepositorySearchPending instead of isSubmitting. Shorthand Enter lookup still sets isSubmitting, but that flag no longer drives any GitHub UI, so a lookup after search settles has no progress indicator for the whole request.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 91ad373. Configure here.
| const isGitHubRepositorySearchPending = | ||
| normalizedRepositorySearchQuery.length > 0 && | ||
| (normalizedRepositorySearchQuery !== debouncedRepositorySearchQuery || | ||
| repositorySearch.isPending); |
There was a problem hiding this comment.
Pending search hides cached results
Medium Severity
isGitHubRepositorySearchPending is true whenever repositorySearch.isPending is set, and displayedGroups then drops the list even if repositorySearch.data already has matches. After this refactor, confirm no longer snapshots results, so Back unsubscribes the SWR atom. Once staleTime (30s) expires—easy while browsing a clone folder—remount revalidates with waiting: true, and the palette shows Searching instead of the repos the user just came from. Mobile still renders the cached list during pending.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 2a4c55e. Configure here.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
There are 4 total unresolved issues (including 3 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6cf30bd. Configure here.
| global: Schema.Struct({ nodes: Schema.Array(RawGitHubRepositorySearchResultSchema) }), | ||
| }), | ||
| }), | ||
| ), |
There was a problem hiding this comment.
Search decode fails on sparse nodes
Medium Severity
The GraphQL search decoder requires every nodes entry to be a complete repository object. GitHub search still emits null or {} for inaccessible or non-matching union items even with type: REPOSITORY, so one sparse entry fails the whole decode as GitHubRepositorySearchDecodeError. Existing GraphQL search in this repo skips those rows instead of blanking the result set. Users then see a search failure rather than the remaining matches.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 6cf30bd. Configure here.


GitHub repository lookup treated a bare name such as
openclawas an exact repository path and failed.That forced users to know the repository owner even when GitHub could find the repository by name.
This PR adds a 100 ms debounced
github.comrepository-name search backed by one GitHub GraphQL request throughgh api graphql, while preserving exactowner/nameand URL lookup.The signed-in user's matches appear first, followed by other repositories; selecting one opens clone destination, and Back returns to search.
Change breakdown
Repository search fetches owner and global matches in one
gh api graphqlrequest, avoiding GitHub's 30-request-per-minute Search API limit while preserving 100 ms live search. This PR intentionally targetsgithub.com; GitHub Enterprise host/account routing stays in #5089 instead of being duplicated here.UI proof
Before: direct base
Typing
openclawand pressing Enter attempts an exact lookup and fails.After: PR
Typing the same query starts search without Enter and returns multiple repositories, with the signed-in user's match first.
The recorded UI pass at
d7a485d1f17bselected a result, opened clone destination, used Back to return to repository search, confirmed that Enter chooses the highlighted shorthand match, and verified the pointer-accessible fallback for a zero-result shorthand query. The current head6cf30bd0d762preserves that behavior, uses reactive query atoms instead of manual search effects and result state, and avoids Search API rate limits with one GraphQL request per query; focused web, mobile, and server typechecks and 39 focused tests pass.Checklist
Created with GPT-5.6 Sol in T3 Code.
Note
Medium Risk
New authenticated GitHub GraphQL search on the add-project path increases API surface and rate-limit exposure, but it is read-scoped and does not change clone/publish write flows.
Overview
Adds GitHub repository search by name when cloning a project, so bare names like
openclawno longer require an exactowner/repolookup.A new
sourceControl.searchRepositoriesRPC (read scope) runs throughSourceControlRepositoryServiceintoGitHubCli.searchRepositories, which usesgh api graphqlwith separate owner (user:@me) and global queries, merges/dedupes results, and boosts exactowner/repomatches. Providers without search still fall back to a single lookup.Web (
CommandPalette) and mobile (AddProjectRepositoryScreen) call the search via debouncedrepositorySearchquery atoms as the user types on the GitHub path: results are selectable and jump to clone destination;isGitHubRepositoryShorthandkeeps Enter-based exact lookup forowner/repowhen search has no highlighted hits. GitHub hints/placeholders and user docs are updated accordingly.Reviewed by Cursor Bugbot for commit 6cf30bd. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add GitHub repository search across source control and UI
searchRepositoriestoGitHubCliusing a GraphQL query that scopes to the authenticated owner and globally, deduplicates results, prioritizes exactowner/repomatches, and limits to 20.sourceControl.searchRepositoriesWebSocket RPC and updatesSourceControlProviderandSourceControlRepositoryService.owner/reposhorthand.Macroscope summarized 6cf30bd.