From 38482f7cda185e2b532c32d80b43029680411242 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Sat, 31 Oct 2026 15:47:06 -0700 Subject: [PATCH] test(integration): backport the cursor responses wire test fix from #47600 to rc/1.108.0 rc/1.108.0 carries the #43935 backport, which enforces gpt-5's supports_none_reasoning_effort and supports_xhigh_reasoning_effort flags, so the test now reads the levels it parametrizes from the cost map like main does. Only this file of #47600 is taken. Its other files follow changes rc does not have (cherry picked from commit e78f7b4602, tests/integration/providers/test_cursor_responses_wire.py only) --- .../providers/test_cursor_responses_wire.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/integration/providers/test_cursor_responses_wire.py b/tests/integration/providers/test_cursor_responses_wire.py index 6e8c877f7ca..d77d35f2ff8 100644 --- a/tests/integration/providers/test_cursor_responses_wire.py +++ b/tests/integration/providers/test_cursor_responses_wire.py @@ -3,6 +3,7 @@ from __future__ import annotations import json import os import uuid +from importlib.resources import files from typing import Final import pytest @@ -16,8 +17,16 @@ _MODEL: Final = "gpt-5" _API_KEY: Final = "synthetic-cursor-key" _JSON_OBJECT: Final = TypeAdapter(dict[str, JsonValue]) _PROXY_WORKERS: Final = max(1, int(os.environ.get("INTEGRATION_PROXY_WORKERS", "1"))) -_THINKING_LEVELS: Final = ("none", "minimal", "low", "medium", "high", "xhigh", "max") -_CHAT_THINKING_LEVELS: Final = ("none", "minimal", "low", "medium", "high", "max") +_COST_MAP: Final = TypeAdapter(dict[str, dict[str, JsonValue]]) +_MODEL_ROW: Final = _COST_MAP.validate_json( + (files("litellm") / "model_prices_and_context_window_backup.json").read_bytes() +)[_MODEL] +_THINKING_LEVELS: Final = tuple( + level + for level in ("none", "minimal", "low", "medium", "high", "xhigh", "max") + if _MODEL_ROW.get(f"supports_{level}_reasoning_effort") is not False +) +_CHAT_THINKING_LEVELS: Final = tuple(level for level in _THINKING_LEVELS if level != "xhigh") _RESPONSES_SUFFIXES: Final[tuple[tuple[str, dict[str, JsonValue]], ...]] = tuple( (f"-thinking-{level}", {"reasoning": {"effort": level}}) for level in _THINKING_LEVELS ) + (