Skip to content

fix: reset auxiliary_is_nous for non-auto provider resolution paths - #16

Merged
OmarB97 merged 1 commit into
mainfrom
fix/auxiliary-tags-leak-stale-global
May 28, 2026
Merged

fix: reset auxiliary_is_nous for non-auto provider resolution paths#16
OmarB97 merged 1 commit into
mainfrom
fix/auxiliary-tags-leak-stale-global

Conversation

@OmarB97

@OmarB97 OmarB97 commented May 28, 2026

Copy link
Copy Markdown
Owner

What

Fix stale auxiliary_is_nous module-level global causing Nous Portal product
tags (tags: ['product=hermes-agent', 'client=hermes-client-v0.14.0']) to
leak into auxiliary LLM requests for non-Nous providers, triggering HTTP 400
"Extra inputs are not permitted, field: 'tags'" errors.

Why

The auxiliary_is_nous flag is only reset inside _resolve_auto(), which is
the 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 resolves
directly via _resolve_task_provider_model()_resolve_auto() is never
called and the stale True value from a previous call (e.g. compression
routing through Nous) persists.

In _build_call_kwargs(), the condition if provider == "nous" or auxiliary_is_nous then injects extra_body["tags"] into the OpenAI SDK
request, which the downstream provider rejects.

How to Review

  1. Read the 20-line diff in agent/auxiliary_client.py
  2. Verify the guard is placed after _resolve_task_provider_model() and
    before the provider resolution (_get_cached_client / vision path) in
    both call_llm() and async_call_llm()
  3. Confirm the condition resolved_provider != "auto" correctly skips the
    reset for the auto-detect path (where _resolve_auto() already handles it)
  4. Check that auxiliary_is_nous = (resolved_provider == "nous") is the
    correct assignment for explicit non-auto providers

Evidence

  • Config confirmed: user has auxiliary.title_generation.provider: opencode-zen
    in ~/.hermes/config.yaml — title generation resolves to opencode-zen, not auto
  • Reproduced: _resolve_task_provider_model("title_generation", None, None, None, None)
    returns ("opencode-zen", "kimi-k2.6", None, None, None)_resolve_auto() never runs
  • Diff: git diff origin/main shows +20 lines in both sync and async paths
  • rc=0 on commit and push

Verification

# After merge, run auxiliary tasks with a non-Nous explicit provider
# Title generation should no longer include tags in the request body
grep -n "auxiliary_is_nous" agent/auxiliary_client.py  # verify both reset sites
python -m pytest tests/hermes_cli/test_aux_config.py -q  # verify title_generation config test

Risks / Gaps

  • accepted, no follow-up needed: The fix is additive (resets a global that was already stale); it cannot break providers that don't use auxiliary_is_nous
  • accepted, no follow-up needed: _resolve_auto() continues to handle the "auto" path independently — no change there

Collaborators

  • Participants: Omar (operator), Hermes Agent v0.14.0 (opencode-zen / mimo-v2.5)
  • Process: Single-pass diagnosis + fix, ~10 tool calls
  • Task context: fix-aux-tags-leak, hermes-agent bugfix, Size: S, Priority: High
  • Related work: None — standalone fix

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.
@github-actions

Copy link
Copy Markdown

🔎 Lint report: fix/auxiliary-tags-leak-stale-global vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 9543 on HEAD, 9543 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 5029 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@OmarB97
OmarB97 merged commit e5e60d5 into main May 28, 2026
15 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant