Spaces:
Building
Building
Update state_orchestrator.py
Browse files- 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
|
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 |
},
|