feat: add multi-turn conversation support within a session

Send full conversation history with each API request so the AI maintains
context across exchanges. Add "New Chat" button to clear the conversation
and start fresh. No persistent storage — session resets on page reload.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
local
2026-04-04 02:40:33 +01:00
parent 17a5a58e73
commit 3278a408b9
7 changed files with 135 additions and 7 deletions

View File

@@ -0,0 +1,21 @@
## Why
Each chat request currently sends only the latest user message, so the AI has no memory of previous exchanges within the same session. Users expect the assistant to remember context from earlier in the conversation, like ChatGPT/Gemini do.
## What Changes
- Send the full conversation history (all prior user and assistant messages) with each API request instead of just the latest user message
- The backend already forwards all messages in `ChatRequest.Messages` to the Responses API — no backend changes needed
- Add a "New Chat" button to clear the conversation and start fresh
## Capabilities
### New Capabilities
<!-- None -->
### Modified Capabilities
- `chat-ui`: Send full message history with each request; add a "New Chat" button to reset the conversation
## Impact
- `src/ChatAgent.Client/Pages/Chat.razor`: Change request construction to include full history; add new chat button