|
@@ -744,6 +744,7 @@ export async function handler(
|
|
|
// Validate lite subscription billing
|
|
// Validate lite subscription billing
|
|
|
if (opts.modelList === "lite" && authInfo.billing.lite && authInfo.lite) {
|
|
if (opts.modelList === "lite" && authInfo.billing.lite && authInfo.lite) {
|
|
|
try {
|
|
try {
|
|
|
|
|
+ const consoleGoUrl = `https://opencode.ai/workspace/${authInfo.workspaceID}/go`
|
|
|
const sub = authInfo.lite
|
|
const sub = authInfo.lite
|
|
|
const liteData = LiteData.getLimits()
|
|
const liteData = LiteData.getLimits()
|
|
|
|
|
|
|
@@ -756,7 +757,10 @@ export async function handler(
|
|
|
})
|
|
})
|
|
|
if (result.status === "rate-limited")
|
|
if (result.status === "rate-limited")
|
|
|
throw new GoUsageLimitError(
|
|
throw new GoUsageLimitError(
|
|
|
- t("zen.api.error.subscriptionQuotaExceededUseFreeModels"),
|
|
|
|
|
|
|
+ t("zen.api.error.goSubscriptionWeeklyLimitExceeded", {
|
|
|
|
|
+ retryIn: formatRetryTime(result.resetInSec),
|
|
|
|
|
+ consoleGoUrl,
|
|
|
|
|
+ }),
|
|
|
authInfo.workspaceID,
|
|
authInfo.workspaceID,
|
|
|
"weekly",
|
|
"weekly",
|
|
|
result.resetInSec,
|
|
result.resetInSec,
|
|
@@ -773,7 +777,10 @@ export async function handler(
|
|
|
})
|
|
})
|
|
|
if (result.status === "rate-limited")
|
|
if (result.status === "rate-limited")
|
|
|
throw new GoUsageLimitError(
|
|
throw new GoUsageLimitError(
|
|
|
- t("zen.api.error.subscriptionQuotaExceededUseFreeModels"),
|
|
|
|
|
|
|
+ t("zen.api.error.goSubscriptionMonthlyLimitExceeded", {
|
|
|
|
|
+ retryIn: formatRetryTime(result.resetInSec),
|
|
|
|
|
+ consoleGoUrl,
|
|
|
|
|
+ }),
|
|
|
authInfo.workspaceID,
|
|
authInfo.workspaceID,
|
|
|
"monthly",
|
|
"monthly",
|
|
|
result.resetInSec,
|
|
result.resetInSec,
|
|
@@ -790,7 +797,10 @@ export async function handler(
|
|
|
})
|
|
})
|
|
|
if (result.status === "rate-limited")
|
|
if (result.status === "rate-limited")
|
|
|
throw new GoUsageLimitError(
|
|
throw new GoUsageLimitError(
|
|
|
- t("zen.api.error.subscriptionQuotaExceededUseFreeModels"),
|
|
|
|
|
|
|
+ t("zen.api.error.goSubscriptionRollingLimitExceeded", {
|
|
|
|
|
+ retryIn: formatRetryTime(result.resetInSec),
|
|
|
|
|
+ consoleGoUrl,
|
|
|
|
|
+ }),
|
|
|
authInfo.workspaceID,
|
|
authInfo.workspaceID,
|
|
|
"5 hour",
|
|
"5 hour",
|
|
|
result.resetInSec,
|
|
result.resetInSec,
|