HKUDS/DeepTutor · error · HTTPException

A partner uses the Codex login of the account that owns it.

Error message

A partner uses the Codex login of the account that owns it.

What it means

Refusal in the Codex OAuth actor gate: the caller is a partner, and partners are synthetic users whose credentials belong to a real account. Codex OAuth is strictly personal, so a partner can neither be granted nor perform the login flow.

Solutions

  1. Perform Codex OAuth as the owning (real) account, not through the partner
  2. Grant the partner access via account-level mechanisms if integration is needed
  3. Administrators: do not attempt to assign owner-bound OAuth profiles to partners
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at deeptutor/api/routers/settings.py:432 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of HKUDS/DeepTutor@3e82f13042 (2026-08-27). Data as JSON: /api/errors/b192157d5469cf33. Report an issue: GitHub.

Appendix: source

Thrown at deeptutor/api/routers/settings.py:432

def _require_codex_oauth_actor() -> None:
    """Gate the Codex OAuth lifecycle: personal, not administrative.

    Every one of these endpoints acts on the *caller's own* credentials —
    ``get_codex_oauth_service()`` resolves the store, the model catalog, and
    the callback route from owner scope — so requiring an administrator was
    what left ordinary users unable to use Codex at all: an owner-bound
    profile is (correctly) never grantable, and they could not sign in for
    themselves either (#781).

    A partner is refused: it is a synthetic user whose owner is a real
    account, so letting one in would mean acting on that person's login —
    including signing them out. Partners inherit the owner's login at call
    time and need no lifecycle of their own.
    """
    from deeptutor.services.partners.scope import is_partner_user_id

    if is_partner_user_id(get_current_user().id):
        raise HTTPException(
            status_code=status.HTTP_403_FORBIDDEN,
            detail="A partner uses the Codex login of the account that owns it.",
        )


def _codex_http_exception(error: CodexAuthError) -> HTTPException:
    return HTTPException(
        status_code=error.http_status,
        detail={
            "code": error.code,
            "message": error.public_message,
        },
    )


def _provider_choices() -> dict[str, list[dict[str, Any]]]:
    """Build dropdown options for provider selection, keyed by service type."""
    from deeptutor.services.config.provider_runtime import (

View on GitHub (pinned to 3e82f13042)