Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Clarify exec yield timing on Windows (#33150)

iceweasel-oai4da39dbea7a8
diff --git a/codex-rs/core/src/tools/handlers/shell_spec.rs b/codex-rs/core/src/tools/handlers/shell_spec.rs
index 3fb563b8d9..69a7946523 100644
--- a/codex-rs/core/src/tools/handlers/shell_spec.rs
+++ b/codex-rs/core/src/tools/handlers/shell_spec.rs
@@ -23,6 +23,11 @@ pub(crate) fn create_exec_command_tool_with_environment_id(
include_environment_id: bool,
include_shell_parameter: bool,
) -> ToolSpec {
+ let yield_time_ms_description = if cfg!(windows) {
+ "Maximum time to wait before returning a session ID for a still-running command. Commands that finish sooner return immediately. For ordinary commands, omit this parameter to use the 10000 ms default. Set a shorter value only when intentionally starting a long-lived or interactive process and you want a session ID promptly."
+ } else {
+ "Wait before yielding output. Defaults to 10000 ms; effective range is 250-30000 ms."
+ };
let mut properties = BTreeMap::from([
(
"cmd".to_string(),
@@ -44,9 +49,7 @@ pub(crate) fn create_exec_command_tool_with_environment_id(
),
(
"yield_time_ms".to_string(),
- JsonSchema::number(Some(
- "Wait before yielding output. Defaults to 10000 ms; effective range is 250-30000 ms.".to_string(),
- )),
+ JsonSchema::number(Some(yield_time_ms_description.to_string())),
),
(
"max_output_tokens".to_string(),
diff --git a/codex-rs/core/src/tools/handlers/shell_spec_tests.rs b/codex-rs/core/src/tools/handlers/shell_spec_tests.rs
index b7bbfa54a1..cb73d45421 100644
--- a/codex-rs/core/src/tools/handlers/shell_spec_tests.rs
+++ b/codex-rs/core/src/tools/handlers/shell_spec_tests.rs
@@ -29,6 +29,11 @@ fn exec_command_tool_matches_expected_spec() {
"Runs a command in a PTY, returning output or a session ID for ongoing interaction."
.to_string()
};
+ let yield_time_ms_description = if cfg!(windows) {
+ "Maximum time to wait before returning a session ID for a still-running command. Commands that finish sooner return immediately. For ordinary commands, omit this parameter to use the 10000 ms default. Set a shorter value only when intentionally starting a long-lived or interactive process and you want a session ID promptly."
+ } else {
+ "Wait before yielding output. Defaults to 10000 ms; effective range is 250-30000 ms."
+ };
let mut properties = BTreeMap::from([
(
@@ -57,9 +62,7 @@ fn exec_command_tool_matches_expected_spec() {
),
(
"yield_time_ms".to_string(),
- JsonSchema::number(Some(
- "Wait before yielding output. Defaults to 10000 ms; effective range is 250-30000 ms.".to_string(),
- )),
+ JsonSchema::number(Some(yield_time_ms_description.to_string())),
),
(
"max_output_tokens".to_string(),