File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
src/adapters/openai/helpers Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -660,6 +660,21 @@ Respond with:
660
660
try {
661
661
const result = await tool . execute ( args ) ;
662
662
663
+ if ( ! result . success && tool . name === "writeFile" && result . error === "No valid diff blocks found in content" ) {
664
+ const error = new Error ( result . error || "No valid diff blocks found in content" ) ;
665
+ this . context . logger . error ( `Tool attempt ${ currentAttempts } failed:` , { error, tool : tool . name } ) ;
666
+ return {
667
+ success : false ,
668
+ error : result . error ,
669
+ metadata : {
670
+ timestamp : Date . now ( ) ,
671
+ toolName : tool . name ,
672
+ toolAttempts : currentAttempts ,
673
+ workingDir,
674
+ } ,
675
+ } ;
676
+ }
677
+
663
678
if ( ! result . success && currentAttempts < MAX_TRIES ) {
664
679
const error = new Error ( result . error || "Unknown error" ) ;
665
680
this . context . logger . error ( `Tool attempt ${ currentAttempts } failed:` , { error, tool : tool . name } ) ;
You can’t perform that action at this time.
0 commit comments