Skip to content

fix(copilot): don't let a placeholder Extra Usage row block the org billing lookup#844

Merged
robinebers merged 1 commit into
mainfrom
fix/copilot-org-lookup-gate
Jul 3, 2026
Merged

fix(copilot): don't let a placeholder Extra Usage row block the org billing lookup#844
robinebers merged 1 commit into
mainfrom
fix/copilot-org-lookup-gate

Conversation

@robinebers

Copy link
Copy Markdown
Owner

TL;DR

Follow-up to #843: the org-billing lookup for org-managed Copilot seats never ran for the #839 reporter because his placeholder response sneaks an "Extra Usage: 0" row into the mapped lines, and the lookup was gated on the lines being empty. The gate is now an explicit mapper flag, and the meaningless placeholder row is suppressed.

What was happening

What this changes

  • Extra Usage is emitted only alongside a real Credits meter — overage is meaningless without an included pool, so the zero-entitlement placeholder no longer renders a misleading "0".
  • CopilotUsageMapper now returns an explicit isOrgManagedSeat flag (token-based billing + no usable per-seat meters), and CopilotProvider gates the org lookup on that flag instead of the incidental shape of the lines array.
  • The Business-placeholder test fixture is now the reporter's exact payload (all three buckets, overage_permitted: true on premium), so every org-path test exercises the regression; plus dedicated mapper tests for the placeholder-suppression and the flag.

Tests

  • New: placeholder with overage_permitted: true → no Extra Usage row, isOrgManagedSeat true, org lookup runs end-to-end; paid accounts with a real pool keep their Extra Usage row.
  • Full suite: 842 tests, 0 failures.

Made with Cursor

…illing lookup

The org-managed seat placeholder can carry overage_permitted: true on its zero-entitlement
premium bucket, which emitted an "Extra Usage: 0" row and made mapped.lines non-empty — so
the org-billing fallback (gated on lines.isEmpty) never ran (#839, second report). Extra
Usage is now emitted only alongside a real Credits meter (overage is meaningless without an
included pool), and the provider gates the org lookup on an explicit isOrgManagedSeat flag
from the mapper instead of the incidental shape of the lines array.

Co-authored-by: Cursor <cursoragent@cursor.com>
@robinebers robinebers merged commit ae69837 into main Jul 3, 2026
3 checks passed
@robinebers robinebers deleted the fix/copilot-org-lookup-gate branch July 3, 2026 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant