chore: 版本号 0.14.5 → 0.14.6

fix: onNewIteration 空数组真值导致重复消息卡片([] truthy in JS)
This commit is contained in:
thzxx
2026-06-28 21:08:50 +08:00
parent 2f37111074
commit 20701433dd
6 changed files with 12 additions and 10 deletions
+4 -2
View File
@@ -529,7 +529,8 @@ async function handleRetry(): Promise<void> {
});
},
onNewIteration: (toolCalls) => {
if (retryContent || toolCalls) {
const hasToolCalls = toolCalls && toolCalls.length > 0;
if (retryContent || hasToolCalls) {
const now = Date.now();
const toolCallRecords: ToolCallRecord[] | undefined = toolCalls?.map(tc => ({
name: tc.function.name, arguments: tc.function.arguments,
@@ -1283,7 +1284,8 @@ async function sendMessageWithAgentLoop(text: string, currentSession: ChatSessio
if (oldPlaceholder) oldPlaceholder.remove();
// 有文本内容 或 有工具调用 → 保存为独立消息
if (assistantContent || toolCalls) {
const hasToolCalls = toolCalls && toolCalls.length > 0;
if (assistantContent || hasToolCalls) {
const now = Date.now();
// 计算本轮迭代的 token 和时长
const currentEvalCount = state.get<number>('_currentEvalCount', 0);