{"record":{"id":"01e7a11ff34be5f8","repo":"iflytek/astron-agent","slug":"23900-event-not-found-01e7a1","errorCode":"23900","errorMessage":"Event not found","messagePattern":"Event not found","errorType":"error_code","errorClass":"CustomException","httpStatus":null,"severity":"error","filePath":"core/workflow/api/v1/chat/open.py","lineNumber":126,"sourceCode":"    \"\"\"\n    Resume an interrupted chat event\n    :param request: Resume request data\n    :return: Streaming or JSON response\n    \"\"\"\n    event_id = request.event_id\n    event_type = request.event_type\n    content = request.content\n    span = Span(app_id=\"\", uid=\"\", chat_id=\"\")\n    m = Meter()\n\n    with span.start(\n        attributes={\"event_id\": event_id},\n    ) as span_context:\n\n        try:\n            event: Optional[Event] = EventRegistry().get_event(event_id=event_id)\n            if event is None:\n                raise CustomException(\n                    CodeEnum.EVENT_REGISTRY_NOT_FOUND_ERROR,\n                    \"Event not found\",\n                )\n            if EventRegistry().check_event_lock(event_id=event_id):\n                raise CustomException(CodeEnum.EVENT_REGISTRY_LOCK_ERROR)\n            EventRegistry().lock_event(event_id=event_id, sid=span.sid)\n\n            m.set_label(\"flow_id\", event.flow_id)\n            m.set_label(\"app_id\", event.app_id)\n\n            span.set_attribute(\"flow_id\", event.flow_id)\n            span.app_id = event.app_id\n            span.uid = event.uid\n            span.chat_id = event.chat_id\n\n            await span_context.add_info_events_async(\n                {\"resume_event\": json.dumps(event.dict(), ensure_ascii=False)}\n            )","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/core/workflow/api/v1/chat/open.py#L108-L144","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","solutions":["Confirm the event_id came from the current, still-open conversation (e.g. from the interrupt response payload).","Check the cache service (Redis) is up and holds the event_lock/event keys; restart of the cache invalidates all registered events.","If the conversation already finished, start a new chat run instead of resuming the old event_id.","Re-trigger the workflow so a fresh event is registered, then resume with the new event_id."],"exampleFix":"# before\nawait resume_open(event_id=saved_event_id)  # from last week's session\n\n# after\nif EventRegistry().get_event(event_id=saved_event_id) is None:\n    event_id = await start_new_chat_run(flow_id)  # re-register a fresh event\nawait resume_open(event_id=event_id)","handlingStrategy":"try-catch","validationCode":"if EventRegistry().get_event(event_id=event_id) is None:\n    raise ValueError(f\"event {event_id} not registered; start a new run\")","typeGuard":"def event_exists(event_id: str) -> bool:\n    return EventRegistry().get_event(event_id=event_id) is not None","tryCatchPattern":"try:\n    await resume_open(event_id=event_id)\nexcept CustomException as e:\n    if e.code == CodeEnum.EVENT_REGISTRY_NOT_FOUND_ERROR.code:\n        await start_new_chat_run(flow_id)  # registry entry expired/missing\n    else:\n        raise","preventionTips":["Resume promptly after the interrupt; registry entries have a timeout","Persist flow_id/app_id so you can restart a run when the event_id is gone","Monitor cache service health; a Redis restart invalidates all registered events"],"tags":["workflow","cache","event-registry","not-found"],"backgroundTag":"record-not-found","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"}