mirror of
https://github.com/obra/superpowers.git
synced 2026-07-26 04:04:03 +08:00
feat(hermes): Hermes Agent harness support, rebased to a Hermes-only diff
Rebase of PR #1922 onto current dev: the ~14 files of v6.1.0-era codex/release drift are dropped, the porting-guide edits (stale against the post-prune rewrite, no Hermes content) are dropped, and the Hermes surface is kept intact: .hermes-plugin/ (on_session_start bootstrap injection), tests/hermes/ (20 tests, passing), docs/README.hermes.md, references/hermes-tools.md, the Platform Adaptation row, README section, and Python ignores. Known open items from review, unchanged by this rebase: the injection mechanism uses ctx.inject_message from on_session_start, which the official plugin guide does not document (pre_llm_call returning {"context": ...} is the sanctioned path), skills are not registered via ctx.register_skill, and the acceptance transcript predates the fix. Co-authored-by: kumarabd <kumarabd@users.noreply.github.com>
This commit is contained in:
19
tests/hermes/conftest.py
Normal file
19
tests/hermes/conftest.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import pytest
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_ctx():
|
||||
ctx = MagicMock()
|
||||
ctx._hooks = {}
|
||||
ctx._injected = []
|
||||
|
||||
def register_hook(event, fn):
|
||||
ctx._hooks[event] = fn
|
||||
|
||||
def inject_message(content, role="user"):
|
||||
ctx._injected.append({"content": content, "role": role})
|
||||
|
||||
ctx.register_hook.side_effect = register_hook
|
||||
ctx.inject_message.side_effect = inject_message
|
||||
return ctx
|
||||
Reference in New Issue
Block a user