iflytek/astron-agent · error · CustomException

23900

23900

Error message

Event not found

What it means

Raised by resume_open when EventRegistry().get_event(event_id) returns None, meaning no event is registered under the given event_id in the cache-backed registry. Events only live in the registry while a chat/workflow run is in progress (or until timeout), so an unknown id is a not-found condition (code 23900).

Solutions

  1. Confirm the event_id came from the current, still-open conversation (e.g. from the interrupt response payload).
  2. Check the cache service (Redis) is up and holds the event_lock/event keys; restart of the cache invalidates all registered events.
  3. If the conversation already finished, start a new chat run instead of resuming the old event_id.
  4. Re-trigger the workflow so a fresh event is registered, then resume with the new event_id.

Example fix

# before
await resume_open(event_id=saved_event_id)  # from last week's session

# after
if EventRegistry().get_event(event_id=saved_event_id) is None:
    event_id = await start_new_chat_run(flow_id)  # re-register a fresh event
await resume_open(event_id=event_id)
Defensive patterns

Strategy: try-catch

Validate before calling

if EventRegistry().get_event(event_id=event_id) is None:
    raise ValueError(f"event {event_id} not registered; start a new run")

Type guard

def event_exists(event_id: str) -> bool:
    return EventRegistry().get_event(event_id=event_id) is not None

Try / catch

try:
    await resume_open(event_id=event_id)
except CustomException as e:
    if e.code == CodeEnum.EVENT_REGISTRY_NOT_FOUND_ERROR.code:
        await start_new_chat_run(flow_id)  # registry entry expired/missing
    else:
        raise

Prevention

When it happens

Trigger: POSTing to the open-chat resume endpoint with an event_id that was never registered, has expired (event.timeout passed), or whose registry entry was deleted after the run finished.

Common situations: Redis/cache restart wiped the event registry; client retries resume after the conversation already completed and the entry was cleaned up; typo'd or stale event_id from an old session; TTL expiration on long-idle conversations.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


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

Appendix: source

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

    """
    Resume an interrupted chat event
    :param request: Resume request data
    :return: Streaming or JSON response
    """
    event_id = request.event_id
    event_type = request.event_type
    content = request.content
    span = Span(app_id="", uid="", chat_id="")
    m = Meter()

    with span.start(
        attributes={"event_id": event_id},
    ) as span_context:

        try:
            event: Optional[Event] = EventRegistry().get_event(event_id=event_id)
            if event is None:
                raise CustomException(
                    CodeEnum.EVENT_REGISTRY_NOT_FOUND_ERROR,
                    "Event not found",
                )
            if EventRegistry().check_event_lock(event_id=event_id):
                raise CustomException(CodeEnum.EVENT_REGISTRY_LOCK_ERROR)
            EventRegistry().lock_event(event_id=event_id, sid=span.sid)

            m.set_label("flow_id", event.flow_id)
            m.set_label("app_id", event.app_id)

            span.set_attribute("flow_id", event.flow_id)
            span.app_id = event.app_id
            span.uid = event.uid
            span.chat_id = event.chat_id

            await span_context.add_info_events_async(
                {"resume_event": json.dumps(event.dict(), ensure_ascii=False)}
            )

View on GitHub (pinned to 5e758547a8)