{"record":{"id":"b587aac22332de0c","repo":"langchain-ai/deepagents","slug":"plugin-plugin-id-r-is-not-installed","errorCode":null,"errorMessage":"Plugin {plugin_id!r} is not installed","messagePattern":"Plugin (.+?) is not installed","errorType":"exception","errorClass":"MarketplaceError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/plugins/discovery.py","lineNumber":153,"sourceCode":"    if record.source_type in {\"github\", \"git\", \"url\"} and resolved.is_relative_to(\n        cache_root\n    ):\n        if resolved.is_dir():\n            shutil.rmtree(resolved, ignore_errors=True)\n        elif resolved.is_file():\n            resolved.unlink(missing_ok=True)\n    return removed\n\n\ndef _require_installed_plugin(plugin_id: str) -> None:\n    \"\"\"Raise when `plugin_id` does not identify an installed plugin.\n\n    Raises:\n        MarketplaceError: If the plugin is not installed.\n    \"\"\"\n    if plugin_id not in load_installed_plugins(strict=True):\n        msg = f\"Plugin {plugin_id!r} is not installed\"\n        raise MarketplaceError(msg)\n\n\n@plugin_mutation_lock()\ndef set_installed_plugin_enabled(plugin_id: str, *, enabled: bool) -> None:\n    \"\"\"Set the enabled state of an installed plugin.\n\n    Args:\n        plugin_id: Plugin id in `{name}@{marketplace}` form.\n        enabled: Whether to enable the plugin.\n    \"\"\"\n    _require_installed_plugin(plugin_id)\n    set_plugin_enabled(plugin_id, enabled)\n    if enabled:\n        ensure_plugin_data_dir(plugin_id)\n\n\n@plugin_mutation_lock()\ndef uninstall_plugin(plugin_id: str) -> None:","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/plugins/discovery.py#L135-L171","documentation":"_require_installed_plugin checks the plugin id against load_installed_plugins(strict=True) and raises MarketplaceError when it is absent. This is the guard used by set_installed_plugin_enabled so enable/disable only mutates plugins that are actually installed. Strict mode also means a malformed registry file surfaces here rather than being silently ignored.","triggerScenarios":"Calling set_installed_plugin_enabled(plugin_id, enabled=...) (or the CLI `plugin enable/disable`) with an id not in the installed-plugins registry, or with a registry that fails strict validation so the id cannot be found.","commonSituations":"Toggling a plugin after uninstalling it; using a plugin name without the `@marketplace` suffix; hand-editing or corrupting the installed-plugins JSON; a stale id after the plugin was renamed.","solutions":["List installed plugins and use the exact id (`name@marketplace`).","Install the plugin first with `plugin install <id>` before enabling.","If the registry file is corrupt, fix/restore its JSON or reinstall affected plugins.","If the plugin was renamed, use the new id."],"exampleFix":"// before\nset_installed_plugin_enabled(\"widget\", enabled=False)  # MarketplaceError: Plugin 'widget' is not installed\n// after\ninstall_plugin(\"widget@internal\")\nset_installed_plugin_enabled(\"widget@internal\", enabled=False)","handlingStrategy":"validation","validationCode":"from deepagents_code.plugins.discovery import load_installed_plugins\n\ndef ensure_installed(plugin_id: str) -> None:\n    if plugin_id not in load_installed_plugins(strict=True):\n        raise SystemExit(f\"{plugin_id!r} not installed; run 'plugin install {plugin_id}'\")","typeGuard":"def is_installed(plugin_id: str, installed: list[str]) -> bool:\n    return plugin_id in installed","tryCatchPattern":"from deepagents_code.plugins.discovery import MarketplaceError, set_installed_plugin_enabled\n\ntry:\n    set_installed_plugin_enabled(\"widget@internal\", enabled=False)\nexcept MarketplaceError as exc:\n    print(f\"toggle skipped: {exc}\")  # install the plugin first","preventionTips":["Check installed plugins before toggling.","Use ids exactly as listed (including the '@marketplace' suffix).","Install before enable/disable.","Keep the registry file tool-managed, not hand-edited.","Handle plugin renames by re-checking ids after marketplace updates."],"tags":["plugin","registry","marketplace-error"],"backgroundTag":"plugin-not-installed","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}