Add a plugin process host with bounded IPC and lifecycle management (#57290)

## What changed

- Add `codex-plugin-host` to launch a helper with a cleared environment, verify its readiness handshake, and expose framed stdin/stdout pipes with a 256 KiB frame limit and write backpressure.
- Support startup cancellation and process-group cleanup, retaining exit status and the last 16 KiB of stderr while omitting raw diagnostics from `Debug` output.
- Extend the Bazel crate macro to support test-only binaries and fixture entry points outside `src/`.

## Testing

Add process integration tests for framed communication, startup cancellation, helper and descendant cleanup, repeated close calls, and bounded diagnostics from startup and runtime failures.

GitOrigin-RevId: ed539e7899af06ee83a0d8c2d0ea8cec10f19afb
This commit is contained in:
Joe Savona
2026-10-26 22:11:01 +00:00
committed by copyberry
parent b46a3801e4
commit 16effdfc8c
10 changed files with 652 additions and 1 deletions
+11
View File
@@ -0,0 +1,11 @@
//! Bounded IPC and lifetime management for the dedicated V8 plugin process.
pub mod framing;
mod process;
pub use process::PluginExit;
pub use process::PluginProcess;
pub use process::PluginProcessError;
pub const HELPER_ARGUMENT: &str = "--codex-ui-plugin-process";
pub const READY: &[u8] = b"codex-ui-plugin-process/2";