{"record":{"id":"9b7793a4861fb0c8","repo":"langchain-ai/deepagents","slug":"invalid-json-syntax-in-manifest-path-exc","errorCode":null,"errorMessage":"Invalid JSON syntax in {manifest_path}: {exc}","messagePattern":"Invalid JSON syntax in (.+?): (.+?)","errorType":"exception","errorClass":"PluginManifestError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/plugins/manifest.py","lineNumber":278,"sourceCode":"\n    Args:\n        root: Plugin root directory.\n        fallback_name: Name to use only when deriving a manifest-less plugin.\n\n    Returns:\n        `(manifest, manifest_path, warnings)`.\n\n    Raises:\n        PluginManifestError: If the manifest exists but is invalid.\n    \"\"\"\n    manifest_path = find_manifest_path(root)\n    if manifest_path is None:\n        return None, None, ()\n    try:\n        decoded = json.loads(manifest_path.read_text(encoding=\"utf-8\"))\n    except json.JSONDecodeError as exc:\n        msg = f\"Invalid JSON syntax in {manifest_path}: {exc}\"\n        raise PluginManifestError(msg) from exc\n    except OSError as exc:\n        msg = f\"Could not read plugin manifest {manifest_path}: {exc}\"\n        raise PluginManifestError(msg) from exc\n    if not isinstance(decoded, dict):\n        msg = f\"Plugin manifest {manifest_path} must be a JSON object\"\n        raise PluginManifestError(msg)\n    raw = json_object(decoded)\n\n    warnings: list[str] = []\n    name = _validate_name(raw.get(\"name\"), fallback=fallback_name)\n    component_paths: dict[str, tuple[Path, ...]] = {}\n    for field_name in _PATH_COMPONENT_FIELDS:\n        declaration = raw.get(field_name)\n        if declaration is None:\n            continue\n        if field_name in {\"mcpServers\", \"hooks\"} and isinstance(declaration, dict):\n            continue\n        paths = _resolve_component_paths(declaration, root, field_name, warnings)","sourceCodeStart":260,"sourceCodeEnd":296,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/plugins/manifest.py#L260-L296","documentation":"`load_manifest` reads the plugin manifest file and `json.loads` it. A `json.JSONDecodeError` (malformed JSON) is wrapped and re-raised as `PluginManifestError` naming the manifest path and the parser's position detail. All manifest consumers (`install_plugin`, `_validate_plugin_copy`, `_plugin_from_install_path`, `auto_update_plugins`) funnel through this, so a broken manifest blocks install/load/update.","triggerScenarios":"Any call into `load_manifest` for a plugin root whose discovered manifest file (`plugin.json` or other supported path) contains syntactically invalid JSON — trailing commas, comments, unquoted keys, truncated file.","commonSituations":"Hand-edited manifest left a trailing comma; a merge conflict marker was committed; an interrupted download/write truncated the JSON; someone added `//` comments to what must be strict JSON.","solutions":["Open the manifest path from the error message and fix the JSON syntax at the indicated position.","Run `python -m json.tool <manifest>` to pinpoint the syntax error.","If the file was truncated, restore it from the upstream plugin repo and reinstall.","Avoid JSON5-style features (comments, trailing commas) — this parser is strict."],"exampleFix":"// before (plugin.json)\n{\"name\": \"x\", \"version\": \"1.0\",}\n// after\n{\"name\": \"x\", \"version\": \"1.0\"}","handlingStrategy":"validation","validationCode":"import json\nfrom pathlib import Path\np = Path(\"plugin.json\")\njson.loads(p.read_text(encoding=\"utf-8\"))  # raises JSONDecodeError early if malformed","typeGuard":"def is_valid_json(text: str) -> bool:\n    import json\n    try:\n        json.loads(text)\n        return True\n    except json.JSONDecodeError:\n        return False","tryCatchPattern":"try:\n    manifest, _, _ = load_manifest(root)\nexcept PluginManifestError as exc:\n    if \"Invalid JSON syntax\" in str(exc):\n        print(f\"repair manifest: {exc}\")  # exc names path and parse position","preventionTips":["Run `python -m json.tool plugin.json` in CI for every manifest.","No comments or trailing commas — strict JSON only.","Restore from git after merge conflicts instead of committing markers.","Avoid interrupting writes of the manifest (write-then-rename pattern in tooling)."],"tags":["plugins","manifest","json","parse-error"],"backgroundTag":"invalid-json-manifest","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}