chat fixes cleanup
This commit is contained in:
parent
ddb711721c
commit
17c384e168
4 changed files with 1 additions and 10 deletions
|
|
@ -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({
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import { selectDefaultModel } from "../slices/configSlice";
|
|||
import {
|
||||
abortStream,
|
||||
addPromptCompletionPair,
|
||||
clearLastEmptyResponse,
|
||||
setToolGenerated,
|
||||
streamUpdate,
|
||||
} from "../slices/sessionSlice";
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue