Skip to content

feat(providers): migrate GitHub Copilot provider to @github/copilot-sdk, enable thinking + skills#1602

Closed
azoom-hoang-van-viet wants to merge 2 commits into
coleam00:devfrom
azoom-hoang-van-viet:archon/thread-8b078b8d
Closed

feat(providers): migrate GitHub Copilot provider to @github/copilot-sdk, enable thinking + skills#1602
azoom-hoang-van-viet wants to merge 2 commits into
coleam00:devfrom
azoom-hoang-van-viet:archon/thread-8b078b8d

Conversation

@azoom-hoang-van-viet
Copy link
Copy Markdown

Summary

  • Problem: The Copilot community provider depended on @github/copilot v1.0.25 whose import path (@github/copilot/copilot-sdk) was incompatible with the new SDK layout, and the provider lacked support for extended thinking (reasoning) and skills.
  • Why it matters: The new @github/copilot-sdk package (v0.3.0) exposes skillDirectories, streaming, and assistant.reasoning_delta / assistant.reasoning events — unlocking capabilities that Archon already handles for Claude (thinking chunks, skills).
  • What changed: Swapped the npm dep, updated all import paths in provider files and tests, enabled streaming: true, mapped nodeConfig.skills → sessionConfig.skillDirectories, and mapped reasoning events to { type: 'thinking' } chunks.
  • What did not change: Provider architecture (AsyncQueue event bridge, binary-resolver, session resume, MCP wiring), unsupported capabilities (hooks, agents, structuredOutput, fallbackModel, sandbox) remain false.

UX Journey

Before

User sends message with skills → Copilot provider ignores skills field
Extended thinking events from Copilot → dropped (no mapping)

After

User sends message with skills → sessionConfig.skillDirectories = nodeConfig.skills
Copilot emits assistant.reasoning_delta → [thinking chunk] → streamed to platform
Copilot emits assistant.reasoning      → [thinking chunk] → streamed to platform

Architecture Diagram

Before

provider.ts ──import──▶ @github/copilot/copilot-sdk
event-bridge.ts ──────▶ @github/copilot/copilot-sdk

After

provider.ts [~] ──import──▶ @github/copilot-sdk [~]
event-bridge.ts [~] ───────▶ @github/copilot-sdk [~]

Connection inventory:

From To Status Notes
provider.ts @github/copilot-sdk modified import path updated, streaming+skillDirectories added
event-bridge.ts @github/copilot-sdk modified import path updated, reasoning event cases added
capabilities.ts modified thinkingControl + skills → true

Label Snapshot

  • Risk: risk: low
  • Size: size: S
  • Scope: providers
  • Module: providers:copilot

Change Metadata

  • Change type: feature
  • Primary scope: providers

Linked Issue

  • Closes #

Validation Evidence (required)

bun run validate
# ✅ check:bundled, check:bundled-skill, type-check, lint, format:check, tests — all pass
  • All 3 Copilot test files pass (event-bridge.test.ts, provider.test.ts, provider-lazy-load.test.ts)
  • New tests: reasoning_delta → thinking, reasoning → thinking, skillDirectories wiring (3 cases), streaming flag

Security Impact (required)

  • New permissions/capabilities? No
  • New external network calls? No (same Copilot CLI subprocess)
  • Secrets/tokens handling changed? No
  • File system access scope changed? No

Compatibility / Migration

  • Backward compatible? Yes — COPILOT_CAPABILITIES additions are additive; existing sessions unaffected
  • Config/env changes? No
  • Database migration needed? No

Human Verification (required)

  • Verified: type-check, lint, format, full test suite pass via bun run validate
  • Edge cases checked: empty skills array → skillDirectories absent, no skills → absent, streaming always true
  • Not verified: live Copilot API call (requires GitHub Copilot subscription + CLI binary)

Side Effects / Blast Radius (required)

  • Affected subsystems: @archon/providers package only
  • Potential unintended effects: streaming: true may cause the SDK to emit both delta and complete assistant.message events — existing default: branch in mapCopilotEvent returns [] for unknown events, so extra events are silently dropped
  • Guardrails: TypeScript compilation catches any SessionConfig field mismatches at build time

Rollback Plan (required)

  • Fast rollback: revert the dep swap in package.json and run bun install
  • No feature flags
  • Observable failure symptoms: Copilot session creation throws on unknown skillDirectories / streaming fields (would surface as provider error in logs)

Risks and Mitigations

  • Risk: @github/copilot-sdk SessionConfig field names differ from what was assumed
    • Mitigation: TypeScript strict mode + type-check CI will catch mismatches at compile time; confirmed no type errors in current run

azoom-hoang-van-viet and others added 2 commits May 7, 2026 08:11
…pilot-sdk

Migrates from @github/copilot ^1.0.25 to @github/copilot-sdk ^0.3.0 and
wires up the new SDK capabilities: skills via skillDirectories, thinking
via assistant.reasoning_delta / assistant.reasoning events, streaming:true
for delta delivery, and lazy-load safety for compiled binary mode.

- Replace dep @github/copilot → @github/copilot-sdk in providers package.json
- Add CopilotSdkProvider with full IAgentProvider interface implementation
- AsyncQueue + bridgeCopilotSession bridge session events to MessageChunks
- capabilities.ts: thinkingControl:true, skills:true
- provider.ts: streaming:true, skillDirectories from nodeConfig.skills
- event-bridge.ts: map assistant.reasoning_delta and assistant.reasoning → thinking chunks
- binary-resolver.ts: lazy-load safe CLI path resolution for compiled binaries
- Add CopilotProviderDefaults to types.ts (model, cliPath, githubToken)
- Wire registerCopilotProvider() into registry.ts registerCommunityProviders()
- Full test coverage: 62 tests across event-bridge, provider, provider-lazy-load
Restore copilot community provider exports from @archon/providers index
(consistent with Pi provider pattern; was removed as unintentional side-effect
of the @github/copilot-sdk migration commit).

Restore defaultAssistant config.yaml fallback in getOrCreateConversation;
the loadGlobalConfig removal dropped support for users who set
defaultAssistant directly in ~/.archon/config.yaml rather than via the
DEFAULT_AI_ASSISTANT env var.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1aa4b9d9-8f8c-49ee-be6d-86fbd1a5c860

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

@azoom-hoang-van-viet azoom-hoang-van-viet closed this by deleting the head repository May 7, 2026
@Wirasm
Copy link
Copy Markdown
Collaborator

Wirasm commented May 14, 2026

Hi — quick heads-up since you put work into a GitHub Copilot community provider for Archon. The Copilot work is continuing at #1505 (@danielscholl) — that PR landed the shared/skills.ts + shared/structured-output.ts extraction and is currently in maintainer-review with 6 HIGH findings to address before merge.

If you'd like to contribute reviews, suggestions, or test work, you're very welcome there. No pressure — just wanted you to know your earlier work isn't being forgotten and there's still a path to help land Copilot if you're interested.

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