fix(agent): separate preset snapshots from config reload

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Xubin RenandCursor authored and Xubin Ren committed 2026-05-12 20:06:22 +08:00
1 parent 8fcb24bb7c
commit e6103d9312
6 files changed
+53 -22

No files matched your search

+11
View File
@@ -110,6 +110,17 @@ def test_model_preset_accepts_explicit_default_name() -> None:
assert config.resolve_preset().model == "openai/gpt-4.1"
def test_model_presets_rejects_reserved_default_name() -> None:
import pytest
with pytest.raises(ValueError, match="model_preset name 'default' is reserved"):
Config.model_validate({
"modelPresets": {
"default": {"model": "custom-model"},
},
})
def test_resolve_preset_rejects_unknown_named_preset() -> None:
import pytest
with pytest.raises(KeyError, match="model_preset 'missing' not found"):