466
}
467
if (params.item.type === 'commandExecution') {
469
>
// fresh toolCallId; the `commandExecution` item id only
470
>
// disambiguates the codex side.
471
>
const toolCallId = generateUuid();
472
>
state.itemToToolCall.set(params.item.id, {
473
>
toolCallId,
474
>
turnId: params.turnId,
475
>
toolName: 'shell',
476
>
output: '',
477
>
});
478
>
const command = unwrapShellInvocation(params.item.command ?? '');
479
>
return [
480
>
{
481
>
type: ActionType.ChatToolCallStart,
482
>
turnId: params.turnId,
483
>
toolCallId,
484
>
toolName: 'shell',
485
>
displayName: 'Run shell command',
486
>
_meta: toToolCallMeta({ toolKind: 'terminal' }),
487
>
},
488
>
{
489
>
type: ActionType.ChatToolCallDelta,
490
>
turnId: params.turnId,
491
>
toolCallId,
492
>
content: command,
493
>
},
494
>
{
495
>
type: ActionType.ChatToolCallReady,
496
>
turnId: params.turnId,
497
>
toolCallId,
498
>
invocationMessage: command,
499
>
toolInput: command,
500
>
confirmed: ToolCallConfirmationReason.NotNeeded,
501
>
_meta: toToolCallMeta({ toolKind: 'terminal' }),
502
>
},
503
>
];
504
>
}
505
if (params.item.type === 'webSearch') {
506
const toolCallId = generateUuid();