Find
$$ \inf_{\substack{ n\ge 1 \\ a_1,\ldots ,a_n >0 \\ a_1+\cdots +a_n <\pi }} \left( \sum_{j=1}^n a_j\cos \left( a_1+a_2+\cdots +a_j \right)\right) . $$

1. Define \( s_k \) as the partial sum of the sequence \( \{a_j\} \), i.e., 
   \[
   s_k = \sum_{j=1}^k a_j.
   \]
   Given the constraint \( a_1 + a_2 + \cdots + a_n < \pi \), we have \( s_n < \pi \).

2. Consider the expression we need to minimize:
   \[
   \sum_{j=1}^n a_j \cos(s_j).
   \]

3. To find a lower bound, observe that the cosine function \( \cos(s_j) \) ranges between \(-1\) and \(1\). Therefore, the minimum value of \( \cos(s_j) \) is \(-1\).

4. Using this, we can write:
   \[
   \sum_{j=1}^n a_j \cos(s_j) \ge \sum_{j=1}^n a_j (-1) = -\sum_{j=1}^n a_j.
   \]

5. Given the constraint \( \sum_{j=1}^n a_j < \pi \), we have:
   \[
   -\sum_{j=1}^n a_j \ge -\pi.
   \]

6. To check if this bound can be approached, consider the case when \( n = 1 \) and \( a_1 \to \pi \). In this case:
   \[
   \sum_{j=1}^n a_j \cos(s_j) = a_1 \cos(a_1).
   \]
   As \( a_1 \to \pi \), \( \cos(a_1) \to -1 \), and thus:
   \[
   a_1 \cos(a_1) \to \pi \cdot (-1) = -\pi.
   \]

7. Therefore, the infimum of the given expression is indeed \(-\pi\).

The final answer is \(\boxed{-\pi}\).