Skip to content

feat: added github copilot agent plugin#286

Merged
subsy merged 9 commits intosubsy:mainfrom
cachemoney:main
Feb 14, 2026
Merged

feat: added github copilot agent plugin#286
subsy merged 9 commits intosubsy:mainfrom
cachemoney:main

Conversation

@cachemoney
Copy link
Copy Markdown
Contributor

@cachemoney cachemoney commented Feb 5, 2026

Summary

Adds support for github copilot cli agent as a new agent plugin

Summary by CodeRabbit

  • New Features

    • Added a GitHub Copilot CLI agent: configurable model, auto‑approve toggle, timeout, stdin prompt support, dynamic CLI arg handling, detection/version probing, preflight guidance; factory exported and registered.
  • Documentation

    • Added comprehensive GitHub Copilot agent docs and site navigation entry.
  • Tests

    • Added tests covering initialization, detection/version probing, setup questions, arg construction, stdin handling and validation.
  • Chores

    • Registered agent ID mapping for installer.

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 5, 2026

@cachemoney is attempting to deploy a commit to the plgeek Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 5, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds a new GithubCopilotAgentPlugin implementation with tests, docs, registry export and a skill-installer mapping; includes detection (copilot --version), arg/stdin construction, sandbox requirements, setup questions and preflight guidance.

Changes

Cohort / File(s) Summary
Plugin Implementation
src/plugins/agents/builtin/github-copilot.ts
New GithubCopilotAgentPlugin and factory export: metadata, config (model, autoApprove, timeout), initialize, getSandboxRequirements, detect() (uses runVersion), getSetupQuestions, buildArgs, getStdinInput, validation hooks and getPreflightSuggestion.
Tests
src/plugins/agents/builtin/github-copilot.test.ts
New comprehensive test suite covering metadata, initialization, setup questions, validation, sandbox requirements, buildArgs behaviour (--yolo, --model, autoApprove) and stdin handling; mocks child_process.spawn and exposes protected methods via test subclass.
Registry & Installer
src/plugins/agents/builtin/index.ts, src/setup/skill-installer.ts
Register and export the Github Copilot agent factory and plugin type in built-in registry; add github-copilotgithub-copilot entry to AGENT_ID_MAP.
Docs & Navigation
website/content/docs/plugins/agents/github-copilot.mdx, website/lib/navigation.ts
Add documentation page for the GitHub Copilot agent (prereqs, usage, config, troubleshooting) and add navigation entry under Agents.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant Agent as Agent Plugin
participant Runner as Process Runner
participant Copilot as Copilot CLI
participant Sandbox as Sandbox/Env
Agent->>Runner: runVersion("copilot --version") (5s timeout)
Runner->>Copilot: exec "copilot --version"
Copilot-->>Runner: stdout/stderr (version or error)
Runner-->>Agent: {success, version, error}
Agent->>Agent: buildArgs(prompt, model?, autoApprove?)
Agent->>Sandbox: declare auth paths & network requirements
Agent->>Runner: exec Copilot with args + stdin (getStdinInput)
Runner->>Copilot: launch with args + stdin
Copilot-->>Runner: execution result
Runner-->>Agent: execution result

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarises the main change: adding a new GitHub Copilot agent plugin, which is reflected in all modified files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Fix all issues with AI agents
In `@src/plugins/agents/builtin/github-copilot.test.ts`:
- Around line 20-52: Rename the failing test description to reflect the actual
assertion: update the test with description "has structured output format
'jsonl'" (or similar) so it matches the expectation
plugin.meta.structuredOutputFormat === 'jsonl'; locate the test under the
describe('meta') block that references plugin.meta and change its string from
"has no structured output format" to the new matching text.

