langchain-ai/deepagents · error · MarketplaceError

{str(exc)} from split_plugin_id (invalid plugin id)

Error message

{str(exc)} from split_plugin_id (invalid plugin id)

What it means

_resolve_marketplace_and_entry splits the plugin id into plugin and marketplace names; when split_plugin_id raises ValueError (malformed id), the ValueError is re-raised as a MarketplaceError with the original message plus the hint 'from split_plugin_id (invalid plugin id)'. It signals the plugin id string does not have the expected `name@marketplace` shape.

Source

Thrown at libs/code/deepagents_code/plugins/discovery.py:186


@plugin_mutation_lock()
def uninstall_plugin(plugin_id: str) -> None:
    """Uninstall a plugin (disable, clear records, delete orphaned cache).

    Args:
        plugin_id: Plugin id in `{name}@{marketplace}` form.
    """
    uninstall_plugin_record(plugin_id)


def _resolve_marketplace_and_entry(
    plugin_id: str,
) -> tuple[PluginMarketplace, MarketplacePluginEntry]:
    try:
        plugin_name, marketplace_name = split_plugin_id(plugin_id)
    except ValueError as exc:
        raise MarketplaceError(str(exc)) from exc
    records = load_marketplace_records()
    record = records.get(marketplace_name)
    if record is None:
        msg = f"Marketplace {marketplace_name!r} is not configured"
        raise MarketplaceError(msg)
    marketplace = load_marketplace_location(Path(record.install_location))
    entry = next(
        (plugin for plugin in marketplace.plugins if plugin.name == plugin_name),
        None,
    )
    if entry is None:
        msg = f"Plugin {plugin_id!r} not found in marketplace {marketplace_name}"
        raise MarketplaceError(msg)
    return marketplace, entry


@plugin_mutation_lock()
def install_plugin(plugin_id: str) -> PluginInstance:

View on GitHub (pinned to a1af029e6e)

Solutions

  1. Use the full `plugin@marketplace` form, e.g. `plugin install widget@internal`.
  2. Check for shell quoting issues that mangle the `@`.
  3. Read the embedded split_plugin_id message — it states exactly what was wrong with the id.
  4. Run `plugin marketplace list` to get correct marketplace names.

Example fix

// before
dcode plugin install widget
# MarketplaceError: ... from split_plugin_id (invalid plugin id)
// after
dcode plugin install widget@internal
Defensive patterns

Strategy: validation

Validate before calling

def ensure_plugin_id_shape(plugin_id: str) -> str:
    name, sep, market = plugin_id.partition("@")
    if not sep or not name or not market:
        raise SystemExit(f"invalid plugin id {plugin_id!r}; expected 'name@marketplace'")
    return plugin_id

Type guard

def is_valid_plugin_id(plugin_id: str) -> bool:
    name, sep, market = plugin_id.partition("@")
    return bool(sep and name and market and "@" not in market)

Try / catch

from deepagents_code.plugins.discovery import MarketplaceError, install_plugin

try:
    install_plugin("widget@internal")
except MarketplaceError as exc:
    if "split_plugin_id" in str(exc):
        print("fix the plugin id format: name@marketplace")
    else:
        raise

Prevention

When it happens

Trigger: Calling install_plugin (or the CLI `plugin install`) with an id lacking the `@` separator, containing multiple/empty segments, or otherwise rejected by split_plugin_id.

Common situations: Typing just the plugin name (`widget`) instead of `widget@internal`; copy-pasting an id that lost its `@marketplace` tail; shell quoting/escaping stripping characters from the id.

Related errors


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