Repository navigation
Conversation
Hona
added this pull request to stack #49468
September 17, 2026 03:48
Hona
marked this pull request as ready for review
September 17, 2026 03:49
Hona
force-pushed
the
fs-write
branch
2 times, most recently
from
September 17, 2026 04:48
a053c18 to
ec197eb
Compare
Clients can write raw bytes to an absolute path or a path relative to the requested location. Parent directories are created and the resolved absolute path is returned. Unlike fs.read, the target is not confined to the location so clients can stage files in the server tmp directory reported by /api/info, which the model already prefers and is permitted to access. The promise client codegen learns binary request bodies; the Effect client omits the endpoint like fs.read. Also compares the canonical tmp path in the service info test: on Windows CI os.tmpdir() is an 8.3 short name that the server realpaths.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
POST /api/experimental/fs/writeso a client can put raw bytes on the server's filesystem. First consumer: #49467 stages attachments the model can't read natively under the server tmp dir.flowchart LR C[Client] -- "POST /api/experimental/fs/write?path=…<br/>body: raw bytes (application/octet-stream)" --> S[Server] S -- "path.resolve(location.directory, path)" --> R{absolute?} R -- yes --> A["/any/where/file.bin"] R -- no --> L["<location>/relative/file.bin"] A & L --> W["writeWithDirs → { path: resolved }"]fs.read, not confined to the location: the point is to reachpaths.tmpfromGET /api/info, which the model is already told to prefer and permitted to access.fs.read); the Effect client omits the endpoint likefs.read. workerd stub reports unavailable.service.test.tson Windows CI: it comparedos.tmpdir()(an 8.3 short name on the runner) against the realpath'dpaths.tmpthe server reports.