Skip to content

🀯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

πŸ› fix(task): anchor sub-agent elapsed time to the task tool createdAt (#16412)

Arvin Xu5f19bf11122e
diff --git a/apps/desktop/package.json b/apps/desktop/package.json
index 5c42b392969..280abbc1c31 100644
--- a/apps/desktop/package.json
+++ b/apps/desktop/package.json
@@ -6,7 +6,7 @@
"homepage": "https://lobehub.com",
"repository": {
"type": "git",
- "url": "https://github.com/lobehub/lobe-chat.git"
+ "url": "https://github.com/lobehub/lobehub.git"
},
"author": "LobeHub",
"main": "./dist/main/index.js",
diff --git a/src/features/Conversation/Messages/GroupTasks/TaskItem/ClientTaskItem.tsx b/src/features/Conversation/Messages/GroupTasks/TaskItem/ClientTaskItem.tsx
index e75df91896b..93b2cbf984b 100644
--- a/src/features/Conversation/Messages/GroupTasks/TaskItem/ClientTaskItem.tsx
+++ b/src/features/Conversation/Messages/GroupTasks/TaskItem/ClientTaskItem.tsx
@@ -100,7 +100,10 @@ const ClientTaskItem = memo<ClientTaskItemProps>(({ item }) => {
const toolCalls = blocks.reduce((sum, block) => sum + (block.tools?.length || 0), 0);
return {
isLoading: false,
- startTime: assistantGroupMessage?.createdAt,
+ // Anchor elapsed time to the task tool's createdAt (when the sub-agent was
+ // invoked) rather than the in-thread first assistant's createdAt (when the
+ // thread finished initializing) β€” the latter excludes init / approval wait.
+ startTime: item.createdAt,
steps: blocks.length,
toolCalls,
};
@@ -118,7 +121,7 @@ const ClientTaskItem = memo<ClientTaskItemProps>(({ item }) => {
isCompleted,
isError,
blocks,
- assistantGroupMessage?.createdAt,
+ item.createdAt,
taskDetail?.duration,
taskDetail?.totalSteps,
taskDetail?.totalToolCalls,
@@ -167,7 +170,7 @@ const ClientTaskItem = memo<ClientTaskItemProps>(({ item }) => {
messages={threadMessages}
model={model ?? undefined}
provider={provider ?? undefined}
- startTime={assistantGroupMessage?.createdAt}
+ startTime={item.createdAt}
totalCost={taskDetail?.totalCost}
/>
)}
diff --git a/src/features/Conversation/Messages/Tasks/TaskItem/ClientTaskItem.tsx b/src/features/Conversation/Messages/Tasks/TaskItem/ClientTaskItem.tsx
index 8658219da07..f5651948cf1 100644
--- a/src/features/Conversation/Messages/Tasks/TaskItem/ClientTaskItem.tsx
+++ b/src/features/Conversation/Messages/Tasks/TaskItem/ClientTaskItem.tsx
@@ -85,7 +85,10 @@ const ClientTaskItem = memo<ClientTaskItemProps>(({ item }) => {
const toolCalls = blocks.reduce((sum, block) => sum + (block.tools?.length || 0), 0);
return {
isLoading: false,
- startTime: assistantGroupMessage?.createdAt,
+ // Anchor elapsed time to the task tool's createdAt (when the sub-agent was
+ // invoked) rather than the in-thread first assistant's createdAt (when the
+ // thread finished initializing) β€” the latter excludes init / approval wait.
+ startTime: item.createdAt,
steps: blocks.length,
toolCalls,
};
@@ -103,7 +106,7 @@ const ClientTaskItem = memo<ClientTaskItemProps>(({ item }) => {
isCompleted,
isError,
blocks,
- assistantGroupMessage?.createdAt,
+ item.createdAt,
taskDetail?.duration,
taskDetail?.totalSteps,
taskDetail?.totalToolCalls,
@@ -141,7 +144,7 @@ const ClientTaskItem = memo<ClientTaskItemProps>(({ item }) => {
messages={threadMessages}
model={model ?? undefined}
provider={provider ?? undefined}
- startTime={assistantGroupMessage?.createdAt}
+ startTime={item.createdAt}
totalCost={taskDetail?.totalCost}
/>
)}