Files
hermes-agent/agent
jakobdylanc f28c52845a fix(models): resolve routed OpenRouter ids in models.dev catalog lookups
Extends the routing-variant fix to the sibling catalog paths, so the whole
bug class is covered rather than just context length (#97820).

_find_model_entry(), lookup_models_dev_context(), get_model_info(), and
get_model_capabilities() all keyed on the full suffixed id, so a routed id
such as z-ai/glm-5.3-flash:floor missed models.dev and fell through to the
generic "glm" family default (202,752 instead of 1,310,720).

The retry with the base id runs LAST — after exact and case-insensitive
matching — so a real catalog SKU always wins over its base.

:free and :batch are deliberately NOT stripped. They are real catalog SKUs,
not routing modifiers: OpenRouter's /models currently lists 18 :free and 65
:batch entries, and 13 of those carry a context window different from their
base (z-ai/glm-5.2:free is 256K vs the base's 1.05M). Stripping them would
report a window LARGER than the model has, so the request fails at the API
instead of merely compacting early — a worse failure than the under-report
this fixes. An absent SKU must also miss rather than inherit the base, so
model_overrides _default fill-gap semantics keep working.

The suffix set is shared from hermes_constants, so validation, context
resolution, and catalog lookup all agree on one definition.
2026-09-11 16:50:20 -07:00
..
…
…
…