{"record":{"id":"96506feb87ec81a3","repo":"microsoft/autogen","slug":"invalid-name-name-name-must-be-less-than-64-ch","errorCode":null,"errorMessage":"Invalid name: {name}. Name must be less than 64 characters.","messagePattern":"Invalid name: (.+?)\\. Name must be less than 64 characters\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/packages/autogen-ext/src/autogen_ext/models/anthropic/_anthropic_client.py","lineNumber":415,"sourceCode":"        return AnthropicClientConfigurationConfigModel(**copied_config)\n\n    @classmethod\n    def _from_config(cls, config: AnthropicClientConfigurationConfigModel) -> Self:\n        copied_config = config.model_copy().model_dump(exclude_none=True)\n        return cls(**copied_config)\n    Normalize names by replacing invalid characters with underscore.\n    \"\"\"\n    return re.sub(r\"[^a-zA-Z0-9_-]\", \"_\", name)[:64]\n\n\ndef assert_valid_name(name: str) -> str:\n    \"\"\"\n    Ensure that configured names are valid, raises ValueError if not.\n    \"\"\"\n    if not re.match(r\"^[a-zA-Z0-9_-]+$\", name):\n        raise ValueError(f\"Invalid name: {name}. Only letters, numbers, '_' and '-' are allowed.\")\n    if len(name) > 64:\n        raise ValueError(f\"Invalid name: {name}. Name must be less than 64 characters.\")\n    return name\n\n\ndef normalize_stop_reason(stop_reason: str | None) -> FinishReasons:\n    if stop_reason is None:\n        return \"unknown\"\n\n    # Convert to lowercase for comparison\n    stop_reason = stop_reason.lower()\n\n    # Map Anthropic stop reasons to standard reasons\n    KNOWN_STOP_MAPPINGS: Dict[str, FinishReasons] = {\n        \"end_turn\": \"stop\",\n        \"max_tokens\": \"length\",\n        \"stop_sequence\": \"stop\",\n        \"tool_use\": \"function_calls\",\n    }\n","sourceCodeStart":397,"sourceCodeEnd":433,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-ext/src/autogen_ext/models/anthropic/_anthropic_client.py#L397-L433","documentation":"Error \"Invalid name: {name}. Name must be less than 64 characters.\" thrown in microsoft/autogen.","triggerScenarios":"Thrown at python/packages/autogen-ext/src/autogen_ext/models/anthropic/_anthropic_client.py:415 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Shorten the name below 64 characters"],"exampleFix":"Trim the name to <=64 chars","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}