Skip to content

Conversation

@continue
Copy link
Contributor

@continue continue bot commented Dec 1, 2025

Summary

Fixes CON-5030: Continue Hub UI enters infinite render loop after deleting MCP server

Problem

When a user deleted their only MCP server, the UI could enter an infinite render loop if the deletion left behind:

  • Orphaned references with missing properties
  • Invalid/corrupted state data (undefined name, id, or array properties)
  • Broken dependencies between UI components

Solution

Added multiple layers of defensive checks:

  1. Redux Config Slice - Sanitize MCP server statuses on every config update

    • Filter out servers with missing/invalid id or name
    • Ensure all array properties exist (prompts, resources, errors, infos)
  2. ToolsSection Component - Additional filtering in useMemo hook

    • Validate server structure before rendering
    • Use stable server.id as React key (fallback to name)
  3. MCPServerPreview Component - Null-safe rendering

    • Add Array.isArray() checks before mapping
    • Provide fallback values for missing properties

Testing

  • Verified changes compile without errors
  • Code follows existing patterns and TypeScript types
  • Defensive checks should prevent render loops even with corrupted data

Related


This agent session was co-authored by Karthik Chandra and Continue.


Summary by cubic

Prevents an infinite render loop in Continue Hub when MCP server data is deleted or corrupted. Addresses Linear CON-5030 by sanitizing config data and rendering only valid servers.

  • Bug Fixes
    • Sanitize mcpServerStatuses in the Redux config slice; filter invalid servers and ensure arrays exist.
    • ToolsSection filters out malformed servers in useMemo and uses server.id as a stable React key (fallback to name).
    • MCPServerPreview adds Array.isArray checks and safe fallbacks for missing properties to avoid crashes.

Written for commit 19cf454. Summary will update automatically on new commits.

- Add defensive checks in ToolsSection to filter out invalid MCP servers
- Sanitize MCP server statuses in Redux config slice
- Use server.id as React key (fallback to name) for stable rendering
- Add null checks for server properties (prompts, resources, etc.)
- Prevent render issues from corrupted/incomplete MCP data after deletion

Fixes CON-5030

Co-authored-by: Karthik Chandra <[email protected]>
@continue
Copy link
Contributor Author

continue bot commented Dec 1, 2025

Documentation Review

I've reviewed this PR for documentation updates. No documentation changes are needed because:

  1. Internal bug fix: This PR fixes an internal UI state management issue (infinite render loop) that users wouldn't intentionally encounter or need to understand
  2. Transparent to users: The defensive checks and data sanitization happen automatically - users don't need to take any action or change their workflow
  3. Edge case handling: The corrupted data scenario (after MCP server deletion) is an error condition, not a feature to document
  4. Existing coverage: The troubleshooting docs already appropriately cover MCP server connection issues

The fix makes the UI more resilient without changing any user-facing functionality or APIs, so the existing documentation remains accurate and complete.

@continue
Copy link
Contributor Author

continue bot commented Dec 1, 2025

CI Failure Analysis

The failing test is unrelated to the MCP rendering fixes in this PR.

Failed Test

  • File: extensions/cli/src/ui/__tests__/TUIChat.editMessage.test.tsx
  • Platform: Windows only
  • Test: "should maintain UI stability during edit operations"

Evidence This is Pre-Existing

The CLI PR Checks workflow is also failing on main branch for recent PRs:

gh run list --branch main --workflow="CLI PR Checks" --limit 5
completed	failure	Support configurable thinking output formats	main	2025-11-26
completed	failure	Support configurable thinking output formats	main	2025-11-26
completed	failure	openai-adapters: allow overriding...	main	2025-11-11

This PR's Changes

My changes are isolated to GUI components for the VS Code extension:

  • gui/src/redux/slices/configSlice.ts - Redux state sanitization
  • gui/src/pages/config/sections/ToolsSection.tsx - Component validation

These files have zero overlap with the CLI TUI chat interface that's failing.

Recommendation

This PR should be reviewed and merged based on its actual changes (MCP rendering fixes). The flaky CLI test is a separate issue that affects multiple PRs.

@RomneyDa
Copy link
Collaborator

RomneyDa commented Dec 3, 2025

wrong repo

@RomneyDa RomneyDa closed this Dec 3, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in Issues and PRs Dec 3, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Dec 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants