{"record":{"id":"7df71dc0997e78c6","repo":"langchain-ai/deepagents","slug":"received-unsupported-arguments-list-kwargs-keys","errorCode":null,"errorMessage":"Received unsupported arguments: {list(kwargs.keys())}","messagePattern":"Received unsupported arguments: (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"libs/partners/runloop/langchain_runloop/provider.py","lineNumber":180,"sourceCode":"            sandbox_id: Existing devbox ID to attach to, or `None` to create.\n            timeout: Reserved for parity with other sandbox providers.\n            snapshot: Blueprint name to boot from (create-if-missing).\n            blueprint_dockerfile: Dockerfile when auto-building a blueprint.\n            **kwargs: Unsupported.\n\n        Returns:\n            Connected `RunloopSandbox` instance.\n\n        Raises:\n            TypeError: If unsupported keyword arguments are passed.\n            KeyError: If `sandbox_id` does not refer to an existing devbox\n                (the SDK's `NotFoundError` is translated to `KeyError` so\n                callers can map a missing sandbox without importing the SDK).\n            RuntimeError: If devbox or blueprint creation fails.\n        \"\"\"\n        if kwargs:\n            msg = f\"Received unsupported arguments: {list(kwargs.keys())}\"\n            raise TypeError(msg)\n\n        dockerfile = blueprint_dockerfile or _DEFAULT_BLUEPRINT_DOCKERFILE\n\n        if sandbox_id is not None:\n            try:\n                devbox = self._sdk.devbox.from_id(sandbox_id)\n            except NotFoundError as e:\n                # Translate the SDK's not-found error into a stable KeyError so\n                # callers (e.g. the deepagents-code factory) can detect a\n                # missing sandbox without importing runloop_api_client.\n                raise KeyError(sandbox_id) from e\n            return RunloopSandbox(devbox=devbox)\n\n        env_blueprint_id = self._resolve_env(\"RUNLOOP_SANDBOX_BLUEPRINT_ID\")\n        env_blueprint_name = self._resolve_env(\"RUNLOOP_SANDBOX_BLUEPRINT_NAME\")\n        blueprint_name = snapshot or env_blueprint_name\n        use_blueprint = env_blueprint_id is not None or blueprint_name is not None\n","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/partners/runloop/langchain_runloop/provider.py#L162-L198","documentation":"`RunloopProvider.get_or_create` accepts only the documented keyword arguments (`sandbox_id`, `timeout`, `snapshot`, `blueprint_dockerfile`); any other keyword lands in `**kwargs` and is rejected immediately with a `TypeError` naming the offending keys. This fail-fast guard prevents silently ignoring mistyped or provider-mismatched options that would otherwise change behavior invisibly.","triggerScenarios":"Calling `get_or_create` with a keyword argument from a different sandbox provider (e.g. `env=`, `region=`, `template=`) or a typo such as `snapshop=` or `blueprint_name=` instead of `snapshot=`.","commonSituations":"Porting code written against another provider's `get_or_create` signature; typos in keyword names; passing old arguments after a provider swap in the deepagents-code sandbox factory.","solutions":["Remove the offending keyword arguments listed in the message.","Rename typos to the supported parameters: `sandbox_id`, `timeout`, `snapshot`, `blueprint_dockerfile`.","Use env vars instead of unsupported kwargs for blueprint selection (`RUNLOOP_SANDBOX_BLUEPRINT_ID` / `RUNLOOP_SANDBOX_BLUEPRINT_NAME`)."],"exampleFix":"// before\nprovider.get_or_create(sandbox_id=\"dbx_123\", envs={\"FOO\": \"bar\"})  # TypeError\n\n// after\nprovider.get_or_create(sandbox_id=\"dbx_123\")","handlingStrategy":"validation","validationCode":"ALLOWED = {\"sandbox_id\", \"timeout\", \"snapshot\", \"blueprint_dockerfile\"}\n\ndef check_kwargs(**kwargs) -> None:\n    bad = set(kwargs) - ALLOWED\n    if bad:\n        raise TypeError(f\"unsupported args: {sorted(bad)}\")","typeGuard":"def has_only_supported_kwargs(kwargs: dict) -> bool:\n    return not (set(kwargs) - {\"sandbox_id\", \"timeout\", \"snapshot\", \"blueprint_dockerfile\"})","tryCatchPattern":"try:\n    sandbox = provider.get_or_create(**options)\nexcept TypeError as e:\n    log.error(\"bad options for runloop provider: %s\", e)\n    raise","preventionTips":["Match kwargs to the provider: strip/rename options when swapping sandbox backends.","Use IDE autocompletion/type checkers (the signature is fully keyword-typed) instead of dynamic `**options`.","Keep provider-specific config in env vars (`RUNLOOP_SANDBOX_BLUEPRINT_*`) rather than ad-hoc kwargs.","Add a unit test asserting the exact supported kwarg set when wrapping the provider."],"tags":["python","api-misuse","typeerror","unsupported-arguments"],"backgroundTag":"unsupported-keyword-argument","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}