litellm/tests/test_litellm/llms/github_copilot
Jason Cook b22f988248 fix(oauth): jsonify_object() for Prisma Json columns in persist_credential_to_db
Reported error after the cross-loop fix:

  Tokens obtained but DB persist failed: Unable to match input value to
  any allowed input type for the field. Parse errors: [...
  ``credential_values`` should be of any of the following types:
  ``JsonNullValueInput``, ``Json`` ...]

Prisma's Json columns ingest pre-serialized JSON *strings*, not raw
Python dicts. The ``/credentials`` endpoint wraps the payload with
``jsonify_object(...)`` (in ``litellm/proxy/utils.py``) which does
``json.dumps`` per nested-dict field. My persist helper was skipping
that step and passing raw dicts — Prisma's binding layer then couldn't
match them to the ``Json`` type.

Route the ``credential_values`` + ``credential_info`` dicts through
``jsonify_object`` before the upsert. Same fix in both ChatGPT and
Copilot ``db_authenticator.py``. Tests updated to assert the serialized
string form (``json.loads(kwargs[...]["credential_values"])``).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 10:58:46 -04:00
..
embedding feat(github-copilot): Add Embedding API support (#17278) 2025-12-01 20:05:28 -08:00
responses fix(github_copilot): preserve encrypted_content in reasoning items for multi-turn conversations (#17130) 2025-12-05 12:42:25 -08:00
test_copilot_db_authenticator.py fix(oauth): jsonify_object() for Prisma Json columns in persist_credential_to_db 2026-04-23 10:58:46 -04:00
test_copilot_oauth_dispatch.py feat(chatgpt, github_copilot): OAuth sign-in + token refresh in proxy UI 2026-04-16 20:30:10 -04:00
test_github_copilot_authenticator.py Revert "Litellm dev 07 21 2025 p1 (#12848)" 2025-07-22 18:28:36 -07:00
test_github_copilot_transformation.py feat(github-copilot): Add Embedding API support (#17278) 2025-12-01 20:05:28 -08:00