Skip to content

feat(gateway): promote GitHub Copilot to a stable backend#14

Open
anxkhn wants to merge 1 commit into
longyangxi:masterfrom
anxkhn:feat/copilot-stable
Open

feat(gateway): promote GitHub Copilot to a stable backend#14
anxkhn wants to merge 1 commit into
longyangxi:masterfrom
anxkhn:feat/copilot-stable

Conversation

@anxkhn

@anxkhn anxkhn commented Jun 29, 2026

Copy link
Copy Markdown

What

Promotes the GitHub Copilot adapter in apps/gateway/src/backends.ts from experimental to stable, bringing it to parity with the Claude/Codex stable adapters. Previously Copilot just spawned a bare -p prompt: no structured output, no session resume, and it could hang on a permission prompt.

Why

The CLI is mature enough to drive autonomously. Wiring up the documented one-shot flags makes it usable for multi-agent runs like the existing stable backends.

Changes

  • apps/gateway/src/backends.ts: copilot is now stable, supportsResume: true, supportsStructuredOutput: true, guardType: "flag". buildArgs emits --output-format json, auto-approves with --allow-all-tools (--allow-all on full access) and --no-ask-user, resumes via --session-id, and passes --model through.
  • packages/orchestrator/src/agent-session.ts: parse Copilot JSONL: capture sessionId from the final result line for resume, and surface the final assistant.message content (deltas skipped to avoid dupes).

Verification (real copilot v1.0.65, authed)

  • pnpm install; gateway bundles via tsup; orchestrator/gateway typecheck show only 2 pre-existing errors (prompt-templates.ts:406, telegram-channel.ts:391), unchanged by this PR.
  • Smoke: ran a JSON one-shot, captured sessionId/exitCode:0, then resumed with the same --session-id and Copilot correctly recalled prior context.
  • Memory suite: 53 pass / 1 fail, pre-existing and unrelated.

Licensing

This repo has no LICENSE file. Contribution terms are unclear; please confirm how you want external contributions handled before merging.

The copilot adapter was marked experimental and only spawned a bare
`-p` prompt, so it had no structured output, no resume, and could hang
on permission prompts. Upgrade it to mirror the stable Claude adapter:

- Emit JSONL via --output-format json (final result line carries
  sessionId and exitCode) and parse Copilot's assistant.message and
  result events in AgentSession.
- Capture sessionId from the result line and resume with --session-id
  so multi-agent runs keep per-agent context.
- Auto-approve non-interactive runs (--allow-all-tools, --allow-all on
  full access) and never block with --no-ask-user.
- Pass --model through.
- Set stability stable, supportsResume, supportsStructuredOutput,
  guardType flag.
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.

1 participant