{"record":{"id":"d3510321ca1aeaa0","repo":"iflytek/astron-agent","slug":"23903-asynchronous-events-are-not-supported-for-resume","errorCode":"23903","errorMessage":"Asynchronous events are not supported for resume","messagePattern":"Asynchronous events are not supported for resume","errorType":"error_code","errorClass":"CustomException","httpStatus":null,"severity":"error","filePath":"core/workflow/api/v1/chat/open.py","lineNumber":170,"sourceCode":"            # Input audit\n            with session_getter(auto_commit=False) as session:\n                app_info = await app_service.get_info(event.app_id, session, span)\n                audit_policy_value = app_info.audit_policy\n            if audit_policy_value == AppAuditPolicy.AGENT_PLATFORM.value:\n                await audit_service.input_audit(content, span)\n\n            await EventRegistry().write_resume_data(\n                queue_name=event.get_node_q_name(),\n                data=json.dumps(\n                    {\"event_type\": event_type, \"content\": content}, ensure_ascii=False\n                ),\n                expire_time=event.timeout,\n            )\n\n            if event.is_async:\n                if EventRegistry().check_event_lock(event_id=event_id):\n                    EventRegistry().unlock_event(event_id=event_id)\n                raise CustomException(\n                    CodeEnum.EVENT_REGISTRY_NOT_SUPPORT_ERROR,\n                    \"Asynchronous events are not supported for resume\",\n                )\n\n            return await Streaming.send(\n                chat_service.chat_resume_response_stream(\n                    span=span_context,\n                    event_id=event_id,\n                    audit_policy=audit_policy_value,\n                    is_release=True,\n                ),\n                StreamingResponse if event.is_stream else JSONResponse,\n            )\n\n        except CustomException as err:\n            span_context.record_exception(err)\n            m.in_error_count(err.code, span=span_context)\n            return await Streaming.send_error(","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/core/workflow/api/v1/chat/open.py#L152-L188","documentation":"resume_open refuses to resume events flagged is_async, because asynchronous events cannot be continued through the streaming resume path. Before raising, the code releases any event lock it acquired (code 23903, EVENT_REGISTRY_NOT_SUPPORT_ERROR). This is an unsupported-operation guard, not a state corruption.","triggerScenarios":"Calling the resume endpoint for a chat event that was created as an async event (event.is_async == True), e.g. an async-triggered workflow run.","commonSituations":"Client mixes up the async and sync chat endpoints and tries to 'resume' a fire-and-forget async run; an async event's id is reused where a synchronous interrupt-resume flow was expected.","solutions":["Check event.is_async before attempting resume and route async events to their own result/notification mechanism.","Use the appropriate async event polling/callback API instead of the streaming resume endpoint.","Trigger a new synchronous chat run if an interactive interrupt/resume cycle is required.","If the event should be resumable, recreate it as a synchronous (non-async) event."],"exampleFix":"# before\nawait resume_open(event_id=event_id)  # may be async\n\n# after\nevent = EventRegistry().get_event(event_id=event_id)\nif event and not event.is_async:\n    await resume_open(event_id=event_id)\nelse:\n    result = await poll_async_event_result(event_id)","handlingStrategy":"validation","validationCode":"event = EventRegistry().get_event(event_id=event_id)\nif event is not None and event.is_async:\n    raise ValueError(f\"event {event_id} is async; use the async result API\")","typeGuard":"def is_sync_resumable(event) -> bool:\n    return event is not None and not event.is_async","tryCatchPattern":"try:\n    await resume_open(event_id=event_id)\nexcept CustomException as e:\n    if e.code == CodeEnum.EVENT_REGISTRY_NOT_SUPPORT_ERROR.code:\n        result = await poll_async_event_result(event_id)\n    else:\n        raise","preventionTips":["Record whether an event came from an async or sync chat flow and keep separate resume paths","Never reuse async event ids with the streaming resume endpoint","Prefer creating synchronous runs when an interactive interrupt/resume cycle is required"],"tags":["workflow","async","unsupported-operation","resume"],"backgroundTag":"operation-not-supported","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}