Files
codex/codex-rs/code-mode/src/lib.rs
T
Charlie Marsh 714bc44f0d Reap idle local code-mode hosts after five seconds (#63537)
## Why

The local code-mode host could stay running after its last session
closed. A short grace period allows nearby sessions to reuse the same
process while releasing it after sustained inactivity.

## What changed

Keep the host active while session leases or operation RPCs are in
flight. Once they drain, start a five-second idle timer. New activity
cancels retirement and starts a fresh grace period when it drains.
Process metrics only sample an existing host and leave the idle timer
untouched. Opening a session after retirement starts a fresh host.

## Testing

Add a lifecycle test that covers overlapping sessions, reuse during the
grace period, retirement despite metrics polling, and startup on the
next session.

GitOrigin-RevId: 2ebf7f7b3b3bf2d5a602b0e5b9085195eee13446
2026-11-24 04:29:16 +00:00

10 lines
270 B
Rust

mod disabled;
mod grpc_session;
mod tool_catalog;
pub use codex_code_mode_protocol::*;
pub use disabled::DisabledCodeModeSessionProvider;
pub use grpc_session::GrpcCallKind;
pub use grpc_session::GrpcCodeModeSessionProvider;
pub use grpc_session::GrpcSessionOpenError;