langchain-ai/deepagents · error · MarketplaceError

Invalid plugin name: {name!r}

Error message

Invalid plugin name: {name!r}

What it means

The manifest's top-level `name` field is validated with _validate_name(allow_at=False). If it is missing, empty, or contains disallowed characters (including '@'), the ValueError is converted to MarketplaceError with the message 'Invalid plugin name: ...'. Marketplace names must be simple identifiers because '@' is reserved for the plugin-id separator.

Source

Thrown at libs/code/deepagents_code/plugins/marketplace.py:818

    )


def _load_marketplace_from_path(root: Path, manifest_path: Path) -> PluginMarketplace:
    try:
        raw = json.loads(manifest_path.read_text(encoding="utf-8"))
    except json.JSONDecodeError as exc:
        msg = f"Invalid JSON syntax in {manifest_path}: {exc}"
        raise MarketplaceError(msg) from exc
    except OSError as exc:
        msg = f"Could not read marketplace manifest {manifest_path}: {exc}"
        raise MarketplaceError(msg) from exc
    if not isinstance(raw, dict):
        msg = f"Marketplace manifest {manifest_path} must be a JSON object"
        raise MarketplaceError(msg)
    try:
        name = _validate_name(raw.get("name"), allow_at=False)
    except ValueError as exc:
        raise MarketplaceError(str(exc)) from exc
    plugins_raw = raw.get("plugins")
    if not isinstance(plugins_raw, list):
        msg = f"Marketplace {name} must contain a plugins array"
        raise MarketplaceError(msg)
    warnings: list[str] = []
    plugins = tuple(
        plugin
        for entry in plugins_raw
        if (plugin := _parse_entry(entry, warnings=warnings)) is not None
    )
    for warning in warnings:
        logger.warning("%s", warning)
    metadata = json_object(raw.get("metadata"))
    return PluginMarketplace(
        name=name,
        root=root,
        manifest_path=manifest_path,
        metadata=metadata,

View on GitHub (pinned to a1af029e6e)

Solutions

  1. Set a non-empty `name` in the manifest using only allowed identifier characters and no '@'.
  2. Remove any '@' or path characters from the marketplace name.
  3. Reinstall/refresh the marketplace from upstream if the shipped manifest is invalid.

Example fix

// before
{ "name": "team@corp", "plugins": [] }
// after
{ "name": "team-corp", "plugins": [] }
Defensive patterns

Strategy: validation

Validate before calling

import re
NAME_RE = re.compile(r"^[A-Za-z0-9][A-Za-z0-9._-]*$")

def marketplace_name_ok(doc: dict) -> bool:
    name = doc.get("name")
    return isinstance(name, str) and NAME_RE.fullmatch(name) is not None and "@" not in name

Type guard

def is_valid_name(v: object) -> TypeGuard[str]:
    return isinstance(v, str) and bool(v) and "@" not in v

Try / catch

try:
    mp = load_marketplace(root)
except MarketplaceError as exc:
    if "Invalid plugin name" in str(exc):
        rename_marketplace_in_manifest(root)
    raise

Prevention

When it happens

Trigger: load_marketplace / add_local_marketplace on a manifest whose `name` is absent, empty string, contains '@', or otherwise fails _validate_name's rules.

Common situations: Typing a marketplace name like 'team@corp' (conflicts with plugin@marketplace ids); forgetting the `name` key entirely; whitespace or path separators in the name; copy-pasting a plugin id into the marketplace name field.

Related errors


AI-assisted analysis of langchain-ai/deepagents@a1af029e6e (2026-08-29). Data as JSON: /api/errors/41073d4e8a4575bb. Report an issue: GitHub.