6 Commits

Author SHA1 Message Date
Dave
cffe63680d Fix MCP server URL to match actual running port (3010)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 16:17:54 +00:00
Dave
f5fffd64b8 story-kit: create 266_story_matrix_bot_structured_conversation_history 2026-03-17 16:17:34 +00:00
Dave
ad68bc912f story-kit: remove 266_story_matrix_bot_structured_conversation_history 2026-03-17 16:17:20 +00:00
Dave
d02d53d112 story-kit: create 266_story_matrix_bot_structured_conversation_history 2026-03-17 16:14:07 +00:00
Dave
3ce7276e89 Fix TS narrowing errors in Chat.test.tsx
TypeScript control flow analysis can't track reassignment inside vi.mock
callbacks, causing lastSendChatArgs to narrow to never. Use non-null
assertions after the explicit toBeNull() guard.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 16:13:29 +00:00
Dave
6d87e64859 story-kit: queue 265_story_spikes_skip_merge_and_stop_for_human_review for QA 2026-03-17 16:11:52 +00:00
4 changed files with 28 additions and 6 deletions

View File

@@ -2,7 +2,7 @@
"mcpServers": {
"story-kit": {
"type": "http",
"url": "http://localhost:3001/mcp"
"url": "http://localhost:3010/mcp"
}
}
}

View File

@@ -0,0 +1,21 @@
---
name: "Matrix bot structured conversation history"
---
# Story 266: Matrix bot structured conversation history
## User Story
As a user chatting with the Matrix bot, I want it to remember and own its prior responses naturally, so that conversations feel like talking to one continuous entity rather than a new instance each message.
## Acceptance Criteria
- [ ] Conversation history is passed as structured API messages (user/assistant turns) rather than a flattened text prefix
- [ ] Claude recognises its prior responses as its own, maintaining consistent personality across a conversation
- [ ] Per-room history survives server restarts (persisted to disk or database)
- [ ] Rolling window trimming still applies to keep context bounded
- [ ] Multi-user rooms still attribute messages to the correct sender
## Out of Scope
- TBD

View File

@@ -625,16 +625,17 @@ describe("Chat localStorage persistence (Story 145)", () => {
// Verify sendChat was called with ALL prior messages + the new one
expect(lastSendChatArgs).not.toBeNull();
expect(lastSendChatArgs?.messages).toHaveLength(3);
expect(lastSendChatArgs?.messages[0]).toEqual({
const args = lastSendChatArgs!;
expect(args.messages).toHaveLength(3);
expect(args.messages[0]).toEqual({
role: "user",
content: "What is Rust?",
});
expect(lastSendChatArgs?.messages[1]).toEqual({
expect(args.messages[1]).toEqual({
role: "assistant",
content: "Rust is a systems programming language.",
});
expect(lastSendChatArgs?.messages[2]).toEqual({
expect(args.messages[2]).toEqual({
role: "user",
content: "Tell me more",
});
@@ -1343,7 +1344,7 @@ describe("Bug 264: Claude Code session ID persisted across browser refresh", ()
expect(lastSendChatArgs).not.toBeNull();
expect(
(lastSendChatArgs?.config as Record<string, unknown>).session_id,
(lastSendChatArgs!.config as Record<string, unknown>).session_id,
).toBe("persisted-session-xyz");
});