Skip to content

Best-in-class GitHub Copilot support for OpenClaw #2

@austenstone

Description

@austenstone

Goal

Make OpenClaw the best possible experience for GitHub Copilot users — covering authentication, model access, CLI integration, and the SDK provider pipeline.

Motivation

GitHub Copilot is one of the most widely adopted AI coding tools, but OpenClaw's integration has lagged behind other providers. We want first-class support across the board:

  • Authentication — Replace the legacy device-flow OAuth with the Copilot SDK's auth management
  • Model discovery — Dynamically discover available models via the SDK instead of hardcoded lists
  • CLI backend — Use @github/copilot-sdk as a native CLI backend (agent runtime via JSON-RPC stdio)
  • Model coverage — Ensure all current Copilot models are represented, including newer additions like claude-opus-4.6-fast

Branches

Work is organized on the cumulative copilot branch, with feature branches merged in as they're completed:

Branch Status Description
feat/copilot-cli-backend PR #17284 Copilot SDK as CLI backend (agent runtime)
feat/copilot-sdk-provider 🚧 In progress SDK-based auth + model discovery (provider pipeline)

Scope

1. CLI Backend (PR openclaw#17284) ✅

  • copilot-sdk.ts — Core SDK wrapper: availability checks, client lifecycle, model listing, agent execution
  • copilot-runner.ts — Bridge to OpenClaw's EmbeddedPiRunResult interface
  • 22 tests passing, full type-check clean

2. Provider Pipeline Migration 🚧

Inspired by PR #4469 (closed during feature freeze, not for quality reasons). Re-implementing with improvements:

  • Replace github-copilot-auth.ts device-flow OAuth with SDK's getAuthStatus()
  • Rewrite token resolution to use SDK-managed tokens
  • Async model discovery with SDK fallback to hardcoded defaults
  • Remove copilot-proxy extension dependency
  • Better singleton management (no module-level mutable state)

3. Model Updates ✅

  • Updated DEFAULT_MODEL_IDS to 17 current Copilot models
  • Added COPILOT_MODEL_ALIASES (15 aliases) for user-friendly model selection
  • Includes claude-opus-4.6-fast, o3-mini, o1, and other recent additions

Technical Details

  • SDK version: @github/copilot-sdk@0.1.22 (exact, no caret — v0.1.23+ requires Node 24)
  • Runtime: Node 22+ (per repo baseline)
  • Architecture: Two complementary integration points:
    1. CLI backend — SDK agent runtime wraps Copilot CLI via JSON-RPC stdio for interactive sessions
    2. Provider pipeline — SDK handles auth + model discovery while messages still flow through OpenClaw's pi-ai pipeline

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions