From ac31c431cb5d8cdeea15127c99741b84a78c02ec Mon Sep 17 00:00:00 2001 From: Faolain Date: Tue, 19 Aug 2025 01:39:24 -0400 Subject: [PATCH] feat: add reasoning capability as optional parameter --- index.ts | 16 ++++++++++++++++ package-lock.json | 6 +++--- package.json | 2 +- tests/test-dev.js | 1 + 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/index.ts b/index.ts index ff3f031..08ce0eb 100644 --- a/index.ts +++ b/index.ts @@ -105,6 +105,12 @@ export const ChatParametersSchema = z.object({ .string() .optional() .describe("The working directory for the task execution."), + reasoningEffort: z + .enum(["low", "medium", "high", "none"]) + .optional() + .describe( + 'Model reasoning effort ("low" | "medium" | "high" | "none"). Passed via --config model_reasoning_effort.', + ), }); // Tool execution functions @@ -142,6 +148,12 @@ export async function chat(args: unknown) { break; } + // reasoning effort -> --config model_reasoning_effort= + if (parsedArgs.reasoningEffort) { + // `--config` has short form `-c`; either works + cliArgs.push("-c", `model_reasoning_effort=${parsedArgs.reasoningEffort}`); + } + // Always use exec mode for non-interactive execution cliArgs.push("exec"); @@ -206,6 +218,10 @@ async function main() { .string() .optional() .describe("The working directory for the task execution."), + reasoningEffort: z + .enum(["low", "medium", "high", "none"]) + .optional() + .describe("Passes through as --config model_reasoning_effort."), }, }, async (args) => { diff --git a/package-lock.json b/package-lock.json index 9e2ea47..fe6281d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "mcp-codex-cli", - "version": "0.1.3", + "version": "0.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "mcp-codex-cli", - "version": "0.1.3", + "version": "0.2.0", "license": "MIT", "dependencies": { "@modelcontextprotocol/sdk": "^1.13.1", @@ -1796,4 +1796,4 @@ } } } -} +} \ No newline at end of file diff --git a/package.json b/package.json index 8ab826e..b3cf185 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mcp-codex-cli", - "version": "1.0.0", + "version": "0.2.0", "description": "MCP server wrapper for OpenAI's Codex CLI", "author": "suwa-sh", "license": "MIT", diff --git a/tests/test-dev.js b/tests/test-dev.js index eebab14..2bdcd75 100755 --- a/tests/test-dev.js +++ b/tests/test-dev.js @@ -13,6 +13,7 @@ async function testChat() { "typescriptで、Hello World と表示するシンプルな関数を作成してください", approvalLevel: "auto-edit", model: "gpt-5", + reasoningEffort: "high", }, true, );