Run write_stdin concurrently across terminal sessions (#33645)

## What changed

- Allow parallel `write_stdin` tool calls to interact with independent terminal sessions.
- Serialize reads and writes within each session so its output buffer and process lifecycle remain consistent.
- Prevent active sessions from being pruned while a `write_stdin` interaction is in progress.

## Testing

- Added unified exec and code mode coverage that uses two terminal sessions concurrently and verifies output from both.

GitOrigin-RevId: 618f5503f4c4670421f680c0f0c27414bc6b2ddd
This commit is contained in:
pakrym-oai authored and copyberry committed 2026-07-16 16:58:41 +00:00
1 parent f722a7ebcf
commit f64233d142
5 files changed
+154 -4

No files matched your search

@@ -40,6 +40,10 @@ impl ToolExecutor<ToolInvocation> for WriteStdinHandler {
create_write_stdin_tool()
}
fn supports_parallel_tool_calls(&self) -> bool {
true
}
fn handle(&self, invocation: ToolInvocation) -> codex_tools::ToolExecutorFuture<'_> {
Box::pin(self.handle_call(invocation))
}