fix(dashboard): run residual cron profile I/O off the event loop (#50948 follow-through) - #61385
Merged
kshitijk4poor merged 2 commits intoJul 9, 2026
Conversation
Two async handlers still called the cron profile-walk helpers directly on the FastAPI event loop after the 49fa04a/346e5673d threadpool migration: - POST /api/cron/fire called _find_cron_job_profile() inline — it walks every profile and lists its jobs (file I/O per profile), stalling the loop before the 202 is returned. - POST /api/cron/blueprints/instantiate called _call_cron_for_profile() inline for create_job. Route both through the existing _run_cron_dashboard_io threadpool wrapper like every other cron dashboard endpoint. Credit: @riceharvest (NousResearch#50948) originally identified the sync-I/O-in-async- handlers bug class for the desktop boot endpoints; 49fa04a, 346e567, 7d0ddbb, d5eee13 and 24d5bda have since fixed most of that PR's scope via the managed threadpool + PID cache + alias-map surfaces. This covers the two cron handlers those merges missed.
Mutation-verified: both tests fail against main's inline-call version and pass with the threadpool routing.
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
…d-residual-cron-event-loop-io fix(dashboard): run residual cron profile I/O off the event loop (NousResearch#50948 follow-through)
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
…d-residual-cron-event-loop-io fix(dashboard): run residual cron profile I/O off the event loop (NousResearch#50948 follow-through)
This was referenced Jul 30, 2026
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
…d-residual-cron-event-loop-io fix(dashboard): run residual cron profile I/O off the event loop (NousResearch#50948 follow-through)
randlee
pushed a commit
to randlee/hermes-agent
that referenced
this pull request
Aug 11, 2026
…d-residual-cron-event-loop-io fix(dashboard): run residual cron profile I/O off the event loop (NousResearch#50948 follow-through)
19 tasks
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 free
to 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
Two cron dashboard handlers still ran per-profile file I/O directly on the FastAPI event loop after the threadpool migration —
POST /api/cron/fire(walks every profile via_find_cron_job_profilebefore returning its 202) andPOST /api/cron/blueprints/instantiate(create_jobinline). Both now route through the existing_run_cron_dashboard_iothreadpool wrapper like every sibling cron endpoint.Changes
hermes_cli/web_server.py:cron_fire_webhook— profile lookup off-loop;instantiate_blueprint—create_joboff-loop viafunctools.partial(keeps**speckwargs from colliding with the wrapper's own parameters).tests/hermes_cli/test_cron_dashboard_off_loop.py: 2 regression tests asserting the helpers execute with no running asyncio loop in their thread + kwargs arrive atcreate_jobintact. Mutation-verified (fail on main's inline version, pass with the fix).Validation
Targeted suites green: test_cron_fire_dashboard, test_web_server_cron_profiles, test_cron_fire_webhook (30 passed) + the 2 new tests. E2E via TestClient with real imports: both endpoints return correct payloads and the stubs prove off-loop execution. ruff clean, ty 0 net-new.
Credit
Supersedes #50948 — can be closed in favor of this.