Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions changelog/unreleased/console-dispatch-copy-and-preview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### English

- Dispatch-group copy now states what the routing actually does: `max_attempts` counts dispatches of the requested logical model, and checked accounts expand into seats in check order, so a later member is no longer described as a failure backup.
- Model pool preview keeps "no preview yet" apart from "no candidate": an empty result says so instead of falling back to the draft rows, and a failed preview no longer shows a stale path.

### 中文

- 调度组文案改为说明真实路由行为:`max_attempts` 统计的是所请求逻辑模型的派发次数,勾选的账号会按勾选顺序展开成座位,后面的成员不再被描述成失败备份。
- 调度组预览把「还没预览」和「没有候选」分开:空结果显示提示而不是退回草稿行,预览失败也不再显示过期路径。
54 changes: 28 additions & 26 deletions frontend/src/i18n/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export const messages: Record<Lang, Dict> = {
modelPoolNameHint: 'Shown only in this console list, so you can tell groups apart. Clients never see it.',
modelPoolNamePh: 'My Claude',
modelPoolStrategy: 'Routing strategy',
modelPoolStrategyHint: 'Priority: always use the first working member (primary/backup). Round robin: spread requests evenly. Fill first: favor the highest-weight member. FEFO: prefer the member whose quota expires soonest.',
modelPoolStrategyHint: 'Priority: order eligible members by priority; later members are not failure backups unless failover is enabled. Round robin: spread requests evenly. Fill first: favor the highest-weight member. FEFO: prefer the member whose quota expires soonest.',
modelPoolStrategy_priority: 'Priority order',
'modelPoolStrategy_round-robin': 'Round robin',
'modelPoolStrategy_fill-first': 'Fill first',
Expand All @@ -154,7 +154,7 @@ export const messages: Record<Lang, Dict> = {
'modelPoolStrategy_most-quota-first': 'Most remaining quota first',
modelPoolFailover: 'Failover',
modelPoolMaxAttempts: 'Max attempts',
modelPoolMaxAttemptsHint: 'Maximum providers tried before the request fails (1-64).',
modelPoolMaxAttemptsHint: 'With failover enabled, this caps total dispatches for the requested logical model, counting the first dispatch and later attempts across members (1-64); it is not a provider count.',
modelPoolMembers: 'Provider models',
modelPoolMembersHint: 'Only connected providers and the models enabled in their provider settings are selectable. The provider account pool picks the serving account automatically; order sets priority.',
modelPoolAddMember: 'Add provider model',
Expand All @@ -178,7 +178,7 @@ export const messages: Record<Lang, Dict> = {
modelPoolColFailover: 'Failover',
modelPoolColEnabled: 'Enabled',
modelPoolColActions: 'Actions',
modelPoolFailoverOn: 'On · {count} attempts',
modelPoolFailoverOn: 'On · up to {count} dispatches',
modelPoolFailoverOff: 'Off',
modelPoolEmpty: 'No dispatch groups',
modelPoolEmptyHint: 'Add a group and clients get another model they can call.',
Expand All @@ -193,22 +193,22 @@ export const messages: Record<Lang, Dict> = {
modelPoolEntryTitle: 'Request',
modelPoolEntryDetail: 'Client model id',
modelPoolEntryNote: 'Starts when a client calls this id',
modelPoolEntryHint: 'Each seat is one provider. Leave accounts empty to use all of them, or check several. Left to right is the try order.',
modelPoolEntryHint: 'Each provider/model can expand into one seat per checked account, in check order. With no accounts checked, all matching connected accounts are eligible; otherwise only checked accounts are included. The row strategy controls how its seats are scheduled.',
modelPoolStepProvider: 'Provider',
modelPoolStepProviderDetail: 'One provider',
modelPoolAccounts: 'Accounts',
modelPoolAccountsHint: 'Leave this empty, or check several: saving uses every connected account of the provider. Check exactly one to use only that account.',
modelPoolAccountsHint: 'Leave accounts unchecked to include all matching connected accounts. Check one or more to include only those accounts; multiple picks expand into seats in check order.',
modelPoolAccountsAll: 'All accounts',
modelPoolAccountsAllCount: 'All {count} accounts',
modelPoolSeatOrderAll: 'Provider order',
modelPoolSeatOrderPicked: 'Check order',
modelPoolSeatOrderAll: 'Account-pool selection',
modelPoolSeatOrderPicked: 'Expanded in check order',
modelPoolSeatCount: '{count} seats',
modelPoolPathCount: '{count} paths',
modelPoolAccountsCount: '{count} accounts',
modelPoolAccountsSearch: 'Find an account',
modelPoolAccountsNoMatch: 'No account matches',
modelPoolNoAccounts: 'This provider has no connected account',
modelPoolAccountsDraft: 'Checking several accounts still saves as every account of the provider. Check exactly one to keep a single account.',
modelPoolAccountsDraft: 'Multiple selections include only the checked accounts; they expand into seats in check order.',
modelPoolClientModel: 'Client model name',
modelPoolCanvasPalette: 'Add a seat',
modelPoolCanvasIncomplete: 'Set up',
Expand All @@ -230,28 +230,29 @@ export const messages: Record<Lang, Dict> = {
modelPoolStepGroupNote: 'Keeps that pool\'s own order',
modelPoolStepIntent: 'Intent',
modelPoolStepIntentDetail: 'Latest user message',
modelPoolStepIntentNote: 'Keywords, or one classifier call',
modelPoolStepIntentNote: 'Keywords or classifier',
modelPoolPathMatch: 'Match',
modelPoolPathDefault: 'Default',
modelPoolPathDefault: 'Default (unmatched)',
modelPoolPathLabel: 'Path name',
modelPoolAddPath: 'Add path',
modelPoolRemovePath: 'Remove path',
modelPoolKeywords: 'Keywords',
modelPoolKeywordsHint: 'Comma-separated. Any case-insensitive hit on the latest user message selects this path.',
modelPoolIntentLabel: 'Classifier label',
modelPoolIntentHint: 'Matched against the classifier reply. The path name is also accepted.',
modelPoolPathFallback: 'Default path',
modelPoolPathFallback: 'Default path (no match; not a failure backup)',
modelPoolClassifier: 'Classifier',
modelPoolClassifierOff: 'Keywords only',
modelPoolClassifierHint: 'Optional. One non-streaming call before routing. It must be a concrete model.',
modelPoolClassifierHint: 'Optional. At a reached branch, a separate non-streaming request uses this concrete model to classify the message; other reached branches can trigger additional classifier requests.',
modelPoolNestedPool: 'Group',
modelPoolNestedPoolPick: 'Choose a group',
modelPoolNestedPoolEmpty: 'No other groups yet',
modelPoolGroupRequired: 'Choose a nested group.',
modelPoolSelfGroup: 'A group cannot nest itself.',
modelPoolClassifierIncomplete: 'The classifier needs a provider and a model.',
modelPoolPreview: 'Try a message',
modelPoolPreviewHint: 'Shows the path and the attempt order for this draft. A classifier is called once when the draft has one.',
modelPoolPreviewHint: 'Shows at most one next candidate or cooling hint from the current pool state, not a full failover sequence. An empty result means the current pool could not confirm a route. Candidate selection reserves no account and advances no rotation; reached branches may dispatch non-streaming classifier requests. API-key grants, request-specific account pins, session affinity, protocol-specific request context, and concurrent or later pool changes are not included, so a live request may differ.',
modelPoolPreviewNoCandidate: 'No current candidate could be confirmed.',
modelPoolPreviewPh: 'Plan the rollout',
modelPoolPreviewRun: 'Preview',
modelPoolPreviewPath: 'Path',
Expand Down Expand Up @@ -1401,7 +1402,7 @@ export const messages: Record<Lang, Dict> = {
modelPoolNameHint: '只出现在这个控制台的列表里,用来辨认。客户端看不到。',
modelPoolNamePh: '我的 Claude',
modelPoolStrategy: '路由策略',
modelPoolStrategyHint: '优先级顺序:始终使用第一个可用成员(主备)。轮询:均匀分摊请求。优先填满:偏向权重最高的成员。最先过期优先:优先使用额度最快到期的成员。',
modelPoolStrategyHint: '优先级顺序:按优先级排列符合条件的成员;除非开启故障转移,后续成员不等于故障备份。轮询:均匀分摊请求。优先填满:偏向权重最高的成员。最先过期优先:优先选择额度最早到期的成员。',
modelPoolStrategy_priority: '优先级顺序',
'modelPoolStrategy_round-robin': '轮询',
'modelPoolStrategy_fill-first': '优先填满',
Expand All @@ -1410,7 +1411,7 @@ export const messages: Record<Lang, Dict> = {
'modelPoolStrategy_most-quota-first': '剩余额度最多优先',
modelPoolFailover: '故障转移',
modelPoolMaxAttempts: '最大尝试次数',
modelPoolMaxAttemptsHint: '请求失败前最多尝试的供应商数量(1-64)。',
modelPoolMaxAttemptsHint: '开启故障转移时,此项限制主请求逻辑模型的总派发次数,包含首次派发和跨成员的后续尝试(1-64),不是供应商数量。',
modelPoolMembers: '供应商模型',
modelPoolMembersHint: '仅可选出已接入的供应商,以及对应供应商设置中启用的模型。账号由供应商账号池自动选择,顺序即优先级。',
modelPoolAddMember: '添加供应商模型',
Expand All @@ -1434,7 +1435,7 @@ export const messages: Record<Lang, Dict> = {
modelPoolColFailover: '故障转移',
modelPoolColEnabled: '启用',
modelPoolColActions: '操作',
modelPoolFailoverOn: '开启 · {count} 次尝试',
modelPoolFailoverOn: '开启 · 最多 {count} 次派发',
modelPoolFailoverOff: '关闭',
modelPoolEmpty: '还没有调度组',
modelPoolEmptyHint: '添加一组,就会多一个客户端能调用的模型。',
Expand All @@ -1449,22 +1450,22 @@ export const messages: Record<Lang, Dict> = {
modelPoolEntryTitle: '请求',
modelPoolEntryDetail: '客户端模型 ID',
modelPoolEntryNote: '客户端调用这个 ID 时开始',
modelPoolEntryHint: '一个座位是一个供应商。不选账号就用它的全部账号,也可以勾上多个。从左到右是尝试顺序。',
modelPoolEntryHint: '每个供应商/模型可按所勾账号展开成多个座位,顺序跟勾选顺序一致。不勾账号时,符合条件的全部已接入账号都可参与;有勾选时只包含所选账号。行内策略决定这些座位的调度方式。',
modelPoolStepProvider: '供应商',
modelPoolStepProviderDetail: '一个供应商',
modelPoolAccounts: '账号',
modelPoolAccountsHint: '不选,或者勾多个,保存都是这个供应商已接入的全部账号。只勾一个,才只走那个账号。',
modelPoolAccountsHint: '账号全不勾选时,纳入符合条件的全部已接入账号。勾选一个或多个后,仅纳入所选账号;多选会按勾选顺序展开为座位。',
modelPoolAccountsAll: '全部账号',
modelPoolAccountsAllCount: '全部 {count} 个账号',
modelPoolSeatOrderAll: '供应商顺序',
modelPoolSeatOrderPicked: '勾选顺序',
modelPoolSeatOrderAll: '由账号池选择',
modelPoolSeatOrderPicked: '按勾选顺序展开',
modelPoolSeatCount: '{count} 个座位',
modelPoolPathCount: '{count} 条路径',
modelPoolAccountsCount: '{count} 个账号',
modelPoolAccountsSearch: '查找账号',
modelPoolAccountsNoMatch: '没有匹配的账号',
modelPoolNoAccounts: '这个供应商还没有接入账号',
modelPoolAccountsDraft: '勾了多个账号时,保存仍是这个供应商的全部账号。只勾一个,才会只记那一个。',
modelPoolAccountsDraft: '多选时仅包含所勾账号,并按勾选顺序展开为座位。',
modelPoolClientModel: '客户端传来的模型名',
modelPoolCanvasPalette: '添加座位',
modelPoolCanvasIncomplete: '待设置',
Expand All @@ -1486,28 +1487,29 @@ export const messages: Record<Lang, Dict> = {
modelPoolStepGroupNote: '内层保持自己的顺序',
modelPoolStepIntent: '意图',
modelPoolStepIntentDetail: '最新一条用户消息',
modelPoolStepIntentNote: '关键词,或一次分类调用',
modelPoolStepIntentNote: '关键词或分类模型',
modelPoolPathMatch: '匹配',
modelPoolPathDefault: '默认',
modelPoolPathDefault: '默认(无匹配)',
modelPoolPathLabel: '路径名称',
modelPoolAddPath: '添加路径',
modelPoolRemovePath: '移除路径',
modelPoolKeywords: '关键词',
modelPoolKeywordsHint: '用逗号分隔。最新一条用户消息里任意一个关键词命中(忽略大小写)即走这条路径。',
modelPoolIntentLabel: '分类标签',
modelPoolIntentHint: '与分类模型的回复比较。路径名称同样可以命中。',
modelPoolPathFallback: '默认路径',
modelPoolPathFallback: '默认路径(无匹配时使用,不是故障备份)',
modelPoolClassifier: '分类模型',
modelPoolClassifierOff: '只用关键词',
modelPoolClassifierHint: '可选。路由前做一次非流式调用,并且必须是具体模型。',
modelPoolClassifierHint: '可选。到达这条分支时,会用所选具体模型另发非流式请求来分类消息;同一次路由中其他实际到达的分支也可能触发额外分类请求。',
modelPoolNestedPool: '调度组',
modelPoolNestedPoolPick: '选择调度组',
modelPoolNestedPoolEmpty: '还没有其他调度组',
modelPoolGroupRequired: '请选择一个嵌套调度组。',
modelPoolSelfGroup: '调度组不能嵌套自己。',
modelPoolClassifierIncomplete: '分类模型需要同时选择供应商和模型。',
modelPoolPreview: '试一句消息',
modelPoolPreviewHint: '按当前草稿显示路径和尝试顺序。草稿里有分类模型时会调用它一次。',
modelPoolPreviewHint: '按当前账号池状态显示至多一个下一候选或冷却提示,不是完整故障转移序列。结果为空表示当前账号池无法确认路由。候选选择不预占账号、不推进轮转;实际到达的分支可能发起非流式分类请求。预览不包含 API 密钥授权、请求级账号指定、会话粘性、协议请求上下文及并发或后续池状态变化,因此真实请求可能不同。',
modelPoolPreviewNoCandidate: '当前无法确认可用候选。',
modelPoolPreviewPh: '帮我规划上线步骤',
modelPoolPreviewRun: '预览',
modelPoolPreviewPath: '路径',
Expand Down
28 changes: 13 additions & 15 deletions frontend/src/pages/ModelPoolEditorPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -312,20 +312,18 @@ export function ModelPoolEditorPage() {
[aggregations, doc, message, models, t],
)
const previewRows = useMemo(() => {
if (preview?.attempts.length) {
return preview.attempts.map((attempt, index) => ({
id: attempt.id || `${attempt.provider}-${attempt.model}-${index}`,
title: accountProviderLabel(attempt.provider, attempt.region || '', t),
detail: attempt.model ? modelTitle(models, attempt.model) : '',
note: attempt.status === 'skipped'
? (attempt.reason === 'no ready account' ? t('modelPoolNoReady') : (attempt.reason || t('modelPoolCanvasSkip')))
: '',
provider: attempt.provider,
}))
}
return draft.rows
}, [draft.rows, models, preview, t])
const previewPath = preview?.path || draft.path
if (!preview) return previewError ? [] : draft.rows
return preview.attempts.map((attempt, index) => ({
id: attempt.id || `${attempt.provider}-${attempt.model}-${index}`,
title: accountProviderLabel(attempt.provider, attempt.region || '', t),
detail: attempt.model ? modelTitle(models, attempt.model) : '',
note: attempt.status === 'skipped'
? (attempt.reason === 'no ready account' ? t('modelPoolNoReady') : (attempt.reason || t('modelPoolCanvasSkip')))
: '',
provider: attempt.provider,
}))
}, [draft.rows, models, preview, previewError, t])
const previewPath = preview ? preview.path : previewError ? '' : draft.path

if (poolLoading) return <SkeletonBlock className="h-64 w-full rounded-xl" />
if (!enabled) return <Navigate to="/" replace />
Expand Down Expand Up @@ -448,6 +446,7 @@ export function ModelPoolEditorPage() {
</InputGroup>
</TextField>
{previewPath ? <p className="mt-1.5 px-1.5 text-caption text-muted">{t('modelPoolPreviewPath')} · {previewPath}</p> : null}
{preview && preview.attempts.length === 0 ? <p className="mt-1.5 px-1.5 text-caption text-muted">{t('modelPoolPreviewNoCandidate')}</p> : null}
{previewError ? <div className="mt-1.5"><PageAlert status="danger" title={previewError} /></div> : null}
{previewRows.length ? (
<ol className="mt-1.5 flex flex-wrap gap-1.5">
Expand Down Expand Up @@ -990,4 +989,3 @@ function accountsForProvider(accounts: AccountRow[], provider: string, region: s
.filter((account) => !wantedRegion || normalizeRegion(account.region) === wantedRegion)
.sort((a, b) => (a.priority ?? 0) - (b.priority ?? 0) || (a.name || a.id).localeCompare(b.name || b.id))
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading
Loading