Skip to content

Fix truncated container file reads - #632

Merged
Brandon Waterloo [MSFT] (bwateratmsft) merged 1 commit into
mainfrom
bwateratmsft-container-file-truncation
Oct 7, 2026
Merged

Brandon Waterloo [MSFT] (bwateratmsft) merged 1 commit into
mainfrom
bwateratmsft-container-file-truncation

Conversation

@bwateratmsft

@bwateratmsft Brandon Waterloo [MSFT] (bwateratmsft) commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

🤖

Summary

  • Honor backpressure and wait for archive consumption and extracted output to finish before returning container file bytes.
  • Parse tar entries in memory instead of using disk extraction, and propagate failed or incomplete reads without returning partial content.
  • Preserve the existing VS Code filesystem-copy download path and Windows raw-byte reads.

Fixes #631.

Validation

  • 22 focused filesystem-provider and tar-extraction regressions pass, including 30 MB size/SHA-256 comparisons, slow destination draining, filesystem copy, opened files, and failure cases.
  • Extension build/type check and touched-file lint pass.
  • Manual testing by the maintainer is pending; this PR is intentionally a draft.

UPDATE: I did the manual testing, all green.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: aec80380-3c6a-4c1e-9039-11bf00ea54f6

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The stream lifecycle and failure-propagation changes are well tested but warrant final maintainer review.

0 open findings

What changed in this PR

Fixes truncated container downloads by correctly awaiting stream completion and tar extraction.

Changes:

  • Adds backpressure-aware in-memory tar extraction.
  • Propagates incomplete and failed reads.
  • Adds comprehensive Linux, Windows, large-file, and failure regression tests.
File Description
src/​utils/​tarUtils.ts Implements awaited in-memory tar parsing.
src/​runtimes/​files/​ContainerFilesProvider.ts Pipelines container output through extraction or raw accumulation.
src/​test/​utils/​tarUtils.test.ts Tests extraction lifecycle and failures.
src/​test/​runtimes/​files/​ContainerFilesProvider.test.ts Tests complete reads and filesystem operations.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@bwateratmsft
Brandon Waterloo [MSFT] (bwateratmsft) merged commit 8ff1320 into main Oct 7, 2026
3 checks passed
@bwateratmsft
Brandon Waterloo [MSFT] (bwateratmsft) deleted the bwateratmsft-container-file-truncation branch October 7, 2026 17:05
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.

Downloaded file from a container is truncated, without error

3 participants