Lightweight coding agent that runs in your terminal
Rust
Use the app-server default output cap for TUI workspace commands (#50477)
Eric Traut6c15cc4aaf42
diff --git a/codex-rs/tui/src/get_git_diff.rs b/codex-rs/tui/src/get_git_diff.rsindex c23dee689b..b3893cf493 100644--- a/codex-rs/tui/src/get_git_diff.rs+++ b/codex-rs/tui/src/get_git_diff.rs@@ -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);diff --git a/codex-rs/tui/src/workspace_command.rs b/codex-rs/tui/src/workspace_command.rsindex 02495d66dd..6d3c030603 100644--- a/codex-rs/tui/src/workspace_command.rs+++ b/codex-rs/tui/src/workspace_command.rs@@ -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),