Skip to content

fix(tests): resolve 10 CI failures across hooks, tiktoken, plugins#3848

Merged
teknium1 merged 1 commit intomainfrom
hermes/hermes-76df6a95
Mar 30, 2026
Merged

fix(tests): resolve 10 CI failures across hooks, tiktoken, plugins#3848
teknium1 merged 1 commit intomainfrom
hermes/hermes-76df6a95

Conversation

@teknium1
Copy link
Copy Markdown
Contributor

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-md hook 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_hooks in TestDiscoverAndLoad tests so they isolate user-hook discovery logic. The TestEmit tests are unaffected (boot-md only registers for gateway:startup, not agent:start).

test_tool_token_estimation.py — 2 failures

tiktoken is 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 plugins now dispatches to cmd_toggle() (interactive curses UI) instead of cmd_list().

Fix: Updated test to mock and assert cmd_toggle instead of cmd_list.

Verification

  • 68/68 targeted tests pass
  • 4509 passed, 0 failed across gateway + hermes_cli + tools suites
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.
@teknium1 teknium1 merged commit 2d264a4 into main Mar 30, 2026
3 checks passed
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant