Summary
The DROID_PLUGIN_ROOT environment variable handed to a plugin's hook script is the literal sentinel string /PLUGIN_ROOT_NOT_EXPANDED_ERROR, not the plugin's install path. Substitution of ${DROID_PLUGIN_ROOT} into the hook's command string works, but a script that reads the variable from its own environment at runtime gets an invalid path.
Environment
droid 0.186.0, macOS (darwin 24.6.0), droid exec mode
Reproduction
Ship a plugin whose hooks/hooks.json declares command: python3 ${DROID_PLUGIN_ROOT}/hooks/canary.py. Install it, trigger the hook. The command-string substitution resolves correctly (the script runs). Inside the script, os.environ["DROID_PLUGIN_ROOT"] returns:
DROID_PLUGIN_ROOT=/PLUGIN_ROOT_NOT_EXPANDED_ERROR
Expected
The env var, if provided, holds the plugin's resolved root path so a hook script can locate its sibling files (a common and documented-adjacent pattern).
Actual
It is a literal sentinel that looks like an internal error leaked into the environment. A hook resolving sibling files (e.g. a hash manifest) via the env var will fail or mis-resolve. Workaround: pass the root as a command argument instead of reading the environment.
Summary
The
DROID_PLUGIN_ROOTenvironment variable handed to a plugin's hook script is the literal sentinel string/PLUGIN_ROOT_NOT_EXPANDED_ERROR, not the plugin's install path. Substitution of${DROID_PLUGIN_ROOT}into the hook'scommandstring works, but a script that reads the variable from its own environment at runtime gets an invalid path.Environment
droid0.186.0, macOS (darwin 24.6.0),droid execmodeReproduction
Ship a plugin whose
hooks/hooks.jsondeclarescommand: python3 ${DROID_PLUGIN_ROOT}/hooks/canary.py. Install it, trigger the hook. The command-string substitution resolves correctly (the script runs). Inside the script,os.environ["DROID_PLUGIN_ROOT"]returns:Expected
The env var, if provided, holds the plugin's resolved root path so a hook script can locate its sibling files (a common and documented-adjacent pattern).
Actual
It is a literal sentinel that looks like an internal error leaked into the environment. A hook resolving sibling files (e.g. a hash manifest) via the env var will fail or mis-resolve. Workaround: pass the root as a command argument instead of reading the environment.