{"record":{"id":"5e816cf300fbb69a","repo":"BerriAI/litellm","slug":"agentic-loop-detected-repeated-tool-call-fingerpri","errorCode":null,"errorMessage":"Agentic loop detected repeated tool-call fingerprint; aborting rerun","messagePattern":"Agentic loop detected repeated tool-call fingerprint; aborting rerun","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/litellm_core_utils/chat_completion_agentic_loop.py","lineNumber":77,"sourceCode":"\n\ndef _fingerprint_tools(tool_calls: object) -> str:\n    try:\n        return json.dumps(tool_calls, sort_keys=True, default=str)\n    except Exception:\n        return str(tool_calls)\n\n\ndef _check_agentic_loop_safety(\n    tool_calls: object,\n    fingerprints: list[str],\n    depth: int,\n    max_loops: int,\n    model: str,\n) -> str:\n    fingerprint: Final = _fingerprint_tools(tool_calls)\n    if fingerprint in fingerprints:\n        raise ValueError(\"Agentic loop detected repeated tool-call fingerprint; aborting rerun\")\n    if depth >= max_loops:\n        raise ValueError(f\"Exceeded max_agentic_loops={max_loops} for model={model}\")\n    return fingerprint\n\n\ndef _wrap_response_as_fake_stream(response: object) -> object:\n    if getattr(response, \"object\", None) == \"chat.completion.chunk\":\n        return response\n    if not hasattr(response, \"choices\"):\n        return response\n    from litellm.llms.base_llm.base_model_iterator import (\n        convert_model_response_to_streaming,\n    )\n\n    return convert_model_response_to_streaming(cast(ModelResponse, response))\n\n\ndef _add_agentic_loop_metadata(kwargs_for_followup: dict[str, object]) -> None:","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/litellm_core_utils/chat_completion_agentic_loop.py#L59-L95","documentation":"Error \"Agentic loop detected repeated tool-call fingerprint; aborting rerun\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/litellm_core_utils/chat_completion_agentic_loop.py:77 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The agentic loop is repeating identical tool calls; fix the tool or prompt so the loop converges, or raise max_agentic_loops."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}