refactor: prune dead isHeartbeatEnabled branches (heartbeat always on)#53
Merged
Conversation
The Reliability column tooltip described stale traffic-vs-errors semantics. Server-side reliability is computed as heartbeat key-health share (proportionHealthyKeys), independent of real traffic. Rewrite the hint to match, drop the dead reliabilityWithHeartbeat property, and update the test assertion.
…s on Heartbeat is now permanently enabled (team policy — heartbeat_enabled defaults true and is no longer toggled). Every isHeartbeatEnabled() call resolved to true, so all disabled-mode branches were dead code. - Remove the isHeartbeatEnabled() toggle and ~30 dead branches across heartbeat.ts, router.ts, proxy.ts, responses.ts, racing-mode.ts, health.ts - Collapse the reliability-scoring fork in router.ts to a single heartbeatReliability(platform, modelId) / 100 line (Beta-posterior fallbacks were unreachable) - Delete orphaned reliabilityPosteriorForModel export (model-priors.ts) - Drop the phantom heartbeat_enabled toggle + 11 parentToggle references in feature-settings.ts - Clean up tests: remove disabled-behavior assertions, drop isHeartbeatEnabled from test mocks, add missing getKeyStats mock export in key-affinity.test.ts Zero behavior change on the live (heartbeat-on) path. Cold keys now consistently report isKeyHealthy === false, matching the existing proportionHealthyKeys docstring.
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
heartbeat_enableddefaults true and is no longer toggled). EveryisHeartbeatEnabled()call resolved totrue, so all disabled-mode branches were dead code.isHeartbeatEnabled()toggle and ~30 dead branches acrossheartbeat.ts,router.ts,proxy.ts,responses.ts,racing-mode.ts,health.ts.router.tsto a singleheartbeatReliability(platform, modelId) / 100line (the Beta-posterior fallbacks were unreachable).reliabilityPosteriorForModelexport (model-priors.ts) and drops the now-phantomheartbeat_enabledfeature toggle + its 11parentTogglereferences infeature-settings.ts.isHeartbeatEnabledfrom test mocks, adds a missinggetKeyStatsmock export inkey-affinity.test.ts.Verification
grep -rn "isHeartbeatEnabled" server/src→ 0 hitsgrep -rn "reliabilityPosteriorForModel" server/src→ 0 hitsnpm run build→ clean (tsc --noEmit passes)npm run test -w server→ 1037 passing / 77 files. The 5 remaining failures are pre-existing and unrelated (a clientsettings-layout.testand afetch-bad-portordering flake that passes in isolation).Notes
isKeyHealthy === false, matching the existingproportionHealthyKeysdocstring ("cold keys are NOT healthy").