feat(agents): add GitHub Copilot CLI as a code-agent option (#28)

* feat(agents): add GitHub Copilot CLI as a code-agent option

Wire `copilot -p "..." --allow-all-tools` into AGENT_DEFS so the daemon
can spawn it alongside the other CLIs. `--allow-all-tools` is required
in non-interactive mode (same tradeoff as Claude's `-p` and Codex's
`exec`). Add a matching GitHub-dark icon with the Copilot two-eye mark.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(copilot-stream): treat result.success as completed when exitCode missing

Strict `obj.exitCode === 0 ? 'completed' : 'error'` mis-flags turns
where Copilot emits a `result` event with `success: true` but no numeric
exitCode. Switch to `obj.success === true || obj.exitCode === 0`. The
asymmetry argument that applies to other defensive ideas in this file
(raw fallback, stringifyResult cap) doesn't apply here — Claude's
`result` event uses a string `stop_reason`, not exitCode, so this is a
Copilot-specific schema-variance fix rather than a one-sided hardening.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(agent-adapters): list Copilot CLI auth paths in §5.7

Adds a one-line note: detection assumes Copilot is already
authenticated, via either `copilot login` (subcommand, OAuth device
flow) or the interactive `/login` slash command inside `copilot` with
no args. Surfaces the assumption so anyone hitting an undetected /
unversioned Copilot install can trace it back.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
lakatos
2026-04-29 16:54:47 +08:00
committed by GitHub
co-authored by Claude Opus 4.7
parent 9db6793029
commit 9858f496fd
10 changed files with 231 additions and 22 deletions
+17
View File
@@ -108,6 +108,23 @@ const VISUALS: Record<string, Visual> = {
);
},
},
// GitHub Copilot — GitHub-dark with the Copilot two-eye mark.
copilot: {
bg: 'linear-gradient(135deg, #0d1117 0%, #1f2937 100%)',
fg: '#ffffff',
glyph: (s) => {
const c = s / 2;
const eyeOff = s * 0.14;
const eyeRx = s * 0.075;
const eyeRy = s * 0.12;
return (
<g fill="#ffffff">
<ellipse cx={c - eyeOff} cy={c} rx={eyeRx} ry={eyeRy} />
<ellipse cx={c + eyeOff} cy={c} rx={eyeRx} ry={eyeRy} />
</g>
);
},
},
// Qwen — Alibaba indigo with stylized Q.
qwen: {
bg: 'linear-gradient(135deg, #615ced 0%, #8b5cf6 100%)',
+1 -1
View File
@@ -64,7 +64,7 @@ export const en: Dict = {
'settings.rescan': '↻ Rescan',
'settings.rescanTitle': 'Re-scan PATH',
'settings.noAgentsDetected':
'No agents detected yet. Install one of Claude Code, Codex, Gemini CLI, OpenCode, Cursor Agent, or Qwen, then click Rescan.',
'No agents detected yet. Install one of Claude Code, Codex, Gemini CLI, OpenCode, Cursor Agent, Qwen, or GitHub Copilot CLI, then click Rescan.',
'settings.apiSection': 'Anthropic API',
'settings.apiKey': 'API key',
'settings.showKey': 'Show key',
+1 -1
View File
@@ -63,7 +63,7 @@ export const zhCN: Dict = {
'settings.rescan': '↻ 重新扫描',
'settings.rescanTitle': '重新扫描 PATH',
'settings.noAgentsDetected':
'尚未检测到任何代理。请安装 Claude Code、Codex、Gemini CLI、OpenCode、Cursor Agent 或 Qwen 中的一个,然后点击「重新扫描」。',
'尚未检测到任何代理。请安装 Claude Code、Codex、Gemini CLI、OpenCode、Cursor Agent、Qwen 或 GitHub Copilot CLI 中的一个,然后点击「重新扫描」。',
'settings.apiSection': 'Anthropic API',
'settings.apiKey': 'API Key',
'settings.showKey': '显示 Key',