langchain-ai/deepagents · error · TypeError

Received unsupported arguments: {list(kwargs.keys())}

Error message

Received unsupported arguments: {list(kwargs.keys())}

What it means

`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.

Source

Thrown at libs/partners/runloop/langchain_runloop/provider.py:180

            sandbox_id: Existing devbox ID to attach to, or `None` to create.
            timeout: Reserved for parity with other sandbox providers.
            snapshot: Blueprint name to boot from (create-if-missing).
            blueprint_dockerfile: Dockerfile when auto-building a blueprint.
            **kwargs: Unsupported.

        Returns:
            Connected `RunloopSandbox` instance.

        Raises:
            TypeError: If unsupported keyword arguments are passed.
            KeyError: If `sandbox_id` does not refer to an existing devbox
                (the SDK's `NotFoundError` is translated to `KeyError` so
                callers can map a missing sandbox without importing the SDK).
            RuntimeError: If devbox or blueprint creation fails.
        """
        if kwargs:
            msg = f"Received unsupported arguments: {list(kwargs.keys())}"
            raise TypeError(msg)

        dockerfile = blueprint_dockerfile or _DEFAULT_BLUEPRINT_DOCKERFILE

        if sandbox_id is not None:
            try:
                devbox = self._sdk.devbox.from_id(sandbox_id)
            except NotFoundError as e:
                # Translate the SDK's not-found error into a stable KeyError so
                # callers (e.g. the deepagents-code factory) can detect a
                # missing sandbox without importing runloop_api_client.
                raise KeyError(sandbox_id) from e
            return RunloopSandbox(devbox=devbox)

        env_blueprint_id = self._resolve_env("RUNLOOP_SANDBOX_BLUEPRINT_ID")
        env_blueprint_name = self._resolve_env("RUNLOOP_SANDBOX_BLUEPRINT_NAME")
        blueprint_name = snapshot or env_blueprint_name
        use_blueprint = env_blueprint_id is not None or blueprint_name is not None

View on GitHub (pinned to a1af029e6e)

Solutions

  1. Remove the offending keyword arguments listed in the message.
  2. Rename typos to the supported parameters: `sandbox_id`, `timeout`, `snapshot`, `blueprint_dockerfile`.
  3. Use env vars instead of unsupported kwargs for blueprint selection (`RUNLOOP_SANDBOX_BLUEPRINT_ID` / `RUNLOOP_SANDBOX_BLUEPRINT_NAME`).

Example fix

// before
provider.get_or_create(sandbox_id="dbx_123", envs={"FOO": "bar"})  # TypeError

// after
provider.get_or_create(sandbox_id="dbx_123")
Defensive patterns

Strategy: validation

Validate before calling

ALLOWED = {"sandbox_id", "timeout", "snapshot", "blueprint_dockerfile"}

def check_kwargs(**kwargs) -> None:
    bad = set(kwargs) - ALLOWED
    if bad:
        raise TypeError(f"unsupported args: {sorted(bad)}")

Type guard

def has_only_supported_kwargs(kwargs: dict) -> bool:
    return not (set(kwargs) - {"sandbox_id", "timeout", "snapshot", "blueprint_dockerfile"})

Try / catch

try:
    sandbox = provider.get_or_create(**options)
except TypeError as e:
    log.error("bad options for runloop provider: %s", e)
    raise

Prevention

When it happens

Trigger: 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=`.

Common situations: 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.

Related errors


AI-assisted analysis of langchain-ai/deepagents@a1af029e6e (2026-08-29). Data as JSON: /api/errors/7df71dc0997e78c6. Report an issue: GitHub.