Skip to content

fix(cloud): handle interrupted download error bodies - #1624

Open
samirhvbr wants to merge 1 commit into
usestrix:mainfrom
samirhvbr:fix/cloud-download-error-body-20261029
Open

samirhvbr wants to merge 1 commit into
usestrix:mainfrom
samirhvbr:fix/cloud-download-error-body-20261029

Conversation

@samirhvbr

Copy link
Copy Markdown

Fixes #1620.

Cloud downloads stream their responses. If a server returns an HTTP error and its JSON or text body is truncated, reading that body currently lets requests.exceptions.ChunkedEncodingError escape from the CLI. For example, scans report --output report.pdf --json produces a traceback instead of a JSON error on an interrupted 503 response.

Convert Requests body-read failures in http.check to the existing CloudTransportError. The runner can then return exit 1 through its normal output handling: JSON for file downloads and stderr for redirected binary output. The response still closes and existing files remain untouched.

Regression tests run through the real CLI and Requests/urllib3 body readers with an incomplete response, mocking only the HTTP request. All four cases fail on unchanged main and pass with this fix: JSON/text error bodies, each sent to a file or raw stdout.

Validation on Python 3.12.14 with frozen dependencies and an isolated HOME:

  • All seven cloud test modules: 325 passed.
  • make check-all: Ruff formatting/lint and full Mypy pass; Pyright stops the target with 941 pre-existing errors. The unchanged base and this branch have identical diagnostic sets (zero additions/removals); http.py has no diagnostics.
  • Full Bandit run separately: passed.
  • git diff --check: passed.

No live managed service, LLM, payment, or scan was used. Network behavior is covered by local synthetic responses; remote CI remains to be run.

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Converts Requests body-read failures in check into CloudTransportError, so interrupted download error bodies reach the CLI’s normal error output.

  • Unreadable cloud response bodies now become normal CLI errors.

Reviews (1) · Last reviewed commit: "fix(cloud): handle interrupted download ..." · Reviewed by Greptile

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Cloud downloads raise an uncaught exception when an HTTP error body is interrupted

1 participant