Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(conversations): show connection state banner for all conversation types

Steven Enamakel072c7b456270
diff --git a/app/src/features/conversations/aui/ConnectionStateBanner.tsx b/app/src/features/conversations/aui/ConnectionStateBanner.tsx
index e44a6a2b62..e0a3b79313 100644
--- a/app/src/features/conversations/aui/ConnectionStateBanner.tsx
+++ b/app/src/features/conversations/aui/ConnectionStateBanner.tsx
@@ -106,17 +106,28 @@ export function ConnectionStateNotice({
);
}
-function ConnectedConnectionStateBanner() {
- const phase = useConnectionPhase(useAppSelector(selectSocketStatus));
+function ConnectedConnectionStateBanner({ status }: { status: SocketStatus }) {
+ const phase = useConnectionPhase(status);
return <ConnectionStateNotice phase={phase} onRetry={reconnect} />;
}
+/** `null` under a host store that carries no `socket` slice. */
+const selectSocketStatusIfTracked = (state: RootState): SocketStatus | null =>
+ state.socket ? selectSocketStatus(state) : null;
+
+function StoreConnectionStateBanner() {
+ const status = useAppSelector(selectSocketStatusIfTracked);
+ if (status === null) return null;
+ return <ConnectedConnectionStateBanner status={status} />;
+}
+
/**
- * Renders nothing when there is no Redux store above it: the thread is also
- * mounted standalone (dev demo, component tests), with no socket to report on.
+ * Renders nothing when there is no socket state above it: the thread is also
+ * mounted standalone or under a partial host store (dev demo, component
+ * tests), with no socket to report on.
*/
export function ConnectionStateBanner() {
const redux = useContext(ReactReduxContext);
if (!redux) return null;
- return <ConnectedConnectionStateBanner />;
+ return <StoreConnectionStateBanner />;
}