Troubleshooting

Atlas error "Response decompression failed" (ZlibError): how to fix it

Updated 5 min read

Atlas reports the APIError "Response decompression failed" with metadata code ZlibError when the gzip or deflate response body could not be inflated, and the fix is to retry, because Atlas maps FetchDecompressionError to a retryable APIError. If retries keep failing, suspect a proxy that re-compresses or truncates the response body, and bypass it for the provider host. If you aborted the request yourself, Atlas raises MessageAbortedError instead, which is not a failure.

Why does Atlas report Response decompression failed

Atlas reports "Response decompression failed" when a FetchDecompressionError with code ZlibError is raised, meaning the body could not be inflated under either of the 2 encodings, gzip or deflate. Atlas's toError maps that FetchDecompressionError to a retryable APIError, so the metadata code you see on the message is ZlibError.

Providers compress their response bodies with gzip or deflate, and Atlas inflates them on arrival. When the compressed stream is malformed, incomplete, or has been rewritten in transit, the inflate step fails and Atlas gets a FetchDecompressionError carrying the code ZlibError. Rather than crash on a raw zlib fault, Atlas converts it into an APIError with the message "Response decompression failed" and marks it retryable. The important read here is that the model produced a response and the bytes came back. The bytes just did not survive decompression, which is a transport-layer problem and not a prompt or model problem.

How to fix Response decompression failed in Atlas

Step 1 of the documented fix is to retry, since the mapped APIError is retryable. If ZlibError keeps recurring, steps 2 and 3 tell you to suspect a proxy that re-compresses or truncates the response body, then bypass that proxy for the provider host and retry the identical message.

Retry is step one because a single corrupted gzip stream can be a transient fluke. A ZlibError that keeps coming back is different: something is reliably damaging the compressed body. Middleboxes that inspect traffic often decompress, modify, and re-compress responses, or cut them short when they exceed a scanning limit, and a re-compressed or truncated gzip body will not inflate cleanly on the Atlas side. Bypassing the proxy for the provider host removes the rewrite and is the cleanest test. Stated plainly, the caveat is that Atlas cannot repair a body that arrived corrupted, so the fix has to happen on the network path.

ZlibError vs MessageAbortedError in Atlas

Atlas distinguishes ZlibError from MessageAbortedError deliberately, and they are 2 different outcomes. A FetchDecompressionError becomes a retryable APIError with code ZlibError, but if the request was aborted, Atlas maps it to MessageAbortedError instead. MessageAbortedError means you cancelled the request, and it is not a failure that needs fixing.

Cancelling a generation tears down an in-flight compressed body, which at the byte level looks a lot like corruption. Atlas checks for the abort case first, so a request you cancelled surfaces as MessageAbortedError rather than as a misleading "Response decompression failed". If you see MessageAbortedError after hitting cancel, nothing is broken and there is nothing to repair. If you see ZlibError while you were sitting still and waiting for the answer, the body genuinely failed to inflate, and the proxy and truncation checks apply. Reading the metadata code before you start debugging saves the wasted trip.

How to verify the Response decompression failed fix worked

Verify the fix in Atlas by resending the exact message that failed and confirming 0 APIErrors arrive with the metadata code ZlibError. A response that renders fully, on the same provider and through the same network path minus the proxy, is proof that the gzip or deflate body now inflates cleanly.

Repeat the original request rather than a simpler one, because a small response may compress into a body that survives a truncating proxy while a large one does not. Confirm three things after the retry: the assistant message completes, the metadata carries no ZlibError code, and the message is not "Response decompression failed". If ZlibError reappears the moment you route back through the proxy, you have identified the cause conclusively and the fix belongs with whoever administers that proxy.

How to fix it

  1. 01Retry the message. The mapped error is retryable, so Atlas expects a second attempt to be worth making.
  2. 02Suspect a proxy that re-compresses or truncates the response body. A gzip/deflate stream that has been rewritten in flight will not inflate.
  3. 03Bypass the proxy for the provider host and retry the same message to confirm the proxy is the cause.
  4. 04If you aborted the request yourself, expect MessageAbortedError instead of ZlibError. MessageAbortedError is not a failure and needs no fix.
  5. 05Check the metadata code before acting: ZlibError means a decompression failure, and any other code points at a different Atlas error path.

