@@ -1883,55 +1883,91 @@ function ChatViewContent(props: ChatViewProps) {
18831883 ) ;
18841884 const systemComposerBannerItems = useMemo < ComposerBannerStackItem [ ] > ( ( ) => {
18851885 const items : ComposerBannerStackItem [ ] = [ ] ;
1886- const resumingServerUpdate =
1887- serverUpdateState . status === "running" && serverUpdateState . stage === "resuming" ;
1888- if ( activeEnvironmentUnavailableState && ! resumingServerUpdate ) {
1889- const connection = activeEnvironmentUnavailableState . connection ;
1890- const isReconnecting =
1891- connection . phase === "connecting" || connection . phase === "reconnecting" ;
1892- items . push ( {
1893- id : `environment-unavailable:${ activeEnvironmentUnavailableState . environmentId } ` ,
1894- variant : connection . phase === "error" ? "error" : "warning" ,
1895- icon : < WifiOffIcon /> ,
1896- title : `${ activeEnvironmentUnavailableState . label } : ${ connectionStatusTitle ( connection ) } ` ,
1897- description :
1898- connection . error ??
1899- "Reconnect this environment before sending messages or running actions." ,
1900- actions : (
1901- < >
1902- < Button
1903- size = "xs"
1904- disabled = { isReconnecting }
1905- onClick = { ( ) =>
1906- void handleReconnectActiveEnvironment (
1907- activeEnvironmentUnavailableState . environmentId ,
1908- )
1909- }
1910- >
1911- { isReconnecting ? "Reconnecting..." : "Reconnect" }
1912- </ Button >
1913- < Button
1914- size = "xs"
1915- variant = "outline"
1916- onClick = { ( ) => void navigate ( { to : "/settings/connections" } ) }
1917- >
1918- Connections
1919- </ Button >
1920- </ >
1921- ) ,
1922- } ) ;
1886+ const updateRunning = serverUpdateState . status === "running" ;
1887+ const unavailableConnection = activeEnvironmentUnavailableState ?. connection ?? null ;
1888+ const environmentReconnecting =
1889+ unavailableConnection !== null &&
1890+ ( unavailableConnection . phase === "connecting" ||
1891+ unavailableConnection . phase === "reconnecting" ) ;
1892+ // Reconnecting to a version-skewed server with no update in flight
1893+ // usually means the server is restarting mid-update and a refresh wiped
1894+ // the in-memory update state. Fold the reconnect and version banners
1895+ // into one calm line instead of stacking "Failed to connect" on
1896+ // "versions differ". A failed update never folds: its error and retry
1897+ // action must stay visible.
1898+ const reconnectingThroughVersionSkew =
1899+ serverUpdateState . status === "idle" && environmentReconnecting && versionMismatch !== null ;
1900+ // While an update runs, transient connect blips are expected (the server
1901+ // restarts) and the update banner already shows progress. Hard failure
1902+ // phases still surface so the Reconnect action stays reachable.
1903+ const suppressUnavailableBanner = updateRunning && environmentReconnecting ;
1904+ if ( activeEnvironmentUnavailableState && unavailableConnection && ! suppressUnavailableBanner ) {
1905+ if ( reconnectingThroughVersionSkew ) {
1906+ items . push ( {
1907+ id : `environment-unavailable:${ activeEnvironmentUnavailableState . environmentId } ` ,
1908+ variant : "default" ,
1909+ icon : (
1910+ < span
1911+ className = "size-1.5 animate-status-pulse rounded-full bg-foreground"
1912+ aria-hidden = "true"
1913+ />
1914+ ) ,
1915+ title : `${ unavailableConnection . phase === "connecting" ? "Connecting" : "Reconnecting" } to ${ activeEnvironmentUnavailableState . label } ` ,
1916+ description : "It may be finishing an update. One moment." ,
1917+ } ) ;
1918+ } else {
1919+ items . push ( {
1920+ id : `environment-unavailable:${ activeEnvironmentUnavailableState . environmentId } ` ,
1921+ variant : unavailableConnection . phase === "error" ? "error" : "warning" ,
1922+ icon : < WifiOffIcon /> ,
1923+ title : `${ activeEnvironmentUnavailableState . label } : ${ connectionStatusTitle ( unavailableConnection ) } ` ,
1924+ description :
1925+ unavailableConnection . error ??
1926+ "Reconnect this environment before sending messages or running actions." ,
1927+ actions : (
1928+ < >
1929+ < Button
1930+ size = "xs"
1931+ disabled = { environmentReconnecting }
1932+ onClick = { ( ) =>
1933+ void handleReconnectActiveEnvironment (
1934+ activeEnvironmentUnavailableState . environmentId ,
1935+ )
1936+ }
1937+ >
1938+ { environmentReconnecting ? "Reconnecting..." : "Reconnect" }
1939+ </ Button >
1940+ < Button
1941+ size = "xs"
1942+ variant = "outline"
1943+ onClick = { ( ) => void navigate ( { to : "/settings/connections" } ) }
1944+ >
1945+ Connections
1946+ </ Button >
1947+ </ >
1948+ ) ,
1949+ } ) ;
1950+ }
19231951 }
19241952 if (
19251953 serverUpdateEnvironmentId &&
1954+ ! reconnectingThroughVersionSkew &&
19261955 ( serverUpdateState . status !== "idle" ||
19271956 ( showVersionMismatchBanner && versionMismatch && versionMismatchDismissKey ) )
19281957 ) {
19291958 const updateInProgress = serverUpdateState . status === "running" ;
19301959 const updateFailed = serverUpdateState . status === "failed" ;
19311960 items . push ( {
19321961 id : `server-version:${ serverUpdateEnvironmentId } ` ,
1933- variant : updateFailed ? "error" : "warning" ,
1934- icon : < TriangleAlertIcon /> ,
1962+ variant : updateFailed ? "error" : updateInProgress ? "default" : "warning" ,
1963+ icon : updateInProgress ? (
1964+ < span
1965+ className = "size-1.5 animate-status-pulse rounded-full bg-foreground"
1966+ aria-hidden = "true"
1967+ />
1968+ ) : (
1969+ < TriangleAlertIcon />
1970+ ) ,
19351971 title :
19361972 updateInProgress || updateFailed
19371973 ? `${ updateFailed ? "Could not update" : "Updating" } ${ versionMismatchServerLabel } `
@@ -1940,7 +1976,6 @@ function ChatViewContent(props: ChatViewProps) {
19401976 updateInProgress || updateFailed ? (
19411977 < ServerUpdateProgress
19421978 fromVersion = { serverUpdateState . fromVersion }
1943- serverLabel = { versionMismatchServerLabel }
19441979 state = { serverUpdateState }
19451980 />
19461981 ) : versionMismatch ? (
0 commit comments