Skip to content

Commit e33501d

Browse files
authored
Merge pull request #1586 from lyj715824/bugfix/superteam
chore(ci): satisfy Python quality checks
2 parents 0ab5572 + b69fe63 commit e33501d

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

core/agent/engine/nodes/cot/cot_runner.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ async def parse_cot_step(
212212
# 其他情况都视为无效格式
213213
raise cot_exc.CotFormatIncorrectExc("无效的推理格式,缺少必要的标识字段")
214214

215-
async def read_response(
215+
# Keep the streaming protocol transitions together as one state machine.
216+
async def read_response( # noqa: C901
216217
self,
217218
messages: LLMMessages,
218219
first_loop: bool,
@@ -468,7 +469,8 @@ async def _handle_cot_step(
468469
cot_step.action_output = plugin_response.result
469470
yield AgentResponse(typ="cot_step", content=cot_step, model=self.model.name)
470471

471-
async def run(
472+
# Keep the retry, tool-execution, and completion transitions together.
473+
async def run( # noqa: C901
472474
self, span: Span, node_trace_log: NodeTraceLog
473475
) -> AsyncIterator[AgentResponse]:
474476
"""cot run"""

core/workflow/tests/service/test_chat_service_response_filter.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import asyncio
2+
from typing import Any
23

34
import pytest
45

@@ -75,11 +76,11 @@ def test_release_filter_keeps_workflow_end_content() -> None:
7576

7677
@pytest.mark.asyncio
7778
async def test_idle_workflow_sends_heartbeat_before_30_seconds(
78-
monkeypatch,
79+
monkeypatch: pytest.MonkeyPatch,
7980
) -> None:
8081
observed_timeouts: list[float] = []
8182

82-
async def timeout_immediately(awaitable, *, timeout: float):
83+
async def timeout_immediately(awaitable: Any, *, timeout: float) -> None:
8384
observed_timeouts.append(timeout)
8485
awaitable.close()
8586
raise asyncio.TimeoutError

0 commit comments

Comments
 (0)