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

@@ -1,5 +1,3 @@
"""Prompt preparation must leave the public runtime responsive."""
import asyncio
import threading
from copy import deepcopy
@@ -156,14 +154,12 @@ async def test_preparation_allows_status_heartbeat_and_cancellation(
assert final_loop is runtime_loop
if phase != "prompt":
assert snapshot
# Observe the new session entering the real semaphore, not a settling delay.
slots = loop.runner.context_governor._preparation_slots
acquire_slot = slots.acquire
queued = asyncio.Event()
acquired = asyncio.Event()
async def acquire():
# History preparation queues before RequestContext is bound.
is_waiting = asyncio.current_task() is waiting
if is_waiting:
queued.set()
@@ -183,7 +179,6 @@ async def test_preparation_allows_status_heartbeat_and_cancellation(
with pytest.raises(asyncio.CancelledError):
await asyncio.wait_for(waiting, 5)
elif phase == "history":
# The live nested payload may change after capture; the worker owns its copy.
live.messages[0]["content"][0]["text"] = "Changed after capture"
release.set()
await asyncio.wait_for(finished.wait(), 5)
@@ -416,7 +411,6 @@ async def test_cancelled_prompt_keeps_its_worker_slot_until_read_finishes() -> N
second = asyncio.create_task(runner.prepare_prompt(read, "second"))
tasks.append(second)
await asyncio.sleep(0)
# The cancelled caller's read keeps its slot until the worker exits.
assert not entered["second"].is_set()
released["first"].set()
await asyncio.wait_for(entered["second"].wait(), timeout=5)