litellm/tests/test_litellm/llms/chatgpt
Jason Cook f2653df86b fix(oauth): don't eager-resolve tokens during add_deployment cycles
``get_llm_provider_logic.py`` instantiates ``ChatGPTConfig`` /
``GithubCopilotConfig`` and calls ``_get_openai_compatible_provider_info``
at every ``add_deployment`` cycle during proxy startup (30s tick when
``STORE_MODEL_IN_DB=True``). The old code eagerly called
``get_access_token()`` / ``get_api_key()`` through the filesystem
authenticator at that point. With no tokens on disk this falls through
to ``_login_device_code()``, which prints a device prompt to stdout and
polls the IdP for up to 15 minutes — blocking startup and (for OAuth
credentials stored in the DB) duplicating work that ``validate_environment``
is about to do correctly at request time.

Resolution is now a pure metadata pass: pick an ``api_base``, let the
``oauth:<name>`` marker pass through untouched. Actual token resolution
still happens at request time via ``resolve_authenticator`` inside
``validate_environment``, which is where we have the full
``litellm_params`` anyway.

Tests updated to assert ``get_access_token`` / ``get_api_key`` are NOT
called during resolution, and that the ``oauth:`` marker passes through.
2026-04-23 14:58:20 -04:00
..
chat fix(oauth): don't eager-resolve tokens during add_deployment cycles 2026-04-23 14:58:20 -04:00
responses fix(chatgpt): fold response.output_item.done events into SSE parse 2026-04-23 13:24:50 -04:00
__init__.py fix(chatgpt): normalize streaming tool_call indices and deduplicate closing chunks 2026-02-18 18:02:36 -03:00
test_chatgpt_authenticator.py Add ChatGPT subscription support and responses bridge (#19030) 2026-01-19 05:37:45 -08:00
test_chatgpt_db_authenticator.py fix(chatgpt): DBAuthenticator must never fall through to _login_device_code 2026-04-23 12:09:42 -04:00
test_chatgpt_pkce_login.py feat(chatgpt, github_copilot): OAuth sign-in + token refresh in proxy UI 2026-04-16 20:30:10 -04:00