perf(cron): skip config load on idle scheduler ticks (#33612 salvage) - #77614
Merged
kshitijk4poor merged 1 commit intoAug 3, 2026
Merged
Conversation
…esearch#33612) Re-derivation of NousResearch#33612 by @LeonSGP43 onto the rewritten scheduler (the original is 10,692 commits behind; its tick() no longer exists in that shape, so this is a fresh minimal fix crediting the PR's idea). The gateway's built-in ticker calls tick(verbose=False) every 60s. The idle early-return was gated on 'verbose and not due_jobs', so idle GATEWAY ticks fell through to load_config() + worker-pool resolution every minute. Return early on ANY idle tick; keep the post-tick MCP orphan sweep (main intentionally reaps orphaned stdio children on idle ticks). 3 new tests; mutation-checked (restoring the verbose-gated guard fails the config-skip test). 66 scheduler tests green.
kshitijk4poor
enabled auto-merge (rebase)
August 3, 2026 11:40
|
Code Review: #77614 Verdict: Approve read_file hint: helpful UX improvement. LGTM - Reviewed diff. Changes are sound. |
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.
Re-derivation of #33612 by @LeonSGP43 (original is 10,692 commits behind — the tick() it patched no longer exists in that shape, so this is a fresh minimal fix crediting the PR's idea; LeonSGP43's diagnosis was correct then and the bug survived the scheduler rewrite).
Context — what this changes for users
The gateway's built-in cron ticker calls tick(verbose=False) every 60s. The idle early-return was gated on 'verbose AND no due jobs', so idle GATEWAY ticks fell through to a full load_config() + worker-pool resolution every minute, forever, on every long-lived gateway process.
Fix: return early on ANY idle tick — while preserving the post-tick MCP orphan sweep that main intentionally runs even when nothing is due (a naive early-return would have silently killed orphan reaping on idle gateways).
Verification
3 new tests (config-skip verbose+nonverbose, sweep-preserved); mutation-checked (restoring the verbose-gated guard fails the config-skip test); 66 scheduler tests green; ruff clean. The repeated import in the idle branch is sys.modules-cached (measured 0.064 us/iter).
Closes #33612.