mirror of
https://github.com/openai/codex.git
synced 2026-10-31 19:28:49 +00:00
Add a feature flag for code-mode host output truncation (#58159)
## What changed Add the disabled-by-default `code_mode_host_output_truncation` feature flag. When enabled, Core requests server-side output truncation for its built-in code-mode session providers over both stdio and gRPC. Injected providers retain control of their session settings, and explicit session options pass through unchanged. ## Testing Add coverage for both transports verifying that the host's output-limit notice survives a zero-token observation budget. Extend the shared-provider test to exercise an injected provider with the new flag enabled. GitOrigin-RevId: edbb65e930bf544e3d2f8384767037a6fb82d451
This commit is contained in:
@@ -756,16 +756,25 @@ impl ThreadManager {
|
||||
config: &Config,
|
||||
host_program: PathBuf,
|
||||
) -> Arc<dyn CodeModeSessionProvider> {
|
||||
if config.features.enabled(Feature::CodeModeHostGrpc) {
|
||||
Arc::new(
|
||||
let provider: Arc<dyn CodeModeSessionProvider> =
|
||||
if config.features.enabled(Feature::CodeModeHostGrpc) {
|
||||
Arc::new(
|
||||
crate::code_mode_host::ProcessOwnedGrpcCodeModeSessionProvider::with_host_program(
|
||||
host_program,
|
||||
),
|
||||
)
|
||||
} else {
|
||||
Arc::new(ProcessOwnedCodeModeSessionProvider::with_host_program(
|
||||
host_program,
|
||||
))
|
||||
};
|
||||
if config
|
||||
.features
|
||||
.enabled(Feature::CodeModeHostOutputTruncation)
|
||||
{
|
||||
Arc::new(crate::code_mode_host::LocalServerOutputProvider { inner: provider })
|
||||
} else {
|
||||
Arc::new(ProcessOwnedCodeModeSessionProvider::with_host_program(
|
||||
host_program,
|
||||
))
|
||||
provider
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user