Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/autoskillit/core/types/_type_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,15 @@ class BackendCapabilities:

CODEX_MODEL_ALIASES: Mapping[str, str] = MappingProxyType(
{
"sonnet": "gpt-5.5",
"opus": "gpt-5.5",
"haiku": "gpt-5.5",
"sonnet": "gpt-5.6-sol",
"opus": "gpt-5.6-sol",
"haiku": "gpt-5.6-sol",
}
)

CODEX_MODEL_ALIASES_LAST_VERIFIED: str = "2026-07-09"

CODEX_VALID_MODEL_IDS: frozenset[str] = frozenset({"gpt-5.5"})
CODEX_VALID_MODEL_IDS: frozenset[str] = frozenset({"gpt-5.5", "gpt-5.6-sol"})

assert set(CODEX_MODEL_ALIASES.values()).issubset(CODEX_VALID_MODEL_IDS), (
"CODEX_MODEL_ALIASES values must all be members of CODEX_VALID_MODEL_IDS; "
Expand Down
8 changes: 6 additions & 2 deletions tests/cli/test_doctor_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ def test_ok_when_within_threshold_and_valid_aliases(
monkeypatch.setattr(
mod,
"CODEX_MODEL_ALIASES",
{"sonnet": "gpt-5.5", "opus": "gpt-5.5", "haiku": "gpt-5.5"},
{
"sonnet": "gpt-5.6-sol",
"opus": "gpt-5.6-sol",
"haiku": "gpt-5.6-sol",
},
)
result = mod._check_codex_model_alias_staleness()
assert result.severity == Severity.OK
Expand All @@ -45,7 +49,7 @@ def test_warning_when_alias_value_invalid(self, monkeypatch: pytest.MonkeyPatch)
monkeypatch.setattr(
mod,
"CODEX_MODEL_ALIASES",
{"sonnet": "gpt-5.5", "opus": "BOGUS-MODEL"},
{"sonnet": "gpt-5.6-sol", "opus": "BOGUS-MODEL"},
)
result = mod._check_codex_model_alias_staleness()
assert result.severity == Severity.WARNING
Expand Down
21 changes: 19 additions & 2 deletions tests/execution/backends/test_model_translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ def test_strips_context_suffix(self) -> None:
assert "[1m]" not in result
assert result == CODEX_MODEL_ALIASES["opus"]

def test_passthrough_native(self) -> None:
assert CodexBackend().translate_model("gpt-5.5") == "gpt-5.5"
@pytest.mark.parametrize("model_id", ["gpt-5.5", "gpt-5.6-sol"])
def test_passthrough_native(self, model_id: str) -> None:
assert CodexBackend().translate_model(model_id) == model_id

def test_unknown_passthrough(self) -> None:
assert CodexBackend().translate_model("custom-model-xyz") == "custom-model-xyz"
Expand Down Expand Up @@ -176,6 +177,22 @@ def test_food_truck_cmd_has_effort(self) -> None:
)
assert "model_reasoning_effort=high" in list(spec.cmd)

def test_food_truck_opus_suffix_uses_shared_model_with_xhigh_effort(self) -> None:
from autoskillit.core import DirectInstall

spec = CodexBackend().build_food_truck_cmd(
orchestrator_prompt="test",
plugin_source=DirectInstall(plugin_dir="/tmp/plugin"),
cwd="/repo",
completion_marker="%%DONE%%",
model="opus[1m]",
)
cmd = list(spec.cmd)
model_idx = cmd.index("--model")
assert cmd[model_idx + 1] == CODEX_MODEL_ALIASES["opus"]
assert "[1m]" not in cmd[model_idx + 1]
assert "model_reasoning_effort=xhigh" in cmd

def test_interactive_cmd_has_effort(self) -> None:
spec = CodexBackend().build_interactive_cmd(model="sonnet")
assert "model_reasoning_effort=high" in list(spec.cmd)
Expand Down
16 changes: 16 additions & 0 deletions tests/execution/test_model_alias_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,22 @@ def test_codex_alias_values_in_allowlist() -> None:
)


def test_codex_aliases_use_sol() -> None:
from autoskillit.core.types._type_backend import CODEX_MODEL_ALIASES

assert set(CODEX_MODEL_ALIASES) == {"sonnet", "opus", "haiku"}
assert set(CODEX_MODEL_ALIASES.values()) == {"gpt-5.6-sol"}


def test_codex_native_model_allowlist_preserves_compatibility() -> None:
from autoskillit.core.types._type_backend import is_valid_codex_model_id

assert is_valid_codex_model_id("gpt-5.6-sol")
assert is_valid_codex_model_id("gpt-5.5")
assert not is_valid_codex_model_id("gpt-5.4")
assert not is_valid_codex_model_id("gpt-5.4-mini")


def test_claude_alias_values_in_allowlist() -> None:
from autoskillit.core.types._type_backend import CLAUDE_MODEL_ALIASES

Expand Down
Loading