Skip to content

fix: case-insensitive model family matching + compressor init logging - #2350

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-40b195db
Mar 21, 2026
Merged

fix: case-insensitive model family matching + compressor init logging#2350
teknium1 merged 1 commit into
mainfrom
hermes/hermes-40b195db

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Investigating a user report where a 65K context llama.cpp model (Qwen3.5-9B-Q4_K_M.gguf) was compressing on turn 1.

Bug found: the hardcoded DEFAULT_CONTEXT_LENGTHS fallback matching was case-sensitive. "qwen" didn't match "Qwen3.5-9B-Q4_K_M.gguf" because of the capital Q. This meant the model fell through to the 128K default instead of the 131K qwen default — both should prevent turn-1 compression, so the case sensitivity bug is real but may not be the full explanation for the user's issue.

Diagnostic added: the compressor now logs its detected context_length, threshold, model, provider, and base_url at initialization. Next time this happens, the logs will immediately show what went wrong.

Ask the user to update and send their gateway logs — the new init log line will tell us exactly what context length was detected.

Two fixes for local model context detection:

1. Hardcoded DEFAULT_CONTEXT_LENGTHS matching was case-sensitive.
   'qwen' didn't match 'Qwen3.5-9B-Q4_K_M.gguf' because of the
   capital Q. Now uses model.lower() for comparison.

2. Added compressor initialization logging showing the detected
   context_length, threshold, model, provider, and base_url.
   This makes turn-1 compression bugs diagnosable from logs —
   previously there was no log of what context length was detected.
@teknium1
teknium1 merged commit 2988334 into main Mar 21, 2026
1 check passed
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
…NousResearch#2350)

fix: case-insensitive model family matching + compressor init logging
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…NousResearch#2350)

fix: case-insensitive model family matching + compressor init logging
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…NousResearch#2350)

fix: case-insensitive model family matching + compressor init logging
melon-xf added a commit to melon-xf/hermes-agent that referenced this pull request Sep 3, 2026
…NousResearch#2350)

fix: case-insensitive model family matching + compressor init logging
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