Skip to content

Commit

Permalink
fix: delete first message then regenerate again will break the thread (
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-jan authored Dec 15, 2023
1 parent 305d042 commit bcc9bd6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion extensions/conversational-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ export default class JSONConversationalExtension
await fs.mkdir(threadDirPath)
await fs.writeFile(
threadMessagePath,
messages.map((msg) => JSON.stringify(msg)).join('\n') + '\n'
messages.map((msg) => JSON.stringify(msg)).join('\n') +
(messages.length > 1 ? '\n' : '')
)
Promise.resolve()
} catch (err) {
Expand Down

0 comments on commit bcc9bd6

Please sign in to comment.