Skip to content

Photo routes: call the vision model off the event loop - #450

Merged
AVADSA25 merged 1 commit into
mainfrom
photo-routes-no-block
Oct 8, 2026
Merged

AVADSA25 merged 1 commit into
mainfrom
photo-routes-no-block

Conversation

@AVADSA25

@AVADSA25 AVADSA25 commented Oct 8, 2026

Copy link
Copy Markdown
Owner

What

Mickael (8 Oct): "fix the photo routes too". routes/media.py:webcam_capture, routes/upload.py:upload_image and routes/vision.py:vision_analyze are async but called the vision model with blocking requests.post (timeouts 90-120 s), so while a picture was analysed the dashboard answered nothing else. Same class as the startup warmup fixed in #446. The calls now run in asyncio.to_thread. Known issue marked fixed.

Checks

  • tests/test_no_blocking_requests_in_async.py: AST scan of every async def in codec_dashboard.py and routes/ finds no blocking requests call (plus a self-test that the scan catches one). Negative control on main's routes: lists exactly the three handlers.
  • Route extraction, A12 and attachment tests pass. Note: tests/test_llm_vision_dedup.py has 4 order-dependent failures when run right after the route tests; identical on main, passes alone and in the full suite (old leak, docs/known-issues.md 2026-09-04).

Deploy

Restart codec-dashboard.

🤖 Generated with Claude Code

webcam_capture, upload_image and vision_analyze are async but called the vision
model with blocking requests.post, so while a picture was analysed (about
7-23 s) the dashboard answered nothing else: pages, polls and the voice socket
waited. The calls now run in asyncio.to_thread. A new test scans every async
handler in codec_dashboard.py and routes/ for a blocking requests call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AVADSA25
AVADSA25 merged commit d7cf86b into main Oct 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants