fix(gateway): use profile-aware Hermes paths in runtime hints
This commit is contained in:
@@ -144,6 +144,18 @@ class TestGatewayPersonalityNone:
|
||||
|
||||
assert "none" in result.lower()
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_empty_personality_list_uses_profile_display_path(self, tmp_path):
|
||||
runner = self._make_runner(personalities={})
|
||||
(tmp_path / "config.yaml").write_text(yaml.dump({"agent": {"personalities": {}}}))
|
||||
|
||||
with patch("gateway.run._hermes_home", tmp_path), \
|
||||
patch("hermes_constants.display_hermes_home", return_value="~/.hermes/profiles/coder"):
|
||||
event = self._make_event("")
|
||||
result = await runner._handle_personality_command(event)
|
||||
|
||||
assert result == "No personalities configured in `~/.hermes/profiles/coder/config.yaml`"
|
||||
|
||||
|
||||
class TestPersonalityDictFormat:
|
||||
"""Test dict-format custom personalities with description, tone, style."""
|
||||
|
||||
@@ -283,6 +283,19 @@ class TestBuildSessionContextPrompt:
|
||||
assert "Local" in prompt
|
||||
assert "machine running this agent" in prompt
|
||||
|
||||
def test_local_delivery_path_uses_display_hermes_home(self):
|
||||
config = GatewayConfig()
|
||||
source = SessionSource(
|
||||
platform=Platform.LOCAL, chat_id="cli",
|
||||
chat_name="CLI terminal", chat_type="dm",
|
||||
)
|
||||
ctx = build_session_context(source, config)
|
||||
|
||||
with patch("hermes_constants.display_hermes_home", return_value="~/.hermes/profiles/coder"):
|
||||
prompt = build_session_context_prompt(ctx)
|
||||
|
||||
assert "~/.hermes/profiles/coder/cron/output/" in prompt
|
||||
|
||||
def test_whatsapp_prompt(self):
|
||||
config = GatewayConfig(
|
||||
platforms={
|
||||
|
||||
Reference in New Issue
Block a user