fix: run extension setup_hook during install via host agent#740
Merged
Lightheartdevs merged 2 commits intoLight-Heart-Labs:mainfrom Apr 3, 2026
Merged
Conversation
Extensions declaring setup_hook in their manifest (jupyter, dify, etc.) need host-side scripts run to generate required environment variables. The install flow was skipping this step, causing docker compose up to fail with missing required variables and blocking all user extensions. Adds /v1/extension/setup-hook endpoint to the host agent that reads the extension manifest and executes the setup hook script. The dashboard-api now calls this endpoint after copying files but before starting the container. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Narrow exception handler from (OSError, Exception) to (OSError, yaml.YAMLError) - Add type validation for setup_hook manifest value (must be string) - Remove dead symlink check after path resolve() Co-Authored-By: Claude Opus 4.6 (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.
What
Extensions declaring
setup_hookin their manifest now have their hook script executed during install, before the container is started.Why
Extensions with
setup_hook: setup.sh(jupyter, dify, flowise, paperless-ngx, frigate, open-interpreter, weaviate, librechat, anythingllm — 9 total) generate required environment variables. The install flow was skipping this step, causingdocker compose upto fail with missing required variables (e.g.JUPYTER_TOKEN must be set) and blocking ALL user extensions.How
/v1/extension/setup-hookPOST endpoint to the host agent that reads the manifest, validates the hook path (path traversal + file checks), and runsbash <hook> <INSTALL_DIR> <GPU_BACKEND>_call_agent_setup_hook()helper in extensions.py, called after file copy but before container startrestart_requiredflagTesting
resolve()+relative_to(), type validation on manifest fields, subprocess uses list form (no injection)Review
Critique Guardian: APPROVED (after fixing narrowed exception types, added type validation, removed dead symlink check)
Platform Impact
bashavailable natively,subprocess.runportable🤖 Generated with Claude Code