v0.11.9: 修复纯文本消息卡片丢失 + 子代理参数可配置
fix: 恢复纯文本消息的 else if 分支,修复 fed1e6d 重构后用户消息卡片不显示
fix: allVids 类型注解补充 base64 字段,消除 TS2322 编译错误
feat: 子代理最大轮次和超时接入设置面板(subAgentMaxLoops/subAgentTimeout)
chore: 版本号 0.11.7 → 0.11.9
This commit is contained in:
@@ -1018,7 +1018,7 @@ async function sendMessageWithAgentLoop(text: string, currentSession: ChatSessio
|
||||
} else if (pendingImages.length > 1) {
|
||||
apiParts.push(`[${pendingImages.length} 张图片: ${pendingImages.map(img => img.name).join(', ')}]`);
|
||||
}
|
||||
let allVids: Array<{ name: string; count: number; dur: number; frames: Array<{ timestampSeconds: number; name: string }> }> = [];
|
||||
let allVids: Array<{ name: string; count: number; dur: number; frames: Array<{ timestampSeconds: number; name: string; base64: string }> }> = [];
|
||||
if (hasVideos) {
|
||||
if (pendingVideoMeta && pendingVideoFrames.length > 0) {
|
||||
allVids.push({ name: pendingVideoMeta.fileName, count: pendingVideoFrames.length, dur: pendingVideoMeta.duration, frames: pendingVideoFrames });
|
||||
@@ -1052,6 +1052,18 @@ async function sendMessageWithAgentLoop(text: string, currentSession: ChatSessio
|
||||
msg._fileContents = pendingFiles.map(f => ({ language: f.language, content: f.content }));
|
||||
}
|
||||
msgsToAdd.push(msg);
|
||||
} else if (text || pendingFiles.length > 0) {
|
||||
// 纯文本/纯文件消息(无图片、视频附件)
|
||||
const msg: ChatMessage = {
|
||||
role: 'user',
|
||||
content: text || '',
|
||||
timestamp: now
|
||||
};
|
||||
if (userFiles.length > 0) {
|
||||
msg.files = userFiles;
|
||||
msg._fileContents = pendingFiles.map(f => ({ language: f.language, content: f.content }));
|
||||
}
|
||||
msgsToAdd.push(msg);
|
||||
}
|
||||
|
||||
const isFirstMsg = currentSession.messages.length === 0;
|
||||
|
||||
Reference in New Issue
Block a user