{"record":{"id":"980d9f3140dac764","repo":"langchain-ai/deepagents","slug":"skill-trust-store-store-path-has-an-unrecognized","errorCode":null,"errorMessage":"Skill trust store {store_path} has an unrecognized schema version {version!r} (this build understands <= {_STORAGE_VERSION}); refusing to read it","messagePattern":"Skill trust store (.+?) has an unrecognized schema version (.+?) \\(this build understands <= (.+?)\\); refusing to read it","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/skills/trust.py","lineNumber":195,"sourceCode":"    # (treat as nothing trusted) for enforcement, and surface the error for the\n    # audit path. A present-but-non-integer `version` is unrecognized in the same\n    # way (only tampering or a corrupt write produces it, since every writer\n    # stamps an int), so it is refused too rather than falling through and\n    # trusting `dirs`. A missing `version` stays tolerated: an empty `{}` file\n    # has no `dirs` to trust anyway. Together this makes the `_STORAGE_VERSION`\n    # \"bump on incompatible changes\" contract enforceable rather than\n    # aspirational.\n    version = data.get(\"version\")\n    if version is not None and (\n        not isinstance(version, int) or version > _STORAGE_VERSION\n    ):\n        if strict:\n            msg = (\n                f\"Skill trust store {store_path} has an unrecognized schema \"\n                f\"version {version!r} (this build understands <= {_STORAGE_VERSION}); \"\n                f\"refusing to read it\"\n            )\n            raise ValueError(msg)\n        logger.warning(\n            \"Skill trust store %s has an unrecognized schema version %r \"\n            \"(this build understands <= %s); treating as empty\",\n            store_path,\n            version,\n            _STORAGE_VERSION,\n        )\n        return {}\n    return data\n\n\ndef _save_store(data: Mapping[str, Any], store_path: Path) -> bool:\n    \"\"\"Atomic write of JSON trust data to `store_path`.\n\n    Uses `tempfile.mkstemp` + `Path.replace` for crash safety.\n\n    Args:\n        data: Full store dict to write.","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/skills/trust.py#L177-L213","documentation":"`_load_store` rejects trust stores whose schema `version` exceeds `_STORAGE_VERSION` understood by this build. In strict mode it raises `ValueError` telling the user the store's version and the maximum supported; non-strict callers get a warning and an empty store. This is a fail-closed guard against misreading entries written by a newer, incompatible format.","triggerScenarios":"Reading the trust store (via `_read_dirs`, `trust_skill_dir`, `revoke_skill_dir_trust`) after a newer build of deepagents-code wrote a store with a schema version greater than this build's `_STORAGE_VERSION`.","commonSituations":"Downgrading the package or switching between release channels (stable vs nightly) that bumped the store schema; syncing a profile directory from a machine running a newer build.","solutions":["Upgrade deepagents-code to a build that understands the store's schema version","If you must stay on the old build, back up and delete the trust store, then re-add trust entries with the old CLI","Align schema versions across machines rather than sharing a newer-format store with older builds"],"exampleFix":"# before\n$ dcode --version  # older build; trust.json version 2\n# ValueError: ... unrecognized schema version 2 ...\n// after\nuv pip install --upgrade deepagents-code  # build understanding version 2","handlingStrategy":"try-catch","validationCode":"import json\nfrom pathlib import Path\n\ndef store_version_supported(store: Path, max_version: int) -> bool:\n    try:\n        data = json.loads(store.read_text(encoding='utf-8'))\n    except (OSError, ValueError):\n        return False\n    return isinstance(data, dict) and isinstance(data.get('version'), int) \\\n        and data['version'] <= max_version","typeGuard":null,"tryCatchPattern":"try:\n    dirs = _read_dirs(store_path)\nexcept ValueError as exc:\n    print(f'{exc}; upgrade the package or reset the trust store')\n    raise SystemExit(1) from exc","preventionTips":["Keep the same (or newer) deepagents-code build on all machines sharing a profile","Avoid downgrading after a schema-version bump","Back up trust.json before switching release channels","After a downgrade failure, delete the store and re-trust directories"],"tags":["trust-store","schema-version","forward-compatibility"],"backgroundTag":"schema-version-mismatch","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}