chat fixes cleanup

This commit is contained in:
Dallin Romney 2024-12-06 17:36:17 -08:00
parent ddb711721c
commit 17c384e168
4 changed files with 1 additions and 10 deletions

View file

@ -380,10 +380,6 @@ export class Core {
);
let next = await gen.next();
while (!next.done) {
if (Math.random() > 0) {
//
// throw new Error("Intentional");
}
if (abortedMessageIds.has(msg.messageId)) {
abortedMessageIds.delete(msg.messageId);
next = await gen.return({

View file

@ -117,13 +117,9 @@ export const sessionSlice = createSlice({
return;
}
const lastMessage = state.history[state.history.length - 1];
console.log("CLEARING LAST EMPTY RESPONSE", { ...lastMessage });
// Only clear in the case of an empty message
if (!lastMessage.message.content.length) {
console.log("CLEARING", {
...state.history[state.history.length - 2].editorState,
});
state.mainEditorContentTrigger =
state.history[state.history.length - 2].editorState;
state.history = state.history.slice(0, -2);

View file

@ -5,7 +5,6 @@ import { selectDefaultModel } from "../slices/configSlice";
import {
abortStream,
addPromptCompletionPair,
clearLastEmptyResponse,
setToolGenerated,
streamUpdate,
} from "../slices/sessionSlice";

View file

@ -11,7 +11,7 @@ export const streamThunkWrapper = createAsyncThunk<
await runStream();
} catch (e: any) {
// NOTE - streaming errors are shown as ide toasts in core, don't show duplicate here
// console.debug("Error streaming response: ", e);
console.debug("Error streaming response: ", e);
dispatch(clearLastEmptyResponse());
} finally {
dispatch(setInactive());