fix(plugins): remove 8KB heuristic limit on memory-provider detection
Some checks failed
Nix / nix (ubuntu-latest) (pull_request) Failing after 22s
Nix Lockfile Check / nix-lockfile-check (pull_request) Failing after 25s
Contributor Attribution Check / check-attribution (pull_request) Failing after 48s
Supply Chain Audit / Scan PR for critical supply chain risks (pull_request) Successful in 42s
Tests / e2e (pull_request) Successful in 4m3s
Tests / test (pull_request) Failing after 46m23s
Nix / nix (macos-latest) (pull_request) Has been cancelled
Some checks failed
Nix / nix (ubuntu-latest) (pull_request) Failing after 22s
Nix Lockfile Check / nix-lockfile-check (pull_request) Failing after 25s
Contributor Attribution Check / check-attribution (pull_request) Failing after 48s
Supply Chain Audit / Scan PR for critical supply chain risks (pull_request) Successful in 42s
Tests / e2e (pull_request) Successful in 4m3s
Tests / test (pull_request) Failing after 46m23s
Nix / nix (macos-latest) (pull_request) Has been cancelled
The auto-coercion heuristic that detects memory provider plugins by scanning for `register_memory_provider` or `MemoryProvider` in the plugin's __init__.py was limited to the first 8192 bytes. Some third-party memory plugins (e.g. mempalace) place the registration call later in the file, causing the heuristic to miss them and load them as general plugins — which crashes because PluginContext does not expose `register_memory_provider`. The fix is to read the entire file instead of a fixed-size prefix. Plugin __init__.py files are small; the performance impact is negligible. The same fix is applied to both the general plugin auto-coercion (hermes_cli/plugins.py) and the memory-specific discovery helper (plugins/memory/__init__.py). Fixes #990 — mempalace plugin now auto-detected as exclusive and routed to the memory provider discovery path correctly.
This commit is contained in:
@@ -58,7 +58,7 @@ def _is_memory_provider_dir(path: Path) -> bool:
|
||||
if not init_file.exists():
|
||||
return False
|
||||
try:
|
||||
source = init_file.read_text(errors="replace")[:8192]
|
||||
source = init_file.read_text(errors="replace")
|
||||
return "register_memory_provider" in source or "MemoryProvider" in source
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user