Skip to content
Merged
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
3 changes: 1 addition & 2 deletions src/web-ui/src/flow_chat/services/AgenticEventListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export class AgenticEventListener {

if (callbacks.onSessionModelAutoMigrated) {
const unlisten = agentAPI.onSessionModelAutoMigrated((event) => {
logger.warn('Session model auto-migrated', event);
logger.debug('Session model auto-migrated', event);
callbacks.onSessionModelAutoMigrated?.(event);
});
this.unlistenFunctions.push(unlisten);
Expand Down Expand Up @@ -263,4 +263,3 @@ export class AgenticEventListener {
}

export const agenticEventListener = new AgenticEventListener();

Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ import { MCPAPI } from '@/infrastructure/api/service-api/MCPAPI';
import { ACPClientAPI, type AcpPermissionRequestEvent } from '@/infrastructure/api/service-api/ACPClientAPI';
import { globalEventBus } from '@/infrastructure/event-bus';
import type { FlowChatContext, DialogTurn, ModelRound, FlowToolItem } from './types';
import {
buildSessionModelMigrationNotice,
shouldSuppressSessionModelMigrationNotice,
} from '../../utils/sessionModelMigrationNotice';
import {
getAiErrorPresentation,
normalizeAiErrorDetail,
Expand All @@ -46,9 +42,6 @@ import { useReviewActionBarStore } from '../../store/deepReviewActionBarStore';
import { buildDeepReviewCapacityQueueStateFromEvent } from '../../utils/deepReviewQueueStateEvents';

const pendingImageAnalysisTurns = new Map<string, string>();
// `restore_session` and assistant bootstrap can race on the same historical
// session, so collapse identical auto-migration toasts into one short-lived UX notice.
const recentSessionModelMigrationNoticeTimestamps = new Map<string, number>();
import {
debouncedSaveDialogTurn,
immediateSaveDialogTurn,
Expand Down Expand Up @@ -886,33 +879,11 @@ function handleSessionTitleGenerated(event: any): void {
}

function handleSessionModelAutoMigrated(event: SessionModelAutoMigratedEvent): void {
const { sessionId, newModelId, reason } = event;
const { sessionId, newModelId } = event;
if (!sessionId || !newModelId) return;

const store = FlowChatStore.getInstance();
store.updateSessionModelName(sessionId, newModelId);

const notice = buildSessionModelMigrationNotice(event, (key, options) =>
i18nService.t(key, options)
);
if (
shouldSuppressSessionModelMigrationNotice(
recentSessionModelMigrationNoticeTimestamps,
notice.dedupeKey
)
) {
return;
}

notificationService.warning(notice.message, {
title: notice.title,
duration: 6000,
metadata: {
sessionId,
reason,
newModelId,
},
});
}

/**
Expand Down
60 changes: 0 additions & 60 deletions src/web-ui/src/flow_chat/utils/sessionModelMigrationNotice.test.ts

This file was deleted.

67 changes: 0 additions & 67 deletions src/web-ui/src/flow_chat/utils/sessionModelMigrationNotice.ts

This file was deleted.

11 changes: 1 addition & 10 deletions src/web-ui/src/locales/en-US/flow-chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -411,16 +411,7 @@
"temperature": "Temperature",
"maxTokens": "Max Tokens",
"topP": "Top P",
"streaming": "Streaming",
"autoMigrated": {
"title": "Model switched automatically",
"description": "The model previously used by this chat is no longer available. BitFun switched this chat to automatic model selection.",
"reasons": {
"modelUnavailableOnRestore": "This happened while reopening a previous chat. You can keep going, or choose a model again later.",
"modelReconciled": "Your model settings changed recently, so BitFun moved this chat to an available model automatically.",
"fallback": "BitFun selected an available model for this chat automatically."
}
}
"streaming": "Streaming"
},
"toolbar": {
"newSession": "New Session",
Expand Down
11 changes: 1 addition & 10 deletions src/web-ui/src/locales/zh-CN/flow-chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -411,16 +411,7 @@
"temperature": "温度",
"maxTokens": "最大令牌数",
"topP": "Top P",
"streaming": "流式输出",
"autoMigrated": {
"title": "模型已自动切换",
"description": "当前会话之前使用的模型配置已不可用,系统已切换为自动选择模型。",
"reasons": {
"modelUnavailableOnRestore": "这是恢复历史会话时的自动处理,你可以继续使用,或稍后重新指定模型。",
"modelReconciled": "模型配置刚发生过调整,系统已为当前会话自动切换到可用模型。",
"fallback": "系统已为当前会话自动选择可用模型。"
}
}
"streaming": "流式输出"
},
"toolbar": {
"newSession": "新建会话",
Expand Down
11 changes: 1 addition & 10 deletions src/web-ui/src/locales/zh-TW/flow-chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -411,16 +411,7 @@
"temperature": "溫度",
"maxTokens": "最大令牌數",
"topP": "Top P",
"streaming": "流式輸出",
"autoMigrated": {
"title": "模型已自動切換",
"description": "當前會話先前使用的模型設定已不可用,系統已切換為自動選擇模型。",
"reasons": {
"modelUnavailableOnRestore": "這是恢復歷史會話時的自動處理,你可以繼續使用,或稍後重新指定模型。",
"modelReconciled": "模型設定剛發生調整,系統已為當前會話自動切換到可用模型。",
"fallback": "系統已為當前會話自動選擇可用模型。"
}
}
"streaming": "流式輸出"
},
"toolbar": {
"newSession": "新建會話",
Expand Down
Loading