Change the is_resumption field in WorkflowStarted event into reason (vibe-kanban 19ac040e)

Reason should be an enumeration with only one member `resumption` currently.

Please update these part of events:

- Graph / Engine Event (GraphRunStartedEvent)
- Queue event (QueueWorkflowStartedEvent)
- SSE response event (WorkflowStartStreamResponse)

Besides, you should remove the `is_resumption` flag for `node_started` events; including:

- Queue Event (`QueueNodeStartedEvent`)
- SSE Event (`NodeStartStreamResponse`)
- Node event (`NodeRunStartedEvent`)

After finishing the changes above, adjust related tests.
You should run the affected tests and ensure they can pass. (You should use `uv run pytest` to run tests)
This commit is contained in:
QuantumGhost
2026-01-18 21:00:25 +08:00
parent 7bc7a8d0ab
commit afdf2397f2
21 changed files with 59 additions and 227 deletions

View File

@ -13,6 +13,7 @@ from typing import TYPE_CHECKING, cast, final
from flask import Flask, current_app
from core.workflow.entities.workflow_start_reason import WorkflowStartReason
from core.workflow.enums import NodeExecutionType
from core.workflow.graph import Graph
from core.workflow.graph_events import (
@ -235,7 +236,9 @@ class GraphEngine:
self._graph_execution.paused = False
self._graph_execution.pause_reasons = []
start_event = GraphRunStartedEvent(is_resumption=is_resume)
start_event = GraphRunStartedEvent(
reason=WorkflowStartReason.RESUMPTION if is_resume else WorkflowStartReason.INITIAL,
)
self._event_manager.notify_layers(start_event)
yield start_event