From d78f77edb707a1a8147cc6b28a677ec553d83182 Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 23 Apr 2025 00:32:36 +1000 Subject: [PATCH] =?UTF-8?q?fix(agent-loop):=20update=20required=20properti?= =?UTF-8?q?es=20to=20include=20workdir=20and=20ti=E2=80=A6=20(#530)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without this I get an issue running codex it in a docker container. I receive: ``` { "answer": "{\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"\\\"Say hello world\\\"\"}],\"type\":\"message\"}\n{\"id\":\"error-1745325184914\",\"type\":\"message\",\"role\":\"system\",\"content\":[{\"type\":\"input_text\",\"text\":\"⚠️ OpenAI rejected the request (request ID: req_f9027b59ebbce00061e9cd2dbb2d529a). Error details: Status: 400, Code: invalid_function_parameters, Type: invalid_request_error, Message: 400 Invalid schema for function 'shell': In context=(), 'required' is required to be supplied and to be an array including every key in properties. Missing 'workdir'.. Please verify your settings and try again.\"}]}\n" } ``` This fix makes it work. --- codex-cli/src/utils/agent/agent-loop.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codex-cli/src/utils/agent/agent-loop.ts b/codex-cli/src/utils/agent/agent-loop.ts index 5cde3b16..3d34dee3 100644 --- a/codex-cli/src/utils/agent/agent-loop.ts +++ b/codex-cli/src/utils/agent/agent-loop.ts @@ -649,7 +649,7 @@ export class AgentLoop { "The maximum time to wait for the command to complete in milliseconds.", }, }, - required: ["command"], + required: ["command", "workdir", "timeout"], additionalProperties: false, }, },