Skip to content

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

2 participants