Skip to content

feat(mcp): show MCP loading status before first response#1318

Merged
RealKai42 merged 5 commits intomainfrom
kaiyi/mcp-first-msg-block
Mar 3, 2026
Merged

feat(mcp): show MCP loading status before first response#1318
RealKai42 merged 5 commits intomainfrom
kaiyi/mcp-first-msg-block

Conversation

@RealKai42
Copy link
Copy Markdown
Collaborator

@RealKai42 RealKai42 commented Mar 3, 2026

This PR adds explicit MCP loading status events and surfaces them in both shell and web UIs so users see feedback while MCP tools are connecting.

  • Add MCPLoadingBegin / MCPLoadingEnd wire events.
  • Emit loading events in KimiSoul when MCP tool loading is pending.
  • Add has_pending_mcp_tools() in KimiToolset to gate event emission.
  • Handle new events in shell UI with a Connecting to MCP servers... spinner.
  • Handle new events in web session stream with a temporary status message.
  • Update ACP session matching and wire serde tests for new event types.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked the related issue, if any.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have run make gen-changelog to update the changelog.
  • I have run make gen-docs to update the user documentation.

Open with Devin

Copilot AI review requested due to automatic review settings March 3, 2026 06:44
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

Copy link
Copy Markdown
Contributor

Copilot AI left a 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 explicit wire-level MCP loading lifecycle events and wires them through both CLI shell and web UIs so users get immediate feedback while MCP tools are connecting, before the first assistant response.

Changes:

  • Add new wire event types MCPLoadingBegin / MCPLoadingEnd (Python + web TypeScript).
  • Emit loading events in KimiSoul when MCP tool loading is still pending (using new KimiToolset.has_pending_mcp_tools()).
  • Render MCP loading indicators in both the shell UI (spinner) and web session stream (temporary status message), and update ACP session matching + wire serde tests.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
web/src/hooks/wireTypes.ts Adds TS wire event types and includes them in the WireEvent union.
web/src/hooks/useSessionStream.ts Displays/removes a temporary “Connecting to MCP servers…” status message on MCP loading events.
tests/core/test_wire_message.py Extends wire serde snapshot coverage to include the new MCP loading message types.
src/kimi_cli/wire/types.py Defines MCPLoadingBegin/End models and includes them in the wire Event union + exports.
src/kimi_cli/ui/shell/visualize.py Adds an MCP “connecting” spinner and prioritizes it in the live view compose order.
src/kimi_cli/soul/toolset.py Adds has_pending_mcp_tools() helper to detect in-flight background MCP loading.
src/kimi_cli/soul/kimisoul.py Emits MCPLoadingBegin/End around wait_for_mcp_tools() when MCP loading is pending.
src/kimi_cli/acp/session.py Updates match handling to accept/ignore the new MCP loading messages.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@RealKai42 RealKai42 merged commit e6f962d into main Mar 3, 2026
18 checks passed
@RealKai42 RealKai42 deleted the kaiyi/mcp-first-msg-block branch March 3, 2026 07:26
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.

2 participants