Copilot SDK: GitHub Multi-Provider Backend

The Copilot SDK backend wraps GitHub’s Copilot SDK (github-copilot-sdk), providing multi-provider agent capabilities with JSON-RPC event-driven execution.

Overview

  • Status: Beta
  • Provider support: Copilot, OpenAI, Azure, Anthropic, LiteLLM
  • Built-in tools: shell, file_ops, git, web_search
  • MCP support: No
  • Architecture: Python SDK wrapper with CopilotClient singleton

Prerequisites

Install the Copilot CLI:

Terminal window
pip install github-copilot-sdk

Ensure the copilot CLI is on your PATH. For the default Copilot provider, you need an active GitHub Copilot subscription.

Configuration

Terminal window
export POCKETPAW_AGENT_BACKEND="copilot_sdk"

Backend-Specific Settings

SettingEnv VariableDefaultDescription
copilot_sdk_providerPOCKETPAW_COPILOT_SDK_PROVIDER"copilot"Provider: copilot, openai, azure, anthropic, litellm
copilot_sdk_modelPOCKETPAW_COPILOT_SDK_MODEL"" (auto)Model to use
copilot_sdk_max_turnsPOCKETPAW_COPILOT_SDK_MAX_TURNS0 (unlimited)Max turns per query

Provider Configuration

Terminal window
export POCKETPAW_COPILOT_SDK_PROVIDER="copilot"
# Uses your GitHub Copilot subscription, no separate API key needed
Terminal window
export POCKETPAW_COPILOT_SDK_PROVIDER="openai"
export POCKETPAW_OPENAI_API_KEY="sk-..."
Terminal window
export POCKETPAW_COPILOT_SDK_PROVIDER="azure"
# Configure Azure OpenAI credentials
Terminal window
export POCKETPAW_COPILOT_SDK_PROVIDER="anthropic"
export POCKETPAW_ANTHROPIC_API_KEY="sk-ant-..."
Terminal window
export POCKETPAW_COPILOT_SDK_PROVIDER="litellm"
export POCKETPAW_LITELLM_API_BASE="http://localhost:4000"
export POCKETPAW_LITELLM_MODEL="gpt-4o"

Built-in Tools

Copilot ToolPolicy Mapping
shellshell
file_opswrite_file
gitshell
web_searchbrowser

How It Works

  1. PocketPaw creates a CopilotClient singleton for the session
  2. Messages are sent via the JSON-RPC event-driven interface
  3. The Copilot CLI handles tool execution and multi-turn reasoning
  4. History is injected for multi-turn context
  5. Responses stream back as AgentEvent objects

When to Use

Choose Copilot SDK when:

  • You have a GitHub Copilot subscription and want to use it as your agent backbone
  • You want multi-provider flexibility (switch between Copilot, OpenAI, Azure, and Anthropic)
  • You want git-aware coding assistance integrated into PocketPaw