mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
Rename exec_wait tool to wait (#14983)
Summary - document that code mode only exposes `exec` and the renamed `wait` tool - update code mode tool spec and descriptions to match the new tool name - rename tests and helper references from `exec_wait` to `wait` Testing - Not run (not requested)
This commit is contained in:
committed by
GitHub
Unverified
parent
2cc4ee413f
commit
ee756eb80f
@@ -87,7 +87,7 @@ pub enum Feature {
|
||||
JsRepl,
|
||||
/// Enable a minimal JavaScript mode backed by Node's built-in vm runtime.
|
||||
CodeMode,
|
||||
/// Restrict model-visible tools to code mode entrypoints (`exec`, `exec_wait`).
|
||||
/// Restrict model-visible tools to code mode entrypoints (`exec`, `wait`).
|
||||
CodeModeOnly,
|
||||
/// Only expose js_repl tools directly to the model.
|
||||
JsReplToolsOnly,
|
||||
|
||||
@@ -34,10 +34,11 @@ const CODE_MODE_BRIDGE_SOURCE: &str = include_str!("bridge.js");
|
||||
const CODE_MODE_DESCRIPTION_TEMPLATE: &str = include_str!("description.md");
|
||||
const CODE_MODE_WAIT_DESCRIPTION_TEMPLATE: &str = include_str!("wait_description.md");
|
||||
const CODE_MODE_PRAGMA_PREFIX: &str = "// @exec:";
|
||||
const CODE_MODE_ONLY_PREFACE: &str = "Use `exec/exec_wait` tool to run all other tools, do not attempt to use any other tools directly";
|
||||
const CODE_MODE_ONLY_PREFACE: &str =
|
||||
"Use `exec/wait` tool to run all other tools, do not attempt to use any other tools directly";
|
||||
|
||||
pub(crate) const PUBLIC_TOOL_NAME: &str = "exec";
|
||||
pub(crate) const WAIT_TOOL_NAME: &str = "exec_wait";
|
||||
pub(crate) const WAIT_TOOL_NAME: &str = "wait";
|
||||
|
||||
pub(crate) fn is_code_mode_nested_tool(tool_name: &str) -> bool {
|
||||
tool_name != PUBLIC_TOOL_NAME && tool_name != WAIT_TOOL_NAME
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
- Use `exec_wait` only after `exec` returns `Script running with cell ID ...`.
|
||||
- Use `wait` only after `exec` returns `Script running with cell ID ...`.
|
||||
- `cell_id` identifies the running `exec` cell to resume.
|
||||
- `yield_time_ms` controls how long to wait for more output before yielding again. If omitted, `exec_wait` uses its default wait timeout.
|
||||
- `yield_time_ms` controls how long to wait for more output before yielding again. If omitted, `wait` uses its default wait timeout.
|
||||
- `max_tokens` limits how much new output this wait call returns.
|
||||
- `terminate: true` stops the running cell instead of waiting for more output.
|
||||
- `exec_wait` returns only the new output since the last yield, or the final completion or termination result for that cell.
|
||||
- If the cell is still running, `exec_wait` may yield again with the same `cell_id`.
|
||||
- If the cell has already finished, `exec_wait` returns the completed result and closes the cell.
|
||||
- `wait` returns only the new output since the last yield, or the final completion or termination result for that cell.
|
||||
- If the cell is still running, `wait` may yield again with the same `cell_id`.
|
||||
- If the cell has already finished, `wait` returns the completed result and closes the cell.
|
||||
|
||||
@@ -772,7 +772,7 @@ fn create_write_stdin_tool() -> ToolSpec {
|
||||
})
|
||||
}
|
||||
|
||||
fn create_exec_wait_tool() -> ToolSpec {
|
||||
fn create_wait_tool() -> ToolSpec {
|
||||
let properties = BTreeMap::from([
|
||||
(
|
||||
"cell_id".to_string(),
|
||||
@@ -2597,7 +2597,7 @@ pub(crate) fn build_specs_with_discoverable_tools(
|
||||
builder.register_handler(PUBLIC_TOOL_NAME, code_mode_handler);
|
||||
push_tool_spec(
|
||||
&mut builder,
|
||||
create_exec_wait_tool(),
|
||||
create_wait_tool(),
|
||||
/*supports_parallel_tool_calls*/ false,
|
||||
config.code_mode_enabled,
|
||||
);
|
||||
|
||||
@@ -2693,7 +2693,7 @@ fn code_mode_only_restricts_model_tools_to_exec_tools() {
|
||||
"gpt-5.1-codex",
|
||||
&features,
|
||||
Some(WebSearchMode::Live),
|
||||
&["exec", "exec_wait"],
|
||||
&["exec", "wait"],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2724,7 +2724,7 @@ fn code_mode_only_exec_description_includes_full_nested_tool_details() {
|
||||
assert!(!description.contains("Enabled nested tools:"));
|
||||
assert!(!description.contains("Nested tool reference:"));
|
||||
assert!(description.starts_with(
|
||||
"Use `exec/exec_wait` tool to run all other tools, do not attempt to use any other tools directly"
|
||||
"Use `exec/wait` tool to run all other tools, do not attempt to use any other tools directly"
|
||||
));
|
||||
assert!(description.contains("### `update_plan` (`update_plan`)"));
|
||||
assert!(description.contains("### `view_image` (`view_image`)"));
|
||||
@@ -2754,7 +2754,7 @@ fn code_mode_exec_description_omits_nested_tool_details_when_not_code_mode_only(
|
||||
};
|
||||
|
||||
assert!(!description.starts_with(
|
||||
"Use `exec/exec_wait` tool to run all other tools, do not attempt to use any other tools directly"
|
||||
"Use `exec/wait` tool to run all other tools, do not attempt to use any other tools directly"
|
||||
));
|
||||
assert!(!description.contains("### `update_plan` (`update_plan`)"));
|
||||
assert!(!description.contains("### `view_image` (`view_image`)"));
|
||||
|
||||
Reference in New Issue
Block a user