dimensionalOS / dimensionalOS/dimos

teleop/quest: run uvicorn on module._loop, remove WS cross-loop bridge

Open
#2,321 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
4.5k
Forks
808
Avg merge
3d 5h
Merged PRs (30d)
233

Description

Problem

QuestTeleopModule runs uvicorn in its own daemon thread (separate asyncio loop), while the camera handlers run on module._loop. Sending JPEG frames to connected WebSocket clients therefore goes through a thread bridge: a _ws_loop reference captured inside the /ws handler, used by a module-level _push_jpeg helper via asyncio.run_coroutine_threadsafe. This works but is convoluted

Refactor req

Move uvicorn onto module._loop so the WebSocket and handle_color_image execute on the same loop, then the push becomes a direct await ws.send_bytes(jpeg)


Synced from DIM-969 by summer

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating QuestTeleopModule and its module._loop, then inspect the /ws handler, _ws_loop reference, _push_jpeg helper, and handle_color_image. The refactor is done when uvicorn runs on module._loop, WebSocket handling and image processing share that loop, and JPEG delivery uses a direct await ws.send_bytes(jpeg).

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.