Files
Priya RamanandPaperclip 825941bf40 fix(adapter-utils): serialize process-session stdin writes so files land in send order
The sandbox process-session bridge writes each stdin message to its own
remote file. The remote stdin poller reads the files in name order and
holds that order only across files it already sees. It cannot know that a
file with an earlier name is still on the way.

The socket handler fired each stdin write without serialization, so two
writes could interleave. Each write runs several execs, so a later
stdinEnd file could land before the earlier data file it must follow.
The poller then ended the child stdin before the input file landed, and
the child exited with no output. Under load this made the streamed-output
bridge test deliver an empty stdout instead of the echoed input.

Chain the stdin writes so each file lands before the next write starts,
which keeps the files in send order. Chain the teardown stdinEnd write
too, so it lands after any in-flight input file. Add a regression test
that delays the first data file's finalize exec, so the stdinEnd write
wins the race, and proves the bridge still delivers the echo.

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-08-13 17:21:06 +00:00
..