ciyidogan commited on
Commit
14d9f68
·
verified ·
1 Parent(s): 89a643d

Update state_orchestrator.py

Browse files
Files changed (1) hide show
  1. state_orchestrator.py +3 -3
state_orchestrator.py CHANGED
@@ -482,7 +482,7 @@ class StateOrchestrator:
482
  Transition to a new state with validation
483
  """
484
  try:
485
- # Get session context (DÜZELTME: _sessions yerine sessions)
486
  context = self.sessions.get(session_id)
487
  if not context:
488
  log_info(f"❌ Session not found for state transition | session_id={session_id}")
@@ -503,12 +503,12 @@ class StateOrchestrator:
503
 
504
  log_info(f"✅ State transition | session_id={session_id}, {old_state.value} → {new_state.value}")
505
 
506
- # Emit state transition event
507
  await self.event_bus.publish(
508
  Event(
509
  type=EventType.STATE_TRANSITION,
510
  data={
511
- "old_state": old_state.value,
512
  "new_state": new_state.value,
513
  "timestamp": datetime.utcnow().isoformat()
514
  },
 
482
  Transition to a new state with validation
483
  """
484
  try:
485
+ # Get session context
486
  context = self.sessions.get(session_id)
487
  if not context:
488
  log_info(f"❌ Session not found for state transition | session_id={session_id}")
 
503
 
504
  log_info(f"✅ State transition | session_id={session_id}, {old_state.value} → {new_state.value}")
505
 
506
+ # Emit state transition event with correct field names
507
  await self.event_bus.publish(
508
  Event(
509
  type=EventType.STATE_TRANSITION,
510
  data={
511
+ "old_state": old_state.value, # Backend uses old_state/new_state
512
  "new_state": new_state.value,
513
  "timestamp": datetime.utcnow().isoformat()
514
  },