Skip to content

fix(app): restore deferred MCP status updates#30220

Merged
Hona merged 2 commits into
anomalyco:devfrom
Hona:fix/desktop-deferred-mcp-status
Jun 2, 2026
Merged

fix(app): restore deferred MCP status updates#30220
Hona merged 2 commits into
anomalyco:devfrom
Hona:fix/desktop-deferred-mcp-status

Conversation

@Hona
Copy link
Copy Markdown
Member

@Hona Hona commented Jun 1, 2026

  • MCP is lazily enabled, but we destructured its result from useQueries() while it was disabled. When it was enabled later, useQueries() replaced that array entry and the child store kept reading the original disabled result, so the request completed without appearing in the status popover.
  • TanStack's Parallel Queries docs say: "When the number of parallel queries does not change, ... use any number of TanStack Query's useQuery ... functions side-by-side" and reserve useQueries() for when "the number of queries you need to execute changes." These are four fixed directory queries, so use individual useQuery() observers and keep MCP lazy with enabled: mcpEnabled().

@Hona Hona requested a review from adamdotdevin as a code owner June 1, 2026 09:12
Copilot AI review requested due to automatic review settings June 1, 2026 09:12
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 fixes a Solid Query reactivity pitfall in the app’s global-sync child store where a deferred/initially-disabled MCP query was placed inside a destructured useQueries() array, preventing later-enabled MCP status updates from propagating to the UI (desktop status popover).

Changes:

  • Move the deferred MCP status query out of the destructured useQueries() group into its own useQuery() so enabling it later updates the observed result.
  • Keep the existing grouped useQueries() setup for path/LSP/providers unchanged.
  • Update unit tests to mock and assert the new standalone MCP query behavior, including MCP becoming visible after deferred enablement.

Reviewed changes

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

File Description
packages/app/src/context/global-sync/child-store.ts Separates MCP into a standalone useQuery() while keeping other directory queries grouped, restoring reactive MCP status updates after deferred enablement.
packages/app/src/context/global-sync/child-store.test.ts Adjusts mocks and assertions to validate the standalone MCP query enable/disable flow and data visibility after enabling.

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

@Hona Hona merged commit 4e70eab into anomalyco:dev Jun 2, 2026
9 of 12 checks passed
ShamirSecret pushed a commit to ShamirSecret/auto-code-machine that referenced this pull request Jun 2, 2026
0xLLLLH pushed a commit to 0xLLLLH/opencode that referenced this pull request Jun 2, 2026
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