Skip to content

feat: comprehensive hot-reload system for skills, extensions, MCP, and configuration #3696

@yiliang114

Description

@yiliang114

What would you like to be added?

A comprehensive hot-reload system that allows skills, extensions, MCP servers, and configuration changes to take effect at runtime — without restarting the session.

This is a tracking issue. The work breaks down into the following sub-tasks (ordered by dependency):

Sub-tasks

  • 1. Settings file change detection — watch settings.json / settings.local.json for modifications and emit change events. This is the foundational building block that other sub-tasks depend on.
  • 2. Skill hot-reload improvements — the current chokidar-based SkillManager watcher covers .qwen/skills/ directories, but doesn't handle symlinked dirs reliably (Bug: Symlinked skill directories are not loaded or hot-reloaded #2415) or propagate changes to dependent commands/prompts. Improve the watcher to also invalidate downstream command caches and prompt caches when skill files change.
  • 3. MCP/LSP server runtime re-initialization — currently MCP connections are established once at startup. Add the ability to stop, reconfigure, and restart MCP/LSP server connections at runtime (e.g., when settings.json changes or an extension is installed).
  • 4. Comprehensive cache management (clearAllCaches) — create a single utility that clears all subsystem caches (skills, commands, prompts, extensions, MCP configs) in one shot. Currently cache clearing is scattered across SkillManager.refreshCache(), reloadCommands(), etc.
  • 5. /reload slash command — a user-facing command that calls clearAllCaches(), re-initializes MCP/LSP connections, reloads skills and commands, and reports a summary of what was refreshed. This is the manual trigger for when auto-detection falls short.
  • 6. needsRefresh state notification — add a flag in app state that gets set when background changes are detected (extension install/update, settings file change). When set, display a prompt suggesting the user run /reload.

Why is this needed?

When developing or debugging skills, extensions, or MCP server configurations, users currently have to restart the entire session to pick up changes that fall outside the skill file watcher's scope. This breaks the development flow and discards conversation context.

Concrete pain points:

  • Editing settings.json to add/remove an MCP server requires a full restart
  • Installing or updating an extension doesn't reliably reload all dependent commands
  • No way to manually force a full refresh when auto-detection misses a change (symlinked files, config-only changes)
  • The existing reloadCommands() is UI-layer only and doesn't reach MCP/LSP or agent registrations

Additional context

Current state in Qwen Code:

Component Hot-reload support Gap
Skill files (.qwen/skills/) chokidar watcher + refreshCache() Doesn't invalidate downstream command/prompt caches
Commands reloadCommands() in UI layer UI-only, not reachable from core
MCP servers Startup-only initialization No runtime re-init
Settings files No watcher Changes require restart
Extensions reloadCommands() on install Doesn't cover MCP/agents/hooks

Reference: Claude Code implements a similar system with:

  • skillChangeDetector.ts + settings/changeDetector.ts for automatic file watching
  • clearAllCaches() covering all subsystems
  • refreshActivePlugins() orchestrator for runtime component swap
  • needsRefresh flag in AppState with UI notification
  • /reload-plugins command as the manual trigger entry point
  • pluginReconnectKey counter to trigger MCP reconnections

Related closed issues:

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

Status
No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions