Skip to content

feat(aikit): add support for provider github-copilot - #34

Merged
sanchitrk merged 2 commits into
mainfrom
codework-aikit-github-copilot-v1
Sep 22, 2026
Merged

sanchitrk merged 2 commits into
mainfrom
codework-aikit-github-copilot-v1

Conversation

@sanchitrk

Copy link
Copy Markdown
Contributor

Summary

  • Adds a dedicated github-copilot provider that composes the OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages adapters behind one ProviderV4, with per-model routing via api.method
  • Adds GitHub OAuth device-flow login (auth --github-copilot) with GitHub Enterprise support, /copilot_internal/user entitlement checks, plan-specific endpoints.api discovery, and /models catalog fetch with optional --enable-models policy enablement
  • Resolves credentials from COPILOT_GITHUB_TOKEN, GITHUB_TOKEN/GH_TOKEN, existing editor hosts.json/apps.json, or ~/.codework/aikit/auth.json; OAuth tokens are used directly as Bearer credentials
  • Sends Copilot identity headers plus request metadata (x-initiator, Copilot-Vision-Request, X-Interaction-Id, adaptive anthropic-beta filtering) through a shared fetch wrapper
  • Extends modelgen to emit Copilot catalog entries with endpoint methods, thinking-level maps, adaptive-thinking compat flags, cost tiers, and Responses store:false + encrypted-reasoning provider options
  • Wires the protocol through registry, options, thinking, stream, and transform — including github-copilot-namespaced reasoning signature replay

Test plan

  • vp check — format, lint, types clean
  • vp run typecheck — clean
  • vp test — 480 unit tests pass (headers, auth resolution, device flow, storage, routing, thinking options, transforms, CLI)
  • E2E verified against a live Copilot account: text streaming and tool calls round-trip (gpt-4.1 on Copilot Free)

- Add composite provider routing Copilot's chat, responses, and anthropic messages endpoints per model
- Implement GitHub OAuth device-flow login with editor credential reuse and plan-aware endpoint discovery
- Wire github-copilot protocol through the model catalog, registry, options, thinking, and transform paths
- Generate Copilot catalog entries with endpoint methods, thinking-level maps, and compatibility flags
- Add aikit auth --github-copilot CLI with status, logout, enterprise domain, and enable-models support
- Cover headers, request metadata, OAuth storage, device polling, routing, and streaming with tests and e2e
@sanchitrk
sanchitrk merged commit e24ee5f into main Sep 22, 2026
@sanchitrk
sanchitrk deleted the codework-aikit-github-copilot-v1 branch September 23, 2026 17:25
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