Skip to content

The agent that grows with you

fix(data-use): tell free-tier users why every free model refuses

Siddharth Balyan9443a4d82e30
diff --git a/agent/turn_failure_copy.py b/agent/turn_failure_copy.py
index f6b466c0cd4..6fbba663daa 100644
--- a/agent/turn_failure_copy.py
+++ b/agent/turn_failure_copy.py
@@ -217,10 +217,10 @@ _NONRETRYABLE_COPY: dict[str, str] = {
"models with /model."
),
FailoverReason.data_policy_denied.value: (
- "This conversation contains a result from a connected app that may only be sent to a model "
- "that does not train on your data, and '{model}' on {label} can't guarantee that. Switch to "
- "another model with /model, run /compress to summarize the result away, or start a new "
- "session with /new."
+ "This conversation holds a result from a connected app that may only go to a model that "
+ "does not train on your data, and '{model}' on {label} can't promise that. Switch models "
+ "with /model, run /compress to summarize the result away, or start fresh with /new. If you "
+ "are on the free tier, no free model can take this content: upgrade, or use /compress or /new."
),
FailoverReason.upstream_blocked.value: (
"A firewall/CDN in front of {label} blocked the request before it reached the model, so "
diff --git a/tests/agent/test_error_classifier_data_policy.py b/tests/agent/test_error_classifier_data_policy.py
index 9b7cda502ce..3ad8442c2d8 100644
--- a/tests/agent/test_error_classifier_data_policy.py
+++ b/tests/agent/test_error_classifier_data_policy.py
@@ -16,3 +16,14 @@ def test_403_data_policy_denied_never_retries_or_falls_back():
result = classify_api_error(_ForbiddenError(body), provider="nous")
assert result.reason == FailoverReason.data_policy_denied
assert (result.retryable, result.should_fallback, result.should_rotate_credential) == (False, False, False)
+
+
+def test_data_policy_copy_gives_free_tier_users_a_way_out():
+ from types import SimpleNamespace
+
+ from agent.turn_failure_copy import nonretryable_copy
+
+ copy = nonretryable_copy(SimpleNamespace(reason=FailoverReason.data_policy_denied), provider="nous",
+ model="some/model", summary="No endpoint qualifies.")
+ free_tier = copy[copy.index("free tier"):]
+ assert "'some/model'" in copy and "upgrade" in free_tier and "/compress" in free_tier and "/new" in free_tier