Files
codex/codex-rs/code-mode/src/disabled.rs
T
Channing Conger 336dc645fb Use gRPC for all code-mode host connections (#62476)
## What changed

Remove the legacy framed stdio protocol and its client and server.
Local Codex launches the standalone host with `--listen grpc+stdio://`,
which is also the host's default. The `stdio` and `stdio://` aliases
now select gRPC over stdio. The `features.code_mode_host_grpc` setting
is deprecated and ignored.

Carry execution trace context into gRPC tool callbacks and
notifications. Reject oversized execute requests before sending them
so an encoding failure does not appear as a connection reset.

## Testing

Exercise gRPC callback cancellation, trace context across overlapping
yielded cells, and isolation of tool preload failures between sessions.
Check that both values of the deprecated feature setting are ignored.

GitOrigin-RevId: f5faff3901dc60958627f677f50cfad834291b69
2026-11-19 09:37:29 +00:00

27 lines
905 B
Rust

//! Unavailable provider used when the code-mode host is disabled.
use codex_code_mode_protocol::CodeModeSessionCellExecutionLimits;
use codex_code_mode_protocol::CodeModeSessionProvider;
use codex_code_mode_protocol::CodeModeSessionProviderFuture;
/// Rejects code-mode sessions when the standalone host is disabled.
#[derive(Default)]
pub struct DisabledCodeModeSessionProvider;
impl CodeModeSessionProvider for DisabledCodeModeSessionProvider {
fn availability(&self) -> Result<(), String> {
Err("code-mode host is disabled".to_string())
}
fn create_session(&self) -> CodeModeSessionProviderFuture<'_> {
Box::pin(async { Err("code-mode host is disabled".to_string()) })
}
fn create_session_with_limits<'a>(
&'a self,
_limits: CodeModeSessionCellExecutionLimits,
) -> CodeModeSessionProviderFuture<'a> {
self.create_session()
}
}