{"record":{"id":"f0ff0580eaeab4d1","repo":"langchain-ai/deepagents","slug":"managedconfigerror-providerstatus-name-path-prov","errorCode":null,"errorMessage":"ManagedConfigError(ProviderStatus(name, path, ProviderHealth.CORRUPT, reason))","messagePattern":"ManagedConfigError\\(ProviderStatus\\(name, path, ProviderHealth\\.CORRUPT, reason\\)\\)","errorType":"exception","errorClass":"ManagedConfigError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/mcp_disabled.py","lineNumber":288,"sourceCode":"def _raise_for_managed_provider(\n    provider: RankedProviderValue[list[str]],\n) -> None:\n    \"\"\"Apply the deny-list callsite's fail-closed health policy.\n\n    Raises:\n        ManagedConfigError: If the provider is unhealthy or its value is invalid.\n    \"\"\"\n    from deepagents_code.configuration.service import ManagedConfigError\n    from deepagents_code.configuration.types import (\n        Invalid,\n        ProviderHealth,\n        ProviderStatus,\n    )\n\n    if not provider.status.usable:\n        raise ManagedConfigError(provider.status)\n    if isinstance(provider.result, Invalid):\n        raise ManagedConfigError(\n            ProviderStatus(\n                provider.status.name,\n                provider.status.path,\n                ProviderHealth.CORRUPT,\n                provider.result.reason,\n            )\n        )\n\n\ndef _disabled_entries(data: dict[str, Any]) -> set[str]:\n    \"\"\"Return disabled names from the current config shape with legacy fallback.\"\"\"\n    section = data.get(_SECTION)\n    if isinstance(section, dict):\n        entries = _coerce_entries(section.get(_KEY))\n        if entries is not None:\n            return entries\n\n    legacy_section = data.get(_LEGACY_SECTION)","sourceCodeStart":270,"sourceCodeEnd":306,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/mcp_disabled.py#L270-L306","documentation":"When a config provider loads but returns an Invalid result, _raise_for_managed_provider raises ManagedConfigError with a ProviderStatus whose health is CORRUPT and whose reason comes from the Invalid result. This distinguishes 'file loaded but content is invalid' (353) from 'file could not be used at all' (352).","triggerScenarios":"Calling get_disabled_servers when a ranked provider returns result of type Invalid while its status is otherwise usable — i.e. the config file parsed far enough to be read but its content failed validation (e.g. `disabled_servers: \"foo\"` instead of a list of strings).","commonSituations":"Hand-editing `disabled_servers` to a string or dict instead of a list; schema drift after an upgrade changed the expected shape; partial writes leaving malformed TOML/YAML content.","solutions":["Read the `reason` in the raised ManagedConfigError — it names the validation failure.","Open the config file at provider.status.path and fix the `disabled_servers` value to be a list of server-name strings.","Remove the invalid key entirely to fall back to defaults, then re-add it correctly.","Validate the file with a TOML/YAML linter before saving."],"exampleFix":"# before\ndisabled_servers = \"notion\"\n# after\ndisabled_servers = [\"notion\"]","handlingStrategy":"validation","validationCode":"import tomllib\nwith open(config_path, \"rb\") as f:\n    data = tomllib.load(f)\nds = data.get(\"disabled_servers\", [])\nassert isinstance(ds, list) and all(isinstance(x, str) for x in ds), \"disabled_servers must be a list of strings\"","typeGuard":"def is_list_of_str(value: object) -> TypeGuard[list[str]]:\n    return isinstance(value, list) and all(isinstance(x, str) for x in value)","tryCatchPattern":"try:\n    disabled = get_disabled_servers()\nexcept ManagedConfigError as exc:\n    print(f\"corrupt config at {exc.status.path}: {exc.status.detail or ''}\")","preventionTips":["Keep disabled_servers a list of quoted server-name strings","Validate TOML/YAML with a linter before saving","Guard against concurrent/partial writes to config files"],"tags":["mcp","config","corrupt","managed-config"],"backgroundTag":"config-corrupt","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}