fix: correct order for removing cleared content
Some checks failed
Node.js CI / Lint and Test (push) Failing after 47s
Code Analysis / SonarQube (push) Failing after 1m5s

This commit is contained in:
Naomi Carrigan 2025-05-22 15:13:43 -07:00
parent b6350fbc74
commit 9eabdc9a29
Signed by: naomi
SSH Key Fingerprint: SHA256:rca1iUI2OhAM6n4FIUaFcZcicmri0jgocqKiTTAfrt8

View File

@ -44,7 +44,7 @@ export const onMessage = async(message: Message): Promise<void> => {
});
if (clearMessageIndex !== -1) {
// Remove the clear message and everything sent before it, which means everything after in the array because the array is backwards
history.splice(0, clearMessageIndex + 1);
history.splice(clearMessageIndex, history.length - clearMessageIndex);
}
const context: Array<MessageParam> = history.
reverse().