diff --git a/frontend/src/components/admin/channel/__tests__/PricingEntryCard.modelDefaultPrice.spec.ts b/frontend/src/components/admin/channel/__tests__/PricingEntryCard.modelDefaultPrice.spec.ts
index 3eaab643a7..c03722deab 100644
--- a/frontend/src/components/admin/channel/__tests__/PricingEntryCard.modelDefaultPrice.spec.ts
+++ b/frontend/src/components/admin/channel/__tests__/PricingEntryCard.modelDefaultPrice.spec.ts
@@ -25,6 +25,7 @@ function createEntry(models: string[] = []): PricingFormEntry {
cache_read_price: null,
fast_multiplier: null,
flex_multiplier: null,
+ ultrafast_multiplier: null,
reasoning_effort_multipliers: null,
image_input_price: null,
image_output_price: null,
diff --git a/frontend/src/components/admin/channel/__tests__/PricingEntryCard.timePricing.spec.ts b/frontend/src/components/admin/channel/__tests__/PricingEntryCard.timePricing.spec.ts
index deee992b31..22e0c35978 100644
--- a/frontend/src/components/admin/channel/__tests__/PricingEntryCard.timePricing.spec.ts
+++ b/frontend/src/components/admin/channel/__tests__/PricingEntryCard.timePricing.spec.ts
@@ -23,6 +23,7 @@ function createEntry(billingMode: PricingFormEntry['billing_mode'] = 'token'): P
cache_read_price: null,
fast_multiplier: null,
flex_multiplier: null,
+ ultrafast_multiplier: null,
reasoning_effort_multipliers: null,
image_input_price: null,
image_output_price: null,
diff --git a/frontend/src/components/admin/channel/types.ts b/frontend/src/components/admin/channel/types.ts
index 03c74071e5..faebc8bd73 100644
--- a/frontend/src/components/admin/channel/types.ts
+++ b/frontend/src/components/admin/channel/types.ts
@@ -32,6 +32,7 @@ export interface PricingFormEntry {
cache_read_price: number | string | null
fast_multiplier?: number | string | null
flex_multiplier?: number | string | null
+ ultrafast_multiplier?: number | string | null
reasoning_effort_multipliers?: Record
| null
image_input_price: number | string | null
image_output_price: number | string | null
diff --git a/frontend/src/components/keys/UseKeyModal.vue b/frontend/src/components/keys/UseKeyModal.vue
index e0aea84e01..26c36a1fec 100644
--- a/frontend/src/components/keys/UseKeyModal.vue
+++ b/frontend/src/components/keys/UseKeyModal.vue
@@ -1410,6 +1410,11 @@ function generateOpenCodeConfig(platform: string, baseUrl: string, apiKey: strin
}
}
}
+ const solAstraOptions = {
+ limit: { context: 1050000, output: 128000 },
+ options: { store: false },
+ variants: { low: {}, medium: {}, high: {}, xhigh: {}, max: {} }
+ }
const openaiModels = {
'gpt-6': {
name: 'GPT-6 (Astra)',
@@ -1484,23 +1489,9 @@ function generateOpenCodeConfig(platform: string, baseUrl: string, apiKey: strin
options: { store: false },
variants: { none: {}, low: {}, medium: {}, high: {}, xhigh: {}, max: {} }
},
- 'gpt-6.1-sol': {
- name: 'GPT-6.1 Sol',
- limit: {
- context: 1050000,
- output: 128000
- },
- options: {
- store: false
- },
- variants: {
- low: {},
- medium: {},
- high: {},
- xhigh: {},
- max: {}
- }
- },
+ 'gpt-6.2-sol': { name: 'GPT-6.2 Sol', ...solAstraOptions },
+ 'gpt-6.2-astra': { name: 'GPT-6.2 Astra', ...solAstraOptions },
+ 'gpt-6.1-sol': { name: 'GPT-6.1 Sol', ...solAstraOptions },
'gpt-6-sol': {
name: 'GPT-6 Sol',
limit: {
diff --git a/frontend/src/components/keys/__tests__/UseKeyModal.spec.ts b/frontend/src/components/keys/__tests__/UseKeyModal.spec.ts
index 64d9c9bed9..46233b7908 100644
--- a/frontend/src/components/keys/__tests__/UseKeyModal.spec.ts
+++ b/frontend/src/components/keys/__tests__/UseKeyModal.spec.ts
@@ -723,12 +723,17 @@ describe('UseKeyModal', () => {
const parsed = JSON.parse(wrapper.find('pre code').text())
const models = parsed.provider.openai.models
- for (const model of ['gpt-5.6', 'gpt-5.6-sol', 'gpt-5.6-terra', 'gpt-5.6-luna', 'gpt-6.1-sol', 'gpt-6-sol', 'gpt-6-luna']) {
+ for (const model of ['gpt-5.6', 'gpt-5.6-sol', 'gpt-5.6-terra', 'gpt-5.6-luna', 'gpt-6.2-sol', 'gpt-6.2-astra', 'gpt-6.1-sol', 'gpt-6-sol', 'gpt-6-luna']) {
expect(models[model]).toBeDefined()
expect(models[model].variants).toHaveProperty('max')
expect(models[model].variants).toHaveProperty('xhigh')
}
expect(models['gpt-5.6'].name).toBe('GPT-5.6 (Sol)')
+ for (const model of ['gpt-6.2-sol', 'gpt-6.2-astra']) {
+ expect(models[model].variants).not.toHaveProperty('none')
+ expect(models[model].variants).not.toHaveProperty('minimal')
+ expect(models[model].limit).toEqual({ context: 1050000, output: 128000 })
+ }
expect(models['gpt-6.1-sol'].variants).not.toHaveProperty('none')
expect(models['gpt-6.1-terra']).toEqual({
name: 'GPT-6.1 Terra',
diff --git a/frontend/src/components/modelPlaza/PlazaModelPricingTable.vue b/frontend/src/components/modelPlaza/PlazaModelPricingTable.vue
index 6daf1194e8..a667095329 100644
--- a/frontend/src/components/modelPlaza/PlazaModelPricingTable.vue
+++ b/frontend/src/components/modelPlaza/PlazaModelPricingTable.vue
@@ -65,7 +65,18 @@
-
{{ m.name }}
+
+ {{ m.name }}
+
+
+
+
import { computed } from 'vue'
import { useI18n } from 'vue-i18n'
+import Icon from '@/components/icons/Icon.vue'
+import { useClipboard } from '@/composables/useClipboard'
import { formatScaled, resolveIntervalPrices } from '@/utils/pricing'
import { platformAccentColor, platformBadgeLightClass, platformLabel } from '@/utils/platformColors'
import {
@@ -366,6 +379,7 @@ const props = defineProps<{
}>()
const { t } = useI18n()
+const { copyToClipboard } = useClipboard()
/** 实付分区只从平台拿一个主色,浅底/标题/下划线全部由 scoped CSS 用 color-mix 派生。 */
const accentStyle = computed(() => ({ '--plaza-accent': platformAccentColor(props.platform ?? '') }))
diff --git a/frontend/src/components/modelPlaza/__tests__/PlazaModelPricingTable.spec.ts b/frontend/src/components/modelPlaza/__tests__/PlazaModelPricingTable.spec.ts
index 1cfe916d0b..ce2c1108ef 100644
--- a/frontend/src/components/modelPlaza/__tests__/PlazaModelPricingTable.spec.ts
+++ b/frontend/src/components/modelPlaza/__tests__/PlazaModelPricingTable.spec.ts
@@ -3,6 +3,14 @@ import { mount } from '@vue/test-utils'
import PlazaModelPricingTable from '../PlazaModelPricingTable.vue'
import type { PlazaModel } from '@/api/modelPlaza'
+const { copyToClipboard } = vi.hoisted(() => ({
+ copyToClipboard: vi.fn().mockResolvedValue(true)
+}))
+
+vi.mock('@/composables/useClipboard', () => ({
+ useClipboard: () => ({ copyToClipboard })
+}))
+
vi.mock('vue-i18n', async () => {
const actual = await vi.importActual('vue-i18n')
return {
@@ -58,6 +66,27 @@ function mountTable(
}
describe('PlazaModelPricingTable', () => {
+ it('copies the exact model ID from the clicked pricing row', async () => {
+ const model = tokenModel({
+ name: 'provider/Model-v2',
+ time_pricing: {
+ timezone: 'Asia/Shanghai',
+ periods: [{ start_time: '09:00', end_time: '12:00', multiplier: 0.5 }]
+ }
+ })
+ const wrapper = mountTable([tokenModel(), model], 1)
+ const rows = wrapper.findAll('tbody tr').filter(row => row.text().includes(model.name))
+ expect(rows).toHaveLength(2)
+
+ for (const row of rows) {
+ const button = row.get('button[aria-label="modelPlaza.table.copyModelId"]')
+ await button.trigger('click')
+ }
+
+ expect(copyToClipboard.mock.calls).toEqual([[model.name], [model.name]])
+ wrapper.unmount()
+ })
+
it.each([false, true])('shows independent 12h prices without a 1h label (intervals=%s)', (intervals) => {
const model = tokenModel({ name: 'gpt-6-luna', platform: 'openai' })
model.pricing!.cache_write_price = null
diff --git a/frontend/src/composables/__tests__/useModelWhitelist.spec.ts b/frontend/src/composables/__tests__/useModelWhitelist.spec.ts
index 2dbd1a8942..8b7b658c47 100644
--- a/frontend/src/composables/__tests__/useModelWhitelist.spec.ts
+++ b/frontend/src/composables/__tests__/useModelWhitelist.spec.ts
@@ -46,6 +46,8 @@ describe('useModelWhitelist', () => {
expect(models).toContain('gpt-5.6')
expect(models).toContain('gpt-6')
expect(models).toContain('gpt-6-astra')
+ expect(models).toContain('gpt-6.2-sol')
+ expect(models).toContain('gpt-6.2-astra')
expect(models).toContain('gpt-6.1-sol')
expect(models).toContain('gpt-6.1-terra')
expect(models).toContain('gpt-6-sol')
@@ -56,6 +58,8 @@ describe('useModelWhitelist', () => {
it('openai 预设映射包含 GPT-6 别名和 Astra', () => {
expect(getPresetMappingsByPlatform('openai')).toEqual(expect.arrayContaining([
+ expect.objectContaining({ label: 'GPT-6.2 Sol', from: 'gpt-6.2-sol', to: 'gpt-6.2-sol' }),
+ expect.objectContaining({ label: 'GPT-6.2 Astra', from: 'gpt-6.2-astra', to: 'gpt-6.2-astra' }),
expect.objectContaining({ label: 'GPT-6.1 Sol', from: 'gpt-6.1-sol', to: 'gpt-6.1-sol' }),
expect.objectContaining({ label: 'GPT-6.1 Terra', from: 'gpt-6.1-terra', to: 'gpt-6.1-terra' }),
expect.objectContaining({ label: 'GPT-6', from: 'gpt-6', to: 'gpt-6' }),
@@ -206,6 +210,19 @@ describe('useModelWhitelist', () => {
expect(models).toContain('gemini-3.1-pro')
})
+ it('Gemini 4 Carbon exposes the official API model without invented aliases', () => {
+ const models = getModelsByPlatform('gemini')
+ expect(models).toContain('gemini-4-carbon')
+ expect(models).not.toContain('gemini-4-carbon-preview')
+ expect(getModelsByPlatform('antigravity')).toContain('gemini-4-carbon')
+ expect(getPresetMappingsByPlatform('antigravity')).toEqual(expect.arrayContaining([
+ expect.objectContaining({ from: 'gemini-4-carbon', to: 'gemini-4-carbon' })
+ ]))
+ expect(buildModelMappingObject('whitelist', ['gemini-4-carbon'], [])).toEqual({
+ 'gemini-4-carbon': 'gemini-4-carbon'
+ })
+ })
+
it('Gemini 4 Argon 在 gemini 与 antigravity 平台使用对应真实模型 ID 与预设映射', () => {
expect(getModelsByPlatform('gemini')).toContain('gemini-4-argon')
const agModels = getModelsByPlatform('antigravity')
diff --git a/frontend/src/composables/useModelWhitelist.ts b/frontend/src/composables/useModelWhitelist.ts
index 47399f4110..2237179e3e 100644
--- a/frontend/src/composables/useModelWhitelist.ts
+++ b/frontend/src/composables/useModelWhitelist.ts
@@ -12,7 +12,7 @@ const openaiModels = [
// GPT-5.6 系列
'gpt-5.6', 'gpt-5.6-sol', 'gpt-5.6-terra', 'gpt-5.6-luna',
// GPT-6 系列
- 'gpt-6', 'gpt-6-astra', 'gpt-6.1-sol', 'gpt-6.1-terra', 'gpt-6-sol', 'gpt-6-luna',
+ 'gpt-6', 'gpt-6-astra', 'gpt-6.2-sol', 'gpt-6.2-astra', 'gpt-6.1-sol', 'gpt-6.1-terra', 'gpt-6-sol', 'gpt-6-luna',
// GPT-5.5 系列
'gpt-5.5',
// GPT-5.4 系列
@@ -70,7 +70,8 @@ const geminiModels = [
'gemini-3.6-flash',
'gemini-3.7-flash',
'gemini-3.8-flash',
- 'gemini-4-argon'
+ 'gemini-4-argon',
+ 'gemini-4-carbon'
]
// Antigravity 官方支持的模型(精确匹配)
@@ -126,7 +127,8 @@ const antigravityModels = [
'gemini-3.8-flash-medium',
'gemini-3.8-flash-high',
'gemini-3.8-flash-tiered',
- // Gemini 4 Argon 系列
+ // Gemini 4 系列
+ 'gemini-4-carbon',
'gemini-4-argon-low',
'gemini-4-argon-medium',
'gemini-4-argon-high',
@@ -358,6 +360,8 @@ const openaiPresetMappings = [
{ label: 'GPT-6', from: 'gpt-6', to: 'gpt-6', color: 'bg-cyan-100 text-cyan-700 hover:bg-cyan-200 dark:bg-cyan-900/30 dark:text-cyan-400' },
{ label: 'GPT-5.6', from: 'gpt-5.6', to: 'gpt-5.6', color: 'bg-amber-100 text-amber-700 hover:bg-amber-200 dark:bg-amber-900/30 dark:text-amber-400' },
{ label: 'GPT-6.1 Terra', from: 'gpt-6.1-terra', to: 'gpt-6.1-terra', color: 'bg-lime-100 text-lime-700 hover:bg-lime-200 dark:bg-lime-900/30 dark:text-lime-400' },
+ { label: 'GPT-6.2 Sol', from: 'gpt-6.2-sol', to: 'gpt-6.2-sol', color: 'bg-orange-100 text-orange-700 hover:bg-orange-200 dark:bg-orange-900/30 dark:text-orange-400' },
+ { label: 'GPT-6.2 Astra', from: 'gpt-6.2-astra', to: 'gpt-6.2-astra', color: 'bg-orange-100 text-orange-700 hover:bg-orange-200 dark:bg-orange-900/30 dark:text-orange-400' },
{ label: 'GPT-6.1 Sol', from: 'gpt-6.1-sol', to: 'gpt-6.1-sol', color: 'bg-orange-100 text-orange-700 hover:bg-orange-200 dark:bg-orange-900/30 dark:text-orange-400' },
{ label: 'GPT-6 Sol', from: 'gpt-6-sol', to: 'gpt-6-sol', color: 'bg-orange-100 text-orange-700 hover:bg-orange-200 dark:bg-orange-900/30 dark:text-orange-400' },
{ label: 'GPT-5.6 Sol', from: 'gpt-5.6-sol', to: 'gpt-5.6-sol', color: 'bg-orange-100 text-orange-700 hover:bg-orange-200 dark:bg-orange-900/30 dark:text-orange-400' },
@@ -402,6 +406,7 @@ const grokPresetMappings = [
// Antigravity 预设映射(支持通配符)
const antigravityPresetMappings = [
// Claude 5.5 / Gemini 4 Argon / 3.8 Flash 推荐映射
+ { label: '4 Carbon', from: 'gemini-4-carbon', to: 'gemini-4-carbon', color: 'bg-amber-100 text-amber-700 hover:bg-amber-200 dark:bg-amber-900/30 dark:text-amber-400' },
{ label: '4 Argon→High', from: 'gemini-4-argon', to: 'gemini-4-argon-high', color: 'bg-amber-100 text-amber-700 hover:bg-amber-200 dark:bg-amber-900/30 dark:text-amber-400' },
{ label: '4 Argon High', from: 'gemini-4-argon-high', to: 'gemini-4-argon-high', color: 'bg-orange-100 text-orange-700 hover:bg-orange-200 dark:bg-orange-900/30 dark:text-orange-400' },
{ label: '4 Argon Medium', from: 'gemini-4-argon-medium', to: 'gemini-4-argon-medium', color: 'bg-yellow-100 text-yellow-700 hover:bg-yellow-200 dark:bg-yellow-900/30 dark:text-yellow-400' },
diff --git a/frontend/src/i18n/locales/en/admin/accounts.ts b/frontend/src/i18n/locales/en/admin/accounts.ts
index e851568a40..9b3d97afe9 100644
--- a/frontend/src/i18n/locales/en/admin/accounts.ts
+++ b/frontend/src/i18n/locales/en/admin/accounts.ts
@@ -504,6 +504,8 @@ export default {
testConnection: 'Test Connection',
reAuthorize: 'Re-Authorize',
refreshToken: 'Refresh Token',
+ refreshTokenHint: 'Tokens are refreshed automatically in the background. Frequent manual refreshes can race the automatic refresh and invalidate the token, pausing the account.',
+ refreshTokenFrequentWarning: 'Less than a minute since the last manual refresh: frequent refreshes can race the background auto-refresh and invalidate the token. Only retry when necessary.',
noAccountsYet: 'No accounts yet',
createFirstAccount: 'Create your first account to start using AI services.',
tokenRefreshed: 'Token refreshed successfully',
@@ -644,6 +646,9 @@ export default {
oauthPassthrough: 'Auto passthrough (auth only)',
oauthPassthroughDesc:
'When enabled, this OpenAI account uses automatic passthrough: the gateway forwards request/response as-is and only swaps auth, while keeping billing/concurrency/audit and necessary safety filtering.',
+ passthroughModelFilter: 'Filter passthrough accounts by model',
+ passthroughModelFilterDesc:
+ 'Use the account model whitelist and mapping source names to select this account. Mapping targets do not rename passthrough requests. An empty list allows all models. Disabled by default.',
flattenNamespaces: 'Flatten Codex namespace tools (compatibility)',
flattenNamespacesDesc:
'Disabled by default: Codex namespace tool declarations are forwarded as-is on /responses, which is what the ChatGPT Codex backend expects. Enable only when this OAuth account is routed to a relay that rejects namespace tools — flattening renames them to namespace__tool, which breaks models that address collaboration tools as functions... Compaction requests always flatten regardless of this switch.',
@@ -753,7 +758,7 @@ export default {
testMode: 'Test mode',
testModeDefault: 'Default request',
testModeCompact: 'Compact probe',
- modelRestrictionDisabledByPassthrough: 'Automatic passthrough is enabled: model whitelist/mapping will not take effect.',
+ modelRestrictionDisabledByPassthrough: 'Automatic passthrough ignores model restrictions by default. Enable "Filter passthrough accounts by model" to use them for account selection only.',
},
grok: {
baseUrlHint: 'Grok OAuth accounts forward to the official xAI API base URL.',
@@ -1748,6 +1753,10 @@ export default {
grokLastHeadersSeen: 'Headers {time}',
passiveSampled: 'Passive',
activeQuery: 'Query',
+ quotaRefreshFailedCached: 'Refresh failed. Showing a previous observation; remaining quota is unconfirmed.',
+ quotaRefreshFailedUnknown: 'Refresh failed. Current quota is unknown.',
+ quotaObservedAt: 'Quota observed: ',
+ quotaObservationUnknown: 'Unknown (cached)',
estimatedTotalCost: 'Est. total ${cost}',
estimatedTotalCostTooltip: 'Estimated total cost at 100% utilization, based on current window cost and utilization'
},
diff --git a/frontend/src/i18n/locales/en/admin/channels.ts b/frontend/src/i18n/locales/en/admin/channels.ts
index d0aa35cc19..d2ac27d2ba 100644
--- a/frontend/src/i18n/locales/en/admin/channels.ts
+++ b/frontend/src/i18n/locales/en/admin/channels.ts
@@ -150,6 +150,7 @@ export default {
pricePlaceholder: 'Default',
fastMultiplier: 'Fast Multiplier',
flexMultiplier: 'Flex Multiplier',
+ ultrafastMultiplier: 'Ultrafast Multiplier',
reasoningEffortMultipliers: 'Custom Reasoning Effort Multipliers (optional)',
reasoningEffortMultipliersHint: 'Apply the multiplier for the final forwarded reasoning effort to the entire request cost and quota usage. Unconfigured levels use 1×. These multiply with other billing multipliers.',
reasoningEffortMultiplierLabel: '{effort} reasoning effort multiplier',
diff --git a/frontend/src/i18n/locales/en/admin/overview.ts b/frontend/src/i18n/locales/en/admin/overview.ts
index 8faf063f26..250c911632 100644
--- a/frontend/src/i18n/locales/en/admin/overview.ts
+++ b/frontend/src/i18n/locales/en/admin/overview.ts
@@ -1273,6 +1273,8 @@ export default {
title: 'OpenAI Fast mode',
force: 'Force Fast (priority)',
hint: 'Forces service_tier=priority on OpenAI requests in this group. The global Fast/Flex policy can still filter or block it. New requests update immediately after saving; existing WebSocket sessions must reconnect.',
+ forceUltrafast: 'Force Ultra Fast (ultrafast)',
+ ultrafastHint: 'Forces Ultra Fast (service_tier=ultrafast) on supported models. Pro 200 includes GPT-6.2 Sol Ultrafast. Pro 500 includes both Sol and Astra Ultrafast. Other subscriptions use the tiers advertised by their account. If unavailable, Force Fast takes precedence over the client tier. GPT-6.2 Sol and Astra cost 3× Standard through February 28, 2027 (Pacific time), then 6×. GPT-6 Astra and GPT-6.1 Sol cost 6×. Free Fast excludes Ultra Fast.',
free: 'Free Fast',
freeHint: 'Fast requests in this group still use the priority tier, but customers are charged the equivalent Standard price.'
},
diff --git a/frontend/src/i18n/locales/en/admin/settings.ts b/frontend/src/i18n/locales/en/admin/settings.ts
index 868097a92d..b3d3de35ac 100644
--- a/frontend/src/i18n/locales/en/admin/settings.ts
+++ b/frontend/src/i18n/locales/en/admin/settings.ts
@@ -460,8 +460,8 @@ export default {
'Duplicate subscription group: {groupId}. Each group can only appear once.',
subscriptionGroup: 'Subscription Group',
subscriptionValidityDays: 'Validity (days)',
- defaultPlatformQuotas: 'Default Platform Quotas (on signup)',
- defaultPlatformQuotasHint: 'Applied to new users on signup; existing users are not affected. Leave blank = no limit for that platform and window.',
+ defaultPlatformQuotas: 'Default Platform Quotas (on user creation)',
+ defaultPlatformQuotasHint: 'Applied to regular users created by an administrator or through signup; existing users are not affected. Leave blank = no limit for that platform and window.',
platformQuotaNotice: 'Monthly quota uses a 30-day rolling window, not a calendar month.',
},
platformQuota: {
@@ -576,7 +576,7 @@ export default {
cacheTTL5m: '5 minutes',
cacheTTL1h: '1 hour',
anthropicCacheTTL1hInjection: 'Anthropic Cache TTL Injection',
- anthropicCacheTTL1hInjectionHint: 'When enabled, existing ephemeral cache_control blocks in Anthropic OAuth/Setup Token request bodies are forced to 1h; response usage is billed back as 5m by default, with account-level TTL billing override taking priority.',
+ anthropicCacheTTL1hInjectionHint: 'When enabled, existing ephemeral cache_control blocks in Anthropic OAuth/Setup Token request bodies are forced to 1h, except Claude Code compaction requests, which use 5m; response usage is billed back as 5m by default, with account-level TTL billing override taking priority.',
rewriteMessageCacheControl: 'Rewrite Message Cache Breakpoints',
rewriteMessageCacheControlHint: 'Default off: preserve client cache_control on message content blocks. When enabled, client breakpoints are stripped and proxy breakpoints are injected for clients that do not manage caching themselves.',
clientDatelineNormalization: 'Client Dateline Normalization',
diff --git a/frontend/src/i18n/locales/en/dashboard.ts b/frontend/src/i18n/locales/en/dashboard.ts
index c7792ad476..5b41a4b239 100644
--- a/frontend/src/i18n/locales/en/dashboard.ts
+++ b/frontend/src/i18n/locales/en/dashboard.ts
@@ -679,6 +679,7 @@ export default {
},
table: {
model: 'Model',
+ copyModelId: 'Copy model ID {model}',
input: 'Input',
output: 'Output',
cache: 'Cache',
diff --git a/frontend/src/i18n/locales/zh/admin/accounts.ts b/frontend/src/i18n/locales/zh/admin/accounts.ts
index 4c93b07972..a7640ffa8c 100644
--- a/frontend/src/i18n/locales/zh/admin/accounts.ts
+++ b/frontend/src/i18n/locales/zh/admin/accounts.ts
@@ -297,6 +297,8 @@ export default {
testConnection: '测试连接',
reAuthorize: '重新授权',
refreshToken: '刷新令牌',
+ refreshTokenHint: '系统已在后台自动刷新令牌,频繁手动刷新可能与自动刷新相互冲突,导致令牌失效、账号被暂停',
+ refreshTokenFrequentWarning: '距离上次手动刷新不足一分钟:频繁刷新可能与后台自动刷新冲突,导致令牌失效。如无必要请稍候再试。',
noAccountsYet: '暂无账号',
createFirstAccount: '添加 AI 平台账号以开始使用 API 网关。',
tokenRefreshed: 'Token 刷新成功',
@@ -548,6 +550,10 @@ export default {
grokLastHeadersSeen: '响应头 {time}',
passiveSampled: '被动采样',
activeQuery: '查询',
+ quotaRefreshFailedCached: '刷新失败,当前显示历史额度,不能确认剩余额度。',
+ quotaRefreshFailedUnknown: '刷新失败,当前额度未知。',
+ quotaObservedAt: '额度采样时间:',
+ quotaObservationUnknown: '未知(历史缓存)',
estimatedTotalCost: '预计总费用 ${cost}',
estimatedTotalCostTooltip: '根据当前窗口费用和使用率估算达到 100% 使用率时的总费用'
},
@@ -768,6 +774,9 @@ export default {
oauthPassthrough: '自动透传(仅替换认证)',
oauthPassthroughDesc:
'开启后,该 OpenAI 账号将自动透传请求与响应,仅替换认证并保留计费/并发/审计及必要安全过滤;如遇兼容性问题可随时关闭回滚。',
+ passthroughModelFilter: '透传时按账号模型筛选',
+ passthroughModelFilterDesc:
+ '使用账号模型白名单与映射的来源模型名筛选候选账号,映射目标不会改写透传请求的模型名。列表为空时允许所有模型。默认关闭。',
flattenNamespaces: '摊平 Codex namespace 工具(兼容)',
flattenNamespacesDesc:
'默认关闭:/responses 上的 namespace 工具声明原样转发,这正是 ChatGPT Codex 后端期望的形态。仅当该 OAuth 账号指向不认识 namespace 的兼容上游时才开启——摊平会把工具改名为 namespace__tool,使按 functions.<命名空间>.<工具> 寻址的模型(如 gpt-5.6 多智能体)无法调用。压缩(compact)请求不受该开关影响,始终摊平。',
@@ -868,7 +877,7 @@ export default {
testMode: '测试模式',
testModeDefault: '常规请求',
testModeCompact: 'Compact 探测',
- modelRestrictionDisabledByPassthrough: '已开启自动透传:模型白名单/映射不会生效。',
+ modelRestrictionDisabledByPassthrough: '自动透传默认忽略模型限制;开启“透传时按账号模型筛选”后,模型限制仅用于筛选候选账号。',
},
grok: {
baseUrlHint: 'Grok OAuth 账号会转发到官方 xAI API Base URL。',
diff --git a/frontend/src/i18n/locales/zh/admin/channels.ts b/frontend/src/i18n/locales/zh/admin/channels.ts
index 236e6ba54a..3e7bc09d33 100644
--- a/frontend/src/i18n/locales/zh/admin/channels.ts
+++ b/frontend/src/i18n/locales/zh/admin/channels.ts
@@ -150,6 +150,7 @@ export default {
pricePlaceholder: '默认',
fastMultiplier: 'Fast 倍率',
flexMultiplier: 'Flex 倍率',
+ ultrafastMultiplier: 'Ultra Fast 倍率',
reasoningEffortMultipliers: '自定义思考等级倍率(可选)',
reasoningEffortMultipliersHint: '按请求最终转发的思考等级,对整次请求的费用与额度消耗应用对应倍率。未配置的等级按 1 倍计费,可与其他计费倍率叠加。',
reasoningEffortMultiplierLabel: '{effort} 思考等级倍率',
diff --git a/frontend/src/i18n/locales/zh/admin/overview.ts b/frontend/src/i18n/locales/zh/admin/overview.ts
index 9b84e772e8..5386e7c5a7 100644
--- a/frontend/src/i18n/locales/zh/admin/overview.ts
+++ b/frontend/src/i18n/locales/zh/admin/overview.ts
@@ -1271,6 +1271,8 @@ export default {
title: 'OpenAI Fast 模式',
force: '强制使用 Fast(priority)',
hint: '开启后,此分组的 OpenAI 请求会强制写入 service_tier=priority;全局 Fast/Flex 策略仍可过滤或拦截。保存后新请求立即生效,已建立的 WebSocket 会话需重连。',
+ forceUltrafast: '强制使用 Ultra Fast(ultrafast)',
+ ultrafastHint: '对支持的模型强制使用 Ultra Fast(service_tier=ultrafast)。GPT-6.2 订阅档位按套餐补全:Pro 200 支持 Sol,Pro 500 支持 Sol 和 Astra;其他账号使用其目录明确提供的档位。不可用时,若同时开启强制 Fast 则使用 Fast,否则跟随客户端。6.2 Sol 和 Astra 在太平洋时间 2027 年 2 月 28 日及之前按标准价 3 倍计费,之后为 6 倍。GPT-6 Astra 和 GPT-6.1 Sol 为 6 倍。免费 Fast 不包含 Ultra Fast。',
free: '免费 Fast',
freeHint: '该分组的 Fast 请求仍使用 priority 档位,但客户实际费用按同一请求的 Standard 价格计算。'
},
diff --git a/frontend/src/i18n/locales/zh/admin/settings.ts b/frontend/src/i18n/locales/zh/admin/settings.ts
index 31c2dba3f3..085c74e8da 100644
--- a/frontend/src/i18n/locales/zh/admin/settings.ts
+++ b/frontend/src/i18n/locales/zh/admin/settings.ts
@@ -455,8 +455,8 @@ export default {
defaultSubscriptionsDuplicate: '默认订阅存在重复分组:{groupId}。每个分组只能出现一次。',
subscriptionGroup: '订阅分组',
subscriptionValidityDays: '有效期(天)',
- defaultPlatformQuotas: '默认平台限额(注册时分配)',
- defaultPlatformQuotasHint: '新用户注册时自动获得这里配置的限额;已有用户不受影响。留空 = 该平台该窗口不限制。',
+ defaultPlatformQuotas: '默认平台限额(创建用户时分配)',
+ defaultPlatformQuotasHint: '后台创建或自行注册的普通用户会自动获得这里配置的限额;已有用户不受影响。留空 = 该平台该窗口不限制。',
platformQuotaNotice: '月限额为 30 天滚动窗口,非自然月',
},
platformQuota: {
@@ -569,7 +569,7 @@ export default {
cacheTTL5m: '5 分钟',
cacheTTL1h: '1 小时',
anthropicCacheTTL1hInjection: 'Anthropic 缓存 TTL 注入',
- anthropicCacheTTL1hInjectionHint: '开启后,对 Anthropic OAuth/Setup Token 请求体中已有的 ephemeral 缓存块强制写入 1h;响应 usage 默认按 5m 回写计费,账号级 TTL 计费设置优先。',
+ anthropicCacheTTL1hInjectionHint: '开启后,对 Anthropic OAuth/Setup Token 请求体中已有的 ephemeral 缓存块强制写入 1h,Claude Code 压缩请求除外,写入 5m;响应 usage 默认按 5m 回写计费,账号级 TTL 计费设置优先。',
rewriteMessageCacheControl: '改写消息缓存断点',
rewriteMessageCacheControlHint: '默认关闭,保留客户端在 messages 内容块中的 cache_control。开启后会清除客户端断点并注入代理断点,适合不自行管理缓存策略的客户端。',
clientDatelineNormalization: '客户端 dateline 归一化',
diff --git a/frontend/src/i18n/locales/zh/dashboard.ts b/frontend/src/i18n/locales/zh/dashboard.ts
index 6b18eab4ce..4bbd070fa8 100644
--- a/frontend/src/i18n/locales/zh/dashboard.ts
+++ b/frontend/src/i18n/locales/zh/dashboard.ts
@@ -684,6 +684,7 @@ export default {
},
table: {
model: '模型',
+ copyModelId: '复制模型 ID {model}',
input: '输入',
output: '输出',
cache: '缓存',
diff --git a/frontend/src/types/index.ts b/frontend/src/types/index.ts
index f98a4b83a8..21ffc93032 100644
--- a/frontend/src/types/index.ts
+++ b/frontend/src/types/index.ts
@@ -643,6 +643,7 @@ export interface AdminGroup extends Group {
// 管理端的 name / description 始终是原字段,各语言译文另放在 i18n 里
i18n?: GroupI18n
force_openai_fast: boolean
+ force_openai_ultrafast: boolean
free_openai_fast: boolean
model_pricing: import('@/api/admin/channels').ChannelModelPricing[]
// 分组利润控制(openai/anthropic/gemini/grok/antigravity 分组可启用;margin/buffer 为小数存储)。
@@ -818,6 +819,7 @@ export interface CreateGroupRequest {
monthly_limit_usd?: number | null
long_context_pricing_enabled?: boolean
force_openai_fast?: boolean
+ force_openai_ultrafast?: boolean
free_openai_fast?: boolean
model_pricing?: import('@/api/admin/channels').ChannelModelPricing[]
allow_image_generation?: boolean
@@ -886,6 +888,7 @@ export interface UpdateGroupRequest {
monthly_limit_usd?: number | null
long_context_pricing_enabled?: boolean
force_openai_fast?: boolean
+ force_openai_ultrafast?: boolean
free_openai_fast?: boolean
model_pricing?: import('@/api/admin/channels').ChannelModelPricing[]
allow_image_generation?: boolean
@@ -1434,6 +1437,7 @@ export interface WindowStats {
export interface UsageProgress {
utilization: number // Percentage (0-100+, 100 = 100%)
+ utilization_unknown?: boolean
resets_at: string | null
remaining_seconds: number
window_stats?: WindowStats | null // 窗口期统计(从窗口开始到当前的使用量)
diff --git a/frontend/src/utils/__tests__/accountUsageRefresh.spec.ts b/frontend/src/utils/__tests__/accountUsageRefresh.spec.ts
index d54606b88d..4c9fcc0885 100644
--- a/frontend/src/utils/__tests__/accountUsageRefresh.spec.ts
+++ b/frontend/src/utils/__tests__/accountUsageRefresh.spec.ts
@@ -1,11 +1,44 @@
import { describe, expect, it } from 'vitest'
import {
+ buildAccountUsageRefreshKey,
buildAnthropicUsageRefreshKey,
buildGeminiUsageRefreshKey,
buildGrokUsageRefreshKey,
buildOpenAIUsageRefreshKey
} from '../accountUsageRefresh'
+describe('buildAccountUsageRefreshKey', () => {
+ it.each(['oauth', 'setup-token'])('tracks every Claude %s passive snapshot input', (type) => {
+ const base = { id: 1, platform: 'anthropic', type, extra: {} } as any
+ for (const field of ['last_used_at', 'session_window_start', 'session_window_end', 'session_window_status']) {
+ expect(buildAccountUsageRefreshKey({ ...base, [field]: 'new' })).not.toBe(buildAccountUsageRefreshKey(base))
+ }
+ for (const field of ['session_window_utilization', 'passive_usage_sampled_at', 'passive_usage_7d_utilization', 'passive_usage_7d_reset', 'passive_usage_7d_oi_utilization', 'passive_usage_7d_oi_reset']) {
+ expect(buildAccountUsageRefreshKey({ ...base, extra: { [field]: 1 } })).not.toBe(buildAccountUsageRefreshKey(base))
+ }
+ })
+
+ it.each(['anthropic', 'gemini'])('ignores unrelated %s changes and extra key ordering', (platform) => {
+ const base = { id: 1, platform, type: 'oauth', extra: { session_window_utilization: 0, other: 1 } } as any
+ expect(buildAccountUsageRefreshKey({ ...base, current_concurrency: 5, extra: { other: 2, session_window_utilization: 0 } } as any)).toBe(buildAccountUsageRefreshKey(base))
+ expect(buildAccountUsageRefreshKey({ ...base, last_used_at: 'new' })).not.toBe(buildAccountUsageRefreshKey(base))
+ })
+
+ it('tracks an account edit for Gemini but not for Claude', () => {
+ const claude = { id: 1, platform: 'anthropic', type: 'oauth', extra: {} } as any
+ expect(buildAccountUsageRefreshKey({ ...claude, updated_at: 'new' })).toBe(buildAccountUsageRefreshKey(claude))
+ const gemini = { id: 1, platform: 'gemini', type: 'oauth', extra: {} } as any
+ expect(buildAccountUsageRefreshKey({ ...gemini, updated_at: 'new' })).not.toBe(buildAccountUsageRefreshKey(gemini))
+ })
+
+ it('retains OpenAI keys and excludes unsupported platforms/types', () => {
+ const base = { id: 1, platform: 'openai', type: 'oauth', extra: {} } as any
+ expect(buildAccountUsageRefreshKey(base)).toBe(buildOpenAIUsageRefreshKey(base))
+ expect(buildAccountUsageRefreshKey({ ...base, platform: 'anthropic', type: 'apikey' })).toBe('')
+ expect(buildAccountUsageRefreshKey({ ...base, platform: 'antigravity' })).toBe('')
+ })
+})
+
describe('buildOpenAIUsageRefreshKey', () => {
it('会在 codex 快照变化时生成不同 key', () => {
const base = {
diff --git a/frontend/src/utils/accountUsageRefresh.ts b/frontend/src/utils/accountUsageRefresh.ts
index ff89d8edde..ea5642fd6b 100644
--- a/frontend/src/utils/accountUsageRefresh.ts
+++ b/frontend/src/utils/accountUsageRefresh.ts
@@ -106,3 +106,10 @@ export const buildGrokUsageRefreshKey = (account: Pick): string => {
+ if (account.platform === 'openai') return buildOpenAIUsageRefreshKey(account)
+ if (account.platform === 'anthropic') return buildAnthropicUsageRefreshKey(account)
+ if (account.platform === 'gemini') return buildGeminiUsageRefreshKey(account)
+ return ''
+}
diff --git a/frontend/src/views/admin/AccountsView.vue b/frontend/src/views/admin/AccountsView.vue
index 8cc2a32688..fc3bea8757 100644
--- a/frontend/src/views/admin/AccountsView.vue
+++ b/frontend/src/views/admin/AccountsView.vue
@@ -531,7 +531,7 @@ import Icon from '@/components/icons/Icon.vue'
import ErrorPassthroughRulesModal from '@/components/admin/ErrorPassthroughRulesModal.vue'
import TLSFingerprintProfilesModal from '@/components/admin/TLSFingerprintProfilesModal.vue'
import { fetchAllAccountIds } from '@/utils/accountSelection'
-import { buildGrokUsageRefreshKey, buildOpenAIUsageRefreshKey } from '@/utils/accountUsageRefresh'
+import { buildGrokUsageRefreshKey, buildAccountUsageRefreshKey } from '@/utils/accountUsageRefresh'
import { formatDateTime, formatRelativeTime } from '@/utils/format'
import { proxyExpiryBadgeClass, proxyExpiryLabelKey } from '@/utils/proxyExpiry'
import { extractApiErrorMessage } from '@/utils/apiError'
@@ -539,7 +539,6 @@ import { sanitizeUrl } from '@/utils/url'
import { getFloatingPanelPosition } from '@/utils/floatingPanel'
import { formatMultiplier } from '@/utils/formatters'
import type { Account, AccountListItem, AccountPlatform, AccountSchedulerGroupScore, AccountType, AccountUsageInfo, Proxy as AccountProxy, AdminGroup, WindowStats, ClaudeModel, UpstreamBillingProbeSnapshot } from '@/types'
-import { buildAnthropicUsageRefreshKey, buildGeminiUsageRefreshKey } from '@/utils/accountUsageRefresh'
const { t } = useI18n()
const appStore = useAppStore()
@@ -748,7 +747,7 @@ const usageBatchByAccountId = ref>({})
const usageBatchErrorByAccountId = ref>({})
const usageBatchLoadingByAccountId = ref>({})
const usageBatchRequestTokenByAccountId = ref>({})
-const usageBatchCache = new Map()
+const usageBatchCache = new Map()
const USAGE_BATCH_CACHE_TTL = 5 * 60 * 1000
const pendingUsageBatchIds = new Set()
let usageBatchFlushTimer: ReturnType | null = null
@@ -802,6 +801,7 @@ const flushQueuedUsageBatch = async () => {
usageBatchFlushTimer = null
const accountIDs = Array.from(pendingUsageBatchIds)
const force = queuedUsageBatchForce
+ const refreshKeys = new Map(accounts.value.map(account => [account.id, buildAccountUsageRefreshKey(account)]))
pendingUsageBatchIds.clear()
queuedUsageBatchForce = false
@@ -832,7 +832,7 @@ const flushQueuedUsageBatch = async () => {
nextErrors[key] = errorMap[key] ?? null
nextLoading[key] = false
if (usage) {
- usageBatchCache.set(accountID, { data: usage, ts: now })
+ usageBatchCache.set(accountID, { data: usage, ts: now, refreshKey: refreshKeys.get(accountID) ?? '' })
} else {
usageBatchCache.delete(accountID)
}
@@ -870,7 +870,7 @@ const queueBatchedUsage = (account: Account, options?: { force?: boolean }) => {
usageBatchCache.delete(cacheKey)
} else {
const cached = usageBatchCache.get(cacheKey)
- if (cached && Date.now() - cached.ts < USAGE_BATCH_CACHE_TTL) {
+ if (cached && cached.refreshKey === buildAccountUsageRefreshKey(account) && Date.now() - cached.ts < USAGE_BATCH_CACHE_TTL) {
setUsageBatchState(cacheKey, cached.data, null)
setUsageBatchLoading(cacheKey, false)
return
@@ -1436,9 +1436,7 @@ const shouldReplaceAutoRefreshRow = (current: Account, next: Account) => {
current.rate_limit_reset_at !== next.rate_limit_reset_at ||
current.overload_until !== next.overload_until ||
current.temp_unschedulable_until !== next.temp_unschedulable_until ||
- buildOpenAIUsageRefreshKey(current) !== buildOpenAIUsageRefreshKey(next) ||
- buildAnthropicUsageRefreshKey(current) !== buildAnthropicUsageRefreshKey(next) ||
- buildGeminiUsageRefreshKey(current) !== buildGeminiUsageRefreshKey(next) ||
+ buildAccountUsageRefreshKey(current) !== buildAccountUsageRefreshKey(next) ||
buildGrokUsageRefreshKey(current) !== buildGrokUsageRefreshKey(next)
)
}
@@ -2395,7 +2393,16 @@ const handleDuplicateAccount = async (a: Account) => {
duplicatingAccountIDs.delete(a.id)
}
}
+const lastManualRefreshAt = new Map()
+const MANUAL_REFRESH_WARN_INTERVAL_MS = 60_000
+
const handleRefresh = async (a: Account) => {
+ // 只提醒不阻拦:短时间内反复手动刷新可能与后台自动刷新竞争同一份轮换令牌
+ const lastAt = lastManualRefreshAt.get(a.id) ?? 0
+ if (Date.now() - lastAt < MANUAL_REFRESH_WARN_INTERVAL_MS) {
+ appStore.showWarning(t('admin.accounts.refreshTokenFrequentWarning'))
+ }
+ lastManualRefreshAt.set(a.id, Date.now())
try {
const result = await adminAPI.accounts.refreshCredentials(a.id)
patchAccountInList(result.account)
diff --git a/frontend/src/views/admin/ChannelsView.vue b/frontend/src/views/admin/ChannelsView.vue
index 3633f27267..c53bb78093 100644
--- a/frontend/src/views/admin/ChannelsView.vue
+++ b/frontend/src/views/admin/ChannelsView.vue
@@ -883,6 +883,7 @@ function addPricingEntry(sectionIdx: number) {
cache_read_price: null,
fast_multiplier: null,
flex_multiplier: null,
+ ultrafast_multiplier: null,
reasoning_effort_multipliers: null,
image_input_price: null,
image_output_price: null,
@@ -923,6 +924,7 @@ async function syncLatestModels(sectionIdx: number) {
cache_read_price: null,
fast_multiplier: null,
flex_multiplier: null,
+ ultrafast_multiplier: null,
reasoning_effort_multipliers: null,
image_input_price: null,
image_output_price: null,
@@ -1158,6 +1160,7 @@ function formToAPI(): { group_ids: number[], model_pricing: ChannelModelPricing[
cache_read_price: mTokToPerToken(entry.cache_read_price),
fast_multiplier: entry.fast_multiplier != null && entry.fast_multiplier !== '' ? Number(entry.fast_multiplier) : null,
flex_multiplier: entry.flex_multiplier != null && entry.flex_multiplier !== '' ? Number(entry.flex_multiplier) : null,
+ ultrafast_multiplier: entry.ultrafast_multiplier != null && entry.ultrafast_multiplier !== '' ? Number(entry.ultrafast_multiplier) : null,
reasoning_effort_multipliers: formReasoningEffortMultipliersToAPI(entry.reasoning_effort_multipliers),
image_input_price: mTokToPerToken(entry.image_input_price),
image_output_price: mTokToPerToken(entry.image_output_price),
@@ -1252,6 +1255,7 @@ function apiToForm(channel: Channel): PlatformSection[] {
cache_read_price: perTokenToMTok(p.cache_read_price),
fast_multiplier: p.fast_multiplier,
flex_multiplier: p.flex_multiplier,
+ ultrafast_multiplier: p.ultrafast_multiplier,
reasoning_effort_multipliers: p.reasoning_effort_multipliers ? { ...p.reasoning_effort_multipliers } : null,
image_input_price: perTokenToMTok(p.image_input_price),
image_output_price: perTokenToMTok(p.image_output_price),
@@ -1579,7 +1583,8 @@ async function handleSubmit() {
for (const section of form.platforms.filter(s => s.enabled)) {
for (const entry of section.model_pricing) {
if (!isValidPositiveMultiplier(entry.fast_multiplier) ||
- !isValidPositiveMultiplier(entry.flex_multiplier)) {
+ !isValidPositiveMultiplier(entry.flex_multiplier) ||
+ !isValidPositiveMultiplier(entry.ultrafast_multiplier)) {
const platformLabel = t('admin.groups.platforms.' + section.platform, catalogPlatformLabel(section.platform))
const modelLabel = entry.models.join(', ') || t('admin.channels.form.unnamed')
appStore.showError(`${platformLabel} - ${modelLabel}: ${t('admin.channels.form.multiplierPositive')}`)
diff --git a/frontend/src/views/admin/GroupsView.vue b/frontend/src/views/admin/GroupsView.vue
index ae9554b058..00572d47e1 100644
--- a/frontend/src/views/admin/GroupsView.vue
+++ b/frontend/src/views/admin/GroupsView.vue
@@ -1592,6 +1592,19 @@
{{ t("admin.groups.openaiFast.hint") }}
+
+
+ {{ t("admin.groups.openaiFast.forceUltrafast") }}
+
+
+
+
+ {{ t("admin.groups.openaiFast.ultrafastHint") }}
+
{{ t("admin.groups.openaiFast.free") }}
@@ -3256,6 +3269,19 @@
{{ t("admin.groups.openaiFast.hint") }}
+
+
+ {{ t("admin.groups.openaiFast.forceUltrafast") }}
+
+
+
+
+ {{ t("admin.groups.openaiFast.ultrafastHint") }}
+
{{ t("admin.groups.openaiFast.free") }}
@@ -4985,6 +5011,7 @@ const createForm = reactive({
monthly_limit_usd: null as number | null,
long_context_pricing_enabled: true,
force_openai_fast: false,
+ force_openai_ultrafast: false,
free_openai_fast: false,
model_pricing: [] as PricingFormEntry[],
// 图片生成计费配置
@@ -5352,6 +5379,7 @@ const editForm = reactive({
monthly_limit_usd: null as number | null,
long_context_pricing_enabled: true,
force_openai_fast: false,
+ force_openai_ultrafast: false,
free_openai_fast: false,
model_pricing: [] as PricingFormEntry[],
// 图片生成计费配置
@@ -5844,6 +5872,7 @@ const closeCreateModal = () => {
createForm.video_model_prices = createVideoModelPricesForm();
createForm.long_context_pricing_enabled = true;
createForm.force_openai_fast = false;
+ createForm.force_openai_ultrafast = false;
createForm.free_openai_fast = false;
createForm.model_pricing = [];
createForm.web_search_price_per_call = null;
@@ -5970,6 +5999,10 @@ const handleCreateGroup = async () => {
createForm.platform,
createForm.force_openai_fast,
),
+ force_openai_ultrafast: normalizeGroupOpenAIFast(
+ createForm.platform,
+ createForm.force_openai_ultrafast,
+ ),
free_openai_fast: normalizeGroupOpenAIFast(
createForm.platform,
createForm.free_openai_fast,
@@ -6119,6 +6152,7 @@ const handleEdit = async (group: AdminGroup) => {
editForm.long_context_pricing_enabled =
group.long_context_pricing_enabled ?? true;
editForm.force_openai_fast = group.force_openai_fast ?? false;
+ editForm.force_openai_ultrafast = group.force_openai_ultrafast ?? false;
editForm.free_openai_fast = group.free_openai_fast ?? false;
editForm.model_pricing = groupPricingFromAPI(group.model_pricing);
editForm.allow_image_generation = group.allow_image_generation ?? false;
@@ -6254,6 +6288,7 @@ const closeEditModal = () => {
editForm.video_model_prices = createVideoModelPricesForm();
editForm.long_context_pricing_enabled = true;
editForm.force_openai_fast = false;
+ editForm.force_openai_ultrafast = false;
editForm.free_openai_fast = false;
editForm.model_pricing = [];
editForm.web_search_price_per_call = null;
@@ -6314,6 +6349,10 @@ const handleUpdateGroup = async () => {
editForm.platform,
editForm.force_openai_fast,
),
+ force_openai_ultrafast: normalizeGroupOpenAIFast(
+ editForm.platform,
+ editForm.force_openai_ultrafast,
+ ),
free_openai_fast: normalizeGroupOpenAIFast(
editForm.platform,
editForm.free_openai_fast,
diff --git a/frontend/src/views/admin/SettingsView.vue b/frontend/src/views/admin/SettingsView.vue
index 6e63f04232..0db478ce1d 100644
--- a/frontend/src/views/admin/SettingsView.vue
+++ b/frontend/src/views/admin/SettingsView.vue
@@ -5962,6 +5962,7 @@
:options="[
{ value: 'brave', label: 'Brave Search' },
{ value: 'tavily', label: 'Tavily' },
+ { value: 'exa', label: 'Exa' },
]"
class="w-36"
@click.stop
diff --git a/frontend/src/views/admin/__tests__/AccountsView.lite.spec.ts b/frontend/src/views/admin/__tests__/AccountsView.lite.spec.ts
index fb44a917d9..a7c8ee6aae 100644
--- a/frontend/src/views/admin/__tests__/AccountsView.lite.spec.ts
+++ b/frontend/src/views/admin/__tests__/AccountsView.lite.spec.ts
@@ -10,6 +10,7 @@ const {
listWithEtag,
getById,
getBatchTodayStats,
+ getBatchUsage,
getUpstreamBillingProbeSettings,
getAllProxies,
getAllGroups,
@@ -21,6 +22,7 @@ const {
listWithEtag: vi.fn(),
getById: vi.fn(),
getBatchTodayStats: vi.fn(),
+ getBatchUsage: vi.fn(),
getUpstreamBillingProbeSettings: vi.fn(),
getAllProxies: vi.fn(),
getAllGroups: vi.fn(),
@@ -36,6 +38,7 @@ vi.mock('@/api/admin', () => ({
getById,
listWithEtag,
getBatchTodayStats,
+ getBatchUsage,
getUpstreamBillingProbeSettings,
delete: vi.fn(),
batchClearError: vi.fn(),
@@ -99,7 +102,7 @@ const AccountStatsModalStub = defineComponent({
template: '{{ show ? account?.name : "" }}
'
})
-function mountView(stubActionMenu = true) {
+function mountView(stubActionMenu = true, realUsageCell = false) {
return mount(AccountsView, {
attachTo: document.body,
global: {
@@ -130,7 +133,7 @@ function mountView(stubActionMenu = true) {
AccountStatusIndicator: true,
AccountTodayStatsCell: true,
AccountGroupsCell: AccountGroupsCellStub,
- AccountUsageCell: AccountUsageCellStub,
+ AccountUsageCell: realUsageCell ? false : AccountUsageCellStub,
UpstreamBillingRateCell: true,
HelpTooltip: true,
Icon: true,
@@ -169,6 +172,7 @@ describe('admin AccountsView lite account list', () => {
listWithEtag.mockReset().mockResolvedValue({ notModified: true, etag: 'compact-etag', data: null })
getById.mockReset().mockResolvedValue(fullAccount)
getBatchTodayStats.mockReset().mockResolvedValue({ stats: {} })
+ getBatchUsage.mockReset().mockResolvedValue({ usage: { '42': { five_hour: { utilization: 21 }, seven_day: { utilization: 31 } } }, errors: {} })
getUpstreamBillingProbeSettings.mockReset().mockResolvedValue({ enabled: true })
getAllProxies.mockReset().mockResolvedValue([])
getAllGroups.mockReset().mockResolvedValue([{ id: 7, name: 'codex', platform: 'openai' }])
@@ -182,6 +186,45 @@ describe('admin AccountsView lite account list', () => {
vi.restoreAllMocks()
})
+ it.each([
+ ['anthropic', 'oauth'], ['anthropic', 'setup-token'], ['gemini', 'oauth']
+ ])('updates %s %s usage on auto-refresh without force or unrelated probes', async (platform, type) => {
+ vi.useFakeTimers()
+ vi.spyOn(document, 'hidden', 'get').mockReturnValue(false)
+ vi.spyOn(window, 'matchMedia').mockImplementation(() => ({
+ matches: true, addEventListener: vi.fn(), removeEventListener: vi.fn()
+ }) as unknown as MediaQueryList)
+ localStorage.setItem('account-auto-refresh', JSON.stringify({ enabled: true, interval_seconds: 5 }))
+ const account = { ...listRow, platform, type }
+ listAccounts.mockResolvedValue({ items: [account], total: 1, page: 1, page_size: 20, pages: 1 })
+ const wrapper = mountView(true, true)
+ await flushPromises()
+ await vi.advanceTimersByTimeAsync(1)
+ await flushPromises()
+ expect(getBatchUsage).toHaveBeenCalledTimes(1)
+ expect(getBatchUsage).toHaveBeenCalledWith([42], false)
+
+ const next = { ...account, extra: { session_window_utilization: 0.44, passive_usage_7d_utilization: 0.54 }, last_used_at: platform === 'gemini' ? '2026-11-16T10:00:00Z' : null }
+ getBatchUsage.mockResolvedValue({ usage: { '42': { five_hour: { utilization: 44 }, seven_day: { utilization: 54 } } }, errors: {} })
+ listWithEtag.mockResolvedValue({ notModified: false, etag: 'new', data: { items: [next], total: 1, pages: 1 } })
+ await vi.advanceTimersByTimeAsync(6000)
+ await flushPromises()
+ expect(getBatchUsage).toHaveBeenCalledTimes(2)
+ expect(getBatchUsage).toHaveBeenLastCalledWith([42], false)
+ const cell = wrapper.findComponent({ name: 'AccountUsageCell' })
+ expect(cell.props('account').last_used_at).toBe(next.last_used_at)
+ expect(cell.props('batchedUsage').seven_day.utilization).toBe(54)
+ cell.props('requestBatchedUsage')(cell.props('account'))
+ await vi.advanceTimersByTimeAsync(1)
+ expect(getBatchUsage).toHaveBeenCalledTimes(2)
+
+ listWithEtag.mockResolvedValue({ notModified: false, etag: 'unrelated', data: { items: [{ ...next, updated_at: 'new', current_concurrency: 2, extra: { ...next.extra, unrelated: true } }], total: 1, pages: 1 } })
+ await vi.advanceTimersByTimeAsync(6000)
+ await flushPromises()
+ expect(getBatchUsage).toHaveBeenCalledTimes(platform === 'gemini' ? 3 : 2)
+ wrapper.unmount()
+ })
+
it('keeps lite=1 on the initial list request', async () => {
const wrapper = mountView()
await flushPromises()
diff --git a/frontend/src/views/admin/__tests__/ChannelsView.ultrafastPricing.spec.ts b/frontend/src/views/admin/__tests__/ChannelsView.ultrafastPricing.spec.ts
new file mode 100644
index 0000000000..e8b5cf2b8f
--- /dev/null
+++ b/frontend/src/views/admin/__tests__/ChannelsView.ultrafastPricing.spec.ts
@@ -0,0 +1,166 @@
+import { defineComponent } from 'vue'
+import { flushPromises, mount } from '@vue/test-utils'
+import { beforeEach, describe, expect, it, vi } from 'vitest'
+import type { Channel, CreateChannelRequest, UpdateChannelRequest } from '@/api/admin/channels'
+import ChannelsView from '@/views/admin/ChannelsView.vue'
+import PricingEntryCard from '@/components/admin/channel/PricingEntryCard.vue'
+
+const { list, create, update, getGroups, showError } = vi.hoisted(() => ({
+ list: vi.fn(), create: vi.fn(), update: vi.fn(), getGroups: vi.fn(), showError: vi.fn()
+}))
+
+vi.mock('@/api/admin', () => ({
+ adminAPI: {
+ channels: { list, create, update },
+ groups: { getAll: getGroups },
+ settings: { getWebSearchEmulationConfig: vi.fn().mockResolvedValue({ enabled: false }) }
+ }
+}))
+vi.mock('@/api/admin/channels', () => ({
+ default: { getModelDefaultPricing: vi.fn().mockResolvedValue({ found: false }) }
+}))
+vi.mock('@/stores/app', () => ({ useAppStore: () => ({ showSuccess: vi.fn(), showError }) }))
+vi.mock('vue-i18n', async () => ({
+ ...await vi.importActual('vue-i18n'),
+ useI18n: () => ({ t: (key: string) => key })
+}))
+
+function mountView() {
+ return mount(ChannelsView, {
+ global: {
+ stubs: {
+ AppLayout: defineComponent({ template: ' ' }),
+ TablePageLayout: defineComponent({
+ template: ''
+ }),
+ BaseDialog: defineComponent({
+ props: ['show'], template: ''
+ }),
+ DataTable: defineComponent({
+ props: ['data'],
+ template: '
'
+ }),
+ Pagination: true, ConfirmDialog: true, EmptyState: true,
+ Select: true, Icon: true, PlatformIcon: true
+ }
+ }
+ })
+}
+
+type View = ReturnType
+
+async function clickButton(wrapper: View, text: string) {
+ const button = wrapper.findAll('button').find(button => button.text() === text)
+ expect(button).toBeDefined()
+ await button!.trigger('click')
+ await flushPromises()
+}
+
+function multiplierInput(wrapper: View) {
+ return wrapper.findAll('label')
+ .find(label => label.text() === 'admin.channels.form.ultrafastMultiplier')!
+ .element.parentElement!.querySelector('input')!
+}
+
+function makeChannel(): Channel {
+ return {
+ id: 1, name: 'Ultra Fast channel', description: '', status: 'active',
+ billing_model_source: 'channel_mapped', restrict_models: false,
+ features_config: {}, group_ids: [22], model_pricing: [], model_mapping: {},
+ apply_pricing_to_account_stats: false, account_stats_pricing_rules: [],
+ created_at: '2026-01-01T00:00:00Z', updated_at: '2026-01-01T00:00:00Z'
+ }
+}
+
+describe('ChannelsView Ultra Fast pricing', () => {
+ let stored: Channel[]
+
+ beforeEach(() => {
+ vi.clearAllMocks()
+ localStorage.clear()
+ stored = []
+ list.mockImplementation(async () => ({ items: stored, total: stored.length }))
+ getGroups.mockResolvedValue([{ id: 22, name: 'OpenAI group', platform: 'openai', rate_multiplier: 1 }])
+ create.mockImplementation(async (request: CreateChannelRequest) => {
+ stored = [{ ...makeChannel(), ...request } as Channel]
+ return stored[0]
+ })
+ update.mockImplementation(async (_id: number, request: UpdateChannelRequest) => {
+ stored = [{ ...stored[0], ...request } as Channel]
+ return stored[0]
+ })
+ })
+
+ async function createPricingForm() {
+ const wrapper = mountView()
+ await flushPromises()
+ await clickButton(wrapper, 'admin.channels.createChannel')
+ await wrapper.get('input[required]').setValue('Ultra Fast channel')
+ await wrapper.findAll('label').find(label => label.text() === 'admin.groups.platforms.openai')!
+ .get('input[type="checkbox"]').setValue(true)
+ await clickButton(wrapper, 'admin.groups.platforms.openai')
+ await wrapper.findAll('label').find(label => label.text().includes('OpenAI group'))!
+ .get('input[type="checkbox"]').setValue(true)
+ await wrapper.findAll('button').filter(button => button.text() === '+ common.add').at(-1)!.trigger('click')
+ await flushPromises()
+ const modelInput = wrapper.get('input[placeholder="admin.channels.form.modelsPlaceholder"]')
+ await modelInput.setValue('gpt-6-astra')
+ await modelInput.trigger('keydown', { key: 'Enter' })
+ await flushPromises()
+ return wrapper
+ }
+
+ async function setMultiplier(wrapper: View, value: string) {
+ multiplierInput(wrapper).value = value
+ multiplierInput(wrapper).dispatchEvent(new Event('input', { bubbles: true }))
+ await flushPromises()
+ }
+
+ it('persists, reopens, updates and clears the multiplier through the real pricing card', async () => {
+ const wrapper = await createPricingForm()
+ await setMultiplier(wrapper, '3')
+ await wrapper.get('#channel-form').trigger('submit')
+ await flushPromises()
+ expect(showError).not.toHaveBeenCalled()
+ expect(create).toHaveBeenCalledOnce()
+ expect(create.mock.calls[0][0].model_pricing[0].ultrafast_multiplier).toBe(3)
+
+ for (const [previous, next] of [['3', '1.25'], ['1.25', '']]) {
+ await clickButton(wrapper, 'common.edit')
+ await clickButton(wrapper, 'admin.groups.platforms.openai')
+ expect(multiplierInput(wrapper).value).toBe(previous)
+ await setMultiplier(wrapper, next)
+ await wrapper.get('#channel-form').trigger('submit')
+ await flushPromises()
+ expect(showError).not.toHaveBeenCalled()
+ expect(update.mock.lastCall![1].model_pricing[0].ultrafast_multiplier).toBe(next ? Number(next) : null)
+ }
+ await clickButton(wrapper, 'common.edit')
+ await clickButton(wrapper, 'admin.groups.platforms.openai')
+ expect(multiplierInput(wrapper).value).toBe('')
+ wrapper.unmount()
+ })
+
+ it.each(['0', '-1'])('rejects a non-positive multiplier %s before sending a request', async value => {
+ const wrapper = await createPricingForm()
+ await setMultiplier(wrapper, value)
+ await wrapper.get('#channel-form').trigger('submit')
+ await flushPromises()
+ expect(showError).toHaveBeenCalledWith(expect.stringContaining('admin.channels.form.multiplierPositive'))
+ expect(create).not.toHaveBeenCalled()
+ wrapper.unmount()
+ })
+
+ it('shows Ultra Fast only for OpenAI channel pricing', async () => {
+ const wrapper = await createPricingForm()
+ const entry = wrapper.findComponent(PricingEntryCard).props('entry')
+ for (const [platform, enabled, visible] of [
+ ['openai', true, true], ['anthropic', true, false], ['openai', false, false]
+ ] as const) {
+ const card = mount(PricingEntryCard, { props: { entry, platform, enableTierMultipliers: enabled } })
+ expect(card.text().includes('admin.channels.form.ultrafastMultiplier')).toBe(visible)
+ card.unmount()
+ }
+ wrapper.unmount()
+ })
+})
diff --git a/frontend/src/views/admin/__tests__/GroupsView.codexManifest.spec.ts b/frontend/src/views/admin/__tests__/GroupsView.codexManifest.spec.ts
index 0aef73f4fc..574f7269b0 100644
--- a/frontend/src/views/admin/__tests__/GroupsView.codexManifest.spec.ts
+++ b/frontend/src/views/admin/__tests__/GroupsView.codexManifest.spec.ts
@@ -79,6 +79,7 @@ const sourceGroup = {
monthly_limit_usd: null,
long_context_pricing_enabled: true,
force_openai_fast: false,
+ force_openai_ultrafast: false,
free_openai_fast: false,
model_pricing: [],
profit_control_enabled: false,
diff --git a/frontend/src/views/admin/__tests__/GroupsView.openaiForcedTier.spec.ts b/frontend/src/views/admin/__tests__/GroupsView.openaiForcedTier.spec.ts
new file mode 100644
index 0000000000..6d4e7fd402
--- /dev/null
+++ b/frontend/src/views/admin/__tests__/GroupsView.openaiForcedTier.spec.ts
@@ -0,0 +1,326 @@
+import { defineComponent, h } from "vue";
+import { flushPromises, mount } from "@vue/test-utils";
+import { createPinia } from "pinia";
+import { beforeEach, describe, expect, it, vi } from "vitest";
+
+import type { AdminGroup } from "@/types";
+import GroupsView from "@/views/admin/GroupsView.vue";
+
+const {
+ listGroups,
+ getModelAllowlistCandidates,
+ getUsageSummary,
+ getCapacitySummary,
+ getLiveCapability,
+ createGroup,
+ updateGroup,
+} = vi.hoisted(() => ({
+ listGroups: vi.fn(),
+ getModelAllowlistCandidates: vi.fn(),
+ getUsageSummary: vi.fn(),
+ getCapacitySummary: vi.fn(),
+ getLiveCapability: vi.fn(),
+ createGroup: vi.fn(),
+ updateGroup: vi.fn(),
+}));
+
+vi.mock("@/api/admin", () => ({
+ adminAPI: {
+ groups: {
+ list: listGroups,
+ getAll: vi.fn(),
+ getModelAllowlistCandidates,
+ getUsageSummary,
+ getCapacitySummary,
+ getLiveCapability,
+ create: createGroup,
+ update: updateGroup,
+ delete: vi.fn(),
+ duplicate: vi.fn(),
+ updateSortOrder: vi.fn(),
+ },
+ accounts: {
+ list: vi.fn(),
+ getById: vi.fn(),
+ },
+ },
+}));
+
+vi.mock("@/stores/app", () => ({
+ useAppStore: () => ({
+ showError: vi.fn(),
+ showSuccess: vi.fn(),
+ }),
+}));
+
+vi.mock("@/stores/onboarding", () => ({
+ useOnboardingStore: () => ({
+ isCurrentStep: vi.fn(() => false),
+ nextStep: vi.fn(),
+ }),
+}));
+
+vi.mock("vue-i18n", async () => {
+ const actual = await vi.importActual("vue-i18n");
+ return {
+ ...actual,
+ useI18n: () => ({ t: (key: string) => key }),
+ };
+});
+
+const sourceGroup = {
+ id: 42,
+ name: "OpenAI",
+ description: null,
+ platform: "openai",
+ rate_multiplier: 1,
+ rpm_limit: 0,
+ is_exclusive: false,
+ status: "active",
+ subscription_type: "standard",
+ daily_limit_usd: null,
+ weekly_limit_usd: null,
+ monthly_limit_usd: null,
+ long_context_pricing_enabled: true,
+ force_openai_fast: false,
+ force_openai_ultrafast: false,
+ free_openai_fast: false,
+ model_pricing: [],
+ profit_control_enabled: false,
+ profit_min_margin: 0,
+ profit_safety_buffer: 0,
+ allow_image_generation: false,
+ allow_batch_image_generation: false,
+ image_rate_independent: false,
+ image_rate_multiplier: 1,
+ batch_image_discount_multiplier: 0.5,
+ batch_image_hold_multiplier: 0.6,
+ image_price_1k: null,
+ image_price_2k: null,
+ image_price_4k: null,
+ video_rate_independent: false,
+ video_rate_multiplier: 1,
+ video_price_480p: null,
+ video_price_720p: null,
+ video_price_1080p: null,
+ web_search_price_per_call: null,
+ search_price_per_1k: null,
+ audio_realtime_price_per_min: null,
+ audio_tts_price_per_million_chars: null,
+ audio_stt_price_per_hour: null,
+ peak_rate_enabled: false,
+ peak_start: "",
+ peak_end: "",
+ peak_rate_multiplier: 1,
+ claude_code_only: false,
+ fallback_group_id: null,
+ fallback_group_id_on_invalid_request: null,
+ allow_messages_dispatch: false,
+ allow_live: false,
+ require_oauth_only: false,
+ require_privacy_set: false,
+ created_at: "2026-09-05T00:00:00Z",
+ updated_at: "2026-09-05T00:00:00Z",
+ model_routing: null,
+ model_routing_enabled: false,
+ mcp_xml_inject: true,
+ supported_model_scopes: [],
+ account_count: 1,
+ active_account_count: 1,
+ rate_limited_account_count: 0,
+ models_list_config: undefined,
+ codex_models_manifest_config: {
+ enabled: false,
+ account_ids: [],
+ fallback_to_scheduler: false,
+ },
+ sort_order: 10,
+} satisfies AdminGroup;
+
+const AppLayoutStub = defineComponent({
+ template: " ",
+});
+
+const TablePageLayoutStub = defineComponent({
+ template: '',
+});
+
+const DataTableStub = defineComponent({
+ props: {
+ data: { type: Array, default: () => [] },
+ },
+ template: '',
+});
+
+const BaseDialogStub = defineComponent({
+ props: {
+ show: { type: Boolean, default: false },
+ },
+ template: '
',
+});
+
+// 表单提交前会调用这些子组件的 validate(),自动桩不提供该方法。
+const ValidatingFieldStub = defineComponent({
+ setup(_, { expose }) {
+ expose({ validate: () => true, resetValidation: () => undefined });
+ return () => h("div");
+ },
+});
+
+const mountView = () =>
+ mount(GroupsView, {
+ global: {
+ plugins: [createPinia()],
+ stubs: {
+ AppLayout: AppLayoutStub,
+ TablePageLayout: TablePageLayoutStub,
+ DataTable: DataTableStub,
+ Pagination: true,
+ BaseDialog: BaseDialogStub,
+ ConfirmDialog: true,
+ EmptyState: true,
+ Select: true,
+ PlatformIcon: true,
+ Icon: true,
+ GroupCapacityBadge: true,
+ GroupRateMultipliersModal: true,
+ GroupRPMOverridesModal: true,
+ ReasoningEffortPolicyFields: ValidatingFieldStub,
+ CodexManifestAccountsField: ValidatingFieldStub,
+ PricingEntryCard: true,
+ VueDraggable: true,
+ },
+ },
+ });
+
+const openEditDialog = async (group: AdminGroup) => {
+ listGroups.mockResolvedValue({
+ items: [group],
+ total: 1,
+ page: 1,
+ page_size: 20,
+ pages: 1,
+ });
+ const wrapper = mountView();
+ await flushPromises();
+ const editButton = wrapper
+ .findAll("button")
+ .find((button) => button.text().includes("common.edit"));
+ expect(editButton).toBeTruthy();
+ await editButton!.trigger("click");
+ await flushPromises();
+ return wrapper;
+};
+
+const toggle = (
+ wrapper: ReturnType,
+ name: "fast" | "ultrafast",
+) => wrapper.get(`[data-testid="edit-force-openai-${name}"]`);
+
+const isOn = (wrapper: ReturnType, name: "fast" | "ultrafast") =>
+ toggle(wrapper, name).attributes("aria-checked") === "true";
+
+const submit = async (wrapper: ReturnType) => {
+ await wrapper.get("#edit-group-form").trigger("submit");
+ await flushPromises();
+ expect(updateGroup).toHaveBeenCalledTimes(1);
+ expect(updateGroup.mock.calls[0][0]).toBe(sourceGroup.id);
+ return updateGroup.mock.calls[0][1];
+};
+
+describe("GroupsView OpenAI forced service tier", () => {
+ beforeEach(() => {
+ localStorage.clear();
+ listGroups.mockReset();
+ getModelAllowlistCandidates.mockReset();
+ getUsageSummary.mockReset();
+ getCapacitySummary.mockReset();
+ getLiveCapability.mockReset();
+ createGroup.mockReset();
+ updateGroup.mockReset();
+
+ getModelAllowlistCandidates.mockResolvedValue([]);
+ getUsageSummary.mockResolvedValue([]);
+ getCapacitySummary.mockResolvedValue([]);
+ getLiveCapability.mockResolvedValue({ supported: false });
+ updateGroup.mockResolvedValue({});
+ });
+
+ it("shows both switches off for a group that follows the client", async () => {
+ const wrapper = await openEditDialog(sourceGroup);
+
+ expect(isOn(wrapper, "fast")).toBe(false);
+ expect(isOn(wrapper, "ultrafast")).toBe(false);
+
+ wrapper.unmount();
+ });
+
+ it.each([
+ [{ force_openai_fast: true, force_openai_ultrafast: false }],
+ [{ force_openai_fast: false, force_openai_ultrafast: true }],
+ [{ force_openai_fast: true, force_openai_ultrafast: true }],
+ ])("loads and resaves the stored flags %o unchanged", async (flags) => {
+ const wrapper = await openEditDialog({ ...sourceGroup, ...flags });
+
+ expect(isOn(wrapper, "fast")).toBe(flags.force_openai_fast);
+ expect(isOn(wrapper, "ultrafast")).toBe(flags.force_openai_ultrafast);
+ expect(await submit(wrapper)).toMatchObject(flags);
+
+ wrapper.unmount();
+ });
+
+ it("turning on Ultra Fast keeps Force Fast as the fallback for other models", async () => {
+ const wrapper = await openEditDialog({
+ ...sourceGroup,
+ force_openai_fast: true,
+ });
+
+ await toggle(wrapper, "ultrafast").trigger("click");
+ expect(isOn(wrapper, "fast")).toBe(true);
+ expect(isOn(wrapper, "ultrafast")).toBe(true);
+
+ expect(await submit(wrapper)).toMatchObject({
+ force_openai_fast: true,
+ force_openai_ultrafast: true,
+ });
+
+ wrapper.unmount();
+ });
+
+ it("the two switches toggle independently", async () => {
+ const wrapper = await openEditDialog({
+ ...sourceGroup,
+ force_openai_fast: true,
+ force_openai_ultrafast: true,
+ });
+
+ await toggle(wrapper, "fast").trigger("click");
+ expect(isOn(wrapper, "fast")).toBe(false);
+ expect(isOn(wrapper, "ultrafast")).toBe(true);
+
+ expect(await submit(wrapper)).toMatchObject({
+ force_openai_fast: false,
+ force_openai_ultrafast: true,
+ });
+
+ wrapper.unmount();
+ });
+
+ it("clears both flags when both switches are turned off", async () => {
+ const wrapper = await openEditDialog({
+ ...sourceGroup,
+ force_openai_fast: true,
+ force_openai_ultrafast: true,
+ });
+
+ await toggle(wrapper, "fast").trigger("click");
+ await toggle(wrapper, "ultrafast").trigger("click");
+
+ expect(await submit(wrapper)).toMatchObject({
+ force_openai_fast: false,
+ force_openai_ultrafast: false,
+ });
+
+ wrapper.unmount();
+ });
+});
diff --git a/frontend/src/views/admin/__tests__/groupsOpenAIFast.spec.ts b/frontend/src/views/admin/__tests__/groupsOpenAIFast.spec.ts
index a0333e0a5a..db80eddfeb 100644
--- a/frontend/src/views/admin/__tests__/groupsOpenAIFast.spec.ts
+++ b/frontend/src/views/admin/__tests__/groupsOpenAIFast.spec.ts
@@ -21,6 +21,17 @@ describe("groupsOpenAIFast", () => {
expect(normalizeGroupOpenAIFast("openai", false)).toBe(false);
});
+ it("provides localized Ultra Fast switch labels naming the supported models", () => {
+ for (const locale of [zh, en]) {
+ expect(locale.groups.openaiFast).toMatchObject({
+ forceUltrafast: expect.stringContaining("ultrafast"),
+ ultrafastHint: expect.stringContaining("service_tier=ultrafast"),
+ });
+ expect(locale.groups.openaiFast.ultrafastHint).toContain("GPT-6 Astra");
+ expect(locale.groups.openaiFast.ultrafastHint).toContain("GPT-6.1 Sol");
+ }
+ });
+
it("provides localized switch labels", () => {
expect(zh.groups.openaiFast).toMatchObject({
title: expect.any(String),