1. $a, b$ are constants. If the parabola $C: y=\left(t^{2}+t+1\right) x^{2}-2(a+t)^{2} x+t^{2}+3 a t+b$ passes through the fixed point $P(1,0)$ for any real number $t$, when $t=$ $\qquad$, the chord intercepted by the parabola $C$ on the $x$-axis is the longest.
1. -1 .

Substituting $P (1,0)$ into the equation of the parabola $C$ yields
$$
\left(t^{2}+t+1\right)-2(a+t)^{2}+\left(t^{2}+3 a t+b\right)=0 \text {, }
$$

which simplifies to $t(1-a)+\left(1-2 a^{2}+b\right)=0$,
holding for all $t$.
Thus, $1-a=0$, and $1-2 a^{2}+b=0$.
Solving these, we get $a=1, b=1$.
Substituting $a$ and $b$ into the equation of the parabola $C$ gives
$$
y=\left(t^{2}+t+1\right) x^{2}-2(1+t)^{2} x+\left(t^{2}+3 t+1\right) \text {. }
$$

Setting $y=0$, we have
$$
\left(t^{2}+t+1\right) x^{2}-2(1+t)^{2} x+\left(t^{2}+3 t+1\right)=0 \text {. }
$$

Let the roots of this equation be $x_{1}$ and $x_{2}$, then
$$
\begin{array}{l}
|A B|=\left|x_{1}-x_{2}\right|=\sqrt{\left(x_{1}+x_{2}\right)^{2}-4 x_{1} x_{2}} \\
=\left|\frac{2 t}{t^{2}+t+1}\right| .
\end{array}
$$

Noting that the discriminant of this quadratic equation $\Delta=4 t^{2}>0$, to find the maximum value of $|A B|$, we categorize $t$.
(1) When $t>0$,
$$
|A B|=\frac{2 t}{t^{2}+t+1}=\frac{2}{t+\frac{1}{t}+1} \leqslant \frac{2}{3} \text {; }
$$
(2) When $t<0$,
$$
\begin{array}{l}
|A B|=-\frac{2 t}{t^{2}+t+1}=\frac{2}{-t-\frac{1}{t}-1} \\
\leqslant \frac{2}{-1+2 \sqrt{(-t) \frac{1}{-t}}}=2 .
\end{array}
$$

When $t=-1$, $|A B|_{\text {max }}=2$.

From (1) and (2), we know that when $t=-1$, the chord length $|A B|$ reaches its maximum value of 2.