a0c802c02c
The local-endpoint context probe (_query_local_context_length_uncached) treated max_tokens — an output-completion cap — as a candidate for the model's context window. For OpenAI-compatible gateways that advertise a 1M context via context_size / max_input_tokens alongside a smaller max_tokens output cap (e.g. TokenHub serving deepseek-v4-flash: context_size=1048576, max_input_tokens=1048576, max_tokens=393216), Hermes mis-detected the window as 393,216 and — because loopback endpoints are reconciled against a live probe — actively overwrote a previously-correct 1M cache entry. - Add context_size and max_input_tokens to both /v1/models probe candidate lists (single-model detail and list branches). - Remove max_tokens from the context-length candidates; it remains handled separately as an output cap (_MAX_COMPLETION_KEYS). Adds regression tests covering context_size/max_input_tokens priority over max_tokens and the max_tokens-only (no real context key) case.