{"record":{"id":"d50db9ec8261be53","repo":"BerriAI/litellm","slug":"context-management-compact-20260112-trigger-value","errorCode":null,"errorMessage":"context_management.compact_20260112.trigger.value must be at least {COMPACT_MIN_TRIGGER_TOKENS} tokens","messagePattern":"context_management\\.compact_20260112\\.trigger\\.value must be at least (.+?) tokens","errorType":"http","errorClass":"AnthropicContextManagementError","httpStatus":400,"severity":"error","filePath":"litellm/llms/anthropic/experimental_pass_through/context_management/editors/compact.py","lineNumber":562,"sourceCode":"    \"\"\"\n    warnings: Final[list[str]] = []\n    trigger: Final = edit_spec.get(\"trigger\") or {}\n    if not isinstance(trigger, dict):\n        warnings.append(\"trigger_not_a_dict_using_default\")\n        return COMPACT_DEFAULT_TRIGGER_TOKENS, warnings\n\n    trigger_type: Final = trigger.get(\"type\", \"input_tokens\")\n    if trigger_type != \"input_tokens\":\n        warnings.append(f\"unsupported_trigger_type_{trigger_type}_using_input_tokens\")\n\n    value: Final = trigger.get(\"value\")\n    if value is None:\n        return COMPACT_DEFAULT_TRIGGER_TOKENS, warnings\n    if not isinstance(value, int):\n        warnings.append(\"trigger_value_not_int_using_default\")\n        return COMPACT_DEFAULT_TRIGGER_TOKENS, warnings\n    if value < COMPACT_MIN_TRIGGER_TOKENS:\n        raise AnthropicContextManagementError(\n            status_code=400,\n            message=(\n                f\"context_management.compact_20260112.trigger.value must be at \"\n                f\"least {COMPACT_MIN_TRIGGER_TOKENS} tokens\"\n            ),\n        )\n    return value, warnings\n\n\ndef _build_summary_prompt(edit_spec: Mapping[str, object], tools: Sequence[Mapping[str, object]] | None) -> str:\n    custom: Final = edit_spec.get(\"instructions\")\n    if isinstance(custom, str) and custom.strip():\n        return custom\n    prompt = COMPACT_DEFAULT_INSTRUCTIONS\n    if tools:\n        prompt = f\"{prompt}{COMPACT_NO_TOOL_CALLS_SUFFIX}\"\n    return prompt\n","sourceCodeStart":544,"sourceCodeEnd":580,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/anthropic/experimental_pass_through/context_management/editors/compact.py#L544-L580","documentation":"Error \"context_management.compact_20260112.trigger.value must be at least {COMPACT_MIN_TRIGGER_TOKENS} tokens\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/anthropic/experimental_pass_through/context_management/editors/compact.py:562 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Raise context_management.compact trigger value to at least the minimum token count shown in the error."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}