Conversation
Port from Kilo-Org/kilocode#9068. hermes-agent is tool-calling-first — every provider path assumes the model can invoke tools. Models whose OpenRouter supported_parameters doesn't include 'tools' (e.g. image-only or completion-only models) cannot be driven by the agent loop and fail at the first tool call. Filter them out of fetch_openrouter_models() so they never appear in the model picker (`hermes model`, setup wizard, /model slash command). Permissive when the field is missing — OpenRouter-compatible gateways (Nous Portal, private mirrors, older snapshots) don't always populate supported_parameters. Treat missing as 'unknown → allow' rather than silently emptying the picker on those gateways. Only hide models whose supported_parameters is an explicit list that omits tools. Tests cover: tools present → kept, tools absent → dropped, field missing → kept, malformed non-list → kept, non-dict item → kept, empty list → dropped.
Collaborator
Author
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
Hide OpenRouter models whose
supported_parametersdoesn't includetoolsfrom the model picker. Selecting one previously led to immediate runtime failures at the first tool call because hermes-agent's entire agent loop assumes tool calling.Ported from Kilo-Org/kilocode#9068 by @gaganHanda-kilo — same rationale applies: agents that require tool calling shouldn't surface non-tool models in their picker.
Changes
hermes_cli/models.py— Added_openrouter_model_supports_tools()helper. Call it infetch_openrouter_models()to drop curated entries whose live OpenRouter catalog entry explicitly omitstoolsfromsupported_parameters.tests/hermes_cli/test_models.py— 9 new tests covering the helper and the integration point.Behavior
supported_parameterson model[..., "tools", ...][...]without "tools"[](empty list)null/ not a listWhy permissive on missing: Some OpenRouter-compatible gateways (Nous Portal, private mirrors, older catalog snapshots) don't populate
supported_parametersat all. Hard-dropping on missing would silently empty the picker for those users. Only models that explicitly advertise capabilities without tools are hidden. Matches Kilo's same stance.How this adapts to hermes-agent's architecture
Kilo filters in
packages/kilo-gateway/src/api/models.ts(TypeScript, gateway-side). Hermes pulls the catalog directly from OpenRouter's/v1/modelsendpoint insidefetch_openrouter_models(), so the filter lives there — one chokepoint that feedshermes model, the setup wizard, and the/modelslash command.No behavioral change for users whose gateway doesn't populate
supported_parameters(the permissive fallback). Visible change for OpenRouter direct: image-only models likegoogle/gemini-3-pro-image-preview(currently in the curatedOPENROUTER_MODELSlist) will stop appearing in pickers — which is the desired outcome for a tool-calling-first agent.Test plan
Part of the weekly Kilo Code PR scout port — 49 other merged PRs were reviewed this week; most were VS Code/JetBrains/UI-specific and not applicable, and the closely relevant ones (
#9067queued-prompt ordering,#9069opus-4.7 adaptive reasoning,#9199suggest-tool busy state) were structurally already handled in hermes-agent.