Repository navigation
fix: distinguish missing numeric management fields - #615
Open
Ricardo-M-L wants to merge 1 commit into
Open
Ricardo-M-L wants to merge 1 commit into
Ricardo-M-L wants to merge 1 commit into
Conversation
Ricardo-M-L
marked this pull request as ready for review
November 16, 2026 10:01
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.
Problem
readNumberapplies JavaScriptNumber()to any JSON value. This turnsnull, empty strings and arrays into zero and booleans into zero or one. It also prevents later field aliases from being considered. For example, a credential withsize: nullis displayed as0 KBinstead of unknown, and an Agent usage payload withreasoningOutputTokens: nullandreasoningTokens: 42is normalized to zero rather than 42.Skip missing and nonnumeric types, continue through aliases, and accept finite numbers and nonblank numeric strings. Zero remains a valid value. This changes previous coercion behavior: booleans, arrays, objects,
nulland blank strings are now treated as unknown rather than numeric; numeric and numeric-string inputs keep their existing behavior. The examples are synthetic payloads; this PR does not claim a measured frequency in live responses.Validation
6b6200e9and pass after this change.bun test tests/managementNumbers.test.ts tests/agentUsage.test.ts tests/managementApi.test.ts tests/authFiles.test.ts: 65 passed.bun run check: passed.git diff --check: passed.node_modulesfrom another checkout; no live management API was called.Prepared with AI assistance.
November 16 review readiness
Revalidated the unchanged published head
facf2bba00c9with Bun 1.3.14: 65 tests passed, 0 failed across the four files listed above.bun run checkandgit diff --checkpass. The existing dependency installation was reused, and no live management API was called. Current devaba89a78still performs the coercion described above.Ready for maintainer review. The hosted release/build jobs are skipped under their workflow conditions; they are not counted as executed build validation.