{"record":{"id":"ccc0ab869892fbfd","repo":"bytedance/deer-flow","slug":"failed-to-update-thread-state","errorCode":null,"errorMessage":"Failed to update thread state","messagePattern":"Failed to update thread state","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"backend/app/gateway/routers/threads.py","lineNumber":1295,"sourceCode":"    reducer_fields = graph_reducer_channels(getattr(accessor, \"graph\", None))\n    if reducer_fields is None:\n        reducer_fields = THREAD_STATE_REDUCER_FIELDS\n    updates = {key: Overwrite(value) if key in reducer_fields else value for key, value in values.items()}\n    try:\n        async with reserve_checkpoint_write(request, thread_id, user_id=get_effective_user_id()):\n            updated_config = await accessor.aupdate(\n                read_config,\n                updates,\n                as_node=mutation_node,\n            )\n            snapshot = await accessor.aget(updated_config)\n    except ConflictError:\n        raise HTTPException(status_code=409, detail=\"Thread has a run in flight. Update state after the run finishes.\") from None\n    except _CHECKPOINT_MODE_ERRORS as exc:\n        raise _checkpoint_mode_http_error(exc, thread_id) from exc\n    except Exception:\n        logger.exception(\"Failed to update state for thread %s\", sanitize_log_param(thread_id))\n        raise HTTPException(status_code=500, detail=\"Failed to update thread state\")\n\n    if thread_store and body.values and \"title\" in body.values:\n        new_title = body.values[\"title\"]\n        if new_title:\n            try:\n                await thread_store.update_display_name(thread_id, new_title)\n            except Exception:\n                logger.debug(\"Failed to sync title to thread_meta for %s (non-fatal)\", sanitize_log_param(thread_id))\n\n    snapshot_config = snapshot.config or {}\n    checkpoint_id = snapshot_config.get(\"configurable\", {}).get(\"checkpoint_id\")\n    parent_config = snapshot.parent_config or {}\n    parent_checkpoint_id = parent_config.get(\"configurable\", {}).get(\"checkpoint_id\")\n    metadata = snapshot.metadata or {}\n    created_at = snapshot.created_at or metadata.get(\"created_at\", \"\")\n    tasks_raw = snapshot.tasks or ()\n    tasks = [{\"id\": getattr(task, \"id\", \"\"), \"name\": getattr(task, \"name\", \"\")} for task in tasks_raw]\n","sourceCodeStart":1277,"sourceCodeEnd":1313,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/backend/app/gateway/routers/threads.py#L1277-L1313","documentation":"Error \"Failed to update thread state\" thrown in bytedance/deer-flow.","triggerScenarios":"Thrown at backend/app/gateway/routers/threads.py:1295 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the Gateway logs for the underlying state update error.","Verify the payload only contains supported fields and the thread has no active run, then 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-15T22:17:37.221Z"}