refactor: remove redundant comments and docstrings (#6527)

* refactor: remove redundant comments and docstrings

* fix(signal): annotate async context manager as a generator
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-30 13:07:03 +08:00
1 parent cb3ba45317
commit a4d2430140
922 files changed
+406 -7738

No files matched your search

-40
View File
@@ -1,5 +1,3 @@
"""Tests for SubagentManager lifecycle — spawn, run, announce, cancel."""
import asyncio
import time
from pathlib import Path
@@ -20,9 +18,6 @@ from nanobot.bus.queue import MessageBus
from nanobot.providers.base import GenerationSettings, LLMProvider, LLMUsage
from nanobot.utils.llm_runtime import LLMRuntime
# ---------------------------------------------------------------------------
# Helpers
# ---------------------------------------------------------------------------
def _manager(tmp_path: Path, **kw) -> SubagentManager:
defaults = dict(
@@ -93,11 +88,6 @@ async def test_close_cancels_tasks_before_closing_exec_sessions(tmp_path):
sm._exec_session_manager.close_all.assert_awaited_once()
# ---------------------------------------------------------------------------
# SubagentStatus defaults
# ---------------------------------------------------------------------------
class TestSubagentStatus:
def test_defaults(self):
s = SubagentStatus(
@@ -185,11 +175,6 @@ class TestLegacyCompatibility:
await sm.spawn("task")
# ---------------------------------------------------------------------------
# spawn
# ---------------------------------------------------------------------------
class TestSpawn:
@pytest.mark.asyncio
async def test_returns_string_with_task_id(self, tmp_path):
@@ -344,11 +329,6 @@ class TestSpawn:
await _drain_subagent_tasks(sm)
# ---------------------------------------------------------------------------
# _run_subagent
# ---------------------------------------------------------------------------
class TestRunSubagent:
@pytest.mark.asyncio
async def test_successful_run(self, tmp_path):
@@ -406,11 +386,6 @@ class TestRunSubagent:
assert status.stop_reason == "completed"
# ---------------------------------------------------------------------------
# _announce_result
# ---------------------------------------------------------------------------
class TestAnnounceResult:
@pytest.mark.asyncio
async def test_publishes_inbound_message(self, tmp_path):
@@ -497,11 +472,6 @@ class TestAnnounceResult:
assert published[0].metadata["origin_message_id"] == "msg-123"
# ---------------------------------------------------------------------------
# cancel_by_session
# ---------------------------------------------------------------------------
class TestCancelBySession:
@pytest.mark.asyncio
async def test_cancels_running_tasks(self, tmp_path):
@@ -570,11 +540,6 @@ class TestCancelBySession:
assert count == 0
# ---------------------------------------------------------------------------
# get_running_count / get_running_count_by_session
# ---------------------------------------------------------------------------
class TestRunningCounts:
@pytest.mark.asyncio
async def test_running_count_zero(self, tmp_path):
@@ -606,11 +571,6 @@ class TestRunningCounts:
assert sm.get_running_count_by_session("nonexistent") == 0
# ---------------------------------------------------------------------------
# _SubagentHook
# ---------------------------------------------------------------------------
class TestSubagentHook:
@pytest.mark.asyncio
async def test_after_iteration_updates_status(self):