Skip to content

fix: load MCP servers on lazy-resume so tools work after restart#561

Merged
PureWeen merged 2 commits intomainfrom
fix/mcp-servers-on-resume
Apr 8, 2026
Merged

fix: load MCP servers on lazy-resume so tools work after restart#561
PureWeen merged 2 commits intomainfrom
fix/mcp-servers-on-resume

Conversation

@PureWeen
Copy link
Copy Markdown
Owner

@PureWeen PureWeen commented Apr 8, 2026

Summary

Two fixes for MCP server availability:

1. MCP servers missing on lazy-resumed sessions

When sessions are lazily resumed after app restart, the ResumeSessionConfig was missing McpServers and SkillDirectories. This meant MCP tools (e.g., WorkIQ, Maestro) were unavailable until the user manually ran /mcp reload.

Fix: Load MCP servers and skill directories in EnsureSessionConnectedAsync before creating the resume config. Also applied to the fresh-session fallback path.

2. /mcp reload crashes on mobile

The command tried to access the local SDK session which doesn't exist in remote mode, throwing InvalidOperationException. The guard existed in CopilotService but the UI called through without checking first.

Fix: Guard in Dashboard.razor before calling ReloadMcpServersAsync, showing a friendly message.

Test plan

  • LazyResumePath_IncludesMcpServersAndSkills — structural test verifying MCP servers in both resume and fallback configs
  • Full suite: 3320 tests pass

🤖 Generated with Claude Code

PureWeen and others added 2 commits April 8, 2026 08:35
Resumed sessions were missing McpServers and SkillDirectories in both
the ResumeSessionConfig and the fresh-session fallback. This caused MCP
tools (e.g., WorkIQ) to be unavailable until manual /mcp reload.

Also guard /mcp reload on mobile — it requires a local SDK session which
doesn't exist in remote mode. Show a friendly message instead of crashing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The public ResumeSessionAsync (used by sidebar resume, bridge resume,
and external session resume) had the same missing McpServers/SkillDirectories
as the lazy-resume path. Add them + regression test.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@PureWeen
Copy link
Copy Markdown
Owner Author

PureWeen commented Apr 8, 2026

🔍 Multi-Model Code Review — PR #561 (Final review)

PR: fix: load MCP servers on lazy-resume so tools work after restart
Branch: fix/mcp-servers-on-resume
Tests: ✅ 3321 passed, 0 failed
CI: ⚠️ No checks reported on the branch


Status of All Findings

# Finding Status
1 Missing MCP in public ResumeSessionAsync (sidebar/bridge) ✅ FIXED in 277b36fb

Final Review (3/3 unanimous — no issues)

All 3 reviewers confirmed:

  • Both lazy-resume paths (primary + fallback) correctly include McpServers/SkillDirectories
  • Public ResumeSessionAsync (sidebar/bridge) also fixed
  • Auth-retry path reuses the already-configured resumeConfig — covered
  • IsRemoteMode guard on /mcp reload follows established patterns
  • ConnectionSettings.Load() is actually more correct than _currentSettings for this use case (picks up toggle changes)
  • Both structural tests are adequate

Pre-existing note (not a blocker): Two other resume paths (TryRecoverPermissionAsync, ResumeCodespaceSessionsAsync) also lack MCP loading — worth a follow-up.


Recommendation

Approve — All findings resolved. All resume paths covered. Ready to merge.

@PureWeen PureWeen merged commit 3523b45 into main Apr 8, 2026
@PureWeen PureWeen deleted the fix/mcp-servers-on-resume branch April 8, 2026 16:10
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.

1 participant