fix(pulse): unblock the event loop, bound two child spawns, hoist the cron parse - #1736
Open
elhoim wants to merge 5 commits into
Open
fix(pulse): unblock the event loop, bound two child spawns, hoist the cron parse#1736elhoim wants to merge 5 commits into
elhoim wants to merge 5 commits into
Conversation
execFileSync with a 120s timeout inside an HTTP handler blocks Bun's single thread; /healthz, the dashboard and hook validation all stall behind it, risking a supervisor SIGKILL. Same shape this release already applied to modules/bunker.ts. modules/upgrades.ts changes only because graduateHypothesis becomes async and its caller must await it.
stderr was piped and never read with no timeout, so >64KB deadlocks the request and wedged children accumulate on every uncached poll. Matches the modules/work.ts fix from this same release.
…nute mostRecentOccurrence re-parsed on every one of up to 10,080 minute-steps; the parse, not the field test, was the whole cost. matchesCron's signature is unchanged.
telegram was removed from OutputTarget with no default branch, so a config upgraded from an older version keeps those jobs, sends nothing, and still reports the dispatch as a success.
The clamped value was used for tsMs but the raw NaN still reached agoFrom.
elhoim
force-pushed
the
fix/pulse-modules
branch
from
August 3, 2026 07:01
b1fdac7 to
8d92c6b
Compare
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.
5 commits, one per fix, so each can be cherry-picked independently. Each was verified to apply cleanly onto
47df8eeby itself.d3d7f202ce4dc244815efc7dbe948d92c6bFive defects in the Pulse server modules. Two are regressions of bugs this same release fixed elsewhere.
modules/hypotheses.ts:180—execFileSyncwith a 120s timeout inside an HTTP handler blocks Bun's single-threaded event loop;/healthz, the dashboard and hook validation all stall behind it. Matches the async shape this release already applied tomodules/bunker.ts.modules/atlas.ts:48—stderr: "pipe"never drained and no timeout, so >64KB on stderr deadlocks the request and wedged children accumulate on every uncached poll. Matches themodules/work.tsfix from this same release: drain both streams concurrently under a kill timer.lib.ts:348—mostRecentOccurrencere-parsed the cron expression on every one of up to 10,080 minute-steps. The parse, not the field test, was the whole cost. Hoisted out of the loop;matchesCron's public signature is unchanged.lib.ts:468—telegramwas removed fromOutputTargetwith nodefault:branch, so a config upgraded from an older version keeps those jobs, sends nothing, and still reports success. Now logs an error.modules/menubar.ts:352— a clamped value was used fortsMsbut the rawNaNreachedagoFrom, rendering "Hermes sidecar down — NaNd". Clamps once and uses it for both.modules/upgrades.tsis in the diff for one reason only: makinggraduateHypothesisasync requires its caller toawait. Not a drive-by.Testing. Commands and output are in the per-file notes above. I did not do a fresh-system install verification (contributing step 3) — these are targeted fixes verified per-file, not an install run.