Skip to content

fix: lazy-import eth_abi + declare python_dependencies (Hermes catalog validate) - #54

Open
teknium1 wants to merge 1 commit into
clawnchdev:mainfrom
teknium1:catalog-validate-fix
Open

teknium1 wants to merge 1 commit into
clawnchdev:mainfrom
teknium1:catalog-validate-fix

Conversation

@teknium1

Copy link
Copy Markdown

hermes plugins validate fails at HEAD with capability probe: import failed: No module named 'eth_abi': clawmes/delegation/encoding.py imports eth_abi/eth_utils at module level and is reached from import clawmes (commands.delegation → compiler), so the plugin cannot load wherever those packages are missing. Hermes never auto-installs plugin dependencies and the validate probe imports the module in a bare environment, so this also blocks catalog CI.

This PR turns the two imports into thin lazy abi_encode()/keccak() wrappers (all call sites unchanged), replaces the six module-level SEL_* computations with their precomputed literal values (each equals selector(<sig>); four are already pinned by tests/delegation/test_encoding.py, all six re-verified against eth_utils.keccak), and declares python_dependencies in plugin.yaml mirroring pyproject.toml (plus eth-abi, which is imported directly). tests/delegation/test_encoding.py + test_compiler.py: 53 passed before and after.

Before: capability probe: import failed: No module named 'eth_abi' → After: ok: true (register() ran in isolation) in both a full Hermes venv and a bare Python 3.11 Hermes install.

With this merged, hermes plugins validate passes and Hermes maintainers can list the plugin in the plugin catalog at the merged commit (see NousResearch/hermes-agent#112292 for the sweep).

…ugins validate passes

`hermes plugins validate` fails at HEAD with
`capability probe: import failed: No module named 'eth_abi'` because
clawmes/delegation/encoding.py imports eth_abi/eth_utils at module level
and is reached from `import clawmes` (commands.delegation -> compiler).
Hermes never auto-installs plugin dependencies and the probe imports the
plugin bare, so the whole plugin failed to load wherever eth-abi is absent.

- encoding.py: thin abi_encode()/keccak() wrappers import lazily; call
  sites unchanged. SEL_* selectors become the literal precomputed values
  (each == selector(sig); pinned by tests/delegation/test_encoding.py).
- plugin.yaml: declare python_dependencies (mirrors pyproject + eth-abi).

tests/delegation/test_encoding.py + test_compiler.py: 53 passed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant