{"record":{"id":"db66a5bdc31032f1","repo":"langchain-ai/deepagents","slug":"invalid-json-syntax-in-manifest-path-exc-db66a5","errorCode":null,"errorMessage":"Invalid JSON syntax in {manifest_path}: {exc}","messagePattern":"Invalid JSON syntax in (.+?): (.+?)","errorType":"exception","errorClass":"MarketplaceError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/plugins/marketplace.py","lineNumber":808,"sourceCode":"    )\n    display_name_value = entry.get(\"displayName\")\n    return MarketplacePluginEntry(\n        name=name,\n        source=source,\n        description=description_value if isinstance(description_value, str) else None,\n        author=author,\n        display_name=(\n            display_name_value if isinstance(display_name_value, str) else None\n        ),\n    )\n\n\ndef _load_marketplace_from_path(root: Path, manifest_path: Path) -> PluginMarketplace:\n    try:\n        raw = 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 MarketplaceError(msg) from exc\n    except OSError as exc:\n        msg = f\"Could not read marketplace manifest {manifest_path}: {exc}\"\n        raise MarketplaceError(msg) from exc\n    if not isinstance(raw, dict):\n        msg = f\"Marketplace manifest {manifest_path} must be a JSON object\"\n        raise MarketplaceError(msg)\n    try:\n        name = _validate_name(raw.get(\"name\"), allow_at=False)\n    except ValueError as exc:\n        raise MarketplaceError(str(exc)) from exc\n    plugins_raw = raw.get(\"plugins\")\n    if not isinstance(plugins_raw, list):\n        msg = f\"Marketplace {name} must contain a plugins array\"\n        raise MarketplaceError(msg)\n    warnings: list[str] = []\n    plugins = tuple(\n        plugin\n        for entry in plugins_raw","sourceCodeStart":790,"sourceCodeEnd":826,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/plugins/marketplace.py#L790-L826","documentation":"Marketplace manifests (.marketplace.json style files) are parsed with json.loads when loading a marketplace from a path. If the file contains malformed JSON, the underlying json.JSONDecodeError is wrapped in MarketplaceError with the file path and parser detail so callers get a single domain exception type. It is a configuration-content error, not a lookup failure.","triggerScenarios":"Calling load_marketplace(root) / _load_marketplace_file / add_local_marketplace where find_marketplace_manifest located a manifest whose bytes are not valid JSON (json.JSONDecodeError branch in _load_marketplace_from_path).","commonSituations":"Hand-edited marketplace.json with a trailing comma, missing brace, or comments; a truncated download of a marketplace repo; a file saved with BOM or HTML error page content instead of JSON; merge-conflict markers left in the manifest.","solutions":["Open the manifest path printed in the message and fix the JSON syntax at the line/column reported in the exc detail (validate with `python -m json.tool <file>`).","Re-clone or re-download the marketplace repository if the file is corrupted or truncated.","If the file is generated, regenerate it with a JSON serializer instead of string concatenation; strip BOM/comments."],"exampleFix":"// before (broken manifest)\n{ \"name\": \"my-market\", \"plugins\": [ { \"id\": \"a\", } ] }   // trailing comma\n// after\n{ \"name\": \"my-market\", \"plugins\": [ { \"id\": \"a\" } ] }","handlingStrategy":"validation","validationCode":"import json\nfrom pathlib import Path\n\ndef manifest_is_valid_json(path: Path) -> bool:\n    try:\n        json.loads(path.read_text(encoding=\"utf-8-sig\"))\n        return True\n    except (json.JSONDecodeError, OSError):\n        return False","typeGuard":"def is_json_object(raw: object) -> TypeGuard[dict]:\n    return isinstance(raw, dict)","tryCatchPattern":"from deepagents_code.plugins import MarketplaceError\ntry:\n    mp = load_marketplace(root)\nexcept MarketplaceError as exc:\n    logger.error(\"Marketplace load failed: %s\", exc)\n    mp = None","preventionTips":["Always validate manifests with `python -m json.tool` or a JSON linter before committing.","Generate manifests with json.dump rather than string templates.","Save manifests without BOM, comments, or trailing commas."],"tags":["json","config","marketplace","parsing"],"backgroundTag":"invalid-json-syntax","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}