{"record":{"id":"505984deb7a895a1","repo":"OpenBMB/ChatDev","slug":"workflow-execution-cancelled","errorCode":null,"errorMessage":"Workflow execution cancelled","messagePattern":"Workflow execution cancelled","errorType":"exception","errorClass":"WorkflowCancelledError","httpStatus":null,"severity":"warning","filePath":"runtime/node/executor/base.py","lineNumber":146,"sourceCode":"        role: MessageRole,\n        content: MessageContent,\n        *,\n        source: str | None = None,\n        metadata: Dict[str, Any] | None = None,\n        preserve_role: bool = False,\n    ) -> Message:\n        meta = dict(metadata or {})\n        if source:\n            meta.setdefault(\"source\", source)\n        return Message(role=role, content=content, metadata=meta, preserve_role=preserve_role)\n\n    def _clone_messages(self, messages: List[Message]) -> List[Message]:\n        return [message.clone() for message in messages]\n\n    def _ensure_not_cancelled(self) -> None:\n        event = getattr(self.context, \"cancel_event\", None)\n        if event is not None and event.is_set():\n            raise WorkflowCancelledError(\"Workflow execution cancelled\")\n","sourceCodeStart":128,"sourceCodeEnd":147,"githubUrl":"https://github.com/OpenBMB/ChatDev/blob/4fb2db0ea90375ce1059f44fe03ffbd191a7a169/runtime/node/executor/base.py#L128-L147","documentation":"Cooperative-cancellation guard: before/inside each major executor step, if context.cancel_event is set, a WorkflowCancelledError is raised so the run stops promptly and cleanly.","triggerScenarios":"User or supervisor sets the cancel_event while a node is executing (between provider calls, tool batches, thinking/memory phases).","commonSituations":"UI stop button; workflow timeout policy cancelling long agent loops; parent workflow cancelling subgraph runs.","solutions":["Treat WorkflowCancelledError as a normal exit: do not retry, propagate or mark the run cancelled","If cancellation is premature, review what sets cancel_event (timeout, user action)","Clean up partial artifacts (files, threads) in a finally block on the calling side"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if context.cancel_event and context.cancel_event.is_set():\n    return  # skip before starting work","typeGuard":null,"tryCatchPattern":"try:\n    outputs = executor.execute(node, inputs)\nexcept WorkflowCancelledError:\n    mark_run_cancelled(); return","preventionTips":["Check cancel_event in your own loops around executor calls","Never retry on WorkflowCancelledError"],"tags":["cancellation","workflow-lifecycle"],"backgroundTag":"operation-cancelled","analyzedSha":"4fb2db0ea90375ce1059f44fe03ffbd191a7a169","analyzedAt":"2026-08-27T14:35:29.622Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}