File tree Expand file tree Collapse file tree
src/agents/sessions/tools Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -191,7 +191,8 @@ describe("edit tool", () => {
191191 undefined ,
192192 ) ;
193193
194- expect ( result . content [ 0 ] . text ) . toContain ( "No changes made" ) ;
194+ const textContent = result . content [ 0 ] ;
195+ expect ( "text" in textContent ? textContent . text : "" ) . toContain ( "No changes made" ) ;
195196 // File must not be rewritten
196197 await expect ( fs . readFile ( filePath , "utf-8" ) ) . resolves . toBe ( "unchanged content\n" ) ;
197198 } ) ;
@@ -209,7 +210,8 @@ describe("edit tool", () => {
209210 undefined ,
210211 ) ;
211212
212- expect ( result . content [ 0 ] . text ) . toContain ( "Successfully replaced" ) ;
213+ const textContent = result . content [ 0 ] ;
214+ expect ( "text" in textContent ? textContent . text : "" ) . toContain ( "Successfully replaced" ) ;
213215 await expect ( fs . readFile ( filePath , "utf-8" ) ) . resolves . toBe ( "new content\n" ) ;
214216 } ) ;
215217} ) ;
Original file line number Diff line number Diff line change @@ -487,6 +487,7 @@ export function createEditToolDefinition(
487487 text : `No changes made to ${ path } . The replacement produced identical content.` ,
488488 } ,
489489 ] ,
490+ details : undefined ,
490491 } ;
491492 }
492493 throw normalizedError ;
Original file line number Diff line number Diff line change @@ -134,8 +134,9 @@ describe("write tool", () => {
134134 undefined ,
135135 ) ;
136136
137- expect ( result . content [ 0 ] . text ) . toContain ( "No changes made" ) ;
138- expect ( result . content [ 0 ] . text ) . toContain ( "identical" ) ;
137+ const textContent = result . content [ 0 ] ;
138+ expect ( "text" in textContent ? textContent . text : "" ) . toContain ( "No changes made" ) ;
139+ expect ( "text" in textContent ? textContent . text : "" ) . toContain ( "identical" ) ;
139140 // File content must not change
140141 await expect ( fs . readFile ( filePath , "utf-8" ) ) . resolves . toBe ( "hello\n" ) ;
141142 } ) ;
@@ -151,7 +152,8 @@ describe("write tool", () => {
151152 undefined ,
152153 ) ;
153154
154- expect ( result . content [ 0 ] . text ) . toContain ( "Successfully wrote" ) ;
155+ const textContent = result . content [ 0 ] ;
156+ expect ( "text" in textContent ? textContent . text : "" ) . toContain ( "Successfully wrote" ) ;
155157 await expect ( fs . readFile ( filePath , "utf-8" ) ) . resolves . toBe ( "new\n" ) ;
156158 } ) ;
157159} ) ;
Original file line number Diff line number Diff line change @@ -417,6 +417,7 @@ export function createWriteToolDefinition(
417417 text : `No changes made to ${ path } . File content is identical.` ,
418418 } ,
419419 ] ,
420+ details : undefined ,
420421 } ;
421422 }
422423 await ops . mkdir ( dir ) ;
You can’t perform that action at this time.
0 commit comments