9. From $2 a_{n+2}=a_{n+1}+a_{n}$, we can get
$$
a_{n+2}-a_{n+1}=-\frac{1}{2}\left(a_{n+1}-a_{n}\right).
$$

Thus, $\left\{a_{n+1}-a_{n}\right\}$ is a geometric sequence with the first term $a_{2}-a_{1}=b-a$ and the common ratio $-\frac{1}{2}$, so $a_{n+1}-a_{n}=\left(-\frac{1}{2}\right)^{n-1}(b-a)$.
Taking $n$ as $1,2, \cdots, n-1$, and adding the obtained $n-1$ equations, we get
$$
a_{n}=a+\frac{2}{3}(b-a)\left(1-\left(-\frac{1}{2}\right)^{n-1}\right).
$$

Therefore,
$$
\begin{aligned}
a_{1}+a_{2}+\cdots+a_{n} & =n a+\frac{2}{3}(b-a)\left(n-\frac{1-\left(-\frac{1}{2}\right)^{n}}{1-\left(-\frac{1}{2}\right)}\right) \\
& =n a+\frac{2}{3}(b-a) n-\frac{4}{9}(b-a)+\frac{4}{9}(b-a)\left(-\frac{1}{2}\right)^{n}.
\end{aligned}
$$

Since $\lim _{n \rightarrow \infty}\left(a_{1}+a_{2}+\cdots+a_{n}\right)=4$, we have $a+\frac{2}{3}(b-a)=0$ and $-\frac{4}{9}(b-a)=4$, solving these gives $a=6$, $b=-3$.
9. (16 points) Let the sequence $\left\{a_{n}\right\}$ satisfy $a_{1}=a, a_{2}=b, 2 a_{n+2}=a_{n+1}+a_{n}$. If $\lim _{n \rightarrow \infty}\left(a_{1}+a_{2}+\right.$ $\left.\cdots+a_{n}\right)=4$, find the values of $a, b$.

保留源文本的换行和格式，直接输出翻译结果。