feat: complete native BOM and Harness execution acceptance

This commit is contained in:
阿白叔 committed 2026-11-12 19:21:55 +08:00
1 parent 4f8fbd7806
commit 65438cb7e5
234 files changed
+24402 -865

No files matched your search

+11 -1
View File
@@ -1,4 +1,5 @@
import pytest
import json
def settings():
@@ -8,9 +9,18 @@ def settings():
def test_settings_are_bounded_persistent_and_do_not_accept_credentials(tmp_path):
load, save = settings()
assert load(tmp_path)['response_timeout_seconds'] == 90
assert load(tmp_path)['response_timeout_seconds'] == 0
value = save(tmp_path, {'response_timeout_seconds': 120, 'model_context_limit': 12000})
assert load(tmp_path) == value
for invalid in [{'response_timeout_seconds': 1}, {'api_key': 'do-not-persist'}, {'model_context_limit': True}]:
with pytest.raises(ValueError):
save(tmp_path, invalid)
def test_old_application_defaults_migrate_to_native_limits(tmp_path):
load, save = settings()
path = tmp_path / 'dsh/assistant-settings.json'
path.parent.mkdir()
path.write_text(json.dumps({'response_timeout_seconds': 90, 'model_context_limit': 16000}))
assert load(tmp_path) == {'response_timeout_seconds': 0, 'model_context_limit': 0}
assert save(tmp_path, {'response_timeout_seconds': 0, 'model_context_limit': 0}) == load(tmp_path)