mirror of
https://github.com/openai/codex.git
synced 2026-11-17 14:58:36 +00:00
Restrict shell_command to a single local environment (#36329)
## What changed - Register the legacy `shell_command` handler only when exactly one local environment is available, including when unified exec keeps it hidden for compatibility. - Reserve the unnamespaced `shell_command` name so external tools cannot claim it when the built-in handler is unavailable. Namespaced tools with that name remain supported. ## Testing - Cover remote and multiple-environment tool plans, unified exec routing, and external tool registration for reserved and namespaced variants. GitOrigin-RevId: 93834539b31ac8a7fea072bfa4de792bcc3e053b
This commit is contained in:
1 parent
66d63afd18
commit
ef293f7ac9
5 files changed
+137
-11
No files matched your search
@@ -384,7 +384,13 @@ impl ToolRegistry {
|
||||
}
|
||||
|
||||
pub(crate) fn register_external(&mut self, runtime: Arc<dyn CoreToolRuntime>) -> bool {
|
||||
match self.tools.entry(runtime.tool_name()) {
|
||||
let tool_name = runtime.tool_name();
|
||||
if tool_name.namespace.is_none() && tool_name.name == "shell_command" {
|
||||
tracing::warn!(tool_name = %tool_name, "skipping external tool with reserved name");
|
||||
return false;
|
||||
}
|
||||
|
||||
match self.tools.entry(tool_name) {
|
||||
Entry::Vacant(entry) => {
|
||||
entry.insert(runtime);
|
||||
true
|
||||
|
||||
Reference in new issue
Block a user