In `@src/plugins/agents/builtin/github-copilot.ts`:
- Around line 23-43: The meta object for the GitHub Copilot plugin incorrectly
sets structuredOutputFormat: 'jsonl' while supportsSubagentTracing is false;
update the AgentPluginMeta in the GitHub Copilot plugin (the readonly meta
block) to remove or set structuredOutputFormat to undefined (or delete that
property) so it matches supportsSubagentTracing: false and the plugin reality,
and then update the corresponding test expectations in github-copilot.test.ts to
assert no structured output format (or change supportsSubagentTracing to true
only if you implement JSONL parsing for the plugin).
- Around line 183-203: In buildArgs (method buildArgs in the GitHub Copilot
agent) replace the unsupported '--yes' flag pushed when this.autoApprove is true
with a supported auto-approve flag such as '--allow-all' (or
'--allow-all-tools'/'--yolo' if you prefer); update the args.push call that
currently uses '--yes' so it pushes '--allow-all' when this.autoApprove is
truthy, leaving the rest of the logic (including the '--model' handling)
unchanged.

In `@website/content/docs/plugins/agents/github-copilot.mdx`:
- Around line 16-26: The docs incorrectly suggest installing the Copilot CLI via
the GitHub CLI extension ("gh extension install github/gh-copilot"), which only
provides a "gh copilot" subcommand rather than a standalone "copilot" executable
required by the plugin; update the installation block (the lines showing the
GitHub CLI and Copilot install commands) to instruct users to install a
standalone Copilot CLI (examples: Homebrew `brew install copilot-cli`, npm `npm
install -g `@github/copilot``, winget `GitHub.Copilot`, or the official install
script URL) and remove or clearly separate the `gh extension install
github/gh-copilot` line so the README refers to the actual `copilot` binary on
PATH.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Fix all issues with AI agents
In `@src/plugins/agents/builtin/github-copilot.test.ts`:
- Around line 159-169: The tests expect the CLI flag to be '--yes' but the
implementation in buildArgs (github-copilot.ts) currently pushes '--yolo' when
autoApprove is true; update buildArgs to push '--yes' instead (and ensure
TestableGithubCopilotPlugin.testBuildArgs and plugin.initialize behavior remain
consistent with the autoApprove true/false paths) so the tests asserting args
include/omit '--yes' will pass.

In `@src/plugins/agents/builtin/github-copilot.ts`:
- Around line 61-71: Update the getSandboxRequirements() implementation to
include the GitHub CLI config directory in authPaths: add '~/.config/gh'
alongside '~/.config/github-copilot' and '~/.gitconfig' so the sandbox covers
gh's hosts.yml fallback; modify the authPaths array returned by
getSandboxRequirements() in the github-copilot agent to include this path.

