Skip to content

Commit 202d343

Browse files
committed
fix: use parentTaskId for telemetry to support history-resumed subtasks
The telemetry properties were using task?.parentTask?.taskId and !!task.parentTask, but when a subtask is resumed from history via reopenParentFromDelegation, the live parentTask reference is undefined (since the parent was disposed). The parentTaskId string is always correctly set from the persisted historyItem. Changed to use the persisted parentTaskId instead of the live reference.
1 parent 8a8f811 commit 202d343

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/webview/ClineProvider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2906,11 +2906,11 @@ export class ClineProvider
29062906
language,
29072907
mode,
29082908
taskId: task?.taskId,
2909-
parentTaskId: task?.parentTask?.taskId,
2909+
parentTaskId: task?.parentTaskId,
29102910
apiProvider: apiConfiguration?.apiProvider,
29112911
modelId: task?.api?.getModel().id,
29122912
diffStrategy: task?.diffStrategy?.getName(),
2913-
isSubtask: task ? !!task.parentTask : undefined,
2913+
isSubtask: task ? !!task.parentTaskId : undefined,
29142914
...(todos && { todos }),
29152915
}
29162916
}

0 commit comments

Comments
 (0)