openai/codex · error · TypeError

Expected generated params model or dict, got {type(params)._

Error message

Expected generated params model or dict, got {type(params).__name__}

What it means

Error "Expected generated params model or dict, got {type(params).__name__}" thrown in openai/codex.

Source

Thrown at sdk/python/src/openai_codex/client.py:108

        | V2LoginAccountParams
        | JsonObject
        | None
    ),
) -> JsonObject:
    if params is None:
        return {}
    if hasattr(params, "model_dump"):
        dumped = params.model_dump(
            by_alias=True,
            exclude_none=True,
            mode="json",
        )
        if not isinstance(dumped, dict):
            raise TypeError("Expected model_dump() to return dict")
        return dumped
    if isinstance(params, dict):
        return params
    raise TypeError(f"Expected generated params model or dict, got {type(params).__name__}")


def _installed_codex_path() -> Path:
    try:
        from codex_cli_bin import bundled_codex_path
    except ImportError as exc:
        raise FileNotFoundError(
            "Unable to locate the pinned Codex runtime. Install the published SDK build "
            f"with its {RUNTIME_PKG_NAME} dependency, or set CodexConfig.codex_bin "
            "explicitly."
        ) from exc

    return bundled_codex_path()


def _installed_codex_path_dirs() -> tuple[Path, ...]:
    try:
        from codex_cli_bin import bundled_path_dir

View on GitHub (pinned to 339751715c)

Solutions

  1. Pass a dict or the generated params model for this method instead of the given type.

When it happens

Trigger: Thrown at sdk/python/src/openai_codex/client.py:108 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/f1f48f077d3ad8c9. Report an issue: GitHub.