diff --git a/gui/src/pages/gui/Chat.tsx b/gui/src/pages/gui/Chat.tsx
index ea514b833..9f544bf40 100644
--- a/gui/src/pages/gui/Chat.tsx
+++ b/gui/src/pages/gui/Chat.tsx
@@ -75,6 +75,7 @@ import {
loadLastSession,
saveCurrentSession,
} from "../../redux/thunks/session";
+import StreamError from "./StreamError";
const StopButton = styled.div`
background-color: ${vscBackground};
@@ -551,6 +552,9 @@ export function Chat() {
)}
+
diff --git a/gui/src/pages/gui/StreamError.tsx b/gui/src/pages/gui/StreamError.tsx
new file mode 100644
index 000000000..b5db2489e
--- /dev/null
+++ b/gui/src/pages/gui/StreamError.tsx
@@ -0,0 +1,12 @@
+import { useAppSelector } from "../../redux/hooks";
+
+const StreamError = () => {
+ const streamError = useAppSelector((state) => state.session.streamError);
+
+ if (streamError) {
+ return null;
+ }
+ return
Hello
;
+};
+
+export default StreamError;
diff --git a/gui/src/redux/slices/sessionSlice.ts b/gui/src/redux/slices/sessionSlice.ts
index 75a73af2b..8ce289eed 100644
--- a/gui/src/redux/slices/sessionSlice.ts
+++ b/gui/src/redux/slices/sessionSlice.ts
@@ -53,6 +53,10 @@ type SessionState = {
states: ApplyState[];
curIndex: number;
};
+ streamError?: {
+ statusCode: number;
+ message: string;
+ };
};
function isCodeToEditEqual(a: CodeToEdit, b: CodeToEdit) {
@@ -348,6 +352,15 @@ export const sessionSlice = createSlice({
}
}
},
+ setStreamError: (
+ state,
+ { payload }: PayloadAction<{ statusCode: number; message: string }>,
+ ) => {
+ state.streamError = payload;
+ },
+ clearStreamError: (state) => {
+ state.streamError = undefined;
+ },
newSession: (state, { payload }: PayloadAction
) => {
state.lastSessionId = state.id;
@@ -369,7 +382,6 @@ export const sessionSlice = createSlice({
state.curCheckpointIndex = 0;
}
},
-
updateSessionTitle: (state, { payload }: PayloadAction) => {
state.title = payload;
},