mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-15 09:21:36 +00:00
fix(agent): scope Nous tags to Nous auxiliary calls
This commit is contained in:
parent
08890d77e6
commit
819def44c7
3 changed files with 43 additions and 1 deletions
|
|
@ -5004,7 +5004,7 @@ def _build_call_kwargs(
|
|||
|
||||
# Provider-specific extra_body
|
||||
merged_extra = dict(extra_body or {})
|
||||
if provider == "nous" or auxiliary_is_nous:
|
||||
if provider == "nous":
|
||||
merged_extra.setdefault("tags", []).extend(_nous_portal_tags())
|
||||
if merged_extra:
|
||||
kwargs["extra_body"] = merged_extra
|
||||
|
|
|
|||
|
|
@ -81,6 +81,7 @@ AUTHOR_MAP = {
|
|||
"290859878+synapsesx@users.noreply.github.com": "synapsesx",
|
||||
"157689911+itsflownium@users.noreply.github.com": "itsflownium",
|
||||
"dirtyren@users.noreply.github.com": "dirtyren",
|
||||
"achaljhawar03@gmail.com": "achaljhawar",
|
||||
"claytonchew@ClaytonMacMiniM4.local": "claytonchew",
|
||||
"hbentel@gmail.com": "hbentel",
|
||||
"JustinBao@outlook.com": "justinbao19",
|
||||
|
|
|
|||
|
|
@ -146,6 +146,47 @@ class TestBuildCallKwargsMaxTokens:
|
|||
assert "max_completion_tokens" not in kwargs
|
||||
|
||||
|
||||
class TestNousTagsScoping:
|
||||
def test_tags_injected_when_provider_is_nous(self, monkeypatch):
|
||||
import agent.auxiliary_client as aux
|
||||
|
||||
monkeypatch.setattr(aux, "auxiliary_is_nous", False)
|
||||
|
||||
kwargs = aux._build_call_kwargs(
|
||||
provider="nous",
|
||||
model="hermes-4",
|
||||
messages=[{"role": "user", "content": "hi"}],
|
||||
)
|
||||
|
||||
assert kwargs["extra_body"]["tags"] == aux._nous_portal_tags()
|
||||
|
||||
def test_tags_not_injected_for_gemini_when_main_is_nous(self, monkeypatch):
|
||||
import agent.auxiliary_client as aux
|
||||
|
||||
monkeypatch.setattr(aux, "auxiliary_is_nous", True)
|
||||
|
||||
kwargs = aux._build_call_kwargs(
|
||||
provider="gemini",
|
||||
model="gemini-2.5-flash",
|
||||
messages=[{"role": "user", "content": "hi"}],
|
||||
)
|
||||
|
||||
assert "extra_body" not in kwargs
|
||||
|
||||
def test_tags_not_injected_for_openrouter_when_main_is_nous(self, monkeypatch):
|
||||
import agent.auxiliary_client as aux
|
||||
|
||||
monkeypatch.setattr(aux, "auxiliary_is_nous", True)
|
||||
|
||||
kwargs = aux._build_call_kwargs(
|
||||
provider="openrouter",
|
||||
model="openai/gpt-5.4",
|
||||
messages=[{"role": "user", "content": "hi"}],
|
||||
)
|
||||
|
||||
assert "extra_body" not in kwargs
|
||||
|
||||
|
||||
class TestNormalizeAuxProvider:
|
||||
def test_maps_github_copilot_aliases(self):
|
||||
assert _normalize_aux_provider("github") == "copilot"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue