From e5a244ad5d78013a54eaed754f4882b3a5dd4acc Mon Sep 17 00:00:00 2001 From: teknium1 Date: Tue, 17 Mar 2026 04:02:15 -0700 Subject: [PATCH] fix(aux): reset auxiliary_is_nous flag on each resolution attempt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The module-level auxiliary_is_nous was set to True by _try_nous() and never reset. In long-running gateway processes, once Nous was resolved as auxiliary provider, the flag stayed True forever — even if subsequent resolutions chose a different provider (e.g. OpenRouter). This caused Nous product tags to be sent to non-Nous providers. Reset the flag at the start of _resolve_auto() so only the winning provider's flag persists. --- agent/auxiliary_client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/agent/auxiliary_client.py b/agent/auxiliary_client.py index 3142e4894..a0807d8ab 100644 --- a/agent/auxiliary_client.py +++ b/agent/auxiliary_client.py @@ -706,6 +706,8 @@ def _resolve_forced_provider(forced: str) -> Tuple[Optional[OpenAI], Optional[st def _resolve_auto() -> Tuple[Optional[OpenAI], Optional[str]]: """Full auto-detection chain: OpenRouter → Nous → custom → Codex → API-key → None.""" + global auxiliary_is_nous + auxiliary_is_nous = False # Reset — _try_nous() will set True if it wins for try_fn in (_try_openrouter, _try_nous, _try_custom_endpoint, _try_codex, _resolve_api_key_provider): client, model = try_fn()