fix: case-insensitive model family matching + compressor init logging
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.
This commit is contained in:
parent
29520df44f
commit
292d12bed4
2 changed files with 10 additions and 1 deletions
|
|
@ -93,6 +93,14 @@ class ContextCompressor:
|
|||
)
|
||||
self.threshold_tokens = int(self.context_length * threshold_percent)
|
||||
self.compression_count = 0
|
||||
|
||||
if not quiet_mode:
|
||||
logger.info(
|
||||
"Context compressor initialized: model=%s context_length=%d "
|
||||
"threshold=%d (%.0f%%) provider=%s base_url=%s",
|
||||
model, self.context_length, self.threshold_tokens,
|
||||
threshold_percent * 100, provider or "none", base_url or "none",
|
||||
)
|
||||
self._context_probed = False # True after a step-down from context error
|
||||
|
||||
self.last_prompt_tokens = 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue