Files
hermes-agent/scripts
Jan-Stefan Janetzky de5f8e90d6 fix(pm): admit plugin and extra changes against a Nix package's environment
On a Nix package every `hermes plugins enable|disable`, plugin install,
plugin update and `hermes pm install` died in the venv stamp: PM looked
for uv.lock beside the wheel-installed modules (#140765). Shipping the
lockfile does not help, because the sync then builds a dependency
generation from a source tree the package does not carry.

A Nix package's environment is its store closure, so the sync no longer
builds there. On a `distribution: nix` install it checks what a plugin
change brings in, and what extras were asked for, against the
distributions the application can already import, publishes the change
when they are satisfied, and refuses by package name otherwise, pointing
at extraPythonPackages and extraDependencyGroups. The sync records no
dependency state and downloads nothing.

- pm/nix_admission.py: the check. The application's sys.path reaches
  every PM child through runtime_environment(), so the worker and
  `hermes pm ...` judge the same environment.
- A plugin that was already enabled is not re-judged by an unrelated
  change, so one enabled by hand cannot block enabling or disabling
  another, or itself.
- `hermes pm install` without --extra no longer asks a Nix package for
  [all]: the package variant chose its extras.
- Only the executing tree resolves through the package's stamp; a Nix
  install asked to sync another checkout reads that checkout's.

Fixes #140765

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-30 15:08:02 +05:30
..
…