copilot-custom-endpoint 3.7.1 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,20 +12,22 @@
12
12
  | **GLM Models for Copilot** (KiwiGaze) | [`yijiazhen-qi.glm-for-github-copilot-chat`](https://marketplace.visualstudio.com/items?itemName=yijiazhen-qi.glm-for-github-copilot-chat) | ✅ | ✅ | Quota dashboard, dual API |
13
13
  | **GLM Chat Provider** (zelosleone) | _(pending)_ | ❌ | ✅ | 14 models, per-model thinking tiers |
14
14
 
15
+ > **Live-validated 2026-11-13** (VS Code 1.146, both harnesses): `glm-5.3-flash` completed plain chat plus a multi-step tool loop with HTTP 200 on both harnesses, and `glm-5.3` (text) did the same on the Copilot harness. `reasoning_effort: "low"` and `max_completion_tokens: 131072` reached Z.ai with **no `thinking` object**, which is correct — the server forces deep thinking and `clear_thinking` handles history. No `reasoning_content` was replayed on the tool turn. Copilot sends 128 tools and Local sends 57; vision and long-context compaction were not tested. See [harness research § 9](../../research/vscode-1.146-copilot-harness.md#9-phase-3-live-provider-validation-2026-11-13).
16
+
15
17
  ## At a Glance
16
18
 
17
- | Field | Value |
18
- | ---------------------- | ------------------------------------------------------------------------------------------------------------------ |
19
- | Mode | **Direct** (no proxy) |
20
- | Billing | **Pay-as-You-Go** (PaaS API) — Coding Plan subscription exists but is **not usable** from VS Code custom endpoints |
21
- | Vision | ✅ Yes (`glm-5.3-flash`) |
22
- | Tool calling | ✅ Yes (native multimodal tool use on `glm-5.3-flash`) |
23
- | Context | 1M (`glm-5.3-flash` / `glm-5.3` / `glm-5.2` Solid Lossless Context) |
24
- | Max output | 131072 |
25
- | Required `requestBody` | `thinking: { type: "enabled" }` + `reasoning_effort: "max"` (recommended) |
26
- | Endpoint (intl) | `https://api.z.ai/api/paas/v4/chat/completions` |
27
- | Endpoint (China) | `https://open.bigmodel.cn/api/paas/v4/chat/completions` |
28
- | Auth | `Authorization: Bearer $ZAI_API_KEY` |
19
+ | Field | Value |
20
+ | ---------------- | ------------------------------------------------------------------------------------------------------------------ |
21
+ | Mode | **Direct** (no proxy) |
22
+ | Billing | **Pay-as-You-Go** (PaaS API) — Coding Plan subscription exists but is **not usable** from VS Code custom endpoints |
23
+ | Vision | ✅ Yes (`glm-5.3-flash`) |
24
+ | Tool calling | ✅ Yes (native multimodal tool use on `glm-5.3-flash`) |
25
+ | Context | 1M (`glm-5.3-flash` / `glm-5.3` / `glm-5.2` Solid Lossless Context) |
26
+ | Max output | 131072 |
27
+ | Supported config | `modelOptions` for sampling + `supportsReasoningEffort` + `reasoningEffortFormat: "chat-completions"` |
28
+ | Endpoint (intl) | `https://api.z.ai/api/paas/v4/chat/completions` |
29
+ | Endpoint (China) | `https://open.bigmodel.cn/api/paas/v4/chat/completions` |
30
+ | Auth | `Authorization: Bearer $ZAI_API_KEY` |
29
31
 
30
32
  ### Models
31
33
 
@@ -61,24 +63,22 @@
61
63
  {
62
64
  "name": "GLM",
63
65
  "vendor": "customendpoint",
64
- "apiKey": "",
66
+ "apiKey": "${input:glmApiKey}",
65
67
  "apiType": "chat-completions",
66
68
  "models": [
67
69
  {
68
70
  "id": "glm-5.3-flash",
69
- "name": "GLM 5.3 Flash (multimodal)",
71
+ "name": "GLM 5.3 Flash",
70
72
  "url": "https://api.z.ai/api/paas/v4/chat/completions",
71
73
  "toolCalling": true,
72
74
  "vision": true,
73
75
  "streaming": true,
74
- "maxInputTokens": 1048576,
76
+ "maxInputTokens": 917504,
75
77
  "maxOutputTokens": 131072,
76
- "requestBody": {
77
- "thinking": { "type": "enabled" },
78
- "reasoning_effort": "max",
79
- "temperature": 1.0,
80
- "top_p": 0.95
81
- }
78
+ "modelOptions": { "temperature": 1, "top_p": 0.95 },
79
+ "supportsReasoningEffort": ["low", "high", "max"],
80
+ "reasoningEffortFormat": "chat-completions",
81
+ "thinking": true
82
82
  },
83
83
  {
84
84
  "id": "glm-5.3",
@@ -87,20 +87,20 @@
87
87
  "toolCalling": true,
88
88
  "vision": false,
89
89
  "streaming": true,
90
- "maxInputTokens": 1048576,
90
+ "maxInputTokens": 917504,
91
91
  "maxOutputTokens": 131072,
92
- "requestBody": {
93
- "thinking": { "type": "enabled" },
94
- "reasoning_effort": "max",
95
- "temperature": 1.0,
96
- "top_p": 0.95
97
- }
92
+ "modelOptions": { "temperature": 1, "top_p": 0.95 },
93
+ "supportsReasoningEffort": ["low", "high", "max"],
94
+ "reasoningEffortFormat": "chat-completions",
95
+ "thinking": true
98
96
  }
99
97
  ]
100
98
  }
101
99
  ```
102
100
 
103
- > **Leave `apiKey` as `""`** — set it through the Language Models UI so VS Code stores it in the OS keychain (it will replace the empty string with a `${input:chat.lm.secret.<id>}` reference).
101
+ > **Context budget:** `917504 + 131072 = 1048576`, the GLM 5.x window (input and output combined). VS Code uses that sum as the model's total context, so only raise `maxInputTokens` by lowering `maxOutputTokens`.
102
+
103
+ > **`apiKey` must be non-empty** — the file's schema enforces `minLength: 1`, so `"apiKey": ""` shows _String is shorter than the minimum length of 1_. Use the `${input:...}` placeholder shown above and set it through the Language Models UI, which stores it in the OS keychain and rewrites the value to a `${input:chat.lm.secret.<id>}` reference.
104
104
  > If you signed up on `bigmodel.cn` (China), swap the `url` values in the block above to the regional endpoint `https://open.bigmodel.cn/api/paas/v4/chat/completions`.
105
105
 
106
106
  ### 2. API Key
@@ -119,27 +119,27 @@
119
119
 
120
120
  ## Notes
121
121
 
122
- - **Sampling:** recommended `temperature: 1`, `top_p: 0.95`. Z.ai's `temperature` is **hard-capped at `1.0` server-side** — sending `> 1.0` will reject with a 400. Don't set `do_sample: false` from `requestBody` (it would make `temperature`/`top_p` be ignored).
122
+ - **Sampling:** recommended `temperature: 1`, `top_p: 0.95` in `modelOptions`. Z.ai's `temperature` is **hard-capped at `1.0` server-side** — sending `> 1.0` will reject with a 400. On VS Code 1.146 `requestBody` is dropped, so `do_sample` and other provider keys cannot be sent from this file.
123
123
  - **`tool_choice` only supports `auto`** — don't override it (VS Code's default is `auto`).
124
- - **`clear_thinking` defaults to `true` server-side**, which strips historical `reasoning_content` from prior turns before sending to the model. This is what makes multi-turn tool loops stable. **Do not** set `clear_thinking: false` from `requestBody` — VS Code can't forward `reasoning_content` and the request will fail. (Note: Z.ai's GLM-5.3-Flash docs recommend `thinking.clear_thinking: false` for clients that **do** preserve `reasoning_content` — e.g. Claude Code / agent SDKs — not for the VS Code custom-endpoint path.)
125
- - **GLM 5.3 and GLM 5.3 Flash are always-thinking** — `thinking.type` only supports `enabled`; disabling reasoning is **not supported**. `reasoning_effort` accepts `low`, `high`, or `max` (default `max`; `max` recommended for coding). If you previously sent `thinking.type: "disabled"` for other GLM models, switch it to `enabled` with `reasoning_effort: "low"` when moving to `glm-5.3` / `glm-5.3-flash`.
124
+ - **`clear_thinking` defaults to `true` server-side**, which strips historical `reasoning_content` from prior turns before sending to the model. This is what makes multi-turn tool loops stable. It cannot be changed from `chatLanguageModels.json` on 1.146 (`requestBody` is dropped) — leave it at the server default. Note: Z.ai's GLM-5.3-Flash docs recommend `thinking.clear_thinking: false` for clients that **do** preserve `reasoning_content` — e.g. Claude Code / agent SDKs — not for the VS Code custom-endpoint path.
125
+ - **GLM 5.3 and GLM 5.3 Flash are always-thinking** — `thinking.type` only supports `enabled`; disabling reasoning is **not supported**, and the provider thinks by default, so the dropped `requestBody.thinking` key changes nothing. `reasoning_effort` accepts `low`, `high`, or `max` (default `max`; `max` recommended for coding) and is exposed through the model picker via `supportsReasoningEffort`.
126
126
  - **Vision** is supported on `glm-5.3-flash` (native multimodal — the first in the GLM-5 series; text + image input, text output). `glm-5.3`, `glm-5.2` and `glm-5.1` are text-only. For turnkey VS Code video understanding, see [**Video Context MCP**](https://www.videocontextmcp.com/). **Validated 2026-08-28 on `glm-5.3-flash`:** both vision surfaces work through the custom endpoint — chat image attachments (base64 `image_url`) and the `view_image` tool on workspace files. Fine-grained text, layout, and image content were read correctly in both tests.
127
127
  - **Context caching** is automatic — `usage.prompt_tokens_details.cached_tokens` reports cache hits; cache writes are currently free. Cache reads for `glm-5.3-flash` are $0.03/M (list; $0.015/M during the launch promo).
128
128
 
129
129
  ## Troubleshooting
130
130
 
131
- | Symptom | Likely cause | Fix |
132
- | -------------------------------------------------------- | --------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
133
- | Model not in picker | Config not reloaded, or JSON syntax error | Restart VS Code; validate JSON |
134
- | HTTP 400 on the first turn | `requestBody` removed `do_sample` semantics or invalid `temperature` | Ensure `temperature ≤ 1.0` and `top_p ∈ [0.01, 1.0]` |
135
- | `invalid temperature: only values ≤ 1.0 are allowed` | Set `temperature > 1.0` | Lower it to `1.0` or below |
136
- | Tool call succeeds but follow-up turn degrades | `clear_thinking: false` set in `requestBody` | Remove the `clear_thinking` key and let the server default to `true` |
137
- | `tool_choice: required` rejected | GLM only supports `auto` | Don't override `tool_choice` (VS Code's default is `auto`) |
138
- | `thinking.type: disabled` rejected on `glm-5.3` | GLM 5.3 only supports enabled thinking; reasoning cannot be disabled | Use `thinking: { "type": "enabled" }` + `reasoning_effort: "low"` (or higher) |
139
- | `Failed to download multimodal content` on a vision call | Z.ai's servers couldn't reach the image URL | Use a base64 `data:image/...` URI instead |
140
- | 401 Unauthorized | Region mismatch (international key used on China URL, or vice versa) | Match your key to the regional endpoint |
141
- | Upstream complains about `reasoning_content is missing` | You set `clear_thinking: false` from a client that doesn't forward it | Drop `clear_thinking` from `requestBody` |
142
- | 429 / "concurrency limit exceeded" | Too many in-flight requests | Reduce concurrent agent sessions, or upgrade your Z.ai plan |
131
+ | Symptom | Likely cause | Fix |
132
+ | -------------------------------------------------------- | ----------------------------------------------------------------------- | --------------------------------------------------------------------------- |
133
+ | Model not in picker | Config not reloaded, or JSON syntax error | Restart VS Code; validate JSON |
134
+ | HTTP 400 on the first turn | Invalid `temperature` or `top_p` in `modelOptions` | Ensure `temperature ≤ 1.0` and `top_p ∈ [0.01, 1.0]` |
135
+ | `invalid temperature: only values ≤ 1.0 are allowed` | Set `temperature > 1.0` | Lower it to `1.0` or below |
136
+ | Tool call succeeds but follow-up turn degrades | Server-side `clear_thinking` behaviour with incomplete history | Leave `clear_thinking` at its default; it cannot be set from this file |
137
+ | `tool_choice: required` rejected | GLM only supports `auto` | Don't override `tool_choice` (VS Code's default is `auto`) |
138
+ | `thinking.type: disabled` rejected on `glm-5.3` | GLM 5.3 only supports enabled thinking; reasoning cannot be disabled | Don't send `thinking`; lower `reasoning_effort` in the model picker instead |
139
+ | `Failed to download multimodal content` on a vision call | Z.ai's servers couldn't reach the image URL | Use a base64 `data:image/...` URI instead |
140
+ | 401 Unauthorized | Region mismatch (international key used on China URL, or vice versa) | Match your key to the regional endpoint |
141
+ | Upstream complains about `reasoning_content is missing` | A client that sets `clear_thinking: false` without forwarding reasoning | Leave the server default (`true`); the key is not settable from this file |
142
+ | 429 / "concurrency limit exceeded" | Too many in-flight requests | Reduce concurrent agent sessions, or upgrade your Z.ai plan |
143
143
 
