diff --git a/src/ai/unified-ai-runner.shared.ts b/src/ai/unified-ai-runner.shared.ts index d1e3d61..9845eda 100644 --- a/src/ai/unified-ai-runner.shared.ts +++ b/src/ai/unified-ai-runner.shared.ts @@ -19,8 +19,7 @@ import {executeToolCall, ToolRuntimeContext} from "./tools/runtime"; import {MessageImagePart, MessagePart} from "../common/message-part"; import {KeyedAsyncLock} from "../util/async-lock"; import {type AiRequestQueueTarget} from "./provider-request-queue"; -import {PYTHON_INTERPRETER_TOOL_NAME} from "./tools/python-interpretator"; -import {pythonInterpreterToolPrompt} from "./tools/python-interpretator"; +import {PYTHON_INTERPRETER_TOOL_NAME, pythonInterpreterToolPrompt} from "./tools/python-interpretator"; import {getResponseLanguageInstruction, UserAiResponseLanguage, UserAiVoiceMode} from "../common/user-ai-settings"; import { isTranscribableAudioDownload, @@ -457,13 +456,10 @@ export function roundStatus(round: number, firstRoundStatus: string, content?: s return null; } - const status = toolCalls?.length ? Environment.getUseToolText(toolCalls) + return toolCalls?.length ? Environment.getUseToolText(toolCalls) : thinking ? Environment.reasoningText : round === 0 ? firstRoundStatus : Environment.waitThinkText; - - - return status; } export function isPlainTextDocument(doc: AiDownloadedFile): boolean { @@ -1287,7 +1283,7 @@ export async function executeTool( await message.flush(); const parsedArgs = parseToolArgumentsObject(toolCall.argumentsText); - if (parsedArgs.ok === false) { + if (!parsedArgs.ok) { const result = toolFailureResult("invalid_arguments", parsedArgs.message, { raw: parsedArgs.raw.slice(0, 4000), });