Repository navigation
Add GitHub Copilot extension - #21225
Conversation
commented
Aug 28, 2025
|
Congratulations on your new Raycast extension! 🚀 Due to our current reduced availability during summer, the initial review may take up to 10-15 business days. Once the PR is approved and merged, the extension will be available on our Store. |
left a comment
There was a problem hiding this comment.
Greptile Summary
This PR introduces a new GitHub Copilot extension for Raycast that integrates with GitHub's Copilot coding agent feature. The extension provides two main commands: "Create Task" allows users to delegate coding tasks to GitHub Copilot by specifying a repository, branch, and task description, while "View Tasks" displays ongoing and completed Copilot agent sessions with their associated pull requests.
The extension follows standard Raycast patterns with OAuth authentication for GitHub API access, form-based task creation with repository and branch selection dropdowns, and a list-based interface for tracking task progress. The implementation includes comprehensive service layers for interacting with GitHub's REST and GraphQL APIs, as well as direct integration with GitHub's Copilot API at api.githubcopilot.com. The extension uses custom hooks for repository search, branch management, and session data fetching, with proper caching and loading state management throughout.
The architecture includes proper error handling via showFailureToast, OAuth integration using both OAuth.PKCEClient and OAuthService, and follows Raycast's established patterns for GitHub integrations. The extension targets users with GitHub Copilot Pro, Business, or Enterprise access who want to manage their AI coding tasks directly from Raycast's interface.
PR Description Notes:
- Several checklist items remain unchecked, indicating the extension may not have completed all preparation steps
- The PR description doesn't provide details about the extension's functionality or implementation approach
Important Files Changed
File Changes
| Filename | Score | Overview |
|---|---|---|
extensions/github-copilot/CHANGELOG.md |
2/5 | Uses hardcoded date instead of required {PR_MERGE_DATE} template string |
extensions/github-copilot/src/components/PullRequestWithAgentSessionsItem.tsx |
2/5 | Unsafe array access to sessions[0] without bounds checking could cause runtime errors |
extensions/github-copilot/src/utils.tsx |
2/5 | Direct array access without null checks and potentially confusing color choices |
extensions/github-copilot/src/hooks/useRepositorySearch.ts |
3/5 | Complex search query construction logic that could generate malformed queries |
extensions/github-copilot/src/services/copilot.ts |
3/5 | Uses potentially unsafe global ID generation and direct MessagePack encoding |
extensions/github-copilot/src/view-tasks.tsx |
3/5 | Well-structured component following Raycast patterns with proper OAuth integration |
extensions/github-copilot/src/create-task.tsx |
4/5 | Comprehensive form implementation with proper validation and error handling |
extensions/github-copilot/src/hooks/useBranches.ts |
4/5 | Complex but well-implemented branch management with smart caching and ordering |
extensions/github-copilot/src/components/RepositoryDropdown.tsx |
4/5 | Well-designed dropdown with UX enhancements like recently used repositories |
extensions/github-copilot/src/services/branches.ts |
4/5 | Clean service implementation with proper error handling, though with unused pagination fields |
extensions/github-copilot/src/services/repositories.ts |
4/5 | Well-structured repository service functions with proper error handling |
extensions/github-copilot/src/lib/github-client.ts |
4/5 | Straightforward error handling utility with user-friendly messages |
extensions/github-copilot/src/lib/oauth.ts |
4/5 | OAuth implementation using dual client pattern with proper Octokit integration |
extensions/github-copilot/LICENSE.md |
4/5 | Standard MIT license with appropriate copyright holder |
extensions/github-copilot/README.md |
4/5 | Clear documentation with minor typos, includes proper screenshots |
extensions/github-copilot/src/hooks/usePullRequestsWithAgentSessions.ts |
4/5 | Well-implemented hook with mode switching for development and production |
extensions/github-copilot/src/components/index.tsx |
5/5 | Simple barrel export file with no issues |
extensions/github-copilot/tsconfig.json |
5/5 | Standard and appropriate TypeScript configuration |
extensions/github-copilot/.prettierrc |
5/5 | Correctly configured Prettier settings following Raycast standards |
Confidence score: 2/5
- This PR has several critical issues that could cause runtime errors and doesn't follow required repository standards
- Score lowered due to unsafe array access patterns, incorrect CHANGELOG format, and potential runtime crashes
- Pay special attention to
CHANGELOG.md,PullRequestWithAgentSessionsItem.tsx, andutils.tsxfiles which need fixes before merging
19 files reviewed, 13 comments
|
|
||
| ### Requirements | ||
|
|
||
| - **Access to [GitHub Copilot coding agent](https://docs.github.com/en/enterprise-cloud@latest/copilot/concepts/coding-agent/coding-agent)**, available for Copilot Pro, Pro+, Business and Enterpise users. If you're a Business or Enterprise subscriber, an administrator will have to [enable](https://docs.github.com/en/enterprise-cloud@latest/copilot/concepts/coding-agent/enable-coding-agent) the feature. |
There was a problem hiding this comment.
syntax: 'Enterpise' is misspelled, should be 'Enterprise'
| - **Access to [GitHub Copilot coding agent](https://docs.github.com/en/enterprise-cloud@latest/copilot/concepts/coding-agent/coding-agent)**, available for Copilot Pro, Pro+, Business and Enterpise users. If you're a Business or Enterprise subscriber, an administrator will have to [enable](https://docs.github.com/en/enterprise-cloud@latest/copilot/concepts/coding-agent/enable-coding-agent) the feature. | |
| - **Access to [GitHub Copilot coding agent](https://docs.github.com/en/enterprise-cloud@latest/copilot/concepts/coding-agent/coding-agent)**, available for Copilot Pro, Pro+, Business and Enterprise users. If you're a Business or Enterprise subscriber, an administrator will have to [enable](https://docs.github.com/en/enterprise-cloud@latest/copilot/concepts/coding-agent/enable-coding-agent) the feature. |
| if (event.type === "PushEvent" && event.repo) { | ||
| const repoKey = event.repo.name; | ||
| if (!repositories.has(repoKey)) { | ||
| const [owner, name] = event.repo.name.split("/"); |
There was a problem hiding this comment.
logic: Potential runtime error if event.repo.name doesn't contain a slash. Add validation: const parts = event.repo.name.split('/'); if (parts.length !== 2) continue;
| const octokit = getOctokit(); | ||
|
|
||
| try { | ||
| const [owner, repo] = nwo.split("/"); |
There was a problem hiding this comment.
logic: Same issue - nwo.split('/') could fail if format is invalid. Add validation for proper owner/repo format.
| const [owner, repo] = nwo.split("/"); | |
| const parts = nwo.split("/"); | |
| if (parts.length !== 2) { | |
| throw new Error(`Invalid repository format: ${nwo}`); | |
| } | |
| const [owner, repo] = parts; |
| export const fetchRepositoryDefaultBranch = async (nwo: string): Promise<string | null> => { | ||
| if (!nwo) return null; | ||
|
|
||
| const [owner, repo] = nwo.split("/"); |
There was a problem hiding this comment.
logic: Same validation needed here for nwo.split('/').
| const [owner, repo] = nwo.split("/"); | |
| const parts = nwo.split("/"); | |
| if (parts.length !== 2) { | |
| throw new Error(`Invalid repository format: ${nwo}`); | |
| } | |
| const [owner, repo] = parts; |
| } catch (error) { | ||
| console.error(error); | ||
| } |
There was a problem hiding this comment.
style: Error handling only logs to console. Consider using showFailureToast from @raycast/utils for better user feedback.
| refs(refPrefix: "refs/heads/", first: 100) { | ||
| nodes { | ||
| name | ||
| } | ||
| pageInfo { | ||
| hasNextPage | ||
| endCursor | ||
| } |
There was a problem hiding this comment.
style: GraphQL query fetches pagination info but doesn't use it, limiting results to 100 branches. Consider implementing pagination or removing unused fields
| import { PullRequestWithAgentSessions, AgentSessionState } from "./services/copilot"; | ||
|
|
||
| export function getIcon(pullRequestWithAgentSessions: PullRequestWithAgentSessions) { | ||
| if (pullRequestWithAgentSessions.sessions[0].state === AgentSessionState.QUEUED) { |
There was a problem hiding this comment.
logic: Accessing sessions[0] without checking if sessions array exists or has elements could cause runtime errors
| if (pullRequestWithAgentSessions.sessions[0].state === AgentSessionState.QUEUED) { | |
| if (pullRequestWithAgentSessions.sessions?.[0]?.state === AgentSessionState.QUEUED) { |
| export function useSearchRepositories(opts: { searchQuery?: string; organizations?: string[] }) { | ||
| return useCachedPromise( | ||
| async (searchQuery?: string, organizations?: string[]) => { | ||
| let searchText = `sort:pushed_at:desc sort:updated-desc`; |
There was a problem hiding this comment.
logic: Having two sort parameters (sort:pushed_at:desc sort:updated-desc) may cause issues. GitHub search typically expects a single sort parameter.
| if (searchQuery) { | ||
| const [owner, repo] = searchQuery.includes("/") ? searchQuery.split("/") : [undefined, undefined]; | ||
| if (owner) { | ||
| searchText += ` user:${owner} ${repo}`; |
There was a problem hiding this comment.
logic: If repo is undefined when splitting owner/repo, this will add undefined to the search query, potentially causing malformed queries.
| searchText += ` user:${owner} ${repo}`; | |
| searchText += ` user:${owner}${repo ? ` ${repo}` : ''}`; |
| showToast({ | ||
| style: Toast.Style.Failure, | ||
| title: "Failed to load branches", | ||
| message: error.message, | ||
| }); |
There was a problem hiding this comment.
style: Could be simplified with showFailureToast from @raycast/utils
| showToast({ | |
| style: Toast.Style.Failure, | |
| title: "Failed to load branches", | |
| message: error.message, | |
| }); | |
| showFailureToast(error, { | |
| title: "Failed to load branches", | |
| }); |
commented
Aug 28, 2025
|
Published to the Raycast Store: |
commented
Aug 28, 2025
|
🎉 🎉 🎉 We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag. |
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare located outside the metadata folder if they were not generated with our metadata tool