fix(sessions): terminalize session on workflow completion
DefaultSessionReducer skipped WorkflowCompletedEvent to avoid terminalizing on freestyle planning's mid-session completion, but that left execution/normal completions stuck ACTIVE forever — headless watchers and approval loops never saw a terminal state. Add workflowId to WorkflowCompletedEvent (defaulted for replay compat), pass graph.id at all completeWorkflow sites, and terminalize to COMPLETED unless it's the freestyle_planning handoff. Correct stale tests that pinned the ACTIVE-forever behavior.
This commit is contained in:
@@ -59,6 +59,6 @@ class SessionReplayTest {
|
||||
|
||||
val state = replayer.rebuild(sessionId)
|
||||
|
||||
assertEquals(SessionStatus.CREATED, state.status)
|
||||
assertEquals(SessionStatus.COMPLETED, state.status)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ class TransitionReplayIntegrationTest {
|
||||
val state = replayer.rebuild(sessionId)
|
||||
|
||||
assertEquals(
|
||||
SessionStatus.ACTIVE,
|
||||
SessionStatus.COMPLETED,
|
||||
state.status
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user