diff --git a/.story_kit/work/1_upcoming/179_story_add_configurable_chat_history_pruning.md b/.story_kit/work/1_upcoming/179_story_add_configurable_chat_history_pruning.md new file mode 100644 index 0000000..a267208 --- /dev/null +++ b/.story_kit/work/1_upcoming/179_story_add_configurable_chat_history_pruning.md @@ -0,0 +1,23 @@ +--- +name: "Add configurable chat history pruning" +--- + +# Story 179: Add configurable chat history pruning + +## User Story + +As a user, I want chat history to be automatically pruned to a configurable limit, so that long sessions don't bloat localStorage and degrade performance. + +## Acceptance Criteria + +- [ ] Default limit of 200 messages is applied when saving to localStorage +- [ ] Messages are pruned from the front (oldest removed first) via messages.slice(-limit) +- [ ] Limit is configurable via localStorage key storykit-chat-history-limit:{projectPath} +- [ ] A limit of 0 means unlimited (no pruning) +- [ ] useChatHistory returns maxMessages and setMaxMessages for future UI use +- [ ] Existing useChatHistory tests continue to pass +- [ ] New tests cover: pruning at limit, custom limit, unlimited mode + +## Out of Scope + +- TBD