mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-27 17:58:07 +00:00
test(conversation): add runtime surface drift test for stored-prompt staleness check
This commit is contained in:
parent
a2b0d6d8e4
commit
30cd6e989d
1 changed files with 18 additions and 0 deletions
|
|
@ -485,3 +485,21 @@ class TestStoredPromptCwdDrift:
|
|||
assert _stored_prompt_matches_runtime(agent, stored_prompt) is True, (
|
||||
"Expected True when stored cwd matches current cwd"
|
||||
)
|
||||
|
||||
def test_stored_prompt_stale_when_runtime_surface_differs(self):
|
||||
"""Desktop GUI marker in stored prompt must not be reused when running in terminal."""
|
||||
from unittest.mock import patch
|
||||
from agent.conversation_loop import _stored_prompt_matches_runtime
|
||||
|
||||
agent = self._make_agent()
|
||||
stored_prompt = (
|
||||
"Runtime surface: you're running inside the Hermes desktop GUI app.\n"
|
||||
"Model: test/model\n"
|
||||
"Provider: openrouter\n"
|
||||
)
|
||||
|
||||
# Current runtime is terminal/CLI: no desktop marker.
|
||||
with patch.dict(os.environ, {"HERMES_DESKTOP": ""}, clear=False):
|
||||
assert _stored_prompt_matches_runtime(agent, stored_prompt) is False, (
|
||||
"Expected False when stored prompt claims desktop but HERMES_DESKTOP is unset"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue