Skip to content

fix: scope learned notes to the failing tool; untrack .pyc files - #3

Merged
forumevi merged 1 commit into
forumevi:mainfrom
teknium1:hermes-catalog/tool-scoped-notes
Sep 27, 2026
Merged

forumevi merged 1 commit into
forumevi:mainfrom
teknium1:hermes-catalog/tool-scoped-notes

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Why

Follow-up to the Hermes plugin-catalog review of NousResearch/hermes-agent#124519 (the two leftovers noted there):

  1. A note learned for one tool was injected for another tool's error. query_patch matched on error_type/error_message only, so a session's bash ValueError could receive "Previous tool 'read_file' failed…" from a row another session had stored (reproduced live during the review). bf9f3fd stopped persisting the generic fallback, but the lookup still had no tool scope, and rows written by earlier versions stay in memory.db.
  2. 8 .pyc files were still tracked and the .gitignore added in bf9f3fd is UTF-16 with a BOM, which git does not read as ignore rules — so __pycache__/ was never actually ignored.

What

  • core/fts5_memory_patcher.py: tool_name is now a column of the FTS5 table; query_patch(tool_name, …) requires tool_name:"<tool>" AND (…); learn_from_outcome(tool_name, …) stores it. On a memory.db created by an older version the column does not exist, the query raises OperationalError, which the existing handler turns into None → the plugin falls back to the in-memory generic note instead of replaying another tool's row.
  • core/runtime_interceptor.py: passes tool_name through.
  • git rm --cached the 8 .pyc; .gitignore rewritten as ASCII (__pycache__/, *.pyc).
  • core/error_analyzer.py deleted — nothing imports it (README row removed too).
  • Tests updated to the new signature, plus one regression test (test_patch_is_scoped_to_tool: a read_file note is not returned for a bash error).

python -m pytest tests/test_self_healing.py → 19 passed. hermes plugins validate → ok, no warnings; install scanner → safe.

Once merged, the catalog entry can be re-pinned to the merge sha.

query_patch matched on error_type/error_message only, so a note stored for
one tool was injected for another tool's error. Add tool_name to the FTS5
table and require it in the lookup. Untrack the 8 committed .pyc files and
replace the UTF-16 .gitignore (unreadable by git) with an ASCII one. Drop
the unused core/error_analyzer.py.

Signed-off-by: teknium1 <teknium1@users.noreply.github.com>
@forumevi
forumevi merged commit b8ca86d into forumevi:main Sep 27, 2026
1 check passed
@forumevi

Copy link
Copy Markdown
Owner

Thanks @teknium1 for the direct fixes! Merged into main. I really appreciate the hands-on help. 🚀

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.

2 participants