{"record":{"id":"b43e749bd5ca113d","repo":"bytedance/deer-flow","slug":"this-turn-can-no-longer-be-branched-from","errorCode":null,"errorMessage":"This turn can no longer be branched from.","messagePattern":"This turn can no longer be branched from\\.","errorType":"http","errorClass":"HTTPException","httpStatus":409,"severity":"error","filePath":"backend/app/gateway/routers/threads.py","lineNumber":271,"sourceCode":"            snapshot,\n            target_human_id,\n            max_depth=_BRANCH_HISTORY_RAW_SCAN_LIMIT,\n        )\n    except CheckpointParentMissingError:\n        thread_id = config.get(\"configurable\", {}).get(\"thread_id\", \"\")\n        logger.debug(\n            \"Could not resolve parent lineage for branch thread %s; falling back to history scan\",\n            sanitize_log_param(thread_id),\n            exc_info=True,\n        )\n    except CheckpointLineageError as exc:\n        thread_id = config.get(\"configurable\", {}).get(\"thread_id\", \"\")\n        logger.warning(\n            \"Rejected unsafe checkpoint lineage for branch thread %s\",\n            sanitize_log_param(thread_id),\n            exc_info=True,\n        )\n        raise HTTPException(status_code=409, detail=\"This turn can no longer be branched from.\") from exc\n\n    try:\n        history = await accessor.ahistory(config, limit=_BRANCH_HISTORY_RAW_SCAN_LIMIT)\n    except _CHECKPOINT_MODE_ERRORS as exc:\n        thread_id = config.get(\"configurable\", {}).get(\"thread_id\", \"\")\n        raise _checkpoint_mode_http_error(exc, thread_id) from exc\n    except Exception as exc:\n        thread_id = config.get(\"configurable\", {}).get(\"thread_id\", \"\")\n        logger.exception(\"Failed to scan replay checkpoint history for thread %s\", sanitize_log_param(thread_id))\n        raise HTTPException(status_code=500, detail=\"Failed to inspect checkpoint history\") from exc\n\n    replay_base, target_found = find_checkpoint_before_message_chronologically(history, target_human_id)\n    if not target_found:\n        logger.warning(\n            \"Could not locate branch user message %s in chronological history for thread %s\",\n            sanitize_log_param(target_human_id),\n            sanitize_log_param(config.get(\"configurable\", {}).get(\"thread_id\", \"\")),\n        )","sourceCodeStart":253,"sourceCodeEnd":289,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/backend/app/gateway/routers/threads.py#L253-L289","documentation":"Error \"This turn can no longer be branched from.\" thrown in bytedance/deer-flow.","triggerScenarios":"Thrown at backend/app/gateway/routers/threads.py:271 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Branch from a later, still-addressable turn in the conversation.","Reload the thread to get current checkpoint state before branching."],"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-15T22:17:37.221Z"}