story-kit: start 179_story_add_configurable_chat_history_pruning

This commit is contained in:
Dave
2026-02-25 11:26:48 +00:00
parent 12da373ac6
commit 7fd00efc1a

View File

@@ -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