@@ -300,6 +300,18 @@ def main():
300300 context_files = load_context_files (args .framework , failed_jobs )
301301 previous_fixes = get_previous_fixes ()
302302
303+ # Debug: show what logs we have
304+ logs_path = Path (args .logs_dir )
305+ if logs_path .exists ():
306+ log_files = list (logs_path .rglob ("*.txt" ))
307+ print (f"Log files found: { len (log_files )} " )
308+ for f in log_files [:10 ]:
309+ print (f" { f .name } ({ f .stat ().st_size } bytes)" )
310+ else :
311+ print (f"WARNING: logs dir { args .logs_dir } does not exist!" )
312+
313+ print (f"Error lines extracted: { len (error_lines .splitlines ())} lines" )
314+ print (f"Error lines preview: { error_lines [:500 ]} " )
303315 print (f"Failed jobs detected: { failed_jobs or 'none (including all files)' } " )
304316 print (f"Context files loaded: { list (context_files .keys ())} " )
305317 print ()
@@ -310,26 +322,37 @@ def main():
310322
311323 prompt = build_prompt (args .framework , args .branch , error_lines ,
312324 context_files , previous_fixes , retry_context )
325+ print (f"Prompt size: { len (prompt )} chars" )
313326 response = call_bedrock (SYSTEM_PROMPT , prompt )
327+ print (f"LLM response ({ len (response )} chars):" )
328+ print (response [:2000 ])
329+ if len (response ) > 2000 :
330+ print (f" ... ({ len (response ) - 2000 } more chars)" )
331+ print ()
314332
315333 if response .strip ().startswith ("TRANSIENT:" ):
316334 print (f"Transient: { response .strip ().split (':' , 1 )[1 ].strip ()} " )
317335 sys .exit (0 )
318336
319337 blocks = parse_blocks (response )
338+ if blocks :
339+ print (f"Parsed { len (blocks )} block(s): { [b ["path" ] for b in blocks ]} " )
320340 if not blocks :
321341 retry_context = (
322342 f"Could not parse search/replace blocks from response.\n "
323343 f"Response started with: { response [:300 ]} ...\n "
324344 f"Use exact format: <filepath>\\ n<<<<<<< SEARCH\\ n...\\ n=======\\ n...\\ n>>>>>>> REPLACE"
325345 )
326346 print ("No blocks parsed, retrying..." )
347+ print (f" Response preview: { response [:200 ]} " )
327348 continue
328349
329350 modified , errors = apply_blocks (blocks )
330351 if errors :
331352 retry_context = f"{ len (modified )} applied, { len (errors )} failed:\n " + "\n " .join (errors )
332353 print (f"{ 'Partial' if modified else 'All failed' } : { len (errors )} error(s), retrying..." )
354+ for e in errors :
355+ print (f" ERROR: { e [:300 ]} " )
333356 continue
334357
335358 # Success
0 commit comments