fix: reset auxiliary_is_nous for non-auto provider resolution paths - #16
Merged
Conversation
The module-level `auxiliary_is_nous` flag is only reset inside _resolve_auto(), which is never called when a task has an explicit provider configured (e.g. auxiliary.title_generation.provider: opencode-zen). A stale True value from a previous call (e.g. compression via auto→Nous) leaks Nous Portal tags into requests for non-Nous providers, causing HTTP 400 'Extra inputs are not permitted, field: tags'. Reset the flag in both call_llm() and async_call_llm() when the resolved provider is not 'auto', so it accurately reflects whether the current call targets Nous Portal.
🔎 Lint report:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fix stale
auxiliary_is_nousmodule-level global causing Nous Portal producttags (
tags: ['product=hermes-agent', 'client=hermes-client-v0.14.0']) toleak into auxiliary LLM requests for non-Nous providers, triggering HTTP 400
"Extra inputs are not permitted, field: 'tags'" errors.
Why
The
auxiliary_is_nousflag is only reset inside_resolve_auto(), which isthe auto-detection chain for auxiliary provider resolution. When a task has an
explicit provider configured in
config.yaml(e.g.auxiliary.title_generation.provider: opencode-zen), the provider resolvesdirectly via
_resolve_task_provider_model()—_resolve_auto()is nevercalled and the stale
Truevalue from a previous call (e.g. compressionrouting through Nous) persists.
In
_build_call_kwargs(), the conditionif provider == "nous" or auxiliary_is_nousthen injectsextra_body["tags"]into the OpenAI SDKrequest, which the downstream provider rejects.
How to Review
agent/auxiliary_client.py_resolve_task_provider_model()andbefore the provider resolution (
_get_cached_client/ vision path) inboth
call_llm()andasync_call_llm()resolved_provider != "auto"correctly skips thereset for the auto-detect path (where
_resolve_auto()already handles it)auxiliary_is_nous = (resolved_provider == "nous")is thecorrect assignment for explicit non-auto providers
Evidence
auxiliary.title_generation.provider: opencode-zenin
~/.hermes/config.yaml— title generation resolves to opencode-zen, not auto_resolve_task_provider_model("title_generation", None, None, None, None)returns
("opencode-zen", "kimi-k2.6", None, None, None)—_resolve_auto()never runsgit diff origin/mainshows +20 lines in both sync and async pathsrc=0on commit and pushVerification
Risks / Gaps
auxiliary_is_nous_resolve_auto()continues to handle the "auto" path independently — no change thereCollaborators