ci: reduce Python test overhead and Windows latency (#6357)

* test: merge overlapping semantic contract coverage

Consolidate the six confirmed NAN-310 overlap groups while preserving replay, usage, generation kwargs, archive metadata, inspect fields, and subagent crash/redelivery assertions.

* test: lighten history seeds and layer runner progress rules

* ci: defer test storage setup and record phase timings

Close each listener-owned binary bridge before waiting for its TCP server; retain active upload and undecided-connection regressions. Avoid consuming readiness twice and run the repository import scan once in its static gate. NAN-310.

* test: scope filesystem mocks and observe consumed socket prefixes

* test: publish subprocess readiness files atomically

* ci: isolate external tool discovery and use three Windows workers
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-21 14:47:55 +08:00
1 parent 743c51e81f
commit f284749d2f
28 files changed
+518 -448

No files matched your search

+5 -59
View File
@@ -1210,37 +1210,8 @@ async def test_runner_carries_retry_notifications_in_provider_context():
@pytest.mark.asyncio
async def test_runner_passes_temperature_to_provider():
"""temperature from AgentRunSpec should reach provider.chat_stream_with_retry."""
from nanobot.agent.runner import AgentRunner
captured: dict = {}
async def chat_stream_with_retry(**kwargs):
captured.update(kwargs)
return LLMResponse(content="done", tool_calls=[], usage=None)
provider = MagicMock(spec=LLMProvider)
provider.chat_stream_with_retry = chat_stream_with_retry
tools = MagicMock()
tools.get_definitions.return_value = []
runner = AgentRunner()
await runner.run(make_run_spec(provider,
initial_messages=[{"role": "user", "content": "hi"}],
tools=tools,
model="test-model",
max_iterations=1,
max_tool_result_chars=_MAX_TOOL_RESULT_CHARS,
temperature=0.7,
))
assert captured["temperature"] == 0.7
@pytest.mark.asyncio
async def test_runner_passes_max_tokens_to_provider():
"""max_tokens from AgentRunSpec should reach provider.chat_stream_with_retry."""
async def test_runner_passes_generation_settings_to_provider():
"""Non-default generation settings should reach provider.chat_stream_with_retry."""
from nanobot.agent.runner import AgentRunner
captured: dict = {}
@@ -1261,36 +1232,11 @@ async def test_runner_passes_max_tokens_to_provider():
model="test-model",
max_iterations=1,
max_tool_result_chars=_MAX_TOOL_RESULT_CHARS,
temperature=0.3,
max_tokens=8192,
))
assert captured["max_tokens"] == 8192
@pytest.mark.asyncio
async def test_runner_passes_reasoning_effort_to_provider():
"""reasoning_effort from AgentRunSpec should reach provider.chat_stream_with_retry."""
from nanobot.agent.runner import AgentRunner
captured: dict = {}
async def chat_stream_with_retry(**kwargs):
captured.update(kwargs)
return LLMResponse(content="done", tool_calls=[], usage=None)
provider = MagicMock(spec=LLMProvider)
provider.chat_stream_with_retry = chat_stream_with_retry
tools = MagicMock()
tools.get_definitions.return_value = []
runner = AgentRunner()
await runner.run(make_run_spec(provider,
initial_messages=[{"role": "user", "content": "hi"}],
tools=tools,
model="test-model",
max_iterations=1,
max_tool_result_chars=_MAX_TOOL_RESULT_CHARS,
reasoning_effort="high",
))
assert captured["temperature"] == 0.3
assert captured["max_tokens"] == 8192
assert captured["reasoning_effort"] == "high"