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
1 change: 0 additions & 1 deletion src/ucode/agents/codex.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,6 @@ def default_model(state: dict) -> str | None:
return state["codex_default_model"]
if smart_routing_v2.smart_routing_enabled():
return _smart_routing_config_model(state)
clear_model_preferences(state)
return None


Expand Down
11 changes: 4 additions & 7 deletions tests/test_agent_codex.py
Original file line number Diff line number Diff line change
Expand Up @@ -909,15 +909,12 @@ def _isolate_profile_config(self, tmp_path, monkeypatch):
monkeypatch.setattr(codex, "CODEX_CONFIG_PATH", tmp_path / "ucode.config.toml")
monkeypatch.setattr(codex, "CODEX_BACKUP_PATH", tmp_path / "backup.toml")

def test_clears_profile_model_preferences(self, tmp_path):
codex.CODEX_CONFIG_PATH.write_text(
'model = "gpt-5.6-sol"\nmodel_reasoning_effort = "medium"\n', encoding="utf-8"
)
def test_reads_without_touching_profile_model_preferences(self, tmp_path):
original = 'model = "gpt-5.6-sol"\nmodel_reasoning_effort = "medium"\n'
codex.CODEX_CONFIG_PATH.write_text(original, encoding="utf-8")

assert codex.default_model({"codex_models": ["system.ai.gpt-5-6-luna"]}) is None
doc = read_toml_safe(codex.CODEX_CONFIG_PATH)
assert "model" not in doc
assert "model_reasoning_effort" not in doc
assert codex.CODEX_CONFIG_PATH.read_text(encoding="utf-8") == original

def test_none_when_no_configured_model(self):
assert codex.default_model({}) is None
Expand Down
Loading