iflytek/astron-agent · error · CustomException

23903

23903

Error message

Asynchronous events are not supported for resume

What it means

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.

Solutions

  1. Check event.is_async before attempting resume and route async events to their own result/notification mechanism.
  2. Use the appropriate async event polling/callback API instead of the streaming resume endpoint.
  3. Trigger a new synchronous chat run if an interactive interrupt/resume cycle is required.
  4. If the event should be resumable, recreate it as a synchronous (non-async) event.

Example fix

# before
await resume_open(event_id=event_id)  # may be async

# after
event = EventRegistry().get_event(event_id=event_id)
if event and not event.is_async:
    await resume_open(event_id=event_id)
else:
    result = await poll_async_event_result(event_id)
Defensive patterns

Strategy: validation

Validate before calling

event = EventRegistry().get_event(event_id=event_id)
if event is not None and event.is_async:
    raise ValueError(f"event {event_id} is async; use the async result API")

Type guard

def is_sync_resumable(event) -> bool:
    return event is not None and not event.is_async

Try / catch

try:
    await resume_open(event_id=event_id)
except CustomException as e:
    if e.code == CodeEnum.EVENT_REGISTRY_NOT_SUPPORT_ERROR.code:
        result = await poll_async_event_result(event_id)
    else:
        raise

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/d3510321ca1aeaa0. Report an issue: GitHub.

Appendix: source

Thrown at core/workflow/api/v1/chat/open.py:170

            # Input audit
            with session_getter(auto_commit=False) as session:
                app_info = await app_service.get_info(event.app_id, session, span)
                audit_policy_value = app_info.audit_policy
            if audit_policy_value == AppAuditPolicy.AGENT_PLATFORM.value:
                await audit_service.input_audit(content, span)

            await EventRegistry().write_resume_data(
                queue_name=event.get_node_q_name(),
                data=json.dumps(
                    {"event_type": event_type, "content": content}, ensure_ascii=False
                ),
                expire_time=event.timeout,
            )

            if event.is_async:
                if EventRegistry().check_event_lock(event_id=event_id):
                    EventRegistry().unlock_event(event_id=event_id)
                raise CustomException(
                    CodeEnum.EVENT_REGISTRY_NOT_SUPPORT_ERROR,
                    "Asynchronous events are not supported for resume",
                )

            return await Streaming.send(
                chat_service.chat_resume_response_stream(
                    span=span_context,
                    event_id=event_id,
                    audit_policy=audit_policy_value,
                    is_release=True,
                ),
                StreamingResponse if event.is_stream else JSONResponse,
            )

        except CustomException as err:
            span_context.record_exception(err)
            m.in_error_count(err.code, span=span_context)
            return await Streaming.send_error(

View on GitHub (pinned to 5e758547a8)