style: auto-fix linting issues

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
claude[bot] 2026-04-03 19:20:57 +00:00
parent 4c4b497d2a
commit 2135849f27
2 changed files with 4 additions and 11 deletions

View file

@ -99,16 +99,14 @@ class LLMClient:
await self.openai_client.close()
except Exception as e:
logger.debug(
"Failed to close OpenAI client (already closed or transport error): %s",
type(e).__name__,
"Failed to close OpenAI client (already closed or transport error): %s", type(e).__name__
)
if self.anthropic_client is not None:
try:
await self.anthropic_client.close()
except Exception as e:
logger.debug(
"Failed to close Anthropic client (already closed or transport error): %s",
type(e).__name__,
"Failed to close Anthropic client (already closed or transport error): %s", type(e).__name__
)
self.client_loop = loop

View file

@ -27,9 +27,7 @@ class TestLLMClientClose:
# Create a mock client that fails on close()
mock_openai = AsyncMock()
mock_openai.close = AsyncMock(
side_effect=RuntimeError("Transport already closed")
)
mock_openai.close = AsyncMock(side_effect=RuntimeError("Transport already closed"))
# Patch the client creation
with (
@ -68,10 +66,7 @@ class TestLLMClientClose:
assert True
except RuntimeError as e:
if "Transport already closed" in str(e):
pytest.fail(
f"close() error was not handled: {e}. "
"This causes 500 errors in production."
)
pytest.fail(f"close() error was not handled: {e}. This causes 500 errors in production.")
raise
@pytest.mark.asyncio