fix: normalize reasoning effort ordering in UI

This commit is contained in:
Greer Guthrie
2026-04-09 11:06:39 -05:00
committed by Teknium
parent 6f8e426275
commit 775a46ce75
9 changed files with 60 additions and 12 deletions

View File

@@ -1811,7 +1811,10 @@ def _set_reasoning_effort(config, effort: str) -> None:
def _prompt_reasoning_effort_selection(efforts, current_effort=""):
"""Prompt for a reasoning effort. Returns effort, 'none', or None to keep current."""
ordered = list(dict.fromkeys(str(effort).strip().lower() for effort in efforts if str(effort).strip()))
deduped = list(dict.fromkeys(str(effort).strip().lower() for effort in efforts if str(effort).strip()))
canonical_order = ("minimal", "low", "medium", "high", "xhigh")
ordered = [effort for effort in canonical_order if effort in deduped]
ordered.extend(effort for effort in deduped if effort not in canonical_order)
if not ordered:
return None