From 251b04ec2dc7f161e8e976953a26477ca57e0eeb Mon Sep 17 00:00:00 2001 From: weishu Date: Tue, 13 Jan 2026 10:58:01 +0800 Subject: [PATCH] fix: use message field for Codex permission card subtitle Codex elicitation requests from MCP use the 'message' field (from ElicitRequest schema), not 'command' or 'cwd'. Update the permission handler to extract and pass this field, and display it as the card subtitle with fallback to command. --- cli/src/codex/codexMcpClient.ts | 5 +++-- cli/src/codex/codexRemoteLauncher.ts | 2 ++ web/src/components/ToolCard/knownTools.tsx | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cli/src/codex/codexMcpClient.ts b/cli/src/codex/codexMcpClient.ts index 23e719ea..8352704a 100644 --- a/cli/src/codex/codexMcpClient.ts +++ b/cli/src/codex/codexMcpClient.ts @@ -262,8 +262,9 @@ export class CodexMcpClient { toolCallId, toolName, { - command: command ?? [], - cwd: cwd ?? '' + message: typeof params.message === 'string' ? params.message : undefined, + command: command ?? undefined, + cwd: cwd ?? undefined } ); diff --git a/cli/src/codex/codexRemoteLauncher.ts b/cli/src/codex/codexRemoteLauncher.ts index 8e8b68a8..7c37c786 100644 --- a/cli/src/codex/codexRemoteLauncher.ts +++ b/cli/src/codex/codexRemoteLauncher.ts @@ -314,6 +314,7 @@ class CodexRemoteLauncher extends RemoteLauncherBase { const permissionHandler = new CodexPermissionHandler(session.client, { onRequest: ({ id, toolName, input }) => { const inputRecord = input && typeof input === 'object' ? input as Record : {}; + const message = typeof inputRecord.message === 'string' ? inputRecord.message : undefined; const rawCommand = inputRecord.command; const command = Array.isArray(rawCommand) ? rawCommand.filter((part): part is string => typeof part === 'string').join(' ') @@ -329,6 +330,7 @@ class CodexRemoteLauncher extends RemoteLauncherBase { callId: id, input: { tool: toolName, + message, command, cwd }, diff --git a/web/src/components/ToolCard/knownTools.tsx b/web/src/components/ToolCard/knownTools.tsx index 3117ad39..8d07e5d7 100644 --- a/web/src/components/ToolCard/knownTools.tsx +++ b/web/src/components/ToolCard/knownTools.tsx @@ -143,7 +143,7 @@ export const knownTools: Record getInputStringAny(opts.input, ['command']) ?? null, + subtitle: (opts) => getInputStringAny(opts.input, ['message', 'command']) ?? null, minimal: true }, shell_command: {