mirror of
https://github.com/openai/codex.git
synced 2026-11-02 19:43:24 +00:00
feat: exec-command-mcp
This commit is contained in:
@@ -480,6 +480,7 @@ impl Session {
|
||||
sandbox_policy.clone(),
|
||||
config.include_plan_tool,
|
||||
config.include_apply_patch_tool,
|
||||
config.experimental_disable_built_in_shell_tool,
|
||||
),
|
||||
user_instructions,
|
||||
base_instructions,
|
||||
@@ -1049,6 +1050,7 @@ async fn submission_loop(
|
||||
new_sandbox_policy.clone(),
|
||||
config.include_plan_tool,
|
||||
config.include_apply_patch_tool,
|
||||
config.experimental_disable_built_in_shell_tool,
|
||||
);
|
||||
|
||||
let new_turn_context = TurnContext {
|
||||
@@ -1125,6 +1127,7 @@ async fn submission_loop(
|
||||
sandbox_policy.clone(),
|
||||
config.include_plan_tool,
|
||||
config.include_apply_patch_tool,
|
||||
config.experimental_disable_built_in_shell_tool,
|
||||
),
|
||||
user_instructions: turn_context.user_instructions.clone(),
|
||||
base_instructions: turn_context.base_instructions.clone(),
|
||||
|
||||
@@ -162,6 +162,8 @@ pub struct Config {
|
||||
/// model family's default preference.
|
||||
pub include_apply_patch_tool: bool,
|
||||
|
||||
pub experimental_disable_built_in_shell_tool: bool,
|
||||
|
||||
/// The value for the `originator` header included with Responses API requests.
|
||||
pub internal_originator: Option<String>,
|
||||
|
||||
@@ -409,6 +411,8 @@ pub struct ConfigToml {
|
||||
/// Experimental path to a file whose contents replace the built-in BASE_INSTRUCTIONS.
|
||||
pub experimental_instructions_file: Option<PathBuf>,
|
||||
|
||||
pub experimental_disable_built_in_shell_tool: Option<bool>,
|
||||
|
||||
/// The value for the `originator` header included with Responses API requests.
|
||||
pub internal_originator: Option<String>,
|
||||
|
||||
@@ -678,6 +682,9 @@ impl Config {
|
||||
experimental_resume,
|
||||
include_plan_tool: include_plan_tool.unwrap_or(false),
|
||||
include_apply_patch_tool: include_apply_patch_tool_val,
|
||||
experimental_disable_built_in_shell_tool: cfg
|
||||
.experimental_disable_built_in_shell_tool
|
||||
.unwrap_or(false),
|
||||
internal_originator: cfg.internal_originator,
|
||||
preferred_auth_method: cfg.preferred_auth_method.unwrap_or(AuthMode::ChatGPT),
|
||||
};
|
||||
@@ -1043,6 +1050,7 @@ disable_response_storage = true
|
||||
base_instructions: None,
|
||||
include_plan_tool: false,
|
||||
include_apply_patch_tool: false,
|
||||
experimental_disable_built_in_shell_tool: false,
|
||||
internal_originator: None,
|
||||
preferred_auth_method: AuthMode::ChatGPT,
|
||||
},
|
||||
@@ -1096,6 +1104,7 @@ disable_response_storage = true
|
||||
base_instructions: None,
|
||||
include_plan_tool: false,
|
||||
include_apply_patch_tool: false,
|
||||
experimental_disable_built_in_shell_tool: false,
|
||||
internal_originator: None,
|
||||
preferred_auth_method: AuthMode::ChatGPT,
|
||||
};
|
||||
@@ -1164,6 +1173,7 @@ disable_response_storage = true
|
||||
base_instructions: None,
|
||||
include_plan_tool: false,
|
||||
include_apply_patch_tool: false,
|
||||
experimental_disable_built_in_shell_tool: false,
|
||||
internal_originator: None,
|
||||
preferred_auth_method: AuthMode::ChatGPT,
|
||||
};
|
||||
|
||||
@@ -37,6 +37,7 @@ pub enum ConfigShellToolType {
|
||||
DefaultShell,
|
||||
ShellWithRequest { sandbox_policy: SandboxPolicy },
|
||||
LocalShell,
|
||||
NoBuiltInShellTool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
@@ -53,8 +54,11 @@ impl ToolsConfig {
|
||||
sandbox_policy: SandboxPolicy,
|
||||
include_plan_tool: bool,
|
||||
include_apply_patch_tool: bool,
|
||||
experimental_disable_built_in_shell_tool: bool,
|
||||
) -> Self {
|
||||
let mut shell_type = if model_family.uses_local_shell_tool {
|
||||
let mut shell_type = if experimental_disable_built_in_shell_tool {
|
||||
ConfigShellToolType::NoBuiltInShellTool
|
||||
} else if model_family.uses_local_shell_tool {
|
||||
ConfigShellToolType::LocalShell
|
||||
} else {
|
||||
ConfigShellToolType::DefaultShell
|
||||
@@ -533,6 +537,9 @@ pub(crate) fn get_openai_tools(
|
||||
ConfigShellToolType::LocalShell => {
|
||||
tools.push(OpenAiTool::LocalShell {});
|
||||
}
|
||||
ConfigShellToolType::NoBuiltInShellTool => {
|
||||
// Do not add a shell tool
|
||||
}
|
||||
}
|
||||
|
||||
if config.plan_tool {
|
||||
@@ -597,6 +604,7 @@ mod tests {
|
||||
SandboxPolicy::ReadOnly,
|
||||
true,
|
||||
model_family.uses_apply_patch_tool,
|
||||
/*experimental_disable_built_in_shell_tool*/ false,
|
||||
);
|
||||
let tools = get_openai_tools(&config, Some(HashMap::new()));
|
||||
|
||||
@@ -612,6 +620,7 @@ mod tests {
|
||||
SandboxPolicy::ReadOnly,
|
||||
true,
|
||||
model_family.uses_apply_patch_tool,
|
||||
/*experimental_disable_built_in_shell_tool*/ false,
|
||||
);
|
||||
let tools = get_openai_tools(&config, Some(HashMap::new()));
|
||||
|
||||
@@ -627,6 +636,7 @@ mod tests {
|
||||
SandboxPolicy::ReadOnly,
|
||||
false,
|
||||
model_family.uses_apply_patch_tool,
|
||||
/*experimental_disable_built_in_shell_tool*/ false,
|
||||
);
|
||||
let tools = get_openai_tools(
|
||||
&config,
|
||||
@@ -721,6 +731,7 @@ mod tests {
|
||||
SandboxPolicy::ReadOnly,
|
||||
false,
|
||||
model_family.uses_apply_patch_tool,
|
||||
/*experimental_disable_built_in_shell_tool*/ false,
|
||||
);
|
||||
|
||||
let tools = get_openai_tools(
|
||||
@@ -777,6 +788,7 @@ mod tests {
|
||||
SandboxPolicy::ReadOnly,
|
||||
false,
|
||||
model_family.uses_apply_patch_tool,
|
||||
/*experimental_disable_built_in_shell_tool*/ false,
|
||||
);
|
||||
|
||||
let tools = get_openai_tools(
|
||||
@@ -828,6 +840,7 @@ mod tests {
|
||||
SandboxPolicy::ReadOnly,
|
||||
false,
|
||||
model_family.uses_apply_patch_tool,
|
||||
/*experimental_disable_built_in_shell_tool*/ false,
|
||||
);
|
||||
|
||||
let tools = get_openai_tools(
|
||||
@@ -882,6 +895,7 @@ mod tests {
|
||||
SandboxPolicy::ReadOnly,
|
||||
false,
|
||||
model_family.uses_apply_patch_tool,
|
||||
/*experimental_disable_built_in_shell_tool*/ false,
|
||||
);
|
||||
|
||||
let tools = get_openai_tools(
|
||||
|
||||
Reference in New Issue
Block a user