{"record":{"id":"d723cce58a86d61b","repo":"langchain-ai/deepagents","slug":"failed-to-command-args-plugin-id-exc","errorCode":null,"errorMessage":"Failed to {command} {args.plugin_id}: {exc}","messagePattern":"Failed to (.+?) (.+?): (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/plugins/commands_cli.py","lineNumber":164,"sourceCode":"            details = f\" (version: {instance.version})\"\n        text = (\n            f\"Installed plugin {instance.plugin_id}{details}. Run /reload to activate.\"\n        )\n        print(text)  # noqa: T201\n        return text\n    if command == \"uninstall\":\n        uninstall_plugin(args.plugin_id)\n        text = f\"Uninstalled plugin {args.plugin_id}.\"\n        print(text)  # noqa: T201\n        return text\n    if command in {\"enable\", \"disable\"}:\n        enabled = command == \"enable\"\n        try:\n            set_installed_plugin_enabled(args.plugin_id, enabled=enabled)\n        except (MarketplaceError, OSError, ValueError) as exc:\n            text = f\"Failed to {command} {args.plugin_id}: {exc}\"\n            print(text)  # noqa: T201\n            raise SystemExit(1) from exc\n        text = f\"{command.title()}d plugin {args.plugin_id}.\"\n        print(text)  # noqa: T201\n        return text\n    if command == \"marketplace\":\n        marketplace_command = getattr(args, \"marketplace_command\", None)\n        if marketplace_command in {\"list\", \"ls\"}:\n            records = load_marketplace_records()\n            rows = [\n                {\n                    \"name\": record.name,\n                    \"source_type\": record.source_type,\n                    \"source\": redact_marketplace_source(record.source),\n                    \"install_location\": (\n                        record.install_location\n                        if record.source_type in {\"directory\", \"file\"}\n                        else \"<managed cache>\"\n                    ),\n                }","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/plugins/commands_cli.py#L146-L182","documentation":"execute_plugin_command catches MarketplaceError, OSError, and ValueError from set_installed_plugin_enabled for the `plugin enable`/`plugin disable` CLI commands and re-raises them as this message with exit code 1. It means the enable/disable toggle could not be applied — almost always because the plugin id is not present in the installed-plugins registry, or the registry file could not be read/written.","triggerScenarios":"Running `plugin enable <id>` or `plugin disable <id>` where set_installed_plugin_enabled raises MarketplaceError('Plugin ... is not installed') (via _require_installed_plugin), or the registry JSON is corrupt/unwritable (OSError/ValueError).","commonSituations":"Disabling a plugin that was already uninstalled or never installed; a typo in the plugin id; editing the installed-plugins file by hand and breaking its JSON; running the command without write permission to the config directory.","solutions":["Run `plugin list` (or check the installed-plugins registry) to confirm the exact plugin id.","Fix the id spelling — the error message echoes the id with !r quoting.","If the registry file was hand-edited, restore valid JSON or reinstall the plugin.","Check filesystem permissions on the config directory used by the registry.","Reinstall the plugin if it was removed but is still expected."],"exampleFix":"// before\n$ dcode plugin disable widge@internal\nFailed to disable widge@internal: Plugin 'widge@internal' is not installed\n// after\n$ dcode plugin disable widget@internal\nDisabled plugin widget@internal.","handlingStrategy":"validation","validationCode":"def can_toggle(installed_ids: list[str], plugin_id: str) -> bool:\n    return plugin_id in installed_ids\n\n# before calling the CLI\nif not can_toggle(installed_ids, \"widget@internal\"):\n    raise SystemExit(f\"{plugin_id} is not installed; run 'plugin install' first\")","typeGuard":"def is_exact_installed_id(plugin_id: str, installed: list[str]) -> bool:\n    return plugin_id in installed  # ids are exact strings incl. '@marketplace'","tryCatchPattern":"proc = subprocess.run([\"dcode\", \"plugin\", \"disable\", \"widget@internal\"], capture_output=True, text=True)\nif proc.returncode == 1 and proc.stdout.startswith(\"Failed to disable\"):\n    print(\"toggle failed:\", proc.stdout.strip())","preventionTips":["Verify the id with `plugin list` before enable/disable.","Never hand-edit the installed-plugins registry JSON.","Install the plugin before attempting to enable it.","Watch for plugin renames after marketplace refreshes.","Ensure the config directory is writable."],"tags":["cli","plugin-enable","plugin-disable"],"backgroundTag":"plugin-not-installed","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}