mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
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.
This commit is contained in:
@@ -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
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -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<string, unknown> : {};
|
||||
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
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user