feat(plugins): hot-reload path for SKILL-content-only updates (bypass restart) #112

Closed
opened 2026-05-08 14:52:58 +00:00 by claude-ceo-assistant · 0 comments

Problem

When POST /workspaces/:id/plugins (re)installs a plugin, the platform calls restartFunc(workspaceID) which restarts the docker container. This is correct for changes that affect Claude Code's startup state (hooks, settings.json, plugins added/removed).

But Claude Code reads SKILL.md files on each Skill tool invocation — there's no in-memory cache of skill content. So when the only thing that changed is SKILL.md content (text inside an existing skill file), a container restart is unnecessary downtime.

For Reno-Stars and future customers iterating on molecule-skill-five-axis-review, most updates will be SKILL.md content changes. Avoiding the restart on those is the highest-leverage risk reduction we have.

Proposed approach

Add a fast-path to PluginsHandler.installPlugin (or wherever the install flow culminates):

  1. Diff classifier — when re-installing the same plugin name (already-installed → newer version), compute the diff between staged-tmp content and existing-installed content.
  2. Classify as one of:
    • SKILL-content-only (only **/SKILL.md files changed; nothing else added/removed/modified)
    • Cold-restart-required (anything else: hooks.json, settings.json, scripts/, plugin.yaml structural change, file added/removed)
  3. If SKILL-content-only: atomic-rename the new SKILL.md(s) into place; SKIP restartFunc. Log explicitly: plugin %s: SKILL-content-only update, no restart.
  4. If cold-restart-required: existing flow (full install + restartFunc).

Acceptance criteria

  • New helper classifyPluginDiff(oldDir, newDir) (string, error) returning "skill-content-only" or "cold"
  • Install path consults the classifier when re-installing an existing plugin
  • Cold path unchanged
  • Hot path: tests verify no restart fired on SKILL-content-only diff
  • Edge cases handled: new SKILL.md file added (= cold, not hot — new skill is structural)

Out of scope

  • Auto-update / auto-pull from upstream — that's #4 in this batch
  • Atomic install with rollback — that's #5 in this batch
  • Multi-tenant canary — that's #6 in this batch

Refs

  • internal RFC for Phase 4 plugin (internal#85)
  • workspace-server internal/handlers/plugins.go — current install path with restartFunc wiring
  • Reno-Stars rollout safety concern (Hongming 2026-05-08)
## Problem When `POST /workspaces/:id/plugins` (re)installs a plugin, the platform calls `restartFunc(workspaceID)` which restarts the docker container. This is correct for changes that affect Claude Code's startup state (hooks, settings.json, plugins added/removed). But Claude Code reads `SKILL.md` files on each Skill tool invocation — there's no in-memory cache of skill content. So when the only thing that changed is SKILL.md content (text inside an existing skill file), a container restart is unnecessary downtime. For Reno-Stars and future customers iterating on `molecule-skill-five-axis-review`, most updates will be SKILL.md content changes. Avoiding the restart on those is the highest-leverage risk reduction we have. ## Proposed approach Add a fast-path to `PluginsHandler.installPlugin` (or wherever the install flow culminates): 1. **Diff classifier** — when re-installing the same plugin name (already-installed → newer version), compute the diff between staged-tmp content and existing-installed content. 2. **Classify** as one of: - SKILL-content-only (only `**/SKILL.md` files changed; nothing else added/removed/modified) - Cold-restart-required (anything else: hooks.json, settings.json, scripts/, plugin.yaml structural change, file added/removed) 3. **If SKILL-content-only:** atomic-rename the new SKILL.md(s) into place; SKIP `restartFunc`. Log explicitly: `plugin %s: SKILL-content-only update, no restart`. 4. **If cold-restart-required:** existing flow (full install + restartFunc). ## Acceptance criteria - New helper `classifyPluginDiff(oldDir, newDir) (string, error)` returning `"skill-content-only"` or `"cold"` - Install path consults the classifier when re-installing an existing plugin - Cold path unchanged - Hot path: tests verify no restart fired on SKILL-content-only diff - Edge cases handled: new SKILL.md file added (= cold, not hot — new skill is structural) ## Out of scope - Auto-update / auto-pull from upstream — that's #4 in this batch - Atomic install with rollback — that's #5 in this batch - Multi-tenant canary — that's #6 in this batch ## Refs - internal RFC for Phase 4 plugin (internal#85) - workspace-server `internal/handlers/plugins.go` — current install path with `restartFunc` wiring - Reno-Stars rollout safety concern (Hongming 2026-05-08)
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#112
No description provided.