JatinAutonomousLabs commited on
Commit
045bb0b
·
verified ·
1 Parent(s): 3cd135e

Update app_gradio.py

Browse files
Files changed (1) hide show
  1. app_gradio.py +9 -4
app_gradio.py CHANGED
@@ -347,7 +347,7 @@ def execute_main_task(history, state, budget):
347
  # Increment estimated cost per node execution
348
  estimated_cost += cost_per_loop
349
 
350
- # Replace the problematic merge logic with this corrected version:
351
  for key, value in node_output.items():
352
  if key == 'execution_path':
353
  # Execution path should accumulate
@@ -356,8 +356,10 @@ def execute_main_task(history, state, budget):
356
  aggregated_state[key] = current_path + value
357
  else:
358
  aggregated_state[key] = current_path + [value]
359
- elif key in ['max_loops', 'rework_cycles', 'current_cost', 'approved', 'budget_exceeded']:
360
- # These should be single values, not lists - take the latest
 
 
361
  aggregated_state[key] = value
362
  elif key == 'status_updates':
363
  # Status updates should accumulate as a list
@@ -366,10 +368,13 @@ def execute_main_task(history, state, budget):
366
  aggregated_state[key] = current + value
367
  else:
368
  aggregated_state[key] = current + [value]
 
 
 
369
  else:
370
  # Default: replace with new value
371
  aggregated_state[key] = value
372
-
373
  # Update current cost in state
374
  aggregated_state["current_cost"] = estimated_cost
375
 
 
347
  # Increment estimated cost per node execution
348
  estimated_cost += cost_per_loop
349
 
350
+ # Replace the state merging logic around line 260-280 with:
351
  for key, value in node_output.items():
352
  if key == 'execution_path':
353
  # Execution path should accumulate
 
356
  aggregated_state[key] = current_path + value
357
  else:
358
  aggregated_state[key] = current_path + [value]
359
+ elif key in ['max_loops', 'rework_cycles', 'current_cost', 'approved',
360
+ 'budget_exceeded', 'pragmatistReport', 'governanceReport',
361
+ 'complianceReport', 'observerReport', 'knowledgeInsights']:
362
+ # These should be single values, not accumulate
363
  aggregated_state[key] = value
364
  elif key == 'status_updates':
365
  # Status updates should accumulate as a list
 
368
  aggregated_state[key] = current + value
369
  else:
370
  aggregated_state[key] = current + [value]
371
+ elif key == 'pmPlan' or key == 'experimentResults':
372
+ # These should be replaced, not accumulated
373
+ aggregated_state[key] = value
374
  else:
375
  # Default: replace with new value
376
  aggregated_state[key] = value
377
+
378
  # Update current cost in state
379
  aggregated_state["current_cost"] = estimated_cost
380