fix(aux): reset auxiliary_is_nous flag on each resolution attempt
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.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user