Frequently asked questions

What does ZlibError mean in Atlas
ZlibError is the metadata code Atlas attaches when a FetchDecompressionError is raised, meaning the gzip/deflate response body could not be inflated. Atlas maps it to a retryable APIError with the message "Response decompression failed".
Is Response decompression failed retryable in Atlas
Yes. Atlas maps the FetchDecompressionError to a retryable APIError, so retrying is the documented first step. A ZlibError that recurs on every retry usually means a proxy is re-compressing or truncating the body.
Can a proxy cause Response decompression failed in Atlas
Yes. A proxy that re-compresses or truncates the response body will produce a gzip/deflate stream that Atlas cannot inflate. Bypass the proxy for the provider host and retry to confirm.
Why did Atlas give me MessageAbortedError instead of ZlibError
Atlas maps an aborted request to MessageAbortedError rather than to a decompression APIError. If you cancelled the request yourself, MessageAbortedError is expected and is not a failure.
Does Response decompression failed mean the model failed
No. "Response decompression failed" means the response body arrived but could not be inflated. The model produced output. The failure is in the gzip/deflate transport layer, not in the model.
How do I confirm the ZlibError is gone in Atlas
Resend the exact message that failed and check that the reply completes with no ZlibError code in the APIError metadata. Use the original large request, not a small one, since small bodies can slip past a truncating proxy.

Try Atlas in your terminal

The terminal-native AI coding agent. Free core, single binary.

Install Atlas

Related guides

Atlas with Poolside Laguna XS 2.1 in 2026

Poolside Laguna XS 2.1 in Atlas, 2026: the fast tier of Poolside's coding-native line at $0.06/$0.12 per Mtok on OpenRouter, holding 262,144 tokens of context.

Atlas with Qwen3-Coder Next (local via Ollama): the Top-Ranked Local Coder in 2026

Qwen3-Coder Next is the top-ranked local coding model of mid-2026: 262,144 token context, free self-hosted, or $0.22 / $1.80 per Mtok on Bedrock. Atlas setup and tradeoffs.

Atlas with Grok 4.20 (Reasoning) in 2026: A 1M Token Reader

Grok 4.20 (Reasoning) reads 1,000,000 tokens at $1.25 per Mtok input and writes at $2.5 per Mtok, but caps output at 30,000 tokens. A superb reader, a terse writer.

Atlas with OpenCoder 8B (Ollama): the Auditable Local Coder in 2026

OpenCoder 8B (Ollama) runs Atlas on a fully open code LLM: open data, open recipe, 4.7GB, 8K tokens (8,192) of context, Free (self-hosted). Setup and tradeoffs.

Atlas with Qwen3.5 Plus: A Million-Token Window for $0.40 per Mtok in 2026

Qwen3.5 Plus gives Atlas a 1M tokens (1,000,000) context window at $0.40 per Mtok input and $2.40 per Mtok output. What the million tokens buy, and what closed weights cost.

Atlas with Qwen3.6 27B: The 2026 Dense Checkpoint, Priced Honestly

Qwen3.6 27B is the dense reasoning model of Alibaba's April 2026 line: 256K tokens (262,144) of context at $0.60 per Mtok input and $3.60 per Mtok output, running inside Atlas.

Atlas with Qwen3 32B: The Largest Dense Qwen3 in 2026

Qwen3 32B in Atlas: 16,384 max output tokens, hybrid thinking, 128K tokens (131,072) of context, $0.70 per Mtok input and $2.80 per Mtok output in 2026.

Atlas with GPT-5 Pro: The 272,000 Token Output Ceiling in 2026

GPT-5 Pro in Atlas: the only OpenAI model with a 272,000 token max output, priced at $15 per Mtok input, $120 per Mtok output on a 400K tokens window.

Browse this resource hub