diff --git a/src/api/providers/openrouter.ts b/src/api/providers/openrouter.ts index 744d413..6e31055 100644 --- a/src/api/providers/openrouter.ts +++ b/src/api/providers/openrouter.ts @@ -58,6 +58,7 @@ export class OpenRouterHandler implements ApiHandler { msg.content = [{ type: "text", text: msg.content }] } if (Array.isArray(msg.content)) { + // NOTE: this is fine since env details will always be added at the end. but if it weren't there, and the user added a image_url type message, it would pop a text part before it and then move it after to the end. let lastTextPart = msg.content.filter((part) => part.type === "text").pop() if (!lastTextPart) {