fix(llm-deepseek): refuse an API key no header can carry

This commit is contained in:
Yichen Jiang
2026-08-06 21:39:57 +08:00
parent b6b57ceda3
commit 5514dd2bd6
4 changed files with 77 additions and 7 deletions

View File

@@ -642,7 +642,11 @@ Requires: `llm`
* reasoning effort resolves to `high`.
*/
export interface Config {
/** Literal API key; prefer {@link apiKeyEnv} so no secret enters configuration files. */
/**
* Literal API key; prefer {@link apiKeyEnv} so no secret enters configuration files. Trimmed
* and format-checked by {@link resolveAdapterOptions}; a value no HTTP header can carry fails
* there rather than inside `fetch`.
*/
apiKey?: string
/** Credential reference (environment-variable name) resolved per request; defaults to `DEEPSEEK_API_KEY`. */
apiKeyEnv?: string