fix(cost): restore caller failure reasons on reconciled receipts, release 0.139.0 - #500
Merged
Conversation
0.138.0 narrowed CostReceipt.error to the ledger's own 'paid-call-failed'
and reconcile silently dropped a caller's { error } option — a crash
orphan settled as a successful zero-dollar call, and ledgers persisted
before 0.138.0 with custom reasons failed schema parse. reconcile now
accepts { error } (implying failure), buildReceipt records the caller
reason with 'paid-call-failed' as the default, and the receipt schema
accepts any non-empty reason. Release 0.139.0 also carries the DSPy RLM
analyst engine (#495) that merged without a release.
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.
Found by agent-runtime's bench gate: 0.138.0 changed
reconcile(callId, observed, { error?: string })to{ failed?: boolean }, silently ignoring the caller's option — agent-bench's crash orphans settled as successful $0 calls, and pre-0.138 ledgers with custom reasons no longer parse (schema narrowed toz.literal('paid-call-failed')).Fix:
reconcileaccepts{ error }(a supplied reason implies failure),buildReceiptrecords it with'paid-call-failed'as the ledger's own default, and the receipt schema accepts any non-empty reason so old ledgers parse again. Two new tests pin both paths.Release 0.139.0 (changelog stamped) also gives #495's DSPy RLM engine its release entry; implementation digest re-pinned (cost-ledger.ts is digest-covered), evidence digests untouched.
Proof: digest check valid · full suite green (exit 0) · typecheck 0 · lint clean ·
pnpm verify:packageexit 0 (all four version-lock sites at 0.139.0).