In `@website/content/docs/plugins/agents/github-copilot.mdx`:
- Around line 139-148: Update the troubleshooting block that runs the `which
copilot` check so it no longer instructs users to install the GitHub CLI
extension `gh extension install github/gh-copilot`; instead list the correct
ways to install the standalone Copilot CLI expected by the plugin (for example
`brew install copilot-cli`, `npm install -g `@github/copilot``, or the official
curl installer `curl -fsSL https://gh.io/copilot-install | bash`) so the `which
copilot` check will find the actual `copilot` binary.
- Around line 14-24: Wrap the installation lines under the "## Prerequisites"
section in a fenced shell code block so they render as a single bash snippet:
insert a starting ```bash fence immediately before the first comment line "#
Install GitHub CLI" and a closing ``` fence immediately after the final command
"curl -fsSL https://gh.io/copilot-install | bash". Update the block that
contains the Copilot/GitHub CLI install commands (the lines under the "##
Prerequisites" header) to be enclosed by these fences so comments starting with
# render correctly as shell comments.
🧹 Nitpick comments (4)
src/plugins/agents/builtin/github-copilot.ts (2)

45-59: initialize does not reject invalid timeout values (e.g. negative numbers or zero).

The guard config.timeout > 0 correctly filters non-positive values, so this is fine. However, the model guard does not trim whitespace — a config value of " " (spaces only) would pass the length > 0 check and be stored, which could produce an invalid --model " " argument. Consider trimming:

Suggested fix
-        if (typeof config.model === 'string' && config.model.length > 0) {
-            this.model = config.model;
+        if (typeof config.model === 'string' && config.model.trim().length > 0) {
+            this.model = config.model.trim();
         }

232-240: Preflight suggestion references copilot --version but also suggests installing GitHub CLI and running gh auth login.

The mix of standalone copilot CLI and gh CLI references could confuse users. If the plugin targets the standalone copilot binary (as meta.defaultCommand indicates), step 2 ("Install GitHub CLI") is only a prerequisite for authentication, not for getting the copilot binary itself. Consider clarifying this distinction, e.g. "Install Copilot CLI: https://docs.github.com/copilot/..." as a separate step.

src/plugins/agents/builtin/github-copilot.test.ts (1)

141-149: The unknown cast is unnecessary — buildArgs and getStdinInput are protected, so a subclass can call them directly.

Proposed simplification
     class TestableGithubCopilotPlugin extends GithubCopilotAgentPlugin {
         testBuildArgs(prompt: string): string[] {
-            return (this as unknown as { buildArgs: (p: string) => string[] }).buildArgs(prompt);
+            return this.buildArgs(prompt);
         }
 
         testGetStdinInput(prompt: string): string | undefined {
-            return (this as unknown as { getStdinInput: (p: string) => string | undefined }).getStdinInput(prompt);
+            return this.getStdinInput(prompt);
         }
     }
website/content/docs/plugins/agents/github-copilot.mdx (1)

115-123: Minor grammar nit flagged by static analysis.

Line 122: "Handle exit" reads slightly awkwardly. Consider "Handle exits" or "Handle exit code" for clarity.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@website/content/docs/plugins/agents/github-copilot.mdx`:
- Around line 16-25: Remove the inline backticks around the npm package name in
the bash fenced block so the line reads "npm install -g `@github/copilot`"
(replace the token `` `@github/copilot` ``), and adjust the GitHub CLI note so
it is clearly optional for authentication only—either move the "Install GitHub
CLI" comment to a troubleshooting/authentication section or add a parenthetical
"(Optional) Install GitHub CLI for authentication: gh auth login" directly under
the copilot install lines; ensure the bash fence remains intact and the npm
package appears as plain text.
- Around line 164-171: Replace the incorrect `gh auth login` instruction (which
applies to the GitHub CLI `gh copilot` extension) with the correct
authentication steps for the standalone `copilot` binary: document the
interactive method (run `copilot` and use the `/login` command at the prompt)
and the non-interactive method (set `GH_TOKEN` or `GITHUB_TOKEN` to a
fine-grained PAT that includes the "Copilot Requests" permission); update the
block containing `gh auth login` to list these two methods and remove the
misleading `gh` command.
🧹 Nitpick comments (2)
website/content/docs/plugins/agents/github-copilot.mdx (2)

95-103: Options reference looks good overall — minor point on timeout defaults.

The table states the default timeout is 0 (no timeout), while the full config example on line 88 uses timeout = 300000. This is fine as an override example, but it could be worth adding a brief inline comment in the full config example (e.g., # default: 0 (no timeout)) to avoid confusion for readers scanning the examples without reading the table.


119-125: Minor grammar nit: "Handle exit" reads better as "Handle exit codes" or with a preposition.

Static analysis flagged a possible missing word. Consider:

-4. **Handle exit**: Reports success, failure, or timeout
+4. **Handle exit codes**: Reports success, failure, or timeout

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/plugins/agents/builtin/github-copilot.ts`:
- Around line 73-102: The detect() error message incorrectly points to the
GitHub CLI repo; update the error returned when findResult.found is false in
detect() to reference the Copilot CLI install instructions and make it clear
we're looking for the standalone 'copilot' binary (adjust the URL and message
text in the return object that currently references https://github.com/cli/cli);
locate this in the detect() method (symbols: detect, commandPath,
meta.defaultCommand, findCommandPath) and replace the install link/message with
the correct Copilot CLI installation URL and wording.
🧹 Nitpick comments (1)
src/plugins/agents/builtin/github-copilot.test.ts (1)

142-150: Consider simplifying the protected method access pattern.

The double cast through unknown (this as unknown as { buildArgs: ... }) is noisy. Since you already control the subclass, you can call the protected methods directly — TypeScript allows subclasses to access protected members.

♻️ Simplified test subclass
     class TestableGithubCopilotPlugin extends GithubCopilotAgentPlugin {
         testBuildArgs(prompt: string): string[] {
-            return (this as unknown as { buildArgs: (p: string) => string[] }).buildArgs(prompt);
+            return this.buildArgs(prompt);
         }
 
         testGetStdinInput(prompt: string): string | undefined {
-            return (this as unknown as { getStdinInput: (p: string) => string | undefined }).getStdinInput(prompt);
+            return this.getStdinInput(prompt);
         }
     }

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@src/plugins/agents/builtin/github-copilot.ts`:
- Around line 161-181: Update the help text for the 'model' setup question in
the override getSetupQuestions() method of the GitHub Copilot agent: remove the
OpenAI-specific examples ("gpt-4, gpt-3.5-turbo") and replace them with a
generic instruction telling users to check available models via the Copilot CLI
(e.g., run the `/model` command) and that available models may vary by account;
locate the entry with id: 'model' in getSetupQuestions() and update its help
string accordingly.
- Around line 22-43: The skills discovery path in GithubCopilotAgentPlugin.meta
is wrong: update the skillsPaths object (inside the meta property of the
GithubCopilotAgentPlugin class) to use the repo path '.github/skills' instead of
'.copilot/skills' so repository-level skills are discovered; leave personal
('~/.copilot/skills') and the other meta flags unchanged.
🧹 Nitpick comments (1)
src/plugins/agents/builtin/github-copilot.ts (1)

228-240: Preflight suggestion mixes standalone copilot and gh CLI guidance — consider clarifying.

detect() looks for the standalone copilot binary, but the preflight on line 236 directs users to install the gh CLI. Both are valid approaches, but the mix could confuse users who don't know the relationship between the two. A brief note distinguishing the standalone CLI from the gh extension path would help.

Suggested clarification
     protected override getPreflightSuggestion(): string {
         return (
             'Common fixes for GitHub Copilot CLI:\n' +
             '  1. Test copilot directly: copilot --version\n' +
-            '  2. Install GitHub CLI: https://github.com/cli/cli\n' +
-            '  3. Authenticate with GitHub: gh auth login\n' +
+            '  2. Install standalone: npm install -g `@github/copilot-cli`\n' +
+            '     Or via GitHub CLI extension: gh extension install github/gh-copilot\n' +
+            '  3. Authenticate: gh auth login\n' +
             '  4. Verify GitHub Copilot subscription is active'
         );
     }

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ralph-tui Error Error Feb 14, 2026 0:30am

Request Review

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 12, 2026

Codecov Report

❌ Patch coverage is 81.31313% with 37 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.76%. Comparing base (339178e) to head (32fa7b6).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
src/plugins/agents/builtin/github-copilot.ts 80.92% 37 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #286      +/-   ##
==========================================
+ Coverage   44.52%   44.76%   +0.23%     
==========================================
  Files          96       97       +1     
  Lines       30345    30543     +198     
==========================================
+ Hits        13512    13673     +161     
- Misses      16833    16870      +37     
Files with missing lines Coverage Δ
src/plugins/agents/builtin/index.ts 92.85% <100.00%> (+0.85%) ⬆️
src/setup/skill-installer.ts 74.03% <100.00%> (+0.14%) ⬆️
src/plugins/agents/builtin/github-copilot.ts 80.92% <80.92%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@subsy
Copy link
Copy Markdown
Owner

subsy commented Feb 14, 2026

@cachemoney thanks for this - mad e aminor docs fix but otherwise good to go - will be in the next release

@subsy subsy merged commit 265d83b into subsy:main Feb 14, 2026
7 of 8 checks passed
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