File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -81,14 +81,13 @@ export async function CopilotAuthPlugin({ client }) {
8181 }
8282
8383 if ( body ?. input ) {
84- isAgentCall = body . input . some (
85- ( input ) => ( input . role && [ "assistant" ] . includes ( input . role ) ) || ( input . type && RESPONSES_API_ALTERNATE_INPUT_TYPES . includes ( input . type ) ) ,
86- )
87- isVisionRequest = body . input . some (
88- ( input ) =>
89- Array . isArray ( input . content ) &&
90- input . content . some ( ( part ) => part . type === "input_image" ) ,
91- ) ;
84+ const lastInput = body . input [ body . input . length - 1 ] ;
85+
86+ const isAssistant = lastInput ?. role === "assistant" ;
87+ const hasAgentType = lastInput ?. type ? RESPONSES_API_ALTERNATE_INPUT_TYPES . includes ( lastInput . type ) : false ;
88+ isAgentCall = isAssistant || hasAgentType ;
89+
90+ isVisionRequest = Array . isArray ( lastInput ?. content ) && lastInput . content . some ( ( part ) => part . type === "input_image" ) ;
9291 }
9392 } catch { }
9493 const headers = {
You can’t perform that action at this time.
0 commit comments