{"record":{"id":"1f41139b38495c95","repo":"langchain-ai/deepagents","slug":"profile-key-key-r-has-more-than-one-expecte","errorCode":null,"errorMessage":"Profile key {key!r} has more than one ':'; expected 'provider' or 'provider:model'.","messagePattern":"Profile key (.+?) has more than one ':'; expected 'provider' or 'provider:model'\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/deepagents/deepagents/profiles/_keys.py","lineNumber":34,"sourceCode":"    halves, multiple colons, and empty halves.\n\n    Args:\n        key: The registry key to check.\n\n    Raises:\n        ValueError: If `key` is empty, contains leading/trailing whitespace,\n            has more than one `:`, has whitespace adjacent to `:`, or has\n            an empty half on either side of `:`.\n    \"\"\"\n    if not key:\n        msg = \"Profile key must be a non-empty string.\"\n        raise ValueError(msg)\n    if key != key.strip():\n        msg = f\"Profile key {key!r} has leading or trailing whitespace; expected 'provider' or 'provider:model'.\"\n        raise ValueError(msg)\n    if key.count(\":\") > 1:\n        msg = f\"Profile key {key!r} has more than one ':'; expected 'provider' or 'provider:model'.\"\n        raise ValueError(msg)\n    if \":\" in key:\n        provider, _, model = key.partition(\":\")\n        if not provider or not model:\n            msg = f\"Profile key {key!r} has an empty provider or model half; expected 'provider:model'.\"\n            raise ValueError(msg)\n        if provider != provider.strip() or model != model.strip():\n            msg = f\"Profile key {key!r} has whitespace adjacent to ':'; expected 'provider:model' with no spaces around ':'.\"\n            raise ValueError(msg)\n","sourceCodeStart":16,"sourceCodeEnd":43,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/deepagents/deepagents/profiles/_keys.py#L16-L43","documentation":"A profile key may contain at most one ':' separating provider from model ('provider:model'). validate_profile_key raises when key.count(':') > 1, since a second colon makes the key ambiguous under the two-segment scheme.","triggerScenarios":"Passing keys like 'anthropic:model:v2', a full URL 'https://api.x.com', or a Windows-style path as the profile key to a register/lookup API.","commonSituations":"Concatenating model tags or versions onto a model name; pasting endpoint URLs or qualified identifiers into the profile-name field.","solutions":["Reduce the key to two segments: 'provider:model'.","Encode extra qualifiers into the model segment only if allowed (no further colons).","Use a different field for the extra qualifier instead of the key."],"exampleFix":"// before\nregister_provider_profile(\"anthropic:claude-3:latest\")\n// after\nregister_provider_profile(\"anthropic:claude-3-latest\")","handlingStrategy":"validation","validationCode":"if key.count(\":\") > 1:\n    raise ValueError(f\"profile key {key!r} must be 'provider' or 'provider:model'\")","typeGuard":null,"tryCatchPattern":"try:\n    register_provider_profile(key)\nexcept ValueError as e:\n    if \"more than one ':'\" in str(e):\n        provider, model = key.split(\":\", 1)  # or fix source data\n    else:\n        raise","preventionTips":["Never embed URLs or multi-colon identifiers in profile keys","Keep version qualifiers out of the key (use other config fields)"],"tags":["python","profiles","validation"],"backgroundTag":"invalid-profile-key","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}