{"record":{"id":"b573aa7524d216b0","repo":"langchain-ai/deepagents","slug":"shared-config-resolver-has-no-managed-toml-provide","errorCode":null,"errorMessage":"shared config resolver has no managed TOML provider","messagePattern":"shared config resolver has no managed TOML provider","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/configuration/resolver.py","lineNumber":669,"sourceCode":"    Args:\n        resolver: Resolver currently serving the previous generation.\n        candidate: Snapshot fetched before taking the resolver lock. A newer\n            enforceable generation may have published while this caller waited.\n\n    Returns:\n        Replacement carrying the current enforceable generation or the\n        candidate's failed-refresh status.\n\n    Raises:\n        RuntimeError: If the shared resolver has no managed TOML provider.\n    \"\"\"\n    from deepagents_code.configuration.providers import TomlFileProvider\n    from deepagents_code.configuration.service import get_managed_snapshot\n\n    installed = resolver.toml_snapshot(MANAGED_RANK)\n    if installed is None:\n        msg = \"shared config resolver has no managed TOML provider\"\n        raise RuntimeError(msg)\n    if candidate.status.usable:\n        candidate = get_managed_snapshot()\n    replacement = TomlFileProvider(\n        name=candidate.status.name,\n        path=candidate.status.path,\n        rank=MANAGED_RANK,\n        durable=True,\n        snapshot=installed,\n        loader=_reload_enforceable_managed_snapshot,\n    )\n    replacement.reload_from_snapshot(candidate)\n    return replacement\n\n\ndef install_cli_provider(cli_provider: ConfigProvider) -> None:\n    \"\"\"Install the process CLI provider without touching config files.\n\n    Unlike `get_config_resolver(cli_provider=...)`, this never imports","sourceCodeStart":651,"sourceCodeEnd":687,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/configuration/resolver.py#L651-L687","documentation":"_managed_replacement_provider builds a managed-tier replacement for an existing resolver, which presupposes a managed TOML provider already occupies MANAGED_RANK. If `resolver.toml_snapshot(MANAGED_RANK)` returns None — no managed provider is installed on this resolver — it raises RuntimeError, since replacing a tier that does not exist is a programming error, not a config problem.","triggerScenarios":"Calling `get_config_resolver(refresh_managed=True)` (which routes through _managed_replacement_provider via reload_with_replacements) on a resolver instance that was built without a managed TOML provider at MANAGED_RANK — typically a hand-constructed resolver from `resolver_from_snapshots`-style helpers or tests that omitted the managed tier.","commonSituations":"Tests creating resolvers with only user/CLI tiers and then invoking the managed-refresh path; custom tooling reusing internal resolver APIs with a pruned provider set; a code path where managed installation was skipped but a managed refresh was later requested.","solutions":["Build the resolver with a managed TOML provider at MANAGED_RANK (use the standard get_config_resolver construction path).","In tests, include a managed provider fixture (even pointing at an empty/missing file) before testing refresh_managed behavior.","Guard refresh logic: check `resolver.toml_snapshot(MANAGED_RANK) is not None` before requesting a managed replacement."],"exampleFix":"// before: resolver built without a managed tier, then refreshed\nresolver = make_resolver(user=user_snap)  # no managed provider\nresolver.reload_with_replacements({MANAGED_RANK: _managed_replacement_provider(resolver, snap)})\n// RuntimeError\n// after: construct with the managed tier from the start\nresolver = make_resolver(managed=managed_snap, user=user_snap)","handlingStrategy":"validation","validationCode":"if resolver.toml_snapshot(MANAGED_RANK) is None:\n    raise RuntimeError(\n        \"Refusing managed refresh: this resolver has no managed TOML provider; \"\n        \"rebuild it via get_config_resolver().\"\n    )","typeGuard":null,"tryCatchPattern":"try:\n    resolver = get_config_resolver(refresh_managed=True)\nexcept RuntimeError as exc:\n    if \"no managed TOML provider\" in str(exc):\n        resolver = rebuild_standard_resolver()  # include managed tier\n    else:\n        raise","preventionTips":["Always construct resolvers through the standard path so the managed tier exists at MANAGED_RANK.","In tests, include a managed provider fixture even when its file is empty.","Check `resolver.toml_snapshot(MANAGED_RANK)` before invoking any managed-replacement/refresh logic."],"tags":["configuration","resolver","internal-api","missing-provider","testing"],"backgroundTag":"resolver-missing-managed-tier","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}