@@ -192,16 +192,13 @@ const useChatSocket = (isEmpty?: boolean) => {
192192 }
193193
194194 let confirmMessage = `Proceed with calling the ${ frame . tool . name } tool?` ;
195- if (
196- ! frame . tool . instructions ?. startsWith ( '#!sys.openapi' ) &&
197- frame . displayText
198- ) {
195+ if ( frame . tool . instructions ?. startsWith ( '#!sys.openapi' ) ) {
196+ confirmMessage = `Proceed with running the following API operation (or allow all runs of this operation)?` ;
197+ } else if ( frame . displayText ) {
199198 const tool = frame . tool ?. name ?. replace ( 'sys.' , '' ) ;
200199 confirmMessage = frame . tool ?. source ?. repo
201200 ? `Proceed with running the following (or allow all calls from the **${ trimRepo ( frame . tool ?. source . repo ! . Root ) } ** repo)?`
202201 : `Proceed with running the following (or allow all **${ tool } ** calls)?` ;
203- } else if ( frame . tool . instructions ?. startsWith ( '#!sys.openapi' ) ) {
204- confirmMessage = `Proceed with running the following API operation (or allow all runs of this operation)?` ;
205202 }
206203
207204 const form = (
@@ -276,10 +273,10 @@ const useChatSocket = (isEmpty?: boolean) => {
276273
277274 if ( frame . tool . instructions ?. startsWith ( '#!sys.openapi' ) ) {
278275 // If the tool is an OpenAPI tool to list operations or get the schema for an operation, allow it.
276+ const instructions = frame . tool . instructions . split ( ' ' ) ;
279277 if (
280- frame . tool . instructions ?. split ( ' ' ) . length > 2 &&
281- ( frame . tool . instructions ?. split ( ' ' ) [ 1 ] == 'list' ||
282- frame . tool . instructions ?. split ( ' ' ) [ 1 ] == 'get-schema' )
278+ instructions . length > 2 &&
279+ ( instructions [ 1 ] == 'list' || instructions [ 1 ] == 'get-schema' )
283280 ) {
284281 return true ;
285282 }
0 commit comments