fix(copilot): handle zero billing batch size (#36123)

This commit is contained in:
Aiden Cline
2026-07-09 13:14:33 -05:00
committed by GitHub
parent a0e1e3827d
commit 4aa1ad836f
4 changed files with 92 additions and 6 deletions
@@ -99,7 +99,7 @@ function build(key: string, remote: SelectableItem, url: string, prev?: Model):
: undefined
const prices = remote.billing?.token_prices
// Copilot prices are AIC per billing batch; OpenCode stores USD per million tokens.
const usdPerMillion = prices ? 10_000 / prices.batch_size : 0
const usdPerMillion = prices && prices.batch_size > 0 ? 10_000 / prices.batch_size : 0
const model: CopilotModel = {
id: key,