Files
hermes-agent/plugins/cron_providers
Maciej Lisiewski d8fdbe8a54 fix(plugins): keep config-selected plugin names inside their plugin root (#155450)
* fix(plugins): keep config-selected plugin names inside their plugin root

memory.provider, cron.provider and context.engine were joined onto the
plugin root unchecked, so a path-shaped name loaded a package from
anywhere. Worse, the "is bundled" test was lexical (Path.parents), so a
`<root>/../..` spelling counted as bundled and was imported in-process
even under plugins.isolation: host. Names must now be a plain directory
segment (invalid = not found, so the built-in fallbacks apply), and the
bundled test compares resolved paths.

Fixes #141328

* fix(plugins): a user-dir symlink into the bundled root is not bundled

is_direct_child compared resolved paths only, so $HERMES_HOME/plugins/<x>
linking into a bundled dir counted as bundled and loaded in-process past
plugins.isolation: host (and the link could be swapped between check and
import). Require the path to sit under the root both as written and resolved.

Refs #141328

* test(plugins): satisfy ruff PLR0402 and cover the resolved half of is_direct_child

Use `from plugins import ...` instead of aliased submodule imports (ruff
PLR0402 failed the Python lints lane). Add a bundled-root child symlink that
resolves outside the root, so dropping the resolved comparison in
is_direct_child is caught.

Refs #141328

Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>

---------

Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
2026-11-14 12:48:09 +01:00
..