{"record":{"id":"77906ba0621cdbe1","repo":"NousResearch/hermes-agent","slug":"auxiliary-compression-model-aux-model-has-a-cont","errorCode":null,"errorMessage":"Auxiliary compression model {aux_model} has a context window of {aux_context} tokens, which is below the minimum {MINIMUM_CONTEXT_LENGTH} required by Hermes Agent.  Choose a compression model with at least {MINIMUM_CONTEXT_LENGTH // 1000}K context (set auxiliary.compression.model in config.yaml), or set auxiliary.compression.context_length to override the detected value if it is wrong.","messagePattern":"Auxiliary compression model (.+?) has a context window of (.+?) tokens, which is below the minimum (.+?) required by Hermes Agent\\.  Choose a compression model with at least (.+?)K context \\(set auxiliary\\.compression\\.model in config\\.yaml\\), or set auxiliary\\.compression\\.context_length to override the detected value if it is wrong\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agent/conversation_compression.py","lineNumber":1698,"sourceCode":"            aux_model,\n            base_url=aux_base_url,\n            api_key=aux_api_key,\n            config_context_length=getattr(agent, \"_aux_compression_context_length_config\", None),\n            # Each model must be resolved with its own provider so that\n            # provider-specific paths (e.g. Bedrock static table, OpenRouter API)\n            # are invoked for the correct client, not inherited from the main model.\n            provider=(_aux_cfg_provider if _aux_cfg_provider and _aux_cfg_provider != \"auto\" else getattr(agent, \"provider\", \"\")),\n            custom_providers=agent._custom_providers,\n        )\n\n        # Hard floor: the auxiliary compression model must have at least\n        # MINIMUM_CONTEXT_LENGTH (64K) tokens of context.  The main model\n        # is already required to meet this floor (checked earlier in\n        # __init__), so the compression model must too — otherwise it\n        # cannot summarise a full threshold-sized window of main-model\n        # content.  Mirrors the main-model rejection pattern.\n        if aux_context and aux_context < MINIMUM_CONTEXT_LENGTH:\n            raise ValueError(\n                f\"Auxiliary compression model {aux_model} has a context \"\n                f\"window of {aux_context:,} tokens, which is below the \"\n                f\"minimum {MINIMUM_CONTEXT_LENGTH:,} required by Hermes \"\n                f\"Agent.  Choose a compression model with at least \"\n                f\"{MINIMUM_CONTEXT_LENGTH // 1000}K context (set \"\n                f\"auxiliary.compression.model in config.yaml), or set \"\n                f\"auxiliary.compression.context_length to override the \"\n                f\"detected value if it is wrong.\"\n            )\n\n        threshold = agent.context_compressor.threshold_tokens\n        if aux_context < threshold:\n            # Auto-correct: lower the live session threshold so\n            # compression actually works this session.  The hard floor\n            # above guarantees aux_context >= MINIMUM_CONTEXT_LENGTH,\n            # so the new threshold is always >= 64K.\n            #\n            # The compression summariser sends a single user-role","sourceCodeStart":1680,"sourceCodeEnd":1716,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/agent/conversation_compression.py#L1680-L1716","documentation":"The model configured for auxiliary compression (auxiliary.compression.model in config.yaml) has a detected context window smaller than MINIMUM_CONTEXT_LENGTH (64,000 tokens, defined in agent/model_metadata.py). The compressor must be able to hold at least a full threshold-sized window of main-model content, and since the main model is already required to meet this floor, the compression model is held to the same standard at ConversationCompression setup time.","triggerScenarios":"Setting auxiliary.compression.model to a small-context model (e.g. one with an 8K/16K/32K catalog entry) whose detected context_length is below 64,000. Raised in the compression setup path in agent/conversation_compression.py when aux_context is non-zero and below the floor.","commonSituations":"Config file pins an older or lightweight summarizer model with a small advertised window; a custom provider profile whose metadata lists a low context length; the auto-detected value is stale or wrong for a model that actually supports more.","solutions":["Set auxiliary.compression.model to a model with at least 64K context (e.g. a modern flash-class model).","If the detected value is wrong, override it explicitly: set auxiliary.compression.context_length in config.yaml to the true window size.","Verify the provider profile / context-length catalog entry for the chosen model if you believe the detection is stale."],"exampleFix":"# ~/.hermes/config.yaml\n# before\nauxiliary:\n  compression:\n    model: \"old-8k-summarizer\"\n# after — either a bigger model…\nauxiliary:\n  compression:\n    model: \"gemini-2.5-flash\"\n# …or override the detected context length if it is wrong\nauxiliary:\n  compression:\n    model: \"old-8k-summarizer\"\n    context_length: 128000","handlingStrategy":"validation","validationCode":"# Before starting a session with a custom compression model, check the floor:\nfrom agent.model_metadata import MINIMUM_CONTEXT_LENGTH  # 64_000\nassert detected_context >= MINIMUM_CONTEXT_LENGTH, (\n    f\"compression model window {detected_context} < {MINIMUM_CONTEXT_LENGTH}\")","typeGuard":null,"tryCatchPattern":"try:\n    compression = ConversationCompression(agent)\nexcept ValueError as e:\n    if \"below the minimum\" in str(e):\n        # fix config (model or context_length override) and restart\n        ...","preventionTips":["Pick compression models with documented 64K+ context","Set auxiliary.compression.context_length when provider metadata is unreliable","Validate custom provider profiles' context_length metadata before assigning them to compression"],"tags":["config","compression","context-window","startup"],"backgroundTag":null,"analyzedSha":"c896c09c42910c584c4c7d2325b58c14713ea42c","analyzedAt":"2026-08-14T17:18:01.089Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}