Skip to content

Commit ebe7905

Browse files
Copilotnosredna123
andcommitted
Fix unreliable 'result' in locals() check by initializing result at start of try block
Co-authored-by: nosredna123 <[email protected]>
1 parent f9d9f44 commit ebe7905

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

baes/core/enhanced_runtime_kernel.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,9 @@ def _execute_coordination_plan(
801801

802802
while not task_success and retry_count <= max_retries:
803803
try:
804+
# Initialize result to avoid UnboundLocalError in exception handlers
805+
result = {}
806+
804807
# Show retry if this isn't the first attempt
805808
if retry_count > 0:
806809
simplified_name = self._get_simplified_task_name(task_name)
@@ -1288,7 +1291,7 @@ def _execute_coordination_plan(
12881291
{
12891292
"task": task_name,
12901293
"success": True, # Mark as success to continue
1291-
"result": result if 'result' in locals() else {},
1294+
"result": result,
12921295
"techlead_approved": True,
12931296
"force_accepted": True,
12941297
"force_accept_reason": f"Execution errors after {max_retries + 1} attempts",

0 commit comments

Comments
 (0)