Repository navigation
Conversation
…oring the raw payload The settle path chose the consolidated output with ??, which treats an explicit null as absent. The usage.consolidate contract only gives absent (undefined) the meaning of "unchanged"; null is valid Json a consolidator can return deliberately. Restoring the raw payload on null re-exposed exactly the vendor billing fields the hook meant to strip. Fall back to the raw response only when consolidated.output is undefined, and add a regression test for the explicit null payload. Fixes monid-ai#104
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthrough
Priority: ⬇️ Low Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to Explicit null output is preserved, while omitted output still falls back to the raw response. No concrete merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
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.
Fixes #104
The settle path picked the consolidated output with
??:Nullish coalescing treats an explicit
nullas absent, but theusage.consolidatecontract only gives absence the meaning of "payload unchanged".nullis valid Json (zJsonincludes it) and a consolidator can return it deliberately when everything it touched was billing. In that case the engine restored the raw vendor payload and re-exposed exactly the fields the hook meant to strip.The fix falls back to the raw response only when
consolidated.outputisundefined:Added a regression test next to the other D27 settle tests: a consolidate fn returning
{ credits: {}, output: null }against a successful response now settles withoutput: nullinstead of the raw object. Verified the test fails on the old line and passes with the fix;deno task check, the fulldeno task testsuite (1246 passed) anddeno task version:check(no contract-surface change, engine bump not required) are green.Summary by CodeRabbit
nullnow preserve that value instead of falling back to the raw response.