mirror of
https://github.com/openai/codex.git
synced 2026-10-18 17:18:52 +00:00
Use the app-server default output cap for TUI workspace commands (#50477)
## What changed Remove the fixed 64 KiB output cap from `WorkspaceCommand` and send `output_bytes_cap: None` in `command/exec` requests so bounded commands use the app-server default. Preserve `disable_output_cap` for commands that need uncapped output, including Git diffs. GitOrigin-RevId: 6f2ed0d127d9ff2317670851894ae4988f7c7508
This commit is contained in:
@@ -837,7 +837,6 @@ mod tests {
|
||||
) {
|
||||
assert_eq!(command.env, HashMap::new());
|
||||
assert_eq!(command.timeout, Duration::from_secs(/*secs*/ 5));
|
||||
assert_eq!(command.output_bytes_cap, 64 * 1024);
|
||||
assert_eq!(command.disable_output_cap, false);
|
||||
} else {
|
||||
assert_eq!(command.timeout, DIFF_COMMAND_TIMEOUT);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//!
|
||||
//! This module is the TUI boundary for non-interactive commands that need to run wherever
|
||||
//! the active workspace lives. Callers describe a command in terms of argv, cwd, environment
|
||||
//! overrides, timeout, and output cap; the runner translates that request to app-server
|
||||
//! overrides and timeout; the runner translates that request to app-server
|
||||
//! `command/exec`. Keeping this as a TUI-local abstraction lets status surfaces avoid knowing
|
||||
//! whether the current app-server is embedded or remote.
|
||||
//!
|
||||
@@ -43,8 +43,6 @@ pub(crate) struct WorkspaceCommand {
|
||||
pub(crate) env: HashMap<String, Option<String>>,
|
||||
/// Maximum wall-clock duration before app-server cancels the command.
|
||||
pub(crate) timeout: Duration,
|
||||
/// Maximum captured stdout/stderr bytes returned by app-server.
|
||||
pub(crate) output_bytes_cap: usize,
|
||||
/// Whether app-server should return uncapped stdout/stderr.
|
||||
pub(crate) disable_output_cap: bool,
|
||||
}
|
||||
@@ -57,7 +55,6 @@ impl WorkspaceCommand {
|
||||
cwd: None,
|
||||
env: HashMap::new(),
|
||||
timeout: Duration::from_secs(/*secs*/ 5),
|
||||
output_bytes_cap: 64 * 1024,
|
||||
disable_output_cap: false,
|
||||
}
|
||||
}
|
||||
@@ -164,9 +161,10 @@ impl AppServerWorkspaceCommandRunner {
|
||||
impl WorkspaceCommandExecutor for AppServerWorkspaceCommandRunner {
|
||||
/// Sends the command as a one-off app-server `command/exec` request.
|
||||
///
|
||||
/// The request is non-tty, does not stream stdin/stdout/stderr, and uses the caller's timeout
|
||||
/// and output cap. It leaves sandbox and permission profile selection to app-server so the same
|
||||
/// runner follows the active session's embedded or remote execution policy.
|
||||
/// The request is non-tty, does not stream stdin/stdout/stderr, and uses the caller's timeout.
|
||||
/// Bounded commands use app-server's default output cap. It leaves sandbox and permission
|
||||
/// profile selection to app-server so the same runner follows the active session's embedded or
|
||||
/// remote execution policy.
|
||||
fn run(
|
||||
&self,
|
||||
command: WorkspaceCommand,
|
||||
@@ -190,8 +188,7 @@ impl WorkspaceCommandExecutor for AppServerWorkspaceCommandRunner {
|
||||
tty: false,
|
||||
stream_stdin: false,
|
||||
stream_stdout_stderr: false,
|
||||
output_bytes_cap: (!command.disable_output_cap)
|
||||
.then_some(command.output_bytes_cap),
|
||||
output_bytes_cap: None,
|
||||
disable_output_cap: command.disable_output_cap,
|
||||
disable_timeout: false,
|
||||
timeout_ms: Some(timeout_ms),
|
||||
|
||||
Reference in New Issue
Block a user