Skip to content

v0.12.269 — shared spend ledger, onPayment fires, BlockRun defined

Latest

Choose a tag to compare

@VickyXAI VickyXAI released this 04 Sep 03:32
· 1 commit to main since this release

Fixed — one spend ledger for every signing surface

The proxy, the Polymarket tool and doctor each constructed their own SpendControl. Amount windows were enforced once per surface, and saveHistory() was last-writer-wins on disk: LLM spend through the proxy did not count against a Polymarket order, and either could overwrite the other's history. getSharedSpendControl() is now the single default across all four surfaces. Injection is unchanged — every surface still accepts an explicit spendControl.

One trap the shared ledger opened, closed in the same release. sessionSpent is instance state that is never persisted, so the session cap used to reset by accident — every startProxy() built a fresh SpendControl. A ledger that outlives an in-process restart quietly redefines session as "since the gateway booted", and leaves it asymmetric: a gateway restart still reset it, an in-process restart no longer did. docs/configuration.md and the /policy help both promise "session resets on restart", and supersedeEmptyConfigStartup puts ordinary boots through two starts, so this was not a corner case. The restart path now calls resetSession() on purpose.

Also: a torn spending.json is no longer overwritten with empty limits by a history save, and buildPolymarketTool() no longer reads it at every plugin registration.

Fixed — onPayment actually fires

ProxyOptions.onPayment was public, documented, and invoked nowhere. It now fires on both paid paths, gated on the PAYMENT-RESPONSE / X-PAYMENT-RESPONSE settlement header so a rejected 402 does not fire it. An observer that throws is contained after settlement — its failure must not turn a paid response into a retry and risk a second charge.

Fixed — a node_modules symlink was committed to the repo

v0.12.268's follow-up merge carried node_modules into git as a symlink to an absolute path on one machine. Pulling main dropped that link into your working tree, where it shadows the real install and breaks npm ci, tsup and every .bin/* lookup with "too many levels of symbolic links".

If you pulled main between v0.12.268 and this release, run rm -f node_modules && npm ci once. npm package installs were never affected — files in package.json is an allowlist and never included it.

Added — the README says what BlockRun is

BlockRun lets agents pay for the outcome — every LLM, tool and data source, best value per dollar. That definition now leads the README, with the surface behind each claim and a What is BlockRun? FAQ entry.


Thanks to @twzrd-sol for the shared spend ledger (#322#331) and the onPayment fix (#321, #325#330).

Install: npm install -g @blockrun/clawrouter@0.12.269