You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some OpenAI-compatible relay/NewAPI providers sit behind WAF or
Cloudflare rules that may block requests using the SDK default request
headers. Allow users to configure additional HTTP headers, such as a
custom User-Agent, without patching the extension source code.
Changes:
- add a top-level `headers` setting and normalize string header values
- merge user and project headers with project-level precedence
- pass configured headers to the OpenAI SDK via `defaultHeaders`
- include headers in the shared client cache key
- document the setting with a User-Agent example
- add resolver coverage for header merging behavior
Validation:
- npx tsx --test src/tests/settings-and-notify.test.ts
- npm run typecheck
- npm run bundle
Copy file name to clipboardExpand all lines: docs/guide.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -228,6 +228,9 @@ Persist state and notify the webview
228
228
"BASE_URL": "https://api.deepseek.com",
229
229
"MODEL": "deepseek-v4-pro"
230
230
},
231
+
"headers": {
232
+
"User-Agent": "Mozilla/5.0 ..."
233
+
},
231
234
"thinkingEnabled": true,
232
235
"reasoningEffort": "max",
233
236
"notify": "~/.deepcode/notify.sh"
@@ -241,6 +244,7 @@ Persist state and notify the webview
241
244
|`env.API_KEY`| string | Yes | - | API key for the configured provider |
242
245
|`env.BASE_URL`| string | No |`https://api.deepseek.com`| Base URL for a DeepSeek or other OpenAI-compatible endpoint |
243
246
|`env.MODEL`| string | No |`deepseek-v4-pro`| Model identifier passed to `chat.completions.create()`|
247
+
|`headers`| object | No |`{}`| Extra HTTP headers passed to the OpenAI-compatible SDK client, useful for providers that require custom headers such as `User-Agent`|
244
248
|`thinkingEnabled`| boolean | No |`true` for `deepseek-v4-flash` and `deepseek-v4-pro`; otherwise `false`| Enables the optional `thinking` request field when set to `true`|
245
249
|`reasoningEffort`|`"high"` or `"max"`| No |`"max"`| Controls DeepSeek thinking strength via `reasoning_effort` when thinking mode is enabled |
246
250
|`notify`| string | No | - | Executable script path triggered when a task ends in `completed` or `failed`, with `DURATION` set to the elapsed seconds |
0 commit comments