Skip to content

feat: exclude API-billed instances from federated usage totals - #5804

Merged
atomantic merged 1 commit into
mainfrom
cos/task-mtjm3mk8/agent-e884eb74
Sep 2, 2026
Merged

feat: exclude API-billed instances from federated usage totals#5804
atomantic merged 1 commit into
mainfrom
cos/task-mtjm3mk8/agent-e884eb74

Conversation

@atomantic

Copy link
Copy Markdown
Owner

Summary

The Across Instances card on the Usage page now lets you turn Subscriptions off for a federated instance that pays real API rates instead of riding this install's plans.

That instance stays listed (the spend is still real) but is left out of the combined fleet total, so an API-billed box no longer inflates the subscription-priced figure.

The choice is machine-local (settings.usageApiBilledInstanceIds) — it is this install's view of which fleet members ride the plans, not a property of the instance itself — and does not ride the usage digest.

Test plan

  • Open Usage with at least two federated instances showing under Across Instances
  • Confirm the combined total still matches the sum of every row while every Subscriptions switch is on
  • Turn Subscriptions off on an API-billed instance
  • Confirm the row stays listed with an API billed pill, and the combined total / "N of M instances on subscriptions" copy drop that row
  • Reload the page and confirm the exclusion persisted
  • Turn the switch back on and confirm the instance counts again
  • cd server && npx vitest run services/usageFleetBilling.test.js services/peerUsage.test.js routes/usage.test.js
  • cd client && npx vitest run src/components/usage/FleetUsageCard.test.jsx src/pages/UsagePage.test.jsx

Across Instances combined totals assume every machine rides the viewer's
subscriptions. A per-row Subscriptions toggle marks an instance as paying
API rates so it stays listed but drops out of the combined figures.

The choice is machine-local (settings.usageApiBilledInstanceIds) and does
not ride the usage digest.
@atomantic
atomantic merged commit be1d264 into main Sep 2, 2026
9 of 14 checks passed
@atomantic
atomantic deleted the cos/task-mtjm3mk8/agent-e884eb74 branch September 2, 2026 05:19
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