{"record":{"id":"451f276f4b149d29","repo":"bytedance/deer-flow","slug":"str-exc","errorCode":null,"errorMessage":"str(exc)","messagePattern":"str\\(exc\\)","errorType":"http","errorClass":"HTTPException","httpStatus":422,"severity":"error","filePath":"backend/app/gateway/routers/threads.py","lineNumber":534,"sourceCode":"    branched_from_message_id: str\n    workspace_clone_mode: str\n    # \"seeded\" | \"skipped_empty\" | \"failed\" — whether the parent history was\n    # copied into the branch's run-event feed (see branch_thread).\n    history_seed_mode: str\n\n\n# ---------------------------------------------------------------------------\n# Helpers\n# ---------------------------------------------------------------------------\n\n\ndef _delete_thread_data(thread_id: str, paths: Paths | None = None, *, user_id: str | None = None) -> ThreadDeleteResponse:\n    \"\"\"Delete local persisted filesystem data for a thread.\"\"\"\n    path_manager = paths or get_paths()\n    try:\n        path_manager.delete_thread_dir(thread_id, user_id=user_id)\n    except ValueError as exc:\n        raise HTTPException(status_code=422, detail=str(exc)) from exc\n    except FileNotFoundError:\n        # Not critical — thread data may not exist on disk\n        logger.debug(\"No local thread data to delete for %s\", sanitize_log_param(thread_id))\n        return ThreadDeleteResponse(success=True, message=f\"No local data for {thread_id}\")\n    except Exception as exc:\n        logger.exception(\"Failed to delete thread data for %s\", sanitize_log_param(thread_id))\n        raise HTTPException(status_code=500, detail=\"Failed to delete local thread data.\") from exc\n\n    logger.info(\"Deleted local thread data for %s\", sanitize_log_param(thread_id))\n    return ThreadDeleteResponse(success=True, message=f\"Deleted local thread data for {thread_id}\")\n\n\nasync def _fetch_raw_pending_writes(checkpointer: Any, config: dict[str, Any]) -> list[Any]:\n    \"\"\"Fetch pending writes attached to a specific checkpoint.\n\n    Snapshot ``tasks`` only reflect writes that were pending while a task was\n    still scheduled; writes attached to the latest checkpoint afterwards\n    (rollback reattachment, worker error fallback) never surface there, so the","sourceCodeStart":516,"sourceCodeEnd":552,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/backend/app/gateway/routers/threads.py#L516-L552","documentation":"Error \"str(exc)\" thrown in bytedance/deer-flow.","triggerScenarios":"Thrown at backend/app/gateway/routers/threads.py:534 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the Gateway logs for the full exception behind str(exc).","Verify the request parameters (thread id, pagination cursor) are valid and retry."],"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"}