Hi,
I've been running python-vibe-guard against open source Python projects
to validate async runtime detection rules.
Found a potential issue in:
surfsense_backend/app/agents/video_presentation/nodes.py line 140
response = await aspeech(**kwargs)
with open(chunk_path, "wb") as f:
f.write(response.content)
open() and f.write() are synchronous calls inside an async function.
Under concurrent load, this blocks the event loop for the duration of
each file write, serializing all concurrent connections through a single
bottleneck.
Consider using aiofiles as an async alternative:
import aiofiles
async with aiofiles.open(chunk_path, "wb") as f:
await f.write(response.content)
Tool used: python-vibe-guard —
AST-based runtime anti-pattern scanner validated on 250 real repositories.
Hi,
I've been running python-vibe-guard against open source Python projects
to validate async runtime detection rules.
Found a potential issue in:
surfsense_backend/app/agents/video_presentation/nodes.pyline 140open()andf.write()are synchronous calls inside an async function.Under concurrent load, this blocks the event loop for the duration of
each file write, serializing all concurrent connections through a single
bottleneck.
Consider using
aiofilesas an async alternative:Tool used: python-vibe-guard —
AST-based runtime anti-pattern scanner validated on 250 real repositories.