refac
This commit is contained in:
1 parent
30f82788bc
commit
3eb65f4715
3 files changed
+42
-16
No files matched your search
@@ -146,7 +146,9 @@ function buildToolCallToken(item: OutputItem, toolOutputByCallId: Record<string,
|
||||
const callId = item.call_id ?? item.id ?? '';
|
||||
const resultItem = toolOutputByCallId[callId];
|
||||
const status = String(item.status ?? '');
|
||||
const isDone = isDoneStatus(item.status) || !!resultItem;
|
||||
const isPending = status === 'pending';
|
||||
const isDone = !!resultItem || status === 'failed' || status === 'incomplete';
|
||||
const isExecuting = !isDone && status === 'completed';
|
||||
let name = item.name ?? '';
|
||||
if (name === 'delegate_task') {
|
||||
try {
|
||||
@@ -164,7 +166,13 @@ function buildToolCallToken(item: OutputItem, toolOutputByCallId: Record<string,
|
||||
|
||||
return {
|
||||
summary:
|
||||
status === 'pending' ? 'Tool Approval Needed' : isDone ? 'Tool Executed' : 'Executing...',
|
||||
isPending
|
||||
? 'Tool Approval Needed'
|
||||
: isDone
|
||||
? 'Tool Executed'
|
||||
: isExecuting
|
||||
? 'Executing...'
|
||||
: 'Preparing...',
|
||||
text: getToolResultText(resultItem),
|
||||
attributes: {
|
||||
type: 'tool_calls',
|
||||
|
||||
Reference in new issue
Block a user