You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Question rather than a bug report — is the numeric-string case intentional?
finite() takes a number, so a cost field that arrives as a numeric string now prices at 0, where ?? 0 used to hand it straight to decimal.js, which parses it fine:
cost.input
before
after
"3"
3
0
"1e3"
1000
0
{}
threw
0 ✅
If the answer is "a string violates the declared Schema.Finite, so we don't support it", that's a perfectly good answer and I'll drop it — the crash was the real problem and that's fixed. I'm asking because the failure mode flipped from loud to silent (an under-reported cost rather than an aborted turn), and because the same shape just landed in packages/core via #43251, so whichever way you want it, it probably wants to be the same in both.
Happy to send a patch if you'd like the string path kept.
alltomatos pushed a commit
to alltomatos/opencode
that referenced
this pull request
Aug 18, 2026
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
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
Closes#43098
Testing
bun test test/session/compaction.test.ts --test-name-pattern "SessionNs.getUsage"bun typecheckinpackages/opencode