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

-12
View File
@@ -1,5 +1,3 @@
"""Tests for the Mistral provider registration and reasoning quirks."""
from __future__ import annotations
from unittest.mock import patch
@@ -25,13 +23,11 @@ def _mistral_provider(default_model: str = "mistral-medium-3-5") -> OpenAICompat
def test_mistral_config_field_exists() -> None:
"""ProvidersConfig should have a mistral field."""
config = ProvidersConfig()
assert hasattr(config, "mistral")
def test_mistral_provider_in_registry() -> None:
"""Mistral should be registered in the provider registry."""
specs = {s.name: s for s in PROVIDERS}
assert "mistral" in specs
@@ -41,7 +37,6 @@ def test_mistral_provider_in_registry() -> None:
def test_mistral_keyword_match_covers_model_families() -> None:
"""Codestral, Devstral, Ministral, Magistral models route to the Mistral spec."""
from nanobot.config.schema import Config
for model in (
@@ -101,7 +96,6 @@ def test_mistral_uses_high_reasoning_effort(effort) -> None:
def test_magistral_strips_reasoning_effort() -> None:
"""Magistral reasons implicitly; API rejects reasoning_effort kwarg."""
p = _mistral_provider()
for effort in ("low", "medium", "high", "minimal"):
kwargs = p._build_kwargs(
@@ -117,7 +111,6 @@ def test_magistral_strips_reasoning_effort() -> None:
def test_extract_thinking_content_from_mistral_response() -> None:
"""Thinking blocks should land in reasoning_content, not content."""
p = _mistral_provider()
response = {
"choices": [
@@ -146,7 +139,6 @@ def test_extract_thinking_content_from_mistral_response() -> None:
def test_extract_thinking_content_with_tool_calls() -> None:
"""A response with thinking + tool_calls (no text content) should still parse."""
p = _mistral_provider()
response = {
"choices": [
@@ -185,7 +177,6 @@ def test_extract_thinking_content_with_tool_calls() -> None:
def test_thinking_content_only_for_mistral_spec() -> None:
"""Providers without extract_thinking_blocks should not lift thinking text."""
other_spec = find_by_name("openai")
assert other_spec is not None
with patch("nanobot.providers.openai_compat_provider.AsyncOpenAI"):
@@ -218,7 +209,6 @@ def test_thinking_content_only_for_mistral_spec() -> None:
def test_streaming_thinking_chunks_become_reasoning() -> None:
"""Streamed thinking deltas (Mistral shape) feed reasoning_content."""
chunks = [
{
"choices": [
@@ -295,7 +285,6 @@ def test_streaming_thinking_chunks_via_sdk_path() -> None:
def test_mistral_strips_reasoning_content_from_history() -> None:
"""Mistral's request schema 400s on reasoning_content; it must be dropped."""
p = _mistral_provider()
messages = [
{"role": "user", "content": "hi"},
@@ -312,7 +301,6 @@ def test_mistral_strips_reasoning_content_from_history() -> None:
def test_mistral_tool_call_ids_get_normalized() -> None:
"""Non-9-char tool_call IDs should be hashed to 9-char alphanumeric."""
p = _mistral_provider()
messages = [
{"role": "user", "content": "hi"},