← Blog

How-to4 min read

DeepSeek Harness “DeepSeek Messages transport failed”: what it means and how to fix it

What DeepSeek Harness's “transport failed”, “request failed (402)” and “stream ended before message_stop” errors mean, and what to try for each.

Mirasim's first-run screen, where you pick and install the coding agents to useMirasim's first-run screen, where you pick and install the coding agents to use

The short answer

DeepSeek Harness (DSH) talks to DeepSeek's API over a streamed request. “DeepSeek Messages transport failed” means that request broke at the network level: it couldn't connect, or the connection dropped mid-reply. DSH retries this on its own (five times by default), so by the time you see the error, under “This turn failed”, the retries have run out. The fix is almost always in the network path: the proxy, VPN or gateway between you and the API.

  1. Send it again

    The session keeps its history, and file changes DSH already made stay made.

  2. Give DSH the proxy explicitly

    DSH doesn't read the operating system's proxy setting. Set HTTPS_PROXY and HTTP_PROXY (or turn on your proxy app's TUN mode), then restart DSH.

  3. Check which error it really is

    “request failed” with a status code and “stream ended before message_stop” mean different things; see the table below.

Which error, and what to do

The errorWhat happenedWhat to try
DeepSeek Messages transport failedCouldn't reach the API, or the connection dropped while the reply was streaming. Retried five times by default.Fix the proxy (next section), switch network or node, send again.
DeepSeek Messages stream idle timeoutNothing arrived for five minutes, the default idle timeout. Also retried.Send again. The timeout can be raised (see the last section).
DeepSeek Messages stream ended before message_stopThe stream closed before DeepSeek sent its final event. This one is not in the default retry list.Send again by hand. If it happens on every long reply, something in the path is cutting long connections.
request failed (402), Insufficient BalanceYour DeepSeek API balance has run out.Top up on DeepSeek's platform. Retrying won't help.
request failed (401) or (403)The API key is wrong or not allowed.Re-enter the key under Settings → Models.
request failed (429)Too many requests, or a concurrency limit. Retried with back-off.Wait, or run fewer sessions at once.
request failed (500), (502), (503)A server or gateway error; 503 is DeepSeek saying it's overloaded. Retried.Wait a little and send again. With a relay set as the base URL, a 502 usually comes from the relay.
request failed (400) or (404)The request itself was refused: a bad format, or an endpoint or model the server doesn't have. Not retried.Check the base URL and model name, especially with a custom gateway.

Why the browser works but DSH doesn't

The “system proxy” switch in apps like Clash only changes the operating system's proxy setting. Browsers follow it; DSH, like curl, git and npm, follows the HTTPS_PROXY / HTTP_PROXY environment variables instead. So DSH can be connecting directly while your browser goes through the proxy. Either export the variables before starting DSH, or put them in $DSH_HOME/.env, or turn on TUN mode, which covers everything without variables.

Use your proxy app's HTTP port; 7890 is only an example.
export HTTPS_PROXY=http://127.0.0.1:7890
export HTTP_PROXY=http://127.0.0.1:7890
  • SOCKS isn't supported: a socks5:// value is skipped and DSH connects directly. Point the variables at the HTTP port.
  • Behind a company proxy that inspects TLS, set NODE_EXTRA_CA_CERTS to the company's CA file before starting DSH.
  • NO_PROXY takes host names and domain suffixes, not IP ranges like 10.0.0.0/8.

Changing the retries and the timeout

Each provider's timeouts and retry policy live in $DSH_HOME/profiles/<profile>/cordis.patch.yml, the file the Models settings page writes; DSH re-reads it on the next request. streamIdleTimeoutMs sets the idle timeout (default 300000, five minutes). retryPolicy defaults to normal mode, five retries with back-off from 0.5 to 10 seconds; mode: always keeps retrying until it succeeds or you cancel. Every retry is another billed request.

DSH in Mirasim

Mirasim installs and runs DeepSeek Harness itself, on your DeepSeek API key or on Mirasim credit, so these errors read the same there. What it adds: a session can switch to another agent, such as Claude Code or Codex, and keep its conversation, so the work doesn't stop while DSH's connection recovers.

Questions

What does “This turn failed” (本轮运行失败) mean?
That this turn ended on an error. The line under it, such as “DeepSeek Messages transport failed”, is the actual cause.
Is my work lost?
No. The session history stays, and files DSH already changed stay changed. Send the message again.
Does retrying cost money?
Each retry is a new request to the API and is billed like one. That's why always mode is opt-in.
My proxy is on and it still fails
Check that DSH actually sees it: the variables must be set in the environment DSH starts from, or in $DSH_HOME/.env, and must point at an HTTP port, not SOCKS.

Sources

The error texts, retry defaults and settings come from the DeepSeek Harness source and user guides (network proxy, model providers) at github.com/deepseek-ai/deepseek-harness, and the status codes from DeepSeek's API error code page, checked on November 22, 2026. DSH changes quickly; check its repository for the latest.

Keep reading