Allow the none reasoning effort for GPT-6 Luna (#183922)

This commit is contained in:
Matos
2026-10-05 11:54:43 +00:00
committed by Franck Nijhof
parent bd77abd265
commit 46866445f3
4 changed files with 85 additions and 0 deletions
@@ -629,6 +629,7 @@ class OpenAISubentryFlowHandler(ConfigSubentryFlow):
return []
models_reasoning_map: dict[str | tuple[str, ...], list[str]] = {
"gpt-6-luna": ["none", "low", "medium", "high", "xhigh", "max"],
"gpt-6": ["low", "medium", "high", "xhigh", "max"],
"gpt-5.6": ["none", "low", "medium", "high", "xhigh", "max"],
("gpt-5.2-pro", "gpt-5.4-pro", "gpt-5.5-pro"): ["medium", "high", "xhigh"],
@@ -529,6 +529,46 @@
}),
})
# ---
# name: test_model_args[subentry_options7]
dict({
'max_output_tokens': 3000,
'model': 'gpt-6-luna',
'prompt_cache_options': dict({
'ttl': '30m',
}),
'reasoning': dict({
'effort': 'low',
'summary': 'auto',
}),
'service_tier': 'auto',
'store': False,
'stream': True,
'text': dict({
'verbosity': 'medium',
}),
})
# ---
# name: test_model_args[subentry_options8]
dict({
'max_output_tokens': 3000,
'model': 'gpt-6-luna',
'prompt_cache_options': dict({
'ttl': '30m',
}),
'reasoning': dict({
'effort': 'none',
'summary': 'auto',
}),
'service_tier': 'auto',
'store': False,
'stream': True,
'temperature': 0.5,
'text': dict({
'verbosity': 'medium',
}),
'top_p': 0.9,
})
# ---
# name: test_web_search[False]
list([
dict({
@@ -275,6 +275,7 @@ async def test_subentry_unsupported_model(
("gpt-5.5", ["none", "low", "medium", "high", "xhigh"]),
("gpt-5.5-pro", ["medium", "high", "xhigh"]),
("gpt-5.6", ["none", "low", "medium", "high", "xhigh", "max"]),
("gpt-6-luna", ["none", "low", "medium", "high", "xhigh", "max"]),
("gpt-6-astra", ["low", "medium", "high", "xhigh", "max"]),
],
)
@@ -320,6 +321,42 @@ async def test_subentry_reasoning_effort_list(
)
@pytest.mark.usefixtures("mock_init_component")
@pytest.mark.parametrize("subentry_type", ["conversation", "ai_task_data"])
@pytest.mark.parametrize("reasoning_effort", ["none", "low"])
async def test_subentry_luna_reasoning_effort(
hass: HomeAssistant,
mock_config_entry: MockConfigEntry,
subentry_type: str,
reasoning_effort: str,
) -> None:
"""Test that Luna reasoning effort can be selected and saved."""
subentry = next(
entry
for entry in mock_config_entry.subentries.values()
if entry.subentry_type == subentry_type
)
result = await mock_config_entry.start_subentry_reconfigure_flow(
hass, subentry.subentry_id
)
result = await hass.config_entries.subentries.async_configure(
result["flow_id"], {CONF_RECOMMENDED: False}
)
result = await hass.config_entries.subentries.async_configure(
result["flow_id"], {CONF_CHAT_MODEL: "gpt-6-luna"}
)
assert result["step_id"] == "model"
result = await hass.config_entries.subentries.async_configure(
result["flow_id"], {CONF_REASONING_EFFORT: reasoning_effort}
)
assert result["type"] is FlowResultType.ABORT
assert result["reason"] == "reconfigure_successful"
saved = mock_config_entry.subentries[subentry.subentry_id].data
assert saved[CONF_CHAT_MODEL] == "gpt-6-luna"
assert saved[CONF_REASONING_EFFORT] == reasoning_effort
@pytest.mark.parametrize(
("model", "has_reasoning_summary"),
[
@@ -879,6 +879,13 @@ async def test_flex_tier_retry(
CONF_REASONING_SUMMARY: "off",
CONF_VERBOSITY: "high",
},
{CONF_CHAT_MODEL: "gpt-6-luna"},
{
CONF_CHAT_MODEL: "gpt-6-luna",
CONF_REASONING_EFFORT: "none",
CONF_TEMPERATURE: 0.5,
CONF_TOP_P: 0.9,
},
],
)
@pytest.mark.usefixtures("mock_init_component")