WIP#12113
Draft
jefflloyd wants to merge 7 commits into
Draft
Conversation
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>
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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;BonusGrantmapped togranted/remaining_cents. Cached/persisted structs stay back-compatible.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.schema.graphqlmirror the additive server contract.Cross-repo dependency
Pins
warp-proto-apistoe126f5dcc29d…. Pre-merge: re-pin to the merged proto commit, and re-vendorcrates/warp_graphql_schema/api/schema.graphqlfrom 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 = None— REV-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_modeltests 24/24, clippy clean on touched crates. Pre-merge: fullcargo 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