Skip to content

feat(gastown): Billing integration — usage metering, limits, and cost visibility #1402

@jrf0110

Description

@jrf0110

Summary

Gastown currently has no billing integration. Agents consume LLM tokens (tracked via feature attribution #1154) but there are no spending limits, no cost visibility in the UI, and no guard rails to prevent runaway usage. This is a hard launch blocker.

Requirements

Metering & Limits

  • Per-town spending cap (configurable in town settings, sensible default)
  • Real-time usage tracking surfaced from microdollar_usage_metadata (already being written via Add gastown feature attribution for LLM usage tracking #1154)
  • Agent dispatch blocked when spending cap is reached — reconciler should not emit dispatch_agent actions when the town is over budget
  • Grace period or soft-limit warning before hard cutoff

Cost Visibility (UI)

Reconciler Integration

  • reconcileBeads Rule 1 should check budget before assigning agents
  • Running agents should not be killed mid-work when the cap is hit (let them finish current bead, but don't dispatch new work)
  • Mayor should remain functional (can chat, answer questions) even when budget is exceeded — only polecat/refinery dispatch is blocked

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Blocks soft launchenhancementNew feature or requestgt:billingUsage tracking, cost attribution, limits, meteringkilo-duplicateAuto-generated label by Kilokilo-triagedAuto-generated label by Kilo

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions