Skip to content

feat: add GitHub Copilot CLI as a supported agent - #770

Merged
nwparker merged 1 commit into
stablyai:mainfrom
drakontia:drakontia/add-github-copilot-cli-support
Apr 17, 2026
Merged

nwparker merged 1 commit into
stablyai:mainfrom
drakontia:drakontia/add-github-copilot-cli-support

Conversation

@drakontia

Copy link
Copy Markdown
Contributor

What changed

GitHub Copilot CLI (\copilot) is now listed as a supported agent in Settings → Agents.

Users who have GitHub Copilot CLI installed can now select it from the agent picker and Orca will launch it with \copilot --prompt ''\ when opening a workspace with an initial prompt.

Changes

File Change
\src/shared/types.ts\ Added 'copilot'\ to \TuiAgent\ union
\src/shared/tui-agent-config.ts\ Added \copilot\ launch config with \promptInjectionMode: 'flag-prompt'\
\src/renderer/src/lib/agent-catalog.tsx\ Added catalog entry (label, favicon, homepage URL)
\src/renderer/src/components/settings/agents-search.ts\ Added 'copilot', 'github', 'github copilot'\ search keywords
\src/renderer/src/lib/tui-agent-startup.test.ts\ Added test: copilot uses --prompt\ flag for prompt injection

No visual design changes — the entry appears in the existing agents list using the \github.com\ favicon via Google's favicon service.

Tests

Added a test in \ ui-agent-startup.test.ts\ verifying that Orca builds the correct command:

\
copilot --prompt 'Fix the bug'
\\

All 9 tests in the file pass. ✅

AI Code Review Summary

Reviewed by AI coding agent — key findings:

Cross-platform compatibility: ✅

  • The binary name \copilot\ is consistent across macOS, Linux, and Windows (installed via GitHub CLI extension to PATH)
  • No hardcoded path separators or platform-specific assumptions introduced
  • Prompt injection uses the existing \ lag-prompt\ mode (--prompt ''), which is shell-portable

Security audit: ✅

  • No new IPC surfaces, file system access, or network calls introduced
  • The \copilot\ command runs as a user-launched subprocess, consistent with all other agents
  • No secrets or credentials are passed through the prompt injection path

Platform notes

  • Tested on Windows (TypeScript typecheck ✅, lint ✅, unit tests 9/9 ✅)
  • The \copilot\ binary name is the same on macOS/Linux/Windows per GitHub's official docs
  • No platform-specific UI label or shortcut changes were made

- Add 'copilot' to the TuiAgent union type
- Register copilot in TUI_AGENT_CONFIG with flag-prompt injection mode
  (launches as: copilot --prompt '...')
- Add GitHub Copilot to AGENT_CATALOG (after Claude/Codex by priority)
- Add copilot/github search keywords to the Agents settings pane
- Add test for copilot --prompt startup plan

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nwparker

Copy link
Copy Markdown
Contributor

Thanks! I will work on merging this in later

@nwparker

Copy link
Copy Markdown
Contributor

Reviewed and tested this locally by installing the GitHub Copilot CLI (npm i -g @github/copilot, v1.0.32). Two things worth addressing:

1. Bug: --prompt kills the TUI session

Per copilot --help:

-i, --interactive <prompt>  Start interactive mode and automatically execute this prompt
-p, --prompt <text>         Execute a prompt in non-interactive mode (exits after completion)

--prompt is non-interactive and exits after completion, so Orca's hosted terminal would go dead as soon as the prompt finished. The right flag for our use case is -i/--interactive <prompt> (analogous to how Gemini uses --prompt-interactive).

Suggested fix — add a new 'flag-interactive' mode and switch Copilot to it:

// src/shared/tui-agent-config.ts
export type AgentPromptInjectionMode =
  | 'argv'
  | 'flag-prompt'
  | 'flag-prompt-interactive'
  | 'flag-interactive'
  | 'stdin-after-start'

copilot: {
  detectCmd: 'copilot',
  launchCmd: 'copilot',
  expectedProcess: 'copilot',
  // Why: `copilot --prompt <text>` runs non-interactively and exits on
  // completion, which would kill the TUI session Orca is hosting.
  // `-i/--interactive <prompt>` starts an interactive session with the
  // initial prompt pre-executed — the behavior Orca needs.
  promptInjectionMode: 'flag-interactive'
}
// src/renderer/src/lib/tui-agent-startup.ts
if (config.promptInjectionMode === 'flag-interactive') {
  return {
    launchCommand: \`\${baseCommand} -i \${quotedPrompt}\`,
    expectedProcess: config.expectedProcess,
    followupPrompt: null
  }
}

And update the test expectation from copilot --prompt 'Fix the bug' → copilot -i 'Fix the bug'.

2. Minor gap: GENERAL_AGENT_SEARCH_ENTRIES missing 'copilot'

src/renderer/src/components/settings/general-search.ts:80 lists keywords for the Default Agent setting but doesn't include 'copilot', so typing "copilot" in the top-level settings search won't surface it. (The per-agent picker already has the keyword via agents-search.ts — this is just the Default Agent entry in General.)

Applied

I've pushed both fixes as commit b3d7499 on branch drakontia/add-github-copilot-cli-support in this repo — feel free to cherry-pick:

git fetch origin drakontia/add-github-copilot-cli-support
git cherry-pick b3d7499a82

Verified: pnpm typecheck ✅, pnpm lint ✅, target test file 9/9 ✅.

@nwparker
nwparker merged commit 2931f66 into stablyai:main Apr 17, 2026
1 check passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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