feat: prepare EvoScientist 0.3.0
Docker / build (push) Has been cancelled
Build / build (push) Has been cancelled
Lint / ruff (push) Has been cancelled
Test / pytest (ubuntu-latest, 3.11) (push) Has been cancelled
Test / pytest (ubuntu-latest, 3.12) (push) Has been cancelled
Test / pytest (windows-latest, 3.11) (push) Has been cancelled
Test / pytest (windows-latest, 3.12) (push) Has been cancelled

Add bounded document ingestion, controlled web search, recoverable session support, subagent timeouts, and the native sandbox runtime contract. Unify package versioning and add release-focused regression coverage.
This commit is contained in:
m4
2026-09-03 06:55:56 +08:00
parent ce0bec1f91
commit c683f6e739
35 changed files with 2806 additions and 67 deletions
@@ -15,6 +15,7 @@ from types import SimpleNamespace
import pytest
from EvoScientist.llm.contracts import EvoRuntimeError
from EvoScientist.llm.errors import (
AgentControlError,
ModelToolProtocolError,
@@ -169,6 +170,16 @@ class TestNormalize:
assert _normalize(req, error) is None
def test_stable_runtime_error_passes_through(self):
req = _request(_openai_model())
error = EvoRuntimeError(
"UPSTREAM_RATE_LIMITED",
"模型服务请求频率超限,请稍后重试或切换模型。",
details=({"http_status": 429},),
)
assert _normalize(req, error) is None
# ---------------------------------------------------------------------------
# _is_provider_error — used by tool selector to distinguish provider
@@ -397,6 +408,23 @@ class TestMiddleware:
assert excinfo.value.code == "MODEL_TOOL_PROTOCOL_INVALID"
assert excinfo.value.fallbackable is True
def test_awrap_preserves_stable_runtime_error_identity(self):
raised = EvoRuntimeError(
"UPSTREAM_RATE_LIMITED",
"模型服务请求频率超限,请稍后重试或切换模型。",
details=({"http_status": 429},),
)
async def handler(_req):
raise raised
req = _request(_openai_model())
with pytest.raises(EvoRuntimeError) as excinfo:
self._run_awrap(ErrorNormalizationMiddleware(), req, handler)
assert excinfo.value is raised
assert excinfo.value.code == "UPSTREAM_RATE_LIMITED"
def test_awrap_wraps_any_exception_from_recognized_model(self):
"""Any exception raised inside a call to a provider-recognized
model gets wrapped — including builtins like ``RuntimeError``.