-
Notifications
You must be signed in to change notification settings - Fork 5
feat(feature-flag): playground experimental chat #741
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a comprehensive chat system using the AI SDK to enable streaming conversations with multiple AI providers and full MCP (Model Context Protocol) server integration. The implementation provides real-time streaming, tool execution, and a polished UI for interacting with external tools via ToolHive.
- Implements streaming chat interface using AI SDK with real-time IPC communication between frontend and backend
- Adds support for multiple AI providers (OpenAI, Anthropic, Google, xAI, OpenRouter) with dynamic model discovery
- Integrates MCP server tools for enhanced AI capabilities with tool selection and execution tracking
Reviewed Changes
Copilot reviewed 33 out of 34 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
renderer/src/routes/playground.tsx | Creates new playground route with chat interface |
renderer/src/route-tree.gen.ts | Generated route tree updates for playground |
renderer/src/features/chat/ | Complete chat feature implementation with types, hooks, components |
renderer/src/common/components/ui/collapsible.tsx | Adds collapsible UI component for tool management |
renderer/src/common/components/layout/top-nav/index.tsx | Adds playground navigation link |
preload/src/preload.ts | Exposes chat-related IPC methods to renderer |
package.json | Adds AI SDK dependencies and related packages |
main/src/main.ts | Implements chat IPC handlers |
main/src/chat/ | Backend chat implementation with providers, tools, storage, streaming |
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
* feat: initial playground * refactor: complete refactor and overhaul * enable pre-release * fix: adjust unused var, code and deps * feat: use tenstack query for feature flags and put playground around it * revert: remove prerelease true
FYI: This is just a POC under feature flag
playground
Kapture.2025-08-14.at.18.12.12.mp4
AI SDK Chat Integration with MCP Support
This PR reworks the chat system to use the AI SDK and fully integrates with MCP servers (via ToolHive). The goal was to build a solid, stream-based chat experience that can interact with external tools in real-time, across multiple providers.
⸻
What’s new
AI SDK & Chat Streaming
• Switched over to the AI SDK’s streamText API to handle streaming messages.
• Built a custom ChatTransport over Electron IPC to bridge streaming between the backend and frontend.
• Used useChat on the frontend to plug into the new stream and render live updates in the UI.
• Added full metadata to messages (timestamps, model name, token usage, etc.) for better visibility.
MCP Integration
• The app can now dynamically discover tools from MCP servers and expose them in the UI.
• Tool descriptions, input parameters, and execution states are all shown and updated live.
• Each server can have its own set of tools enabled/disabled, and that state is persisted.
• Errors with tool execution or server connectivity are handled gracefully.
Providers
• Supports OpenAI, Anthropic, and OpenRouter (with their full model lists).
• Provider selection is integrated into the chat UI with a searchable dropdown.
• Each provider shares the same interface, so switching is seamless from the user’s point of view.