From 0e2e8124cc1f07c0423e1970e3232f49417304c1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 14 Apr 2026 03:52:07 +0000 Subject: [PATCH 1/4] Initial plan From caf33deb8236ee9ef3fd09aacd939a4c99840d15 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 14 Apr 2026 03:53:09 +0000 Subject: [PATCH 2/4] feat: allow arbitrary reasoning_effort values for forward compatibility Agent-Logs-Url: https://github.com/lyzgeorge/copilot-api/sessions/10f76b26-728d-41d8-8fb3-432974af4318 Co-authored-by: lyzgeorge <8285196+lyzgeorge@users.noreply.github.com> --- src/routes/reasoning-context.ts | 2 +- src/services/copilot/create-chat-completions.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/reasoning-context.ts b/src/routes/reasoning-context.ts index 03f851c31..7bef76e73 100644 --- a/src/routes/reasoning-context.ts +++ b/src/routes/reasoning-context.ts @@ -3,7 +3,7 @@ import type { ChatCompletionsPayload } from "~/services/copilot/create-chat-comp import type { Model } from "~/services/copilot/get-models" export interface ReasoningContext { - reasoningEffort?: "low" | "medium" | "high" + reasoningEffort?: "low" | "medium" | "high" | string thinkingBudget?: number } diff --git a/src/services/copilot/create-chat-completions.ts b/src/services/copilot/create-chat-completions.ts index 15f3e0a21..8da439c24 100644 --- a/src/services/copilot/create-chat-completions.ts +++ b/src/services/copilot/create-chat-completions.ts @@ -143,7 +143,7 @@ export interface ChatCompletionsPayload { logit_bias?: Record | null logprobs?: boolean | null response_format?: { type: "json_object" } | null - reasoning_effort?: "low" | "medium" | "high" | null + reasoning_effort?: "low" | "medium" | "high" | (string & {}) | null seed?: number | null stream_options?: { include_usage?: boolean } | null thinking_budget?: number | null From dcfb3690c60ac4c09832f8dec3ea1f60afafd947 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 14 Apr 2026 03:54:01 +0000 Subject: [PATCH 3/4] fix: use (string & {}) in ReasoningContext for consistent IDE autocomplete Agent-Logs-Url: https://github.com/lyzgeorge/copilot-api/sessions/10f76b26-728d-41d8-8fb3-432974af4318 Co-authored-by: lyzgeorge <8285196+lyzgeorge@users.noreply.github.com> --- src/routes/reasoning-context.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/reasoning-context.ts b/src/routes/reasoning-context.ts index 7bef76e73..ee542e273 100644 --- a/src/routes/reasoning-context.ts +++ b/src/routes/reasoning-context.ts @@ -3,7 +3,7 @@ import type { ChatCompletionsPayload } from "~/services/copilot/create-chat-comp import type { Model } from "~/services/copilot/get-models" export interface ReasoningContext { - reasoningEffort?: "low" | "medium" | "high" | string + reasoningEffort?: "low" | "medium" | "high" | (string & {}) thinkingBudget?: number } From 4f0d9cafafd0b7306972beb801e3b8599c5c9c64 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 14 Apr 2026 03:57:16 +0000 Subject: [PATCH 4/4] docs: add fork improvements hook at top of README Agent-Logs-Url: https://github.com/lyzgeorge/copilot-api/sessions/83622886-a808-4ba6-820c-75ed8300f3ab Co-authored-by: lyzgeorge <8285196+lyzgeorge@users.noreply.github.com> --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 92f0df518..b0b3a55aa 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,18 @@ # Copilot API Proxy +> **This is a fork of [ericc-ch/copilot-api](https://github.com/ericc-ch/copilot-api) with full reasoning / extended-thinking support added.** +> +> **What this fork adds:** +> +> - **Capability-aware reasoning routing** — reads each model's `capabilities.supports` at startup and routes `reasoning_effort` / `thinking_budget` only to models that actually support them; unsupported models silently strip the fields. +> - **Anthropic ↔ OpenAI thinking translation** — `thinking: { type: "enabled", budget_tokens: N }` on the `/v1/messages` surface is automatically translated into `reasoning_effort: "high"` + `thinking_budget` for the upstream call, and vice versa. +> - **Streaming thinking traces** — Claude thinking streams emit proper `content_block_start` / `thinking_delta` / `signature_delta` / `content_block_stop` events so Claude Code and similar clients see native thinking UIs. +> - **Forward-compatible `reasoning_effort`** — type accepts any string (not just `"low" | "medium" | "high"`), so new model-specific values like `"xhigh"` or `"minimal"` are transparently passed through without code changes. +> +> Everything else — auth, rate limiting, usage dashboard, CLI flags — is identical to the upstream project. + +--- + **One Copilot subscription. Every frontier reasoning model. OpenAI and Anthropic shaped.** Point Claude Code, Cline, or your own scripts at a single localhost URL and unlock Claude Sonnet 4.6, GPT-5, Gemini, and friends — with real reasoning traces and thinking budgets routed to whichever knob the upstream model actually supports. > [!WARNING]