fix(client): clearer insecure-base-URL rejection (#1303)

The previous one-line error told users to set
DEEPSEEK_ALLOW_INSECURE_HTTP=1 but the env var name is easy to typo
when you're staring at it in a terminal (sam43b in #1303 wrote
"DEEPSEEKALLOWINSECURE_HTTP"). Reformat the message to:

- Note that loopback hosts are auto-allowed (no env var needed)
- Show the env var with underscores explicit and prominent
- Include a one-line copy-pasteable example

No behavior change; same `validate_base_url_security` decisions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Hunter Bown
2026-05-10 00:27:56 -05:00
parent 8ede860c05
commit 829270a8e7
2 changed files with 13 additions and 3 deletions
+4
View File
@@ -23,6 +23,10 @@ published.
### Fixed
- **Insecure base-URL error message is more discoverable (#1303)** —
the rejection now spells out which env var to set (with underscores
visible), notes that loopback hosts are auto-allowed, and shows a
one-line `DEEPSEEK_ALLOW_INSECURE_HTTP=1 deepseek` example.
- **Workspace skills survive prompt truncation** — when the skill
catalog needs trimming to fit the prompt budget, workspace-local
skills now keep precedence over global ones rather than being
+9 -3
View File
@@ -346,9 +346,15 @@ fn validate_base_url_security(base_url: &str) -> Result<()> {
if base_url.starts_with("http://") {
anyhow::bail!(
"Refusing insecure base URL '{}'. Use HTTPS or set {}=1 to override for trusted environments.",
base_url,
ALLOW_INSECURE_HTTP_ENV
"Refusing insecure base URL '{base_url}'.\n\
\n\
Loopback hosts (localhost, 127.0.0.1, [::1]) are auto-allowed.\n\
For other trusted local hosts (LAN, llama.cpp on a private IP, etc.)\n\
set the env var `{env}=1` in the shell that runs deepseek and re-run.\n\
\n\
Example: `{env}=1 deepseek` (note the underscores).",
base_url = base_url,
env = ALLOW_INSECURE_HTTP_ENV,
);
}