Skip to content

Allow xhigh, max and custom reasoning effort values - #11

Merged
imonlinux merged 1 commit into
imonlinux:mainfrom
AimanFarooq:feat/reasoning-effort-custom
Nov 6, 2026
Merged

imonlinux merged 1 commit into
imonlinux:mainfrom
AimanFarooq:feat/reasoning-effort-custom

Conversation

@AimanFarooq

Copy link
Copy Markdown
Contributor

Follow-up to #7 and #9: the other half of the #7 suggestion, xhigh/max and custom values.

Current OpenAI models go above high, and the selector can't reach those levels today:

  • OpenAI's SDK defines ReasoningEffort as none, minimal, low, medium, high, xhigh, max (reasoning_effort.py).
  • HA core's openai_conversation offers xhigh for gpt-5.2 through gpt-5.5, and xhigh/max for gpt-5.6 and gpt-6 (_get_reasoning_options in its config_flow.py).
  • Meta's Model API documents xhigh, and max on some models (docs). OpenRouter accepts both.

Changes

  • const.py: adds xhigh and max to REASONING_EFFORT_OPTIONS.
  • config_flow.py: sets custom_value=True on the reasoning effort selector, the same pattern the model picker already uses. Providers with their own levels can be configured by typing the value, without waiting for a release.
  • providers/openai_chat_provider.py: trims whitespace from the configured value, since custom values are typed. A blank value is treated like the none default, so the parameter is omitted.
  • strings.json / translations/en.json: adds "Extra high" and "Max" labels. The field description now mentions that a custom value can be typed.
  • Tests:
    • A parametrized provider test covers xhigh, max, a custom value, whitespace trimming, and blank values.
    • A parametrized config-flow test checks that the selector accepts the presets and a custom value.

The default is unchanged (none), so existing entries behave exactly as before. As with the other levels, support depends on the model, and the existing "Leave at Default if your model or server does not support it" description covers that.

The custom-value part is separable. If you'd rather keep the selector to presets only, dropping the custom_value=True line (and its test case) leaves a pure xhigh/max addition.

Validation

  • Rebased on 1.3.0.
  • Full suite on Python 3.13 with requirements_test.txt: 145 passed, 2 skipped (the 134 baseline, plus 11 new parametrized cases).
  • Checked that the new tests catch regressions: with custom_value or the trimming reverted, the custom-value, whitespace and blank cases fail.

Providers define their own reasoning_effort levels beyond low/medium/high:
Meta's Model API documents xhigh and max (on some models), and other
OpenAI-compatible servers have their own. Add xhigh and max as presets and
let the selector accept a typed custom value, as the model picker already
does, so new levels do not need a release.

Custom values are free text, so the provider trims whitespace and treats a
blank value like the none default (parameter omitted).

Follow-up to imonlinux#7.
@imonlinux
imonlinux merged commit 3bd8087 into imonlinux:main Nov 6, 2026
3 checks passed
@imonlinux imonlinux mentioned this pull request Nov 6, 2026
1 of 2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants