Provision on first prompt — mid-session installs never fired SessionStart#26
Merged
Conversation
…SessionStart Installing mid-session left the plugin looking alive (skills/commands/MCP hot-load) while silently capturing nothing: provisioning was wired only to SessionStart, which /reload-plugins does not fire, so ensure-ultan.sh never ran and every per-turn hook no-op'd on the missing binary — until the next fresh session. The UserPromptSubmit hook now falls back to the provisioner when the binary is absent: first prompt after a mid-session install kicks off the background install (instant return, atomic-lock idempotent — repeat prompts exit on the lock). SessionStart wiring is unchanged for the fresh-session path. README quick-start now tells the truth about /reload-plugins, and the bin/ultan wrapper's not-provisioned message says "send any message" instead of "start a new session". Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…in practice The plugin spec has no install-time script, but Claude Code starts the plugin's MCP server right after /plugin install + /reload-plugins — the earliest code the plugin gets to run. `ultan mcp` now fires the background installer when the runtime is missing, with plugin.json passing CLAUDE_PLUGIN_ROOT/CLAUDE_PLUGIN_DATA into its env (documented mcpServers expansion); missing vars degrade to a no-op. Provisioning now starts at the earliest of: MCP server start (~install time), SessionStart (fresh session), or first prompt (mid-session install) — all funneled through ensure-ultan.sh's atomic lock, so concurrent triggers collapse into one install. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Installing the plugin mid-session (
/plugin install+/reload-plugins) loaded skills/commands/MCP but never provisioned the runtime:ensure-ultan.shwas wired only toSessionStart, which/reload-pluginsdoesn't fire. The setup looked alive while capturing nothing until the next fresh session.Fix — provisioning now fires at the earliest of three triggers, all funneled through the installer's atomic lock so they never race:
plugin.jsonpassesCLAUDE_PLUGIN_ROOT/CLAUDE_PLUGIN_DATAinto the server env)SessionStart(fresh-session path, unchanged)UserPromptSubmithook falls back to the provisioner when the binary is missing)README quick-start and the wrapper's not-provisioned message updated to match.
🤖 Generated with Claude Code