144
144
  ## Pricing
145
145
 
@@ -20,6 +20,10 @@
20
20
  | Proxy endpoint | `http://127.0.0.1:3457/v1/chat/completions` |
21
21
  | Auth | `Authorization: Bearer $KIMI_API_KEY` |
22
22
 
23
+ > **Live-validated 2026-11-13** (VS Code 1.146, both harnesses): plain chat plus a multi-step tool loop returned HTTP 200 on both turns through the local proxy, and the follow-up request **replayed
24
+ > `reasoning_content` on the assistant tool-call message** — the first direct evidence of reasoning replay on a custom endpoint.
25
+ > `reasoning_effort: "high"` and `max_completion_tokens: 131072` reached Moonshot. Copilot sends 128 tools and Local sends 57; vision and long-context compaction were not tested. See [harness research § 9](../../research/vscode-1.146-copilot-harness.md#9-phase-3-live-provider-validation-2026-11-13).
26
+
23
27
  ### Models
24
28
 
25
29
  | Model | Vision | Context | Max output | Notes |
@@ -51,25 +55,30 @@
51
55
  {
52
56
  "name": "Kimi",
53
57
  "vendor": "customendpoint",
54
- "apiKey": "",
58
+ "apiKey": "${input:kimiApiKey}",
55
59
  "apiType": "chat-completions",
56
60
  "models": [
57
61
  {
58
62
  "id": "kimi-k3.1-pro",
59
63
  "name": "Kimi K3.1 Pro (Custom Endpoint)",
60
64
  "url": "http://127.0.0.1:3457/v1/chat/completions",
61
- "requestBody": { "temperature": 1, "max_tokens": 8192 },
65
+ "modelOptions": { "temperature": 1 },
66
+ "supportsReasoningEffort": ["low", "high", "max"],
67
+ "reasoningEffortFormat": "chat-completions",
68
+ "thinking": true,
62
69
  "toolCalling": true,
63
70
  "vision": true,
64
71
  "streaming": true,
65
- "maxInputTokens": 1000000,
72
+ "maxInputTokens": 917504,
66
73
  "maxOutputTokens": 131072
67
74
  }
68
75
  ]
69
76
  }
70
77
  ```
71
78
 
72
- > **K3.1 Pro note:** `max_tokens` is set to **8192** as a safe starting point. K3.1 Pro is always-thinking and very verbose (150M tokens generated on the AA Intelligence Index evaluation versus an 87M median). The API default for `max_completion_tokens` is 131072 and can go up to 1048576, but reasoning tokens inflate response size — monitor your usage and adjust upward if needed. K3.1 Pro uses `reasoning_effort` (`low` / `high` / `max`, default `max`), not the K2.x `thinking` parameter; add `"reasoning_effort": "low"` to `requestBody` if answers take too long. The proxy forwards the value untouched.
79
+ > **Context budget:** `917504 + 131072 = 1048576`, the K3.1 Pro window (input and output combined). VS Code uses that sum as the model's total context, so only raise `maxInputTokens` by lowering `maxOutputTokens`.
80
+
81
+ > **K3.1 Pro note:** `requestBody` is **not forwarded** on VS Code 1.146 (measured on both harnesses), so `max_tokens` and a `reasoning_effort` entry in the config have no effect. `modelOptions` handles sampling, and the `supportsReasoningEffort` metadata above adds the **Thinking Effort** picker so you can lower effort without editing JSON. K3.1 Pro is always-thinking and very verbose (150M tokens generated on the AA Intelligence Index evaluation versus an 87M median); the API default for `max_completion_tokens` is 131072 and can go up to 1048576, but reasoning tokens inflate response size — monitor usage. Because this entry declares `thinking: true`, `maxOutputTokens` **is** forwarded as `max_completion_tokens` (measured: 131072 reached Moonshot), so lower that value to cap output; entries without the `thinking` metadata do not get this forwarding.
73
82
 
74
83
  ### 2. API key
75
84
 
@@ -80,7 +89,7 @@ Kimi is **Pay-as-You-Go only** — no subscription. A single Open Platform API k
80
89
  3. Find the **Kimi** group → **Update API Key**.
81
90
  4. Paste your Moonshot / Kimi Platform API key.
82
91
 
83
- > VS Code replaces `"apiKey": ""` with a `${input:chat.lm.secret.<id>}` reference. Kimi Platform (formerly Moonshot) rebranded to `platform.kimi.ai` in 2026 — `api.moonshot.ai` still resolves and the proxy targets it unchanged.
92
+ > **`apiKey` must be non-empty** — the file's schema enforces `minLength: 1`, so `"apiKey": ""` shows _String is shorter than the minimum length of 1_. Use the `${input:...}` placeholder shown above and set it through the Language Models UI, which rewrites it to a `${input:chat.lm.secret.<id>}` keychain reference. Kimi Platform (formerly Moonshot) rebranded to `platform.kimi.ai` in 2026 — `api.moonshot.ai` still resolves and the proxy targets it unchanged.
84
93
 
85
94
  ## Local Proxy
86
95
 
@@ -112,7 +121,7 @@ Set in `.env` at the repo root (the proxy `import 'dotenv/config'` automatically
112
121
 
113
122
  - Forwards your `Authorization` header upstream.
114
123
  - Rewrites plain-chat requests to `temperature: 1`, `top_p: 0.95`.
115
- - For **K2.5 / K2.6**: rewrites tool-enabled requests to `thinking: { type: "disabled" }`, `temperature: 0.6`, `top_p: 0.95`.
124
+ - For **K2.5 / K2.6**: rewrites tool-enabled requests to `thinking: { type: "disabled" }`, `temperature: 0.6`, `top_p: 0.95`. Tool activity means a `"tool"`-role message in history or a non-default `tool_choice`; a `tools` array alone, or `tool_choice: "none"`, is treated as plain chat.
116
125
  - For **K3.1 Pro**: keeps thinking enabled (always-thinking, uses `reasoning_effort`, not `thinking`); rewrites to `temperature: 1`, `top_p: 0.95`. Does **not** inject a `thinking` block — K3.1 Pro rejects it. Every `kimi-k3*` slug is handled this way, including `kimi-k3.1-pro` and `kimi-k3.1-pro-highspeed`.
117
126
  - Preserves streaming responses (SSE).
118
127
  - Writes redacted request summaries to `debug_log/kimi-proxy.ndjson`.
@@ -9,7 +9,7 @@
9
9
  | **Recommended method** | **`proxy/mimo-proxy.mjs`** for V2.6 custom endpoints; the extension is still useful when its model picker exposes V2.6 |
10
10
  | Alternative methods | Direct API (static `thinking: disabled`) or the Xiaomi extension |
11
11
  | Mode (custom endpoint) | **Direct** (static `thinking: disabled`) **or** **Proxy** (dynamic, local on `:3459`) |
12
- | Billing | **Pay-as-You-Go** _or_ **Token Plan subscription** (shared `requestBody`) |
12
+ | Billing | **Pay-as-You-Go** _or_ **Token Plan subscription** (same model config) |
13
13
  | Vision | ✅ Yes (all V2.6 models) |
14
14
  | Tool calling | ✅ Yes; V2.6 preserves thinking only when the history includes `reasoning_content` |
15
15
  | Context | 1M |
@@ -18,6 +18,8 @@
18
18
  | Proxy endpoint | `http://127.0.0.1:3459/v1/chat/completions` |
19
19
  | Auth | `Authorization: Bearer $MIMO_API_KEY` |
20
20
 
21
+ > **Live-validated 2026-11-13** (VS Code 1.146, both harnesses): plain chat plus a multi-step tool loop returned HTTP 200 on both turns through the local proxy. No reasoning history was replayed, so the proxy's fallback injected `thinking: { "type": "disabled" }` on the tool turn and Xiaomi accepted it. Copilot sends 128 tools and Local sends 57; vision and long-context compaction were not tested. See [harness research § 9](../../research/vscode-1.146-copilot-harness.md#9-phase-3-live-provider-validation-2026-11-13).
22
+
21
23
  ### Models
22
24
 
23
25
  | Model | Vision | Context | Max output | Notes |
@@ -67,7 +69,7 @@ The `proxy/mimo-proxy.mjs` preserves V2.6 thinking when assistant tool-call hist
67
69
  - `npm run proxy:mimo` (from the repo root)
68
70
  - `npx copilot-custom-endpoint mimo` (standalone)
69
71
 
70
- When using the proxy, point model URLs to `http://127.0.0.1:3459/v1/chat/completions` and **remove** `thinking` from `requestBody`. The proxy handles it dynamically.
72
+ When using the proxy, point model URLs to `http://127.0.0.1:3459/v1/chat/completions` and leave thinking out of the model entry entirely — `requestBody` is not forwarded on VS Code 1.146. The proxy handles it dynamically.
71
73
 
72
74
  ## Setup
73
75
 
@@ -96,13 +98,17 @@ The extension stores your API key in VS Code's `SecretStorage` (OS keychain).
96
98
  | macOS | `~/Library/Application Support/Code/User/chatLanguageModels.json` |
97
99
  | Linux | `~/.config/Code/User/chatLanguageModels.json` |
98
100
 
99
- #### Direct (static `thinking: disabled`)
101
+ > **Context budget:** `917504 + 131072 = 1048576`, the V2.6 window. VS Code uses that sum as the model's total context, so only raise `maxInputTokens` by lowering `maxOutputTokens`. Both blocks below share the same limits.
102
+
103
+ #### Direct (no thinking control)
104
+
105
+ > **⚠️ On VS Code 1.146 the direct path cannot disable thinking.** `requestBody` is dropped, so MiMo keeps its thinking default and tool loops with incomplete reasoning history can fail with HTTP 400. Use the proxy below for tool-heavy work; the direct entry is fine for plain chat.
100
106
 
101
107
  ```json
102
108
  {
103
109
  "name": "MiMo",
104
110
  "vendor": "customendpoint",
105
- "apiKey": "",
111
+ "apiKey": "${input:mimoApiKey}",
106
112
  "apiType": "chat-completions",
107
113
  "models": [
108
114
  {
@@ -112,13 +118,9 @@ The extension stores your API key in VS Code's `SecretStorage` (OS keychain).
112
118
  "toolCalling": true,
113
119
  "vision": true,
114
120
  "streaming": true,
115
- "maxInputTokens": 1048576,
121
+ "maxInputTokens": 917504,
116
122
  "maxOutputTokens": 131072,
117
- "requestBody": {
118
- "thinking": { "type": "disabled" },
119
- "temperature": 1,
120
- "top_p": 0.95
121
- }
123
+ "modelOptions": { "temperature": 1, "top_p": 0.95 }
122
124
  },
123
125
  {
124
126
  "id": "mimo-v2.6-flash",
@@ -127,13 +129,9 @@ The extension stores your API key in VS Code's `SecretStorage` (OS keychain).
127
129
  "toolCalling": true,
128
130
  "vision": true,
129
131
  "streaming": true,
130
- "maxInputTokens": 1048576,
132
+ "maxInputTokens": 917504,
131
133
  "maxOutputTokens": 131072,
132
- "requestBody": {
133
- "thinking": { "type": "disabled" },
134
- "temperature": 1,
135
- "top_p": 0.95
136
- }
134
+ "modelOptions": { "temperature": 1, "top_p": 0.95 }
137
135
  },
138
136
  {
139
137
  "id": "mimo-v2.6-pro-ultraspeed",
@@ -142,25 +140,21 @@ The extension stores your API key in VS Code's `SecretStorage` (OS keychain).
142
140
  "toolCalling": true,
143
141
  "vision": true,
144
142
  "streaming": true,
145
- "maxInputTokens": 1048576,
143
+ "maxInputTokens": 917504,
146
144
  "maxOutputTokens": 131072,
147
- "requestBody": {
148
- "thinking": { "type": "disabled" },
149
- "temperature": 1,
150
- "top_p": 0.95
151
- }
145
+ "modelOptions": { "temperature": 1, "top_p": 0.95 }
152
146
  }
153
147
  ]
154
148
  }
155
149
  ```
156
150
 
157
- #### With proxy (dynamic thinking, no `requestBody` override)
151
+ #### With proxy (dynamic thinking)
158
152
 
159
153
  ```json
160
154
  {
161
155
  "name": "MiMo",
162
156
  "vendor": "customendpoint",
163
- "apiKey": "",
157
+ "apiKey": "${input:mimoApiKey}",
164
158
  "apiType": "chat-completions",
165
159
  "models": [
166
160
  {
@@ -170,9 +164,9 @@ The extension stores your API key in VS Code's `SecretStorage` (OS keychain).
170
164
  "toolCalling": true,
171
165
  "vision": true,
172
166
  "streaming": true,
173
- "maxInputTokens": 1048576,
167
+ "maxInputTokens": 917504,
174
168
  "maxOutputTokens": 131072,
175
- "requestBody": { "temperature": 1, "top_p": 0.95 }
169
+ "modelOptions": { "temperature": 1, "top_p": 0.95 }
176
170
  },
177
171
  {
178
172
  "id": "mimo-v2.6-flash",
@@ -181,9 +175,9 @@ The extension stores your API key in VS Code's `SecretStorage` (OS keychain).
181
175
  "toolCalling": true,
182
176
  "vision": true,
183
177
  "streaming": true,
184
- "maxInputTokens": 1048576,
178
+ "maxInputTokens": 917504,
185
179
  "maxOutputTokens": 131072,
186
- "requestBody": { "temperature": 1, "top_p": 0.95 }
180
+ "modelOptions": { "temperature": 1, "top_p": 0.95 }
187
181
  },
188
182
  {
189
183
  "id": "mimo-v2.6-pro-ultraspeed",
@@ -192,9 +186,9 @@ The extension stores your API key in VS Code's `SecretStorage` (OS keychain).
192
186
  "toolCalling": true,
193
187
  "vision": true,
194
188
  "streaming": true,
195
- "maxInputTokens": 1048576,
189
+ "maxInputTokens": 917504,
196
190
  "maxOutputTokens": 131072,
197
- "requestBody": { "temperature": 1, "top_p": 0.95 }
191
+ "modelOptions": { "temperature": 1, "top_p": 0.95 }
198
192
  }
199
193
  ]
200
194
  }
@@ -207,11 +201,11 @@ The extension stores your API key in VS Code's `SecretStorage` (OS keychain).
207
201
  3. Find the **MiMo** group → **Update API Key**.
208
202
  4. Paste your MiMo API key.
209
203
 
210
- > VS Code replaces `"apiKey": ""` with a `${input:chat.lm.secret.<id>}` reference. The extension uses its own **MiMo: Set API Key** command instead — skip this step if using the extension.
204
+ > **`apiKey` must be non-empty** — the file's schema enforces `minLength: 1`, so `"apiKey": ""` shows _String is shorter than the minimum length of 1_. Use the `${input:...}` placeholder shown above and set it through the Language Models UI, which rewrites it to a `${input:chat.lm.secret.<id>}` keychain reference. The extension uses its own **MiMo: Set API Key** command instead — skip this step if using the extension.
211
205
 
212
206
  ### 2. Token Plan (optional, all methods)
213
207
 
214
- Token Plan subscribers use different base URLs and `tp-` prefixed keys from pay-as-you-go `sk-` keys. The **model id** and **`requestBody`** are the **same** for both billing modes — only the URL and key prefix differ.
208
+ Token Plan subscribers use different base URLs and `tp-` prefixed keys from pay-as-you-go `sk-` keys. The **model id** and the **sampling configuration** are the **same** for both billing modes — only the URL and key prefix differ.
215
209
 
216
210
  | Mode | Key prefix | Base URL (OpenAI) |
217
211
  | ------------- | ---------- | ----------------------------------------- |
@@ -232,7 +226,7 @@ The `proxy/mimo-proxy.mjs` (optional) keeps V2.6 reasoning enabled when the conv
232
226
  | Start | `npm run proxy:mimo` (or `node proxy/mimo-proxy.mjs`) |
233
227
  | Help | `node proxy/mimo-proxy.mjs --help` |
234
228
 
235
- When using the proxy, point model `url`s to `http://127.0.0.1:3459/v1/chat/completions` and **remove** `thinking` from `requestBody`. The proxy handles V2.6 history-aware fallback dynamically.
229
+ When using the proxy, point model `url`s to `http://127.0.0.1:3459/v1/chat/completions` and leave thinking out of the model entry. The proxy handles the V2.6 history-aware fallback dynamically.
236
230
 
237
231
  ## Notes
238
232
 
@@ -243,13 +237,13 @@ When using the proxy, point model `url`s to `http://127.0.0.1:3459/v1/chat/compl
243
237
 
244
238
  ## Troubleshooting
245
239
 
246
- | Symptom | Likely cause | Fix |
247
- | ------------------------------------------ | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
248
- | HTTP 400 on the second turn of a tool loop | `reasoning_content` missing in history (thinking on) | Use the proxy (`npm run proxy:mimo`), or add `thinking: { type: "disabled" }` to `requestBody`; an extension with a reasoning cache can keep thinking enabled |
249
- | Vision request returns an error | The model entry is missing `vision: true` | Add `vision: true` to the model entry — every current MiMo model accepts image input |
250
- | Custom `tool_choice` ignored | MiMo only honors `"auto"` | Stick to `auto` |
251
- | 401 Unauthorized | Wrong key, or Token Plan URL used with pay-as-you-go key | Match key prefix (`sk-` vs `tp-`) to the endpoint |
252
- | 429 rate-limited | Concurrent sessions exceeded 100 RPM / 10M TPM | Reduce concurrent agent sessions |
240
+ | Symptom | Likely cause | Fix |
241
+ | ------------------------------------------ | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
242
+ | HTTP 400 on the second turn of a tool loop | `reasoning_content` missing in history (thinking on) | Use the proxy (`npm run proxy:mimo`); `requestBody.thinking` is not forwarded on 1.146, so it cannot serve as a fallback |
243
+ | Vision request returns an error | The model entry is missing `vision: true` | Add `vision: true` to the model entry — every current MiMo model accepts image input |
244
+ | Custom `tool_choice` ignored | MiMo only honors `"auto"` | Stick to `auto` |
245
+ | 401 Unauthorized | Wrong key, or Token Plan URL used with pay-as-you-go key | Match key prefix (`sk-` vs `tp-`) to the endpoint |
246
+ | 429 rate-limited | Concurrent sessions exceeded 100 RPM / 10M TPM | Reduce concurrent agent sessions |
253
247
 
254
248
  ## Pricing
255
249
 
@@ -1,8 +1,8 @@
1
1
  # MiniMax — VS Code Custom Endpoint Setup Guide
2
2
 
3
- > **TL;DR:** **MiniMax-M3.1-Flash** (released October 19, 2026) is the current M-series Flash model and needs no proxy. Use `thinking: { "type": "adaptive" }` + `reasoning_split: true` + `reasoning_effort` in `requestBody` so the model can reason and the response arrives in a clean OpenAI format (`reasoning_content`, kept separate from `content`). **M3.1 Flash cannot disable thinking** — `thinking: { "type": "disabled" }` and `reasoning_effort: "none"` both return HTTP 400 (`requires adaptive thinking`, code 2013) — so tune depth with `reasoning_effort` (`low` / `medium` / `high` / `xhigh` / `max`, default `max`).
3
+ > **TL;DR:** **MiniMax-M3.1-Flash** (released October 19, 2026) is the current M-series Flash model and needs no proxy. Set sampling with `modelOptions` and expose the effort picker with `supportsReasoningEffort` + `reasoningEffortFormat: "chat-completions"`; the server already returns reasoning on `reasoning_content` separately from `content`. **`requestBody` is not forwarded by VS Code 1.146**, so `thinking` and `reasoning_split` cannot be set from `chatLanguageModels.json`. **M3.1 Flash cannot disable thinking** — `thinking: { "type": "disabled" }` and `reasoning_effort: "none"` both return HTTP 400 (`requires adaptive thinking`, code 2013) — so tune depth with `reasoning_effort` (`low` / `medium` / `high` / `xhigh` / `max`, default `max`).
4
4
  >
5
- > The same `url`, `model id`, and `requestBody` work for **both** Pay-as-You-Go (account-balance billing) and Token Plan (monthly/annual subscription) — only the API key in the secret field changes.
5
+ > The same `url`, `model id`, and model configuration work for **both** Pay-as-You-Go (account-balance billing) and Token Plan (monthly/annual subscription) — only the API key in the secret field changes.
6
6
  >
7
7
  > **🆕 Try a MiniMax Copilot extension first** (no JSON editing):
8
8
  >
@@ -13,18 +13,22 @@
13
13
 
14
14
  ## At a Glance
15
15
 
16
- | Field | Value |
17
- | ------------------------ | --------------------------------------------------------------------------------------------- |
18
- | Mode | **Direct** (no proxy) |
19
- | Billing | **Pay-as-You-Go** _or_ **Token Plan subscription** (same config) |
20
- | Vision | ✅ Yes (image + video) |
21
- | Tool calling | ✅ Yes |
22
- | Context | 1M |
23
- | Max output | 131072 recommended (524288 max) |
24
- | Required `requestBody` | M3.1 Flash: `thinking: { type: "adaptive" }, reasoning_split: true, reasoning_effort: "high"` |
25
- | Endpoint (international) | `https://api.minimax.io/v1/chat/completions` |
26
- | Endpoint (China) | `https://api.minimaxi.com/v1/chat/completions` |
27
- | Auth | `Authorization: Bearer $MINIMAX_API_KEY` (or Subscription Key, see [Setup](#setup)) |
16
+ | Field | Value |
17
+ | ------------------------ | ----------------------------------------------------------------------------------------------------- |
18
+ | Mode | **Direct** (no proxy) |
19
+ | Billing | **Pay-as-You-Go** _or_ **Token Plan subscription** (same config) |
20
+ | Vision | ✅ Yes (image + video) |
21
+ | Tool calling | ✅ Yes |
22
+ | Context | 1M |
23
+ | Max output | 131072 recommended (524288 max) |
24
+ | Supported config | `modelOptions` for sampling + `supportsReasoningEffort` + `reasoningEffortFormat: "chat-completions"` |
25
+ | Endpoint (international) | `https://api.minimax.io/v1/chat/completions` |
26
+ | Endpoint (China) | `https://api.minimaxi.com/v1/chat/completions` |
27
+ | Auth | `Authorization: Bearer $MINIMAX_API_KEY` (or Subscription Key, see [Setup](#setup)) |
28
+
29
+ > **Live-validated 2026-11-13** (VS Code 1.146, both harnesses): plain chat plus a multi-step tool loop returned HTTP 200 on both turns on the direct route.
30
+ > `reasoning_effort: "medium"` and `max_completion_tokens: 131072` reached MiniMax, and no `thinking`/`reasoning_split` field was needed.
31
+ > `reasoning_content` was not replayed on the tool turn. Copilot sends 128 tools and Local sends 57; vision and long-context compaction were not tested. See [harness research § 9](../../research/vscode-1.146-copilot-harness.md#9-phase-3-live-provider-validation-2026-11-13).
28
32
 
29
33
  ### Models
30
34
 
@@ -37,7 +41,7 @@
37
41
  1. **Edit `chatLanguageModels.json`** — add the MiniMax block below.
38
42
  2. **Set your `MINIMAX_API_KEY`** via Command Palette → **Chat: Manage Language Models**.
39
43
  3. **Configure the Utility Small Model** — Open Settings → search **"Chat: Utility Small Model"** → pick your fastest model (e.g., DeepSeek V4.1 Flash or MiMo V2.6 Flash). [Why?](../../README.md#4-configure-the-utility-small-model)
40
- 4. **Restart VS Code** and pick "MiniMax M3.1 Flash (vision)" in the chat picker.
44
+ 4. **Restart VS Code** and pick "MiniMax M3.1 Flash" in the chat picker.
41
45
 
42
46
  ## Setup
43
47
 
@@ -62,30 +66,31 @@
62
66
  {
63
67
  "name": "MiniMax",
64
68
  "vendor": "customendpoint",
65
- "apiKey": "",
69
+ "apiKey": "${input:minimaxApiKey}",
66
70
  "apiType": "chat-completions",
67
71
  "models": [
68
72
  {
69
73
  "id": "MiniMax-M3.1-Flash",
70
- "name": "MiniMax M3.1 Flash (vision)",
74
+ "name": "MiniMax M3.1 Flash",
71
75
  "url": "https://api.minimax.io/v1/chat/completions",
72
76
  "toolCalling": true,
73
77
  "vision": true,
74
78
  "streaming": true,
75
- "maxInputTokens": 1048576,
79
+ "maxInputTokens": 868928,
76
80
  "maxOutputTokens": 131072,
77
- "requestBody": {
78
- "thinking": { "type": "adaptive" },
79
- "reasoning_split": true,
80
- "reasoning_effort": "high",
81
- "temperature": 1,
82
- "top_p": 0.95
83
- }
81
+ "modelOptions": { "temperature": 1, "top_p": 0.95 },
82
+ "supportsReasoningEffort": ["low", "medium", "high", "xhigh", "max"],
83
+ "reasoningEffortFormat": "chat-completions",
84
+ "thinking": true
84
85
  }
85
86
  ]
86
87
  }
87
88
  ```
88
89
 
90
+ > **Context budget:** `868928 + 131072 = 1000000`, the M3.1 Flash window. VS Code uses that sum as the model's total context. The API allows up to 524288 output tokens, so raise `maxOutputTokens` only by lowering `maxInputTokens` to keep the sum inside the window.
91
+
92
+ > **Measured on VS Code 1.146:** `modelOptions` and the reasoning-effort metadata reach the provider; `requestBody` does **not**. Provider fields such as `thinking` and `reasoning_split` therefore cannot be set from this file — M3.1 Flash already returns thinking on `reasoning_content` by default, so this is a documentation fix rather than a regression.
93
+
89
94
  > **Model IDs are case-sensitive.** Use exactly `MiniMax-M3.1-Flash` (capital `M`s, lowercase `i`). Do **not** invent suffixed ids: VS Code forwards each `id` as the upstream `model` parameter, and the API only knows that id.
90
95
 
91
96
  ### 2. Select your billing mode
@@ -108,7 +113,7 @@ The two keys are **not interchangeable** — a Subscription Key against a PAYG-o
108
113
  3. Find the **MiniMax** group → **Update API Key**.
109
114
  4. Paste your **Open Platform API Key** from `platform.minimax.io/user-center/basic-information/interface-key`.
110
115
 
111
- > VS Code replaces `"apiKey": ""` with a `${input:chat.lm.secret.<id>}` reference.
116
+ > **`apiKey` must be non-empty** — the file's schema enforces `minLength: 1`, so `"apiKey": ""` shows _String is shorter than the minimum length of 1_. Use the `${input:...}` placeholder shown above and set it through the Language Models UI, which rewrites it to a `${input:chat.lm.secret.<id>}` keychain reference.
112
117
 
113
118
  #### Option B — Token Plan Subscription Key
114
119
 
@@ -118,30 +123,22 @@ The same `chatLanguageModels.json` block above is reused unchanged. Only the sec
118
123
  2. Open `platform.minimax.io/user-center/payment/token-plan` and copy the **Subscription Key** (prefix `sk-cp-…`).
119
124
  3. In VS Code, run **Chat: Manage Language Models** → **MiniMax** group → **Update API Key** → paste the Subscription Key.
120
125
 
121
- When the Token Plan 5-hour or weekly quota is exhausted, the request fails with a Token Plan quota error (see [Troubleshooting](#troubleshooting)). At that point you can either wait for the quota window to reset, buy a Credits top-up at the same console (Credits use the same Subscription Key), or swap the key back to your Open Platform API Key to fall back to PAYG. The URL and `requestBody` do not change during the swap.
126
+ When the Token Plan 5-hour or weekly quota is exhausted, the request fails with a Token Plan quota error (see [Troubleshooting](#troubleshooting)). At that point you can either wait for the quota window to reset, buy a Credits top-up at the same console (Credits use the same Subscription Key), or swap the key back to your Open Platform API Key to fall back to PAYG. The URL and model configuration do not change during the swap.
122
127
 
123
128
  ### 4. Thinking depth on M3.1 Flash
124
129
 
125
130
  M3.1 Flash always thinks — `thinking: { "type": "disabled" }` and `reasoning_effort: "none"` both return HTTP 400. The only knob is **`reasoning_effort`**, which accepts `low` / `medium` / `high` / `xhigh` / `max` and defaults to `max` when omitted. Lower levels produce fewer thinking tokens at lower latency; `high` is a good starting point for agent/coding work in VS Code, and `max` matches the configuration Artificial Analysis benchmarked.
126
131
 
127
- ```json
128
- "requestBody": {
129
- "thinking": { "type": "adaptive" },
130
- "reasoning_split": true,
131
- "reasoning_effort": "high",
132
- "temperature": 1,
133
- "top_p": 0.95
134
- }
135
- ```
132
+ On VS Code 1.146 set this through the model picker's **Thinking Effort** control (backed by the `supportsReasoningEffort` metadata above), **not** through `requestBody` — that field is dropped before the request leaves VS Code.
136
133
 
137
- `reasoning_split: true` keeps thinking out of `content` and on `reasoning_content`. Setting it to `false` is not supported on M3.1 Flash, and the server already returns thinking separately by default. `temperature` and `top_p` are accepted but ignored on M3.1 Flash (fixed at `1` and `0.95`); they are kept here only so every provider block in this repo has the same shape.
134
+ `reasoning_split: true` keeps thinking out of `content` and on `reasoning_content`; it cannot be set from `chatLanguageModels.json` on 1.146, and M3.1 Flash already returns thinking separately by default. `temperature` and `top_p` are accepted but ignored on M3.1 Flash (fixed at `1` and `0.95`); they stay in `modelOptions` only so every provider block shares the same shape.
138
135
 
139
136
  ## Notes
140
137
 
141
- - **`thinking: adaptive` + `reasoning_split: true`** is the recommended pair: the server returns thinking on the `reasoning_content` field, which keeps `content` clean for VS Code. The `thinking` field is effectively fixed at `adaptive` (the server rejects `disabled`).
142
- - **`reasoning_effort` controls thinking depth.** Values are `low` / `medium` / `high` / `xhigh` / `max`, default `max`; `none` is rejected.
138
+ - **Thinking output is split by default:** the server returns thinking on `reasoning_content`, keeping `content` clean for VS Code. `thinking` is effectively fixed at `adaptive` (the server rejects `disabled`).
139
+ - **`reasoning_effort` controls thinking depth.** Values are `low` / `medium` / `high` / `xhigh` / `max`, default `max`; `none` is rejected. Choose it in the model picker, not in `requestBody`.
143
140
  - **`temperature: 1`, `top_p: 0.95`** are accepted but **ignored** (M3.1 Flash is fixed at those values); `top_p` must still be inside `(0, 1]` if you send it.
144
- - **Interleaved thinking and tool loops:** MiniMax recommends sending the complete assistant message — including `reasoning_content` — back in history so the reasoning chain stays continuous. VS Code does not preserve `reasoning_content` across tool turns, so expect shallower continuity on long agent runs. This is a quality trade-off, not an error: unlike Kimi K2.7, M3.1 Flash does not reject a tool result whose assistant message lacks reasoning content.
141
+ - **Interleaved thinking and tool loops:** MiniMax recommends sending the complete assistant message — including `reasoning_content` — back in history so the reasoning chain stays continuous. Measured 2026-11-13 on both harnesses: VS Code did **not** replay `reasoning_content` on the MiniMax tool turn (Kimi's entry did), so expect shallower continuity on long agent runs. This is a quality trade-off, not an error: unlike Kimi K2.7, M3.1 Flash does not reject a tool result whose assistant message lacks reasoning content.
145
142
  - **Max output:** `max_completion_tokens` is recommended at 131072 and accepts up to 524288; thinking tokens count toward that limit.
146
143
  - **Rate limits:** 200 RPM / 10M TPM. Input tokens above 512K are available in limited quantity for a limited time.
147
144
 
@@ -150,7 +147,7 @@ M3.1 Flash always thinks — `thinking: { "type": "disabled" }` and `reasoning_e
150
147
  | Symptom | Likely cause | Fix |
151
148
  | -------------------------------------------- | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
152
149
  | Model not in picker | Config not reloaded, or wrong casing | Restart VS Code; verify the model ID is exactly `MiniMax-M3.1-Flash` |
153
- | Reasoning leaks into `content` | Missing `reasoning_split` | Add `reasoning_split: true` to `requestBody` |
150
+ | Reasoning leaks into `content` | Server did not split reasoning | `reasoning_split` cannot be set from `chatLanguageModels.json` on 1.146; check the provider response format instead |
154
151
  | 400 `requires adaptive thinking` (2013) | `thinking: { "type": "disabled" }` or `reasoning_effort: "none"` sent to M3.1 Flash | Remove the override; lower `reasoning_effort` instead. On M3.1 Flash thinking cannot be disabled. |
155
152
  | 400 `reasoning_split` cannot be false | `reasoning_split: false` sent to M3.1 Flash | Use `reasoning_split: true` (or omit it); split output is mandatory on this model. |
156
153
  | 400 / 2013 with `service_tier` | `service_tier` sent to M3.1 Flash | Remove `service_tier` — M3.1 Flash does not accept that field |