SELECT [Id], [WorkspaceId], [OriginalAgent], [ReroutedAgent], [TaskType], [WorkKind], [ReviewerEmail], [ReviewerComment], [CreatedAt]
FROM [dbo].[CapabilityHints]
WHERE [WorkspaceId] = @WorkspaceId
  AND ([OriginalAgent] = @AgentName
   OR [ReroutedAgent] = @AgentName)
ORDER BY [CreatedAt] DESC;
