2. Given the line $y=x-1$ intersects the ellipse $\frac{x^{2}}{a^{2}}+\frac{y^{2}}{a^{2}-1}=1(a>1)$ at points $A, B$, if the circle with $A B$ as its diameter passes through the left focus of the ellipse, find the value of $a$.

 untranslated text remains in its original format and line breaks are preserved.
2. Substituting $y=x-1$ into the ellipse equation, we get $g(x)=x^{2}-\frac{2 a^{2}}{2 a^{2}-1} x+\frac{2 a^{2}-a^{4}}{2 a^{2}-1}=0$. Substituting $x=y+1$ into the ellipse equation, we get $h(y)=y^{2}+\frac{2 a^{2}-2}{2 a^{2}-1} y+\frac{2 a^{2}-a^{4}}{2 a^{2}-1}=0$. Therefore, the equation of the circle with $A B$ as its diameter is $x^{2}+y^{2}-\frac{2 a^{2}}{2 a^{2}-1}+$ $\frac{2 a^{2}-2}{2 a^{2}-1} y+\frac{4 a^{2}-2 a^{4}-1}{2 a^{2}-1}=0$.

Since this circle passes through the left focus of the ellipse $(-1,0)$, substituting this into the above equation yields $a^{4}-4 a^{2}+1=0$. Given that $a>1$, we thus find $a=$ $\frac{1}{2}(\sqrt{6}+\sqrt{2})$.