Repository navigation
Reject a NaN quantile in Metric.summary - #10685
Open
tylergibbs1 wants to merge 1 commit into
Open
tylergibbs1 wants to merge 1 commit into
tylergibbs1 wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: f4f6bbc The changes in this PR will be included in the next version bump. This PR includes changesets to release 35 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|
This branch is waiting to be deployed
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.
Type
Description
Metric.summarychecks each quantile withquantile < 0 || quantile > 1. Both comparisons arefalseforNaN, so aNaNquantile was accepted, and the summary's state then reported it as[NaN, undefined].DevToolsSchema.Summaryrequires finite quantiles, so such a metric could never be encoded in a DevTools metrics snapshot.The check is now
!(quantile >= 0 && quantile <= 1), soNaNfails it and dies with the sameQuantile must be between 0 and 1, found: NaNerror as an out-of-range quantile. Valid quantiles, including 0 and 1, behave as before.A new test in
Metric.test.tsupdates summaries with quantiles-0.1,1.5andNaNand asserts each one dies with that error.I also looked through
packages/effect/srcfor other< 0 || > 1range checks thatNaNcould pass. The only other one is the MCP sampling priority check inai/McpServer.ts, and it already rejects non-finite values first, so this PR doesn't change it.The issue also suggests logging DevTools snapshot encode failures above debug level. This PR doesn't do that.
Validation
At base 30e642f:
NaN(theExitwasSuccessinstead of aDie). The-0.1and1.5cases already died with the expected error.pnpm test --run packages/effect/test/Metric.test.tspasses all 64 tests.pnpm lint-fix,pnpm lint,pnpm check(tsrs) andgit diff --checkpass.Related
Closes #10678
🤖 Generated with Claude Code