refactor: 梳理规则体系并统一记忆与部署流程
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user