From 864a6851df8a782fe7f817531e4502cc2bf5ab68 Mon Sep 17 00:00:00 2001 From: LIghtJUNction Date: Sat, 21 Mar 2026 03:36:32 +0800 Subject: [PATCH] Fix context manager usage for timeout enforcement --- astrbot/core/provider/provider.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/astrbot/core/provider/provider.py b/astrbot/core/provider/provider.py index 2ef5a55f6..679fc9504 100644 --- a/astrbot/core/provider/provider.py +++ b/astrbot/core/provider/provider.py @@ -194,7 +194,7 @@ class Provider(AbstractProvider): async def test(self, test_timeout: float = 45.0) -> None: # Use anyio.fail_after to enforce timeout in async context. # This avoids direct asyncio.wait_for usage inside async functions. - async with anyio.fail_after(test_timeout): + with anyio.fail_after(test_timeout): await self.text_chat(prompt="REPLY `PONG` ONLY")