聊天相关fix

This commit is contained in:
2025-09-20 20:37:31 +08:00
parent 86282eec31
commit b8a417632a
22 changed files with 2423 additions and 398 deletions
@@ -7,6 +7,8 @@ import { ChatModel } from "../data/ChatModel";
import { ChatHistoryManager } from "../manager/ChatHistoryManager";
import Utils from "../../Main/Common/Utils";
import { InnerMsgCode } from "../../Main/Config/InnerMsgCode";
import { TipsPanel } from "../ui/panels/TipsPanel";
import LanguageUtils from "../../Main/Common/LanguageUtils";
/**
* 聊天控制器接口 - 定义Panel和Controller之间的通信协议
@@ -188,7 +190,8 @@ export class ChatController {
try {
const roleId = this.chatModel.getCurrentRoleId();
if (!roleId) {
throw new Error("Role ID is not available in ChatModel");
console.error("Role ID is not available in ChatModel");
TipsPanel.show(LanguageUtils.getText("chat_error_code_1004"));
}
// 添加用户消息到模型