mirror of
https://github.com/openai/codex.git
synced 2026-08-23 13:09:46 +00:00
Standardize shell execution on unified exec (#39757)
## What changed - Remove the legacy `shell_command` handler and runtime, leaving `exec_command` and `write_stdin` as the shell execution tools. - Treat legacy `shell_command` model metadata as `unified_exec`, and normalize legacy user opt-outs so they do not disable command execution. Managed feature requirements and `shell_tool` can still disable it. - Preserve shell approvals, sandboxing, zsh-fork support, and output truncation through the unified execution path. ## Testing - Cover legacy configuration and model-metadata compatibility. - Exercise unified shell execution, approvals, truncation, and `apply_patch` serialization across the app-server and core test suites. GitOrigin-RevId: 5c2fd6164fc3519cdae4944cb9db276b8467311c
This commit is contained in:
@@ -4,7 +4,7 @@ import {
|
||||
assistantMessage,
|
||||
responseCompleted,
|
||||
responseStarted,
|
||||
shell_call as shellCall,
|
||||
exec_command_call as execCommandCall,
|
||||
sse,
|
||||
SseResponseBody,
|
||||
startResponsesTestProxy,
|
||||
@@ -13,7 +13,7 @@ import { createMockClient } from "./testCodex";
|
||||
|
||||
function* infiniteShellCall(): Generator<SseResponseBody> {
|
||||
while (true) {
|
||||
yield sse(responseStarted(), shellCall(), responseCompleted());
|
||||
yield sse(responseStarted(), execCommandCall(), responseCompleted());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -180,16 +180,16 @@ export function assistantMessage(text: string, itemId: string = DEFAULT_MESSAGE_
|
||||
};
|
||||
}
|
||||
|
||||
export function shell_call(): SseEvent {
|
||||
export function exec_command_call(): SseEvent {
|
||||
return {
|
||||
type: "response.output_item.done",
|
||||
item: {
|
||||
type: "function_call",
|
||||
call_id: `call_id${Math.random().toString(36).slice(2)}`,
|
||||
name: "shell_command",
|
||||
name: "exec_command",
|
||||
arguments: JSON.stringify({
|
||||
command: "echo 'Hello, world!'",
|
||||
timeout_ms: 100,
|
||||
cmd: "echo 'Hello, world!'",
|
||||
yield_time_ms: 100,
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user