The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
refactor(data-use): trim comments to the why
Siddharth Balyan0c07f2184340
diff --git a/agent/chat_completion_helpers.py b/agent/chat_completion_helpers.pyindex 1b905dda718..8eca017fc1b 100644--- a/agent/chat_completion_helpers.py+++ b/agent/chat_completion_helpers.py@@ -500,9 +500,8 @@ def _prompt_cache_scope_for_agent(agent) -> str | None:def _merge_nous_portal_messages_extra_body(agent, anthropic_kwargs: dict, api_messages: list) -> dict:- """Merge Portal ``tags`` / ``session_id`` / data-use ``provider`` onto an Anthropic Messages kwargs- dict. The Nous profile is only consulted by the OpenAI-wire transport; never- ``provider_preferences`` (an OpenAI-wire routing object)."""+ """The Nous profile body on the Messages wire, which the profile hook never reaches; never+ ``provider_preferences`` (OpenAI-wire routing the Portal 400s on)."""if getattr(agent, "provider", None) not in {"nous", "nous-portal", "nousresearch"}:return anthropic_kwargstry:diff --git a/agent/error_classifier.py b/agent/error_classifier.pyindex f6b63eb6df2..7ba8befa812 100644--- a/agent/error_classifier.py+++ b/agent/error_classifier.py@@ -863,8 +863,7 @@ def _nous_welcome_tier(c: _Ctx) -> Optional[Verdict]:def _provider_special_cases(c: _Ctx) -> Optional[Verdict]:"""Highest-priority provider-specific shapes that a status code would misroute."""msg, status = c.msg, c.status_code- # Nous API: the request's data-use requirement (from a connector result) has no qualifying endpoint.- # Deterministic for this context on any provider, so no retry and no fallback.+ # Deterministic for this context: another provider would receive the same connector result.if c.code == "data_policy_denied":return _v(_R.data_policy_denied, retryable=False, should_fallback=False)welcome = _nous_welcome_tier(c)diff --git a/agent/message_metadata.py b/agent/message_metadata.pyindex c588a5e19b3..98d84eb9636 100644--- a/agent/message_metadata.py+++ b/agent/message_metadata.py@@ -50,8 +50,7 @@ PERSISTENCE_ONLY_MESSAGE_FIELDS = frozenset() | REPAIR_BOOKKEEPING_FIELDS-# A tool message's connector data-use requirement (``no_training`` / ``zero_retention``): set from the-# gateway's ``dataUse``, persisted inside ``display_metadata``, read by the Nous profile, stripped by the transport.+# Connector data-use requirement on a tool message; persisted inside ``display_metadata``, never sent to a model.DATA_USE = "data_use"