Skip to content

Add "X-MKit-Chat-UUID" header support for streaming responses #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 19, 2025

Conversation

shahariaazam
Copy link
Member

Updated CORS configuration to expose the "X-MKit-Chat-UUID" header. Enhanced the streaming setup to include the chat UUID in response headers when available, improving traceability and debugging for client applications.
This pull request includes changes to add support for exposing and handling a new header, X-MKit-Chat-UUID, in the API. The most important changes include modifying the CORS configuration, updating the streaming headers setup, and ensuring the new header is included when available.

Changes to CORS configuration:

  • cmd/api.go: Added X-MKit-Chat-UUID to the list of exposed headers in the CORS configuration.

Updates to streaming headers setup:

  • internal/handler/chat.go: Updated the setupStreamingHeaders function to accept an additional chatUUID parameter and set the X-MKit-Chat-UUID header if the UUID is available.
  • internal/handler/chat.go: Modified the HandleAskStream function to extract the chat UUID from the request context and pass it to the setupStreamingHeaders function.

Updated CORS configuration to expose the "X-MKit-Chat-UUID" header. Enhanced the streaming setup to include the chat UUID in response headers when available, improving traceability and debugging for client applications.
Copy link

@shahariaazam
Copy link
Member Author

The mcp-frontend can now extract the Chat UUID for streaming message from the header.
shaharia-lab/mcp-frontend#23.

So to fix #19 , we had to fix both frontend and the mcp-kit both.

@shahariaazam shahariaazam merged commit 545c6c7 into main Mar 19, 2025
6 of 7 checks passed
@shahariaazam shahariaazam deleted the issue-19-fix-chat-history branch March 19, 2025 23:41
@shahariaazam shahariaazam linked an issue Mar 19, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Only last 2 messages are getting saved in message history
1 participant