Home

boring / v2

publicBoring-Software-Inc/v2
Overview Code History Branches Pull requestsIssuesInsights Campfire Docs
main
HomeOverview Code PRsIssues

feat(economics): transport counters + usage_counters writes (slice 3)

3 months ago

33e99d1
Authored
grim7/23/2026, 12:47:20 AM
GithubHttp gains an onCall metering hook (one text read serves both byte count
and parse; a throwing hook can never break a forge call). The OpenRouter fetch
is wrapped to size request bodies. An AsyncLocalStorage counter scopes both per
run, so concurrent runs never bleed. runWorkflows runs inside that scope and
writes one usage_counters row at completion (gated on meterSource, best-effort),
activeMs summed from step durations.

Parent97302e9

7 files changed
  • apps/worker/src/ai/generate.ts+23−1
  • apps/worker/src/index.ts+9−3
  • apps/worker/src/jobs/run-workflows.ts+31−4
  • apps/worker/src/metering.test.ts+53−0
  • apps/worker/src/metering.ts+54−0
  • packages/forge-github/src/client/http.test.ts+80−0
  • packages/forge-github/src/client/http.ts+21−5