Skip to content

DROID_PLUGIN_ROOT env var in plugin hooks is the literal sentinel /PLUGIN_ROOT_NOT_EXPANDED_ERROR #5

Description

@Roderick-Clemente

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions