{"record":{"id":"7247260354ed217d","repo":"bytedance/deer-flow","slug":"the-source-assistant-message-is-missing-an-id","errorCode":null,"errorMessage":"The source assistant message is missing an id","messagePattern":"The source assistant message is missing an id","errorType":"http","errorClass":"HTTPException","httpStatus":409,"severity":"error","filePath":"backend/app/gateway/routers/thread_runs.py","lineNumber":747,"sourceCode":"    latest_checkpoint_id = _checkpoint_configurable(latest_checkpoint).get(\"checkpoint_id\")\n    if not latest_checkpoint_id:\n        raise HTTPException(status_code=404, detail=f\"Thread {thread_id} has no checkpoint\")\n\n    messages = _checkpoint_messages(latest_checkpoint)\n    if _has_active_goal(latest_checkpoint):\n        raise HTTPException(status_code=409, detail=\"Cannot edit while a goal is active\")\n\n    _, source_human, _, source_ai, source_message_ids = _latest_editable_turn(messages, human_message_id)\n    source_text = get_original_user_content_text(_message_content(source_human), _message_additional_kwargs(source_human)).strip()\n    if normalized_text == source_text:\n        raise HTTPException(status_code=409, detail=\"Edited message is unchanged\")\n\n    source_human_id = _message_id(source_human)\n    source_ai_id = _message_id(source_ai)\n    if not source_human_id:\n        raise HTTPException(status_code=409, detail=\"The source user message is missing an id\")\n    if not source_ai_id:\n        raise HTTPException(status_code=409, detail=\"The source assistant message is missing an id\")\n\n    base_checkpoint_tuple = await _find_base_checkpoint_before_human(\n        thread_id,\n        source_human_id,\n        request,\n        head_checkpoint=latest_checkpoint,\n    )\n    target_run_id = await _find_target_run_id(thread_id, source_ai_id, source_ai, source_human, request)\n    source_record = await _require_successful_source_run(thread_id, target_run_id, request)\n    checkpoint = _checkpoint_response(base_checkpoint_tuple)\n    replacement_human_message_id = str(uuid.uuid4())\n    source_metadata = getattr(source_record, \"metadata\", None) or {}\n    existing_group_id = source_metadata.get(\"edit_version_group_id\") if isinstance(source_metadata, dict) else None\n    # Reserved for future edit-chain grouping across repeated edits of the same\n    # original prompt; current visibility still keys off regenerate_from_run_id.\n    edit_version_group_id = existing_group_id if isinstance(existing_group_id, str) and existing_group_id else source_human_id\n    metadata = {\n        \"replay_kind\": \"edit\",","sourceCodeStart":729,"sourceCodeEnd":765,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/backend/app/gateway/routers/thread_runs.py#L729-L765","documentation":"Error \"The source assistant message is missing an id\" thrown in bytedance/deer-flow.","triggerScenarios":"Thrown at backend/app/gateway/routers/thread_runs.py:747 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reload the thread history; the assistant message may lack an id due to a corrupted checkpoint.","If the checkpoint is damaged, start a new thread or branch from an earlier healthy checkpoint."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1dd6ba1acb03700589994b0366c5d1c7d05e2eff","analyzedAt":"2026-08-14T21:20:34.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}