refactor: 梳理规则体系并统一记忆与部署流程

This commit is contained in:
qzl
2026-03-23 17:57:24 +08:00
parent 2a14ad1d8e
commit f4b7eb7e09
39 changed files with 2091 additions and 1454 deletions
@@ -114,6 +114,39 @@ def test_build_router_messages_skips_injection_when_context_last_is_user() -> No
assert msg.content == existing_context[i].content
def test_build_model_omits_none_generate_kwargs(
monkeypatch: pytest.MonkeyPatch,
) -> None:
captured: dict[str, object] = {}
class _FakeOpenAIChatModel:
def __init__(self, **kwargs: object) -> None:
captured.update(kwargs)
monkeypatch.setattr(runner_module, "OpenAIChatModel", _FakeOpenAIChatModel)
runner = AgentScopeRunner()
stage_config = runner_module.SystemAgentRuntimeConfig(
agent_type=AgentType.ROUTER,
model_code="demo",
api_base_url="https://example.com",
api_key="test",
llm_config=runner_module.SystemAgentLLMConfig(
temperature=None,
max_tokens=None,
timeout_seconds=30.0,
),
)
model = runner._build_model(stage_config=stage_config)
assert isinstance(model, runner_module.TrackingChatModel)
assert captured["generate_kwargs"] == {
"timeout": 30.0,
"extra_body": {"enable_thinking": False},
}
@pytest.mark.asyncio
async def test_resolve_runtime_client_time_from_forwarded_props() -> None:
runner = AgentScopeRunner()