emrg: offload remaining sync git probes from event loop (rant 2026-08-19T01:05:47) - #859
Merged
Merged
Conversation
argszero
commented
Aug 18, 2026
argszero
left a comment
OwnerAuthor
There was a problem hiding this comment.
✅ LGTM — cycle 790 (Committer). CI test + test-windows both PASS on head 56feb3e (doc-count guard validated 963). Offloads verified: daemon projects_list gather+to_thread, scheduler _start_handler_async; boot path intentionally stays sync (pre-serve).
argszero
commented
Aug 18, 2026
argszero
left a comment
OwnerAuthor
There was a problem hiding this comment.
✅ LGTM — cycle 791 (Committer). Independent re-verify: head unchanged (56feb3e), CI test + test-windows PASS. Diff re-inspected — daemon projects_list to_thread+gather, scheduler _start_handler_async offload; boot path stays sync pre-serve. 2/3.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Systematic audit per host rant 2026-08-19T01:05:47: no blocking calls in the asyncio event loop. The scheduler clone blocking (fixed in #858) was one instance; this PR closes the remaining sync git probes that run in async serving contexts.
Audit findings (this PR's scope)
daemon.pyprojects_listhandler_detect_git_remote(syncgit remote get-urlsubprocess, 5s timeout) per project sequentiallyawait asyncio.to_thread(_detect_git_remote, ...)gathered in parallelscheduler.pyapply_tasks(hot reload)TaskHandler.__init__runs_detect_git_remote(git subprocess) +resolve_git_gh(file IO + cache write)_start_handler_async→asyncio.to_thread(self._build_handler, cfg);create_taskstill on the loopscheduler.pyboot path_start_handler_forat daemon boot — no websocket clients connected yetWhat was already compliant (verified, unchanged)
emrg/tools/— bash tool alreadyasyncio.create_subprocess_shell; no other blocking calls (grep/glob/read/write/edit are file IO on the loop, sub-ms)emrg/connect.py—is_server_running_sync/socket.create_connectiononly called from client sync context and the daemon's pre-serve admission gateemrg/server/scheduler.pyworkspace self-heal git calls — already offloaded viaasyncio.to_thread(emrg: scheduler workspace-heal async offload + clone backoff (rant 2026-08-19T00:54:32) #858)emrg/client/— TUI process manager is a sync main loop, not an asyncio websocket serverVerification
test_hot_reload_offloads_handler_construction_to_thread— apply_tasks awaits_start_handler_async; construction viaasyncio.to_thread; boot path stays synctest_daemon_projects_list_offloads_git_probe_to_thread— daemon source usesasyncio.to_thread(_detect_git_remote, ...)gatheredtest_apply_tasks_hot_reload/test_apply_tasks_update_restart/test_apply_tasks_idempotent— still pass (behavior preserved)