Files
hermes-agent/tests/agent/test_secret_scope_user_message.py
T
teknium1 23036e20a6 fix(ux): plain-language, actionable user-facing messages (core)
Squashed integration of the user-facing message audit for this surface set.
Full per-finding receipts: /tmp/ux-audit/lanes/*-receipt.md (campaign artifacts).
2026-09-15 04:12:13 -07:00

29 lines
968 B
Python

"""UnscopedSecretError reaches end users verbatim (compression-aborted replies, cron notices), so
`str(exc)` must be the one actionable sentence; the developer diagnosis stays in `__notes__`/logs.
"""
import pytest
import agent.secret_scope as ss
@pytest.fixture
def multiplex_on():
ss.set_multiplex_active(True)
try:
yield
finally:
ss.set_multiplex_active(False)
def test_str_is_a_user_sentence_and_developer_detail_rides_the_notes(multiplex_on):
with pytest.raises(ss.UnscopedSecretError) as info:
ss.get_secret("OPENROUTER_API_KEY")
exc = info.value
text = str(exc)
assert "OPENROUTER_API_KEY" in text # still names what could not be read
assert "hermes gateway restart" in text and "hermes debug share" in text
for jargon in ("set_secret_scope", "Workstream", "developer-guide", "os.environ"):
assert jargon not in text
assert any("set_secret_scope" in note for note in exc.__notes__)