fix: strip LiteLLM provider prefix before hermes -m#66
Merged
Conversation
Closed-loop validation has been silently scoring 0/N for any user who
passed a LiteLLM-formatted model string (e.g. `openai/gpt-4o-mini`) to
`--closed-loop-agent-model`. The hermes `-m` flag interprets
`<provider>/<model>` as openrouter-style routing, which switches the
subprocess base_url to openrouter.ai. An OpenAI key in the user's hermes
config isn't valid for openrouter, so the agent loop dies with no turn
and the framework reports it as `uniform_failure` ("validator too weak"),
hiding the real cause.
Strip known LiteLLM provider prefixes in HermesAgentRunner.__init__ so
users get the behavior they expect from the model string they use
everywhere else in the framework. Unknown prefixes pass through, so
openrouter-style routing through an unrecognized vendor still works.
Verified end-to-end: same probe that previously reported 0/7 (with the
bug) now reports 7/7 with `gpt-5.4-mini` and 6/7 with `gpt-5-mini` — the
validator was working all along, just routed wrong.
2 tasks
jramos
added a commit
that referenced
this pull request
May 23, 2026
) The "validator appears too weak" suggestion was actively misleading historically: hermes -m treated LiteLLM provider prefixes as openrouter routing, breaking auth and returning 0-turn sessions that the framework counted as task failures. Users (and reviewers) followed the suggestion to bump model strength when the actual fix was routing. Now that the routing bug is fixed (#66), the residual uniform_failure cases are more likely to be misconfiguration than capability. Lead the suggestion list with "first check the validator actually ran" and point users at the run.log line that confirms routing. Panel title softened from "validator too weak" to "closed-loop scored zero on every task" — observation, not diagnosis.
3 tasks
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.
Summary
Closed-loop validation has been silently scoring 0/N for any user who passed a LiteLLM-formatted model string (e.g.
openai/gpt-4o-mini) to--closed-loop-agent-model. The fix is one helper + a normalization step inHermesAgentRunner.__init__.The bug
hermes -m <provider>/<model>interprets the prefix as openrouter-style routing — it silently switches the subprocessbase_urltoopenrouter.ai. An OpenAI key in the user's hermes config isn't valid for openrouter, so the agent loop dies with no turn. The session JSON contains only the user message, and the framework counts the task as failed.Repro on this machine:
vs the bare-model version which works:
Impact
The framework's saturation pre-flight reported this as
uniform_failure("validator too weak — try a stronger model"), which is the wrong diagnosis — every model tested (nano, mini, gpt-5.4-mini, gpt-5.4) scored 0/7 because of the prefix bug, not because of capability. After the fix, the same probe withgpt-5.4-miniscores 7/7 andgpt-5-miniscores 6/7. The validator was working all along, just routed wrong.This also means all prior
evolve_tool/evolve_skillruns that passed--closed-loop-agent-model openai/…have been getting a contaminated closed-loop signal.The fix
HermesAgentRunner.__init__strips a known LiteLLM provider prefix (openai/,anthropic/,azure/,gemini/,cohere/,bedrock/,mistral/) from the model string and logs the transformation. Unknown prefixes pass through unchanged, so openrouter-style routing through an unrecognized vendor still works.Test plan
uv run pytest -q— expect 1090 passed (+8 new tests acrossTestStripLitellmProviderPrefixand the new integration test inTestHermesAgentRunnerSubprocess).uv run python -m evolution.tools.evolve_tool --tool write_file --manifest …/hermes-agent/tools/ --closed-loop-during-evolution evolution/validation/suites/write_file.jsonl --closed-loop-hermes-repo …/hermes-agent --closed-loop-agent-model openai/gpt-5.4-mini --iterations 1— expect saturation panel to showClosed-loop (behavioral): 1.000 over 7 tasksand aStripped LiteLLM provider prefix …log line.Scope notes
uniform_failuresuggestions; those will be less misleading now that the underlying bug is fixed. A separate pass could tighten the wording (e.g., "check that --closed-loop-agent-model is reachable from your hermes config").--closed-loop-agent-model-routingflag for openrouter users. If anyone hits issues with the strip, that becomes a follow-up.