mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-11 08:38:24 +00:00
fix(lite): keep REASONING_EFFORT_STRENGTH_ORDER importable from router_utils and skip the Codex sync on undecodable debug models output
This commit is contained in:
parent
62e21014b5
commit
0db4944d0f
3 changed files with 10 additions and 4 deletions
|
|
@ -828,7 +828,7 @@ def _codex_debug_models(
|
|||
encoding="utf-8",
|
||||
timeout=_CODEX_PREFLIGHT_TIMEOUT_SECONDS,
|
||||
)
|
||||
except (OSError, subprocess.TimeoutExpired) as e:
|
||||
except (OSError, subprocess.TimeoutExpired, UnicodeError) as e:
|
||||
return ModelSyncSkipped(f"`{name} debug models` failed: {e}")
|
||||
if completed.returncode == 0:
|
||||
return completed.stdout
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ from litellm._logging import verbose_logger
|
|||
from litellm.litellm_core_utils.core_helpers import as_str_mapping
|
||||
from litellm.litellm_core_utils.get_supported_openai_params import get_supported_openai_params
|
||||
from litellm.litellm_core_utils.reasoning_effort_strength import (
|
||||
REASONING_EFFORT_STRENGTH_RANK,
|
||||
REASONING_EFFORT_STRENGTH_ORDER,
|
||||
ReasoningEffortRounding,
|
||||
nearest_declared_reasoning_effort,
|
||||
)
|
||||
|
|
@ -136,7 +136,7 @@ def deployment_reasoning_effort_levels(deployment_model_info: object) -> tuple[s
|
|||
|
||||
def deployment_rounds_reasoning_effort(deployment_model_info: object) -> bool:
|
||||
declared: Final = deployment_reasoning_effort_levels(deployment_model_info)
|
||||
return declared is not None and any(level in REASONING_EFFORT_STRENGTH_RANK for level in declared)
|
||||
return declared is not None and any(level in REASONING_EFFORT_STRENGTH_ORDER for level in declared)
|
||||
|
||||
|
||||
def with_adaptive_thinking_as_effort(
|
||||
|
|
|
|||
|
|
@ -1271,7 +1271,13 @@ class TestCodexModelSync:
|
|||
assert result.reason == "`codex debug models` exited 1: no output"
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"error", [OSError("codex vanished"), subprocess.TimeoutExpired("codex", 10)], ids=["oserror", "timeout"]
|
||||
"error",
|
||||
[
|
||||
OSError("codex vanished"),
|
||||
subprocess.TimeoutExpired("codex", 10),
|
||||
UnicodeDecodeError("utf-8", b"\xff", 0, 1, "invalid start byte"),
|
||||
],
|
||||
ids=["oserror", "timeout", "undecodable"],
|
||||
)
|
||||
def test_unrunnable_preflight_is_reported_not_raised(self, tmp_path, error):
|
||||
def failing_run(*a, **k):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue