941
}
942
if (params.item.type === 'dynamicToolCall') {
944
>
const output = dynamicToolOutput(params.item.contentItems) || entry.output;
945
>
const content = output ? [{ type: ToolResultContentType.Text as const, text: output }] : undefined;
946
>
const serverPastTense = success ? getServerToolDisplay(entry.toolName, params.item.arguments, { text: output, success })?.pastTenseMessage : undefined;
947
>
return [{
948
>
type: ActionType.ChatToolCallComplete,
949
>
turnId: entry.turnId,
950
>
toolCallId: entry.toolCallId,
951
>
result: {
952
>
success,
953
>
pastTenseMessage: serverPastTense ?? (success ? `Called ${entry.toolName}` : `Failed to call ${entry.toolName}`),
954
>
content,
955
>
...(success ? {} : { error: { message: `Dynamic tool ${params.item.status}`, ...(declined ? { code: 'denied' } : {}) } }),
956
>
},
957
>
}];
958
>
}
959
if (params.item.type === 'collabAgentToolCall') {
960
const labels = collabAgentToolLabels(params.item.tool);