fix: route openai-codex through models.dev so GPT-5.5 exposes xhigh

- Remove openai-codex special case that called github_model_reasoning_efforts()
- Codex now falls through to _models_dev_reasoning_efforts() (full efforts)
- GitHub/Copilot still use the GitHub helper (caps at high)
- Added regression tests for both behaviors
This commit is contained in:
Hermes Agent 2026-05-27 21:38:06 -06:00
parent 4d6269eae6
commit b2220a54b5
2 changed files with 31 additions and 4 deletions

View file

@ -2202,10 +2202,6 @@ def resolve_model_reasoning_efforts(
if provider in {"copilot", "github-copilot"}:
return github_model_reasoning_efforts(hinted_model)
if provider == "openai-codex":
bare = hinted_model.rsplit("/", 1)[-1]
return github_model_reasoning_efforts(bare)
if provider == "lmstudio":
probe_base = resolved_base_url or _get_provider_base_url(provider)
opts = lmstudio_model_reasoning_options(hinted_model, probe_base)

View file

@ -2,6 +2,8 @@
import sys
import types
import pytest
from types import SimpleNamespace
@ -78,6 +80,35 @@ def test_models_dev_false_suppresses_prefix_heuristic(monkeypatch):
) == []
def test_codex_gpt55_uses_models_dev_including_xhigh(monkeypatch):
_install_fake_models_dev(
monkeypatch,
lambda provider, model: SimpleNamespace(supports_reasoning=True),
)
import api.config as cfg
result = cfg.resolve_model_reasoning_efforts(
"gpt-5.5", provider_id="openai-codex"
)
assert result == list(cfg.VALID_REASONING_EFFORTS)
assert "xhigh" in result
def test_copilot_gpt55_caps_at_high(monkeypatch):
import api.config as cfg
try:
from hermes_cli.models import github_model_reasoning_efforts
except ImportError:
pytest.skip("hermes_cli not available")
result = cfg.resolve_model_reasoning_efforts(
"gpt-5.5", provider_id="copilot"
)
assert "xhigh" not in result
def test_get_reasoning_status_uses_config_default_model(monkeypatch, tmp_path):
_install_fake_models_dev(
monkeypatch,