{"record":{"id":"2fedcc7de40f977f","repo":"langchain-ai/deepagents","slug":"unsupported-hooks-trust-store-version-version-r","errorCode":null,"errorMessage":"Unsupported hooks trust store version: {version!r}","messagePattern":"Unsupported hooks trust store version: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/hooks/trust.py","lineNumber":198,"sourceCode":"        data: object = json.loads(raw_text)\n    except json.JSONDecodeError as exc:\n        if strict:\n            raise\n        logger.warning(\"Could not parse hooks trust store %s: %s\", path, exc)\n        return HooksTrustStore()\n\n    if not isinstance(data, dict):\n        msg = f\"hooks trust store must be a JSON object: {path}\"\n        if strict:\n            raise TypeError(msg)\n        logger.warning(msg)\n        return HooksTrustStore()\n\n    version = data.get(\"version\")\n    if version != _STORE_VERSION:\n        msg = f\"Unsupported hooks trust store version: {version!r}\"\n        if strict:\n            raise ValueError(msg)\n        logger.warning(\n            \"Ignoring hooks trust store with unsupported version %r\", version\n        )\n        return HooksTrustStore()\n\n    try:\n        projects = _parse_projects(data.get(\"projects\"), path=path)\n    except TypeError:\n        if strict:\n            raise\n        logger.warning(\n            \"Ignoring hooks trust store with invalid projects field at %s\",\n            path,\n        )\n        return HooksTrustStore()\n\n    # Tolerate unknown top-level fields via HooksTrustStore.extra=\"ignore\".\n    return HooksTrustStore(version=_STORE_VERSION, projects=projects)","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/hooks/trust.py#L180-L216","documentation":"The trust store carries a version field; when it doesn't match the library's _STORE_VERSION, _load_store raises ValueError in strict mode (and warns + returns an empty store otherwise). This prevents misinterpreting trust entries written by an incompatible store format.","triggerScenarios":"Loading a trust store written by a different deepagents version whose \"version\" value differs from the current _STORE_VERSION — e.g. downgrading the tool, sharing a store across machines with different versions, or editing version by hand.","commonSituations":"Rolling back to an older release that used a different store version; copying a trust store from another environment; manually incrementing version in the JSON.","solutions":["Recreate the store at the current version: delete the file and re-approve trust for each project.","If migrating forward, upgrade the library version that matches the store, or re-trust projects to rewrite the store.","Don't hand-edit the version field; let the library manage it.","Use strict=False to ignore incompatible stores (with warning) when trust checks are advisory."],"exampleFix":"// before\n{\"version\": 99, \"projects\": {\"/repo/a\": {...}}}  # ValueError in strict mode\n\n// after\nrm ~/.config/deepagents/hooks_trust.json\n# then re-run trust flow:\ntrust_project_hooks(\"/repo/a\")","handlingStrategy":"fallback","validationCode":"data = json.loads(store_path.read_text())\nif isinstance(data, dict) and data.get(\"version\") != CURRENT_STORE_VERSION:\n    migrate_or_reset_store(store_path)","typeGuard":"def is_current_version(data: object) -> TypeGuard[dict]:\n    return isinstance(data, dict) and data.get(\"version\") == CURRENT_STORE_VERSION","tryCatchPattern":"try:\n    store = load_hooks_trust_store(path, strict=True)\nexcept ValueError as exc:\n    if \"Unsupported hooks trust store version\" in str(exc):\n        reset_store_and_retrust(path)  # recreate at current version","preventionTips":["Don't hand-edit the store's version field","Recreate + re-trust after upgrading/downgrading across store-format versions","Avoid copying trust stores between environments with different tool versions","Use strict=False when an ignored (warned) store is acceptable"],"tags":["trust","versioning","migration"],"backgroundTag":"trust-store-version-mismatch","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}