Skip to content

Make watch() async#160

Open
mendral-app[bot] wants to merge 2 commits into
mainfrom
mendral/make-watch-async
Open

Make watch() async#160
mendral-app[bot] wants to merge 2 commits into
mainfrom
mendral/make-watch-async

Conversation

@mendral-app

@mendral-app mendral-app Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Convert watch() method in default/filesystem.py from def to async def so that asyncio.create_task() is always called within a running event loop, eliminating RuntimeError: no running event loop when called from non-async contexts.

Context

Resolves insight: Async watch() called without running event loop

Note

This is a breaking API change — callers must now await sandbox.fs.watch(...) instead of calling it directly. Most users are already in async contexts since the return type is AsyncWatchHandle.


Note

Created by Mendral. Tag @mendral-app with feedback or questions.

@mendral-app mendral-app Bot requested a review from a team June 10, 2026 19:51
@mendral-app mendral-app Bot marked this pull request as ready for review June 10, 2026 20:11
@drappier-charles

Copy link
Copy Markdown
Contributor

@Mendral are you sure? It won't break an user which was using the sync method?

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.

1 participant