openai/codex · error · RuntimeError

unexpected ChatGPT login response: {response_root!r}

Error message

unexpected ChatGPT login response: {response_root!r}

What it means

Error "unexpected ChatGPT login response: {response_root!r}" thrown in openai/codex.

Source

Thrown at sdk/python/src/openai_codex/_login.py:38

    """Subset of AsyncCodex needed by async login handles."""

    _client: AsyncCodexClient

    async def _ensure_initialized(self) -> None:
        """Ensure the owning SDK client has a live Codex connection."""
        ...


def start_chatgpt_login(client: CodexClient) -> ChatgptLoginHandle:
    """Start browser ChatGPT login and return the handle for that attempt."""
    response = client.account_login_start(
        LoginAccountParams(
            root=ChatgptLoginAccountParams(type="chatgpt"),
        )
    )
    response_root = response.root
    if not isinstance(response_root, ChatgptLoginAccountResponse):
        raise RuntimeError(f"unexpected ChatGPT login response: {response_root!r}")
    return ChatgptLoginHandle(
        client,
        response_root.login_id,
        response_root.auth_url,
    )


async def async_start_chatgpt_login(owner: _AsyncLoginOwner) -> AsyncChatgptLoginHandle:
    """Start async browser ChatGPT login and return that attempt's handle."""
    response = await owner._client.account_login_start(
        LoginAccountParams(
            root=ChatgptLoginAccountParams(type="chatgpt"),
        )
    )
    response_root = response.root
    if not isinstance(response_root, ChatgptLoginAccountResponse):
        raise RuntimeError(f"unexpected ChatGPT login response: {response_root!r}")
    return AsyncChatgptLoginHandle(

View on GitHub (pinned to 339751715c)

Solutions

  1. Retry the ChatGPT login; if it persists, update the SDK to match the current login response shape.

When it happens

Trigger: Thrown at sdk/python/src/openai_codex/_login.py:38 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/1b5006f434a99346. Report an issue: GitHub.