Skip to content

fix(cost): restore caller failure reasons on reconciled receipts, release 0.139.0 - #500

Merged
drewstone merged 1 commit into
mainfrom
fix/reconcile-caller-error
Jul 31, 2026
Merged

fix(cost): restore caller failure reasons on reconciled receipts, release 0.139.0#500
drewstone merged 1 commit into
mainfrom
fix/reconcile-caller-error

Conversation

@drewstone

Copy link
Copy Markdown
Contributor

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 to z.literal('paid-call-failed')).

Fix: reconcile accepts { error } (a supplied reason implies failure), buildReceipt records 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:package exit 0 (all four version-lock sites at 0.139.0).

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.
@drewstone
drewstone merged commit 0496017 into main Jul 31, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant