Skip to content

Commit 5addaad

Browse files
guyernestclaude
andcommitted
debug(workflow): Add aggressive trace logging for dispatch
Added detailed trace logging to diagnose why execute_step results aren't being collected: - Log every _dispatch_step call with step_type and action presence - Log before calling execute_step - Log what execute_step returns (type and None check) - Log warning if execute_step returns None This will show us exactly what's happening when action steps (like extract) are executed inside sequences. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 21b1a50 commit 5addaad

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

lambda/tools/local-browser-agent/python/workflow_executor.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ async def run(self):
213213
async def _dispatch_step(self, step: Dict[str, Any]):
214214
"""Route step to appropriate handler based on type."""
215215
step_type = step.get("type", step.get("action"))
216+
print(f" [DISPATCH] step_type={step_type}, has_action={bool(step.get('action'))}", file=sys.stderr)
216217

217218
# Workflow control structures
218219
if step_type == "if":
@@ -231,7 +232,9 @@ async def _dispatch_step(self, step: Dict[str, Any]):
231232
self._execute_fail(step)
232233
# Action steps - delegate to executor
233234
elif step.get("action"):
235+
print(f" [DISPATCH] Calling execute_step for action: {step.get('action')}", file=sys.stderr)
234236
step_result = await self.executor.execute_step(step)
237+
print(f" [DISPATCH] execute_step returned: type={type(step_result)}, is_none={step_result is None}", file=sys.stderr)
235238
# Collect results for final output
236239
if step_result:
237240
print(f" → Collecting step result: {step_result.get('action', 'unknown')}, success={step_result.get('success')}", file=sys.stderr)
@@ -242,6 +245,8 @@ async def _dispatch_step(self, step: Dict[str, Any]):
242245
# Log extracted data if present
243246
if "data" in step_result:
244247
print(f" → Extracted data collected: {list(step_result['data'].keys())}", file=sys.stderr)
248+
else:
249+
print(f" [DISPATCH] WARNING: execute_step returned None or empty!", file=sys.stderr)
245250
else:
246251
raise ValueError(f"Unknown step type: {step_type}")
247252

0 commit comments

Comments
 (0)