Enable writable file streaming in exec-server (#50177)

## What changed

Advertise `fileWriteStreaming` and support `fs/open` with `mode: "replace"` to create or truncate a file for writing. Implement `fs/writeBlock` with explicit offsets and nonempty chunks of up to 1 MiB, rejecting ranges beyond the signed 64-bit file offset limit.

Apply write sandbox permissions when opening writable handles, including when full-disk reads are allowed. Keep `read` as the default open mode.

## Testing

Add integration coverage for positional writes, chunk and offset bounds, replacement truncation, read/write handle permissions, and sandbox write restrictions. Verify that duplicate handle IDs and exhausted handle capacity reject replacement opens without creating or truncating files.

GitOrigin-RevId: 696ee6437dd5f5b69d5a7667dddea0ff44472094
This commit is contained in:
Adam Perry @ OpenAI
2026-10-02 04:25:52 +00:00
committed by copyberry
parent 7135b303d9
commit c39bfa4c8f
14 changed files with 425 additions and 50 deletions
@@ -283,7 +283,7 @@ impl EnvironmentInfo {
environment_config_read: true,
http_header_env_vars: true,
sandboxed_file_streaming: true,
file_write_streaming: false,
file_write_streaming: true,
shell_snapshot_v2: cfg!(unix),
windows_mxc,
linux_root_write_preserves_devices: cfg!(target_os = "linux"),