File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
refact-agent/engine/src/http/routers/v1 Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -153,7 +153,10 @@ pub async fn handle_v1_tools_check_if_confirmation_needed(
153153 let tool = match all_tools. get ( & tool_call. function . name ) {
154154 Some ( x) => x,
155155 None => {
156- return Err ( ScratchError :: new ( StatusCode :: UNPROCESSABLE_ENTITY , format ! ( "Unknown tool: {}" , tool_call. function. name) ) )
156+ tracing:: error!( "Unknown tool: {}" , tool_call. function. name) ;
157+ // Not returning error here, because we don't want to stop the chat, it will fail later
158+ // in `/chat` and provide error to the model
159+ continue ;
157160 }
158161 } ;
159162
@@ -172,8 +175,15 @@ pub async fn handle_v1_tools_check_if_confirmation_needed(
172175 }
173176 } ;
174177
175- let should_confirm = tool. match_against_confirm_deny ( ccx. clone ( ) , & args) . await
176- . map_err ( |e| { ScratchError :: new ( StatusCode :: UNPROCESSABLE_ENTITY , e) } ) ?;
178+ let should_confirm = match tool. match_against_confirm_deny ( ccx. clone ( ) , & args) . await {
179+ Ok ( should_confirm) => should_confirm,
180+ Err ( e) => {
181+ tracing:: error!( "Error getting tool command to match: {e}" ) ;
182+ // Not returning error here, because we don't want to stop the chat, it will fail later
183+ // in `/chat` and provide error to the model
184+ continue ;
185+ }
186+ } ;
177187
178188 match should_confirm. result {
179189 MatchConfirmDenyResult :: DENY => {
You can’t perform that action at this time.
0 commit comments