We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4bc7470 + ab3c902 commit 8e2d72dCopy full SHA for 8e2d72d
1 file changed
index.mjs
@@ -118,9 +118,10 @@ export async function CopilotAuthPlugin({ client }) {
118
? JSON.parse(init.body)
119
: init.body;
120
if (body?.messages) {
121
- isAgentCall = body.messages.some(
122
- (msg) => msg.role && ["tool", "assistant"].includes(msg.role),
123
- );
+ if (body.messages.length > 0) {
+ const lastMessage = body.messages[body.messages.length - 1];
+ isAgentCall = lastMessage.role && ["tool", "assistant"].includes(lastMessage.role);
124
+ }
125
isVisionRequest = body.messages.some(
126
(msg) =>
127
Array.isArray(msg.content) &&
0 commit comments