Skip to content

fix: bound resource downloads - #231

Merged
NianJiuZst merged 1 commit into
mainfrom
codex/download-reliability
Aug 10, 2026
Merged

fix: bound resource downloads#231
NianJiuZst merged 1 commit into
mainfrom
codex/download-reliability

Conversation

@victor0602

@victor0602 victor0602 commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • enforce overall and idle timeouts across response headers, body reads, and disk writes
  • retry transient network, 408, 429, and 5xx failures with exponential backoff and Retry-After support
  • cap download size using Content-Length and streamed byte counts
  • write to a temporary file and atomically replace the destination only after a complete download
  • propagate caller cancellation and clean up readers, writers, and temporary files on every failure path

Validation

  • bun test test/files/download.test.ts
  • bun run typecheck
  • bun run lint
  • bun test (459 passed)

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@NianJiuZst NianJiuZst left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blocking findings on the current head. The implementation bounds headers/body/disk stalls, enforces declared and streamed sizes, preserves the destination until a completed write, and cleans up failed attempts; I recommend merging it.

Verified locally: typecheck, lint (one pre-existing warning), build, 14 focused download tests, and the full suite (459/459). This does not include a multi-gigabyte or real slow-network download.

@NianJiuZst
NianJiuZst merged commit c98e9ce into main Aug 10, 2026
5 checks passed
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.

2 participants