opencode/packages/core/src/github-copilot
2026-10-09 16:45:57 -05:00
..
chat fix(core): accept interleaved Copilot reasoning_opaque values (#54201) 2026-10-09 16:45:57 -05:00
responses fix(core): pass through Copilot Responses settings (#52182) 2026-09-29 17:52:53 -05:00
copilot-provider.ts refactor(core): drop unused default Copilot provider instance (#52648) 2026-10-02 03:29:28 +00:00
models.ts refactor(core): refactor model resolving logic, fix missing variant logic (#48943) 2026-09-14 18:29:34 -05:00
openai-compatible-error.ts core: expose v2 model listing API (#25821) 2026-05-13 14:43:08 +00:00
README.md docs(core): record adapter fork boundaries (#45691) 2026-08-28 15:14:46 -04:00

GitHub Copilot AI SDK Adapters

This directory contains upstream-derived AI SDK implementations adapted for GitHub Copilot. It is not a generic OpenAI-compatible provider.

Provenance

  • chat/ is derived from the Vercel AI SDK @ai-sdk/openai-compatible chat implementation.
  • responses/ is derived from the Vercel AI SDK @ai-sdk/openai Responses implementation.
  • The exact upstream revisions originally copied into this repository are unknown. Current dependency versions and the VERSION constant in copilot-provider.ts are not copy provenance.

Ownership

Keep chat/ and responses/ structurally close to their upstream modules, but preserve the intentional Copilot adaptations: the copilot options and metadata namespace, thinking_budget, reasoning text and opaque reasoning, stateless Responses requests with encrypted reasoning, rotating response item IDs, and explicit function-tool strictness taking precedence over the global fallback.

copilot-provider.ts is the local adapter assembly entrypoint used by plugin/provider/github-copilot.ts. models.ts is OpenCode-owned catalog reconciliation, not vendored SDK code. Authentication, request headers, model routing, and integration lifecycle are also owned by the provider plugin.

When updating the upstream-shaped modules, compare against both source packages and reapply the documented Copilot adaptations. Focused regression coverage is in:

  • test/github-copilot/copilot-chat-model.test.ts
  • test/github-copilot/convert-to-copilot-messages.test.ts
  • test/github-copilot/openai-responses-language-model.test.ts
  • test/github-copilot/openai-responses-prepare-tools.test.ts
  • test/github-copilot/models.test.ts
  • test/plugin/provider-github-copilot.test.ts