Skip to content

WIP#12113

Draft
jefflloyd wants to merge 7 commits into
masterfrom
transparent-pricing/ui
Draft

WIP#12113
jefflloyd wants to merge 7 commits into
masterfrom
transparent-pricing/ui

Conversation

@jefflloyd
Copy link
Copy Markdown
Contributor

Transparent At-Cost Pricing (Phase 1) — client

Re-models the usage/billing UI around dollars + tokens instead of credits.

What's in it

  • request_usage_model: dollar allowance (remaining/used/allowance_cents) + token totals; BonusGrant mapped to granted/remaining_cents. Cached/persisted structs stay back-compatible.
  • Billing & usage UI (billing_and_usage_page_v2, billing_cycle_usage_section): $ + tokens, with inference / compute / platform-fee as distinct lines; per-turn usage footer shows inference cost / platform fee / tokens; free tier shows a $0 allowance → upgrade.
  • Cynic GraphQL fragments + vendored schema.graphql mirror the additive server contract.

Cross-repo dependency

Pins warp-proto-apis to e126f5dcc29d…. Pre-merge: re-pin to the merged proto commit, and re-vendor crates/warp_graphql_schema/api/schema.graphql from the published server schema.

Proto drift — 4 non-pricing fields defaulted (verified safe)

The proto branch is ahead of the previously pinned rev, surfacing 4 unrelated fields that the client now defaults to the "feature off / nothing to report" value (matches current behavior):

  • request_computer_use_result::Approved.windows = [], use_computer_result::Success.{captured_window: None, windows: []} — computer-use result reporting (client doesn't capture windows).
  • ApiKeys.google_cloud_credentials = NoneREV-1599 BYOLLM/GEAP, a separate future client PR.
  • Settings.supports_background_computer_use = false — desktop client doesn't implement it.
    Confirm with the owning workstreams when the client does its real proto bump.

Validation

cargo check (incl. --tests, zero warnings), request_usage_model tests 24/24, clippy clean on touched crates. Pre-merge: full cargo clippy -p warp.

Scope gap

Legacy app/src/settings_view/billing_and_usage_page.rs (non-v2) not updated for $ display — v2 is the primary surface.

CHANGELOG-NEW-FEATURE: See your AI usage as real dollars and token counts (with a separate platform fee) instead of credits.

Plan: https://staging.warp.dev/drive/notebook/EXX3VH5zocAHIPZMMxLVaY
Conversation: https://staging.warp.dev/conversation/d29c940a-6ae1-4613-8c7c-553ad880f02c

Co-Authored-By: Oz oz-agent@warp.dev

jefflloyd and others added 2 commits June 2, 2026 17:20
Re-model the client usage/billing surfaces around true at-cost dollars
(USD cents) and token counts, keeping the legacy credits path running in
shadow. Additive, back-compatible changes only.

Cross-repo wiring (integrator must reconcile before merge):
- Cargo.toml: [patch] warp_multi_agent_api -> local
  ../warp-proto-apis-pricing-contracts worktree so the new
  cost_cents/platform_fee_cents/total_*_tokens proto fields resolve.
  Replace with a published proto rev before merge.
- crates/warp_graphql_schema/api/schema.graphql: mirror the contracts
  GraphQL additions (RequestLimitInfo allowance/used/remainingCents;
  UsageEntry tokens; AICreditsUsageBucket PLATFORM_FEE; BonusGrant
  granted/remainingCents; BonusGrantSpendingInfo currentMonthPurchasedCents;
  LlmUsageMetadata + ConversationUsageMetadata costCents/platformFeeCents/
  tokens). Legacy fields retained + @deprecated. Bindings regenerate at
  build time via cynic. Re-vendor when the server schema publishes.

Model + mapping:
- request_usage_model.rs: RequestLimitInfo gains allowance_cents/used_cents/
  remaining_cents (serde-default, back-compatible with cached prefs);
  BonusGrant gains granted_cents/remaining_cents; new dollar accessors.
- cynic fragments + GraphQL->model conversions updated.
- persistence ConversationUsageMetadata + proto StreamFinished plumbing
  carry exact at-cost cents (decimal-string parsed for display) and token
  totals.

UI:
- billing_and_usage_page_v2 Balance section headlines the $ spend allowance
  (remaining/allowance/used); free tier shows $0.
- billing cycle usage breakdown renders PLATFORM_FEE as a distinct line.
- per-turn usage footer shows inference cost, platform fee, and token totals
  when reported; falls back to credits otherwise.

Also defaults newly-surfaced non-pricing proto fields (windows,
captured_window, google_cloud_credentials, supports_background_computer_use)
exposed by the ahead-of-rev contracts proto.

Co-Authored-By: Oz <oz-agent@warp.dev>
Swaps the integration-only local [patch] for the pushed proto rev
e126f5dcc29d8c4a012397c4ad49040357ddab88.

Co-Authored-By: Oz <oz-agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label Jun 3, 2026
jefflloyd and others added 5 commits June 2, 2026 18:42
Add a client FeatureFlag (TransparentPricing) that makes the at-cost
dollar view and the legacy credits view mutually exclusive across the
usage footer and Billing & Usage v2 -- credits show only when the flag is
off, dollars only when it is on. Default OFF; added to DOGFOOD_FLAGS so
dev/dogfood builds show dollars immediately.

- warp_features: add FeatureFlag::TransparentPricing + DOGFOOD_FLAGS entry
- app: transparent_pricing Cargo feature (not in default) + enabled_features() mapping
- Usage footer (conversation_usage_view): SpendDisplay::current() selects
  dollars (inference cost + platform fee kept as separate lines) or the
  credits rows + per-agent rollup; never both. Tokens, tool calls, models,
  and timing are unchanged. Tests cover both flag states and the
  inference/platform-fee separation.
- Billing & Usage v2 balance section: dollar allowance/spend when on,
  credit cards when off.
- Billing cycle per-row numerics: dollar cost cluster when on, credit
  cluster when off.

Co-Authored-By: Oz <oz-agent@warp.dev>
Keeps the at-cost UI off by default everywhere until promotion; enable
with --features transparent_pricing to test the dollars path.

Co-Authored-By: Oz <oz-agent@warp.dev>
Keeps the flag-off (credits) footer identical to its pre-transparent-pricing
form; token totals belong to the at-cost view.

Co-Authored-By: Oz <oz-agent@warp.dev>
The collapsed usage toggle headlines the conversation's total cost
(inference + platform fee) in dollars when the flag is on, falling back to
credits when no at-cost data is reported. Credits view is unchanged.

Co-Authored-By: Oz <oz-agent@warp.dev>
When transparent pricing is on, the orchestrator's usage toggle headline and
the expanded card sum the at-cost dollars (inference + platform fee) across the
orchestrator and its locally-loaded descendants, with a per-agent dollar
breakdown under View details -- mirroring the credits rollup. Single
conversations keep the inference/platform split.

Co-Authored-By: Oz <oz-agent@warp.dev>
@jefflloyd jefflloyd changed the title Transparent at-cost pricing (Phase 1): usage/billing UI in $ + tokens WIP Jun 3, 2026
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