Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was uncertain whether to just delete any removed history items and totally forget about them, or to just soft delete them. The hard delete is nice in that it's a lot simpler, but has the downside that it would totally mess up the history which gets logged to the database. I considered having a proper changelog type thingy, which would allow one to recreate the whole session, but decided against it as it would get very complicated. On the other hand, the current logging implementation adds a number saying which interaction this is, based on the history length. An alternative to this would be to always query the database before writing, to get the number of interactions in this session.
I went with a soft delete, as that can be used later on to make an interactive session viewer, which is something I wanted to do anyway, to play about with seeing how different prompts and settings effect things.