feat(cost): added hidden cost breakdown component to settings > subscription, start collecting current period copilot cost and last period copilot cost (#1770)

* feat(cost): added hidden cost breakdown component to settings > subscription, start collecting current period copilot cost and last period copilot cost

* don't rerender envvars when switching between workflows in the same workspace
This commit is contained in:
Waleed
2025-10-30 11:09:47 -07:00
committed by GitHub
parent 61725c2d15
commit c99bb0aaa2
14 changed files with 7438 additions and 13 deletions

View File

@@ -0,0 +1,2 @@
ALTER TABLE "user_stats" ADD COLUMN "current_period_copilot_cost" numeric DEFAULT '0' NOT NULL;--> statement-breakpoint
ALTER TABLE "user_stats" ADD COLUMN "last_period_copilot_cost" numeric DEFAULT '0';

File diff suppressed because it is too large Load Diff

View File

@@ -715,6 +715,13 @@
"when": 1761769369858,
"tag": "0102_eminent_amphibian",
"breakpoints": true
},
{
"idx": 103,
"version": "7",
"when": 1761845605676,
"tag": "0103_careful_harpoon",
"breakpoints": true
}
]
}

View File

@@ -571,6 +571,8 @@ export const userStats = pgTable('user_stats', {
proPeriodCostSnapshot: decimal('pro_period_cost_snapshot').default('0'), // Snapshot of Pro usage when joining team
// Copilot usage tracking
totalCopilotCost: decimal('total_copilot_cost').notNull().default('0'),
currentPeriodCopilotCost: decimal('current_period_copilot_cost').notNull().default('0'),
lastPeriodCopilotCost: decimal('last_period_copilot_cost').default('0'),
totalCopilotTokens: integer('total_copilot_tokens').notNull().default(0),
totalCopilotCalls: integer('total_copilot_calls').notNull().default(0),
// Storage tracking (for free/pro users)