Add GitHub Copilot agent adapter#291
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new GitHub Copilot CLI–backed agent adapter to the agent-adapters package, then wires it through the CLI config/onboarding flows and the web UI runtime labeling so it can be selected, validated, and surfaced consistently.
Changes:
- Introduces a
github-copilotagent adapter with registry metadata, configuration docs, validation, output parsing, and error mapping. - Plumbs GitHub Copilot runtime configuration through CLI env/project resolution and adds onboarding checks (binary availability + secret detection in tracked config).
- Updates web UI runtime labels to display “GitHub Copilot” for multiple runtime key variants.
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/web/src/lib/agents/use-agent-monitor.ts | Adds runtime label mappings for GitHub Copilot variants. |
| packages/web/src/components/runtimes/runtimes-panel-utils.ts | Adds runtime label mappings for GitHub Copilot variants. |
| packages/cli/tests/onboard.test.ts | Adds onboarding tests for Copilot binary failure + token-in-config detection. |
| packages/cli/tests/config.test.ts | Adds env var coverage for GitHub Copilot backend/config loading. |
| packages/cli/tests/agent-adapters.test.ts | Ensures CLI adapter factory returns GitHubCopilotAdapter. |
| packages/cli/src/features/workflow/usage-cost.ts | Includes github-copilot model in fallback model resolution. |
| packages/cli/src/features/workflow/agents/agent-log-metadata.ts | Includes github-copilot model in agent log metadata. |
| packages/cli/src/features/onboard/checks-helpers.ts | Adds helper to format missing Copilot binary messages. |
| packages/cli/src/features/onboard/checks-collection.ts | Adds tracked-config secret scan (incl. Copilot token). |
| packages/cli/src/features/onboard/checks-binaries.ts | Adds Copilot CLI binary availability check when configured. |
| packages/cli/src/features/config/types/runtime.types.ts | Adds githubCopilot runtime config + backend enum value. |
| packages/cli/src/features/config/project-agent-config.ts | Resolves/merges GitHub Copilot runtime config across scopes. |
| packages/cli/src/features/config/env-normalizers.ts | Allows AGENT_BACKEND=github-copilot. |
| packages/cli/src/features/config/env-agent-config.ts | Loads GitHub Copilot settings from env vars into runtime config. |
| packages/agent-adapters/tests/opencode.test.ts | Updates registry expectations to include github-copilot. |
| packages/agent-adapters/tests/github-copilot.test.ts | Adds focused tests for GitHub Copilot adapter behavior. |
| packages/agent-adapters/tests/cursor.test.ts | Updates registry expectations to include github-copilot. |
| packages/agent-adapters/tests/adapters.test.ts | Updates factory/registry expectations and normalization coverage. |
| packages/agent-adapters/src/validation.ts | Extends schemas to support github-copilot runtime config. |
| packages/agent-adapters/src/types/agent-adapter.types.ts | Adds github-copilot backend + runtime config typing. |
| packages/agent-adapters/src/registry.ts | Registers GitHub Copilot backend definition + factory. |
| packages/agent-adapters/src/github-copilot/output.ts | Adds stdout-to-finalMessage extraction helper. |
| packages/agent-adapters/src/github-copilot/errors.ts | Adds Copilot-specific error mapping to AgentAdapterError. |
| packages/agent-adapters/src/github-copilot/constants.ts | Defines backend id, label/description, and model metadata. |
| packages/agent-adapters/src/github-copilot/configuration-doc.ts | Provides configuration documentation for env/config fields. |
| packages/agent-adapters/src/github-copilot/adapter.ts | Implements the GitHub Copilot CLI adapter. |
| packages/agent-adapters/package.json | Exposes ./github-copilot export entry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+9
to
+18
| export function mapGitHubCopilotError( | ||
| command: string, | ||
| args: string[], | ||
| result: { code: number; stdout: string; stderr: string }, | ||
| context: GitHubCopilotErrorContext = {}, | ||
| ): Error { | ||
| const output = result.stderr || result.stdout; | ||
| const lower = output.toLowerCase(); | ||
| const base = `${command} ${args.join(" ")} failed with exit code ${result.code}`; | ||
|
|
Comment on lines
+1
to
+3
| export function extractFinalMessage(output: string): string { | ||
| return output.trim() || output; | ||
| } |
Comment on lines
+81
to
+85
| checks.push({ | ||
| name: "Tracked config secrets", | ||
| status: "pass", | ||
| message: "no configured secrets found in tracked config files", | ||
| }); |
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.
Summary
Validation