Skip to content

fix: stream large staged Playground files#1992

Open
chubes4 wants to merge 1 commit into
mainfrom
fix/1990-chunked-staged-writes
Open

fix: stream large staged Playground files#1992
chubes4 wants to merge 1 commit into
mainfrom
fix/1990-chunked-staged-writes

Conversation

@chubes4

@chubes4 chubes4 commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • stream staged files larger than 1 MiB to Playground in 256 KiB binary-safe chunks
  • truncate the existing target before appending, then verify the final SHA-256 without re-embedding the large file
  • retain the existing direct/text and PHP fallback paths for smaller files

Evidence

  • Source relationship: fixes Stream large staged files into Playground without whole-file base64 allocation #1990 in the runtime-playground host-to-VFS staged-input materializer, the path that previously read each staged file and embedded its full base64 payload in PHP.
  • Change kind: bounded-memory runtime implementation plus deterministic materialization coverage.
  • Verification capability: the new test proves byte identity after truncation, binary support, exact bounded chunk payload sizes, hash-only verification, and no direct whole-file writer call for an over-threshold file.
  • Scope: the runtime change is limited to files larger than 1 MiB; small-file mount semantics and established fallback behavior remain unchanged.

Verification

  • npm run build
  • TMPDIR=/tmp npm run test:playground-readonly-mounts
  • TMPDIR=/tmp npm exec -- tsx tests/mount-materialization.test.ts
  • TMPDIR=/tmp npm exec -- tsx tests/staged-input-materialization.test.ts
  • TMPDIR=/tmp npm run test:playground-staged-upload-preview

AI Assistance Disclosure

OpenAI gpt-5.6-sol via OpenCode/Homeboy was used to inspect the relevant runtime path, implement the bounded-memory write flow, and add and run tests.

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.

Stream large staged files into Playground without whole-file base64 allocation

1 participant