where('workspace_id', $workspaceId) ->where('agent_id', $agentId) ->first(); if (! $node) { throw new \InvalidArgumentException('Fleet node not found'); } return CreditEntry::query() ->where('workspace_id', $workspaceId) ->where('fleet_node_id', $node->id) ->latest() ->limit($limit) ->get(); } }