litellm/tests/integration/compatibility
ryan-crabbe-berri 3744c1f558
fix(proxy): keep JSON integers beyond 64 bits exact in request bodies (#55400)
* fix(proxy): keep JSON integers beyond 64 bits exact in request bodies

orjson reads an integer below -2**63 or above 2**64-1 as a float, so a tool schema bound such as 12345678901234567890123 reached the provider as 1.2345678901234568e+22. A body that holds a run of 19 or more digits is now decoded a second time by the stdlib parser, which keeps every digit, and the model rewrite falls back to the stdlib encoder when orjson cannot write such an integer.

Fixes #47947

* fix(proxy): store integers beyond 64 bits as numbers in spend logs and parse twice only for them

The spend-log row kept the host's wide-number marker as a string, so a stored request body
showed the marker text instead of the number. A body is now decoded a second time only when it
holds 20 digits in a row or a minus sign and 19, since a 19-digit positive integer fits 64 bits.

* fix(proxy): parse a body twice only when an integer token is beyond 64 bits

A float fraction, a hash or an id inside a string can hold 20 digits in a row, so the second
parse now needs the digits to follow a JSON separator.
2026-12-01 21:01:28 +00:00
..
_a2a_peers.py fix(a2a): add per-agent a2a_protocol_version override for langgraph-api 0.15 cards (#44463) 2026-10-13 09:04:36 -04:00
_status_code_audit.py test(integration): stop GET /__observations from draining the upstream log (#47256) 2026-10-18 09:58:05 +00:00
test_a2a_protocol_version_bridge.py fix(a2a): add per-agent a2a_protocol_version override for langgraph-api 0.15 cards (#44463) 2026-10-13 09:04:36 -04:00
test_a2a_protocol_version_errors.py fix(a2a): add per-agent a2a_protocol_version override for langgraph-api 0.15 cards (#44463) 2026-10-13 09:04:36 -04:00
test_a2a_protocol_version_override.py test(integration): hand every harness server a port from one per-worker block (#46761) 2026-10-15 16:56:40 -07:00
test_a2a_wire_versions.py test(integration): repair stale contract fixtures (#49700) 2026-11-02 11:23:11 -08:00
test_audio_speech_wire.py fix(openai): bill the audio output tokens OpenAI reports for gpt-4o-mini-tts speech (#52317) 2026-11-17 11:35:30 -08:00
test_audio_transcriptions_wire.py test(audio): bill reported transcription seconds for measurable uploads (#50767) 2026-11-09 23:55:58 +00:00
test_audio_translations_wire.py test(integration): cover audio endpoint contracts (#44699) 2026-10-14 03:41:20 +00:00
test_backend_error_relay.py fix(exceptions): relay param and the plain message from a flat backend error body (#55166) 2026-11-30 21:51:46 +00:00
test_codex_model_catalog.py fix(proxy): send the whole Codex model catalog to Codex 0.166.0-alpha.1 and newer (#50736) 2026-11-10 07:10:30 +00:00
test_completions_body_only_fields.py fix(completions): send fields the OpenAI SDK has no keyword for in the request body (#55158) 2026-11-30 23:49:09 +00:00
test_compressed_request_bodies.py test(proxy): audit #47418 (#48766) 2026-10-28 03:23:34 -07:00
test_embedding_path_aliases.py test(integration): cover embeddings endpoint contracts (#44660) 2026-10-14 03:38:12 +00:00
test_fine_tuning_jobs.py fix(managed_files): send provider file ids when creating a fine-tuning job from managed files (#46552) 2026-10-19 14:40:15 -07:00
test_fine_tuning_managed_files_chaos.py Use strict supervision for worker replacement tests (#51590) 2026-11-13 11:18:52 -08:00
test_granian_admission_saturation.py test(integration): hand every harness server a port from one per-worker block (#46761) 2026-10-15 16:56:40 -07:00
test_integration_worker_cleanup.py test(integration): give chaos and timing tests a harness API and gate raw signals (#46031) 2026-10-12 05:27:33 -07:00
test_large_integer_fidelity.py fix(proxy): keep JSON integers beyond 64 bits exact in request bodies (#55400) 2026-12-01 21:01:28 +00:00
test_malformed_input_status.py fix(proxy): return 400 for an unknown chat content part type or a wrong-typed completions prompt (#55003) 2026-11-30 21:47:24 +00:00
test_missing_body_param_status.py test: fix integration tests that fail on test order, races and intended changes (#49310) 2026-10-30 13:25:47 -07:00
test_openai_consumer.py fix(streaming)!: send the include_usage chunk with an empty choices array (#47109) 2026-10-21 02:26:05 +00:00
test_openai_sdk_client_paths.py fix(router): make the constructor stub work for mypy and guard it in CI (#50354) 2026-11-22 21:25:00 +00:00
test_openai_sdk_client_paths_chaos.py test(integration): stop GET /__observations from draining the upstream log (#47256) 2026-10-18 09:58:05 +00:00
test_persisted_toolsets.py test(integration): give each owned proxy a private database and Redis by default (#47213) 2026-10-18 03:37:41 +00:00
test_prompt_management_routes.py test(integration): cover prompts_tags_caching endpoint contracts (#44686) 2026-10-14 04:10:31 +00:00
test_proxy_utils.py test(integration): cover config_utils endpoint contracts (#44737) 2026-10-14 07:00:23 +00:00
test_responses_openapi_schema.py fix(proxy): document request body and response schemas for the Responses API in OpenAPI (#42802) 2026-09-24 01:28:34 +00:00
test_status_code_followups.py test(integration): stop GET /__observations from draining the upstream log (#47256) 2026-10-18 09:58:05 +00:00
test_status_code_followups_chaos.py test(integration): stop GET /__observations from draining the upstream log (#47256) 2026-10-18 09:58:05 +00:00
test_status_code_followups_defaults.py test(integration): stop GET /__observations from draining the upstream log (#47256) 2026-10-18 09:58:05 +00:00
test_status_code_followups_requests.py test(integration): stop GET /__observations from draining the upstream log (#47256) 2026-10-18 09:58:05 +00:00