Skip to content

The agent that grows with you

test(nous): give the outage-copy negatives their anonymous arm; trim the identity matrix

kshitijk4poor149c2d323f4f
diff --git a/tests/agent/test_welcome_error_identity.py b/tests/agent/test_welcome_error_identity.py
index b9d34aca965..7d57bedfa64 100644
--- a/tests/agent/test_welcome_error_identity.py
+++ b/tests/agent/test_welcome_error_identity.py
@@ -25,10 +25,8 @@ def agent_for(api_key, base_url):
)
[email protected]("api_key", [
- make_jwt(account_tier="free", client_id="hermes-cli"),
- make_jwt(account_tier="paid", client_id="hermes-cli"), "sk-named", None,
-], ids=["named-free", "named-paid", "api-key", "unknown"])
[email protected]("api_key", [make_jwt(account_tier="free", client_id="hermes-cli"), "sk-named"],
+ ids=["named-free", "api-key"])
@pytest.mark.parametrize("base_url", [NAMED, WELCOME])
@pytest.mark.parametrize("case", ["rate_limited", "at_capacity", "admission_closed", "model_not_free", "feature_not_free", "403", "503"])
def test_named_errors_do_not_offer_anonymous_recovery(api_key, base_url, case):
@@ -88,7 +86,6 @@ def test_signing_in_does_not_inherit_anonymous_cooldown(tmp_path, monkeypatch, t
named_blocked = guard_for(guest)
assert named_blocked.action == "return"
assert "free_tier" not in named_blocked.result
- assert "Your Nous account has hit its rate limit" in named_blocked.result["final_response"]
clear_nous_rate_limit()
assert nous_rate_limit_remaining() is None
assert nous_rate_limit_remaining(anonymous=True) > 0
diff --git a/tests/agent/test_welcome_tier_recovery.py b/tests/agent/test_welcome_tier_recovery.py
index 76e17ecc112..5976a065657 100644
--- a/tests/agent/test_welcome_tier_recovery.py
+++ b/tests/agent/test_welcome_tier_recovery.py
@@ -175,10 +175,12 @@ class TestOutageCopy:
def test_other_routes_and_other_reasons_keep_the_technical_summary(self):
from agent.turn_recovery import _welcome_outage_copy
- assert _welcome_outage_copy(PAID, SimpleNamespace(reason=FailoverReason.timeout)) == ""
- assert _welcome_outage_copy(WELCOME, SimpleNamespace(reason=FailoverReason.rate_limit)) == ""
+ assert _welcome_outage_copy(PAID, SimpleNamespace(reason=FailoverReason.timeout), anonymous=True) == ""
+ assert _welcome_outage_copy(WELCOME, SimpleNamespace(reason=FailoverReason.rate_limit), anonymous=True) == ""
# ``unknown`` is the catch-all for status-less local failures, not the free model's trouble.
- assert _welcome_outage_copy(WELCOME, SimpleNamespace(reason=FailoverReason.unknown)) == ""
+ assert _welcome_outage_copy(WELCOME, SimpleNamespace(reason=FailoverReason.unknown), anonymous=True) == ""
+ # A named account's outage is its provider's trouble, not the free model's.
+ assert _welcome_outage_copy(WELCOME, SimpleNamespace(reason=FailoverReason.timeout)) == ""
class TestTerminalResultsCarryTheFreeTierBlock: