@@ -375,15 +375,6 @@ async def edit_file_contents(
375
375
target_content = "" .join (target_lines )
376
376
actual_range_hash = self .calculate_hash (target_content )
377
377
378
- # Debug output for hash comparison
379
- print (
380
- f"Debug - Range hash comparison:"
381
- f"\n Expected: { expected_range_hash } "
382
- f"\n Actual: { actual_range_hash } "
383
- f"\n Content: { target_content !r} "
384
- f"\n Range: { line_start_zero } :{ line_end_zero + 1 } "
385
- )
386
-
387
378
# Compare hashes
388
379
# Empty range_hash means explicit insertion
389
380
is_insertion = (
@@ -419,11 +410,6 @@ async def edit_file_contents(
419
410
# Replace the specified range
420
411
lines [line_start_zero : line_end_zero + 1 ] = new_lines
421
412
422
- # Debug output - shows the operation type
423
- print (
424
- f"Applied patch: line_start={ line_start } line_end={ line_end } is_insertion={ is_insertion } contents={ patch .contents !r} "
425
- )
426
-
427
413
# Write the final content back to file
428
414
final_content = "" .join (lines )
429
415
with open (file_path , "w" , encoding = encoding ) as f :
@@ -453,13 +439,9 @@ async def edit_file_contents(
453
439
"content" : None ,
454
440
}
455
441
except Exception as e :
456
- import traceback
457
-
458
- print (f"Error: { str (e )} " )
459
- print (f"Traceback:\n { traceback .format_exc ()} " )
460
442
return {
461
443
"result" : "error" ,
462
- "reason" : "Unexpected error occurred " ,
444
+ "reason" : f "Unexpected error: { str ( e ) } " ,
463
445
"file_hash" : None ,
464
446
"content" : None ,
465
447
}
0 commit comments