fix: stream internal model calls with idle timeouts (#5730)

* fix: stream internal model calls with idle timeouts

* fix(providers): reject streams without terminal events
This commit is contained in:
chengyongru authored and GitHub committed 2026-09-11 13:06:43 +08:00
1 parent aeb7b207d7
commit 73410e0217
60 files changed
+815 -795

No files matched your search

+4 -4
View File
@@ -311,7 +311,7 @@ async def test_run_exposes_attributes_to_context_provider_without_persisting_the
from nanobot.providers.base import LLMResponse
provider = _fake_provider("test-model")
provider.chat_with_retry = AsyncMock(return_value=LLMResponse(
provider.chat_stream_with_retry = AsyncMock(return_value=LLMResponse(
content="done",
tool_calls=[],
))
@@ -358,7 +358,7 @@ async def test_persisted_turn_callback_is_best_effort_and_reads_display_safe_ses
from nanobot.providers.base import LLMResponse
provider = _fake_provider("test-model")
provider.chat_with_retry = AsyncMock(return_value=LLMResponse(
provider.chat_stream_with_retry = AsyncMock(return_value=LLMResponse(
content="saved reply",
tool_calls=[],
))
@@ -454,7 +454,7 @@ async def test_ephemeral_run_does_not_invoke_persisted_turn_callback(tmp_path):
from nanobot.providers.base import LLMResponse
provider = _fake_provider("test-model")
provider.chat_with_retry = AsyncMock(return_value=LLMResponse(
provider.chat_stream_with_retry = AsyncMock(return_value=LLMResponse(
content="temporary",
tool_calls=[],
))
@@ -649,7 +649,7 @@ async def test_run_ephemeral_still_captures_runner_observability(tmp_path):
provider = MagicMock()
provider.get_default_model.return_value = "test-model"
provider.chat_with_retry = AsyncMock(return_value=LLMResponse(
provider.chat_stream_with_retry = AsyncMock(return_value=LLMResponse(
content="done",
tool_calls=[],
usage=LLMUsage.reported(input_tokens=3, output_tokens=0),