fix(tests): resolve 10 CI failures across hooks, tiktoken, plugins#3848
Merged
fix(tests): resolve 10 CI failures across hooks, tiktoken, plugins#3848
Conversation
test_hooks.py (7 failures): Built-in boot-md hook was always loaded
by _register_builtin_hooks(), adding +1 to every expected hook count.
Mock out built-in registration in TestDiscoverAndLoad so tests isolate
user-hook discovery logic.
test_tool_token_estimation.py (2 failures): tiktoken is not in
core/[all] dependencies. The estimation function gracefully returns {}
when tiktoken is missing, but tests expected non-empty results. Added
skipif markers for tests that need tiktoken.
test_plugins_cmd.py (1 failure): bare 'hermes plugins' now dispatches
to cmd_toggle() (interactive curses UI) instead of cmd_list(). Updated
test to match the new behavior.
itsXactlY
pushed a commit
to itsXactlY/hermes-agent
that referenced
this pull request
Mar 30, 2026
…ousResearch#3848) test_hooks.py (7 failures): Built-in boot-md hook was always loaded by _register_builtin_hooks(), adding +1 to every expected hook count. Mock out built-in registration in TestDiscoverAndLoad so tests isolate user-hook discovery logic. test_tool_token_estimation.py (2 failures): tiktoken is not in core/[all] dependencies. The estimation function gracefully returns {} when tiktoken is missing, but tests expected non-empty results. Added skipif markers for tests that need tiktoken. test_plugins_cmd.py (1 failure): bare 'hermes plugins' now dispatches to cmd_toggle() (interactive curses UI) instead of cmd_list(). Updated test to match the new behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes all 10 CI test failures on main (7078 passed, 10 failed → 7088 passed, 0 failed).
test_hooks.py — 7 failures
Built-in
boot-mdhook is always loaded by_register_builtin_hooks(), which runs before user-hook discovery. Tests expected 0/1/2 loaded hooks but got +1 from boot-md.Fix: Mock out
_register_builtin_hooksinTestDiscoverAndLoadtests so they isolate user-hook discovery logic. TheTestEmittests are unaffected (boot-md only registers forgateway:startup, notagent:start).test_tool_token_estimation.py — 2 failures
tiktokenis not in core or[all]dependencies. The_estimate_tool_tokens()function gracefully returns{}when tiktoken is missing, but tests asserted non-empty results.Fix: Added
@skipif(not _has_tiktoken)markers on the 3 tests that need actual tiktoken. The graceful-degradation test (test_returns_empty_when_tiktoken_unavailable) still runs unconditionally.test_plugins_cmd.py — 1 failure
Bare
hermes pluginsnow dispatches tocmd_toggle()(interactive curses UI) instead ofcmd_list().Fix: Updated test to mock and assert
cmd_toggleinstead ofcmd_list.Verification