fix(agent): separate preset snapshots from config reload
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
committed by
Xubin Ren
co-authored by
Cursor
parent
8fcb24bb7c
commit
e6103d9312
@@ -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"):
|
||||
|
||||
Reference in New Issue
Block a user