{"record":{"id":"c45ceeefed1c59e6","repo":"bytedance/deer-flow","slug":"no-feedback-found-for-this-run","errorCode":null,"errorMessage":"No feedback found for this run","messagePattern":"No feedback found for this run","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"info","filePath":"backend/app/gateway/routers/feedback.py","lineNumber":109,"sourceCode":"\n\n@router.delete(\"/{thread_id}/runs/{run_id}/feedback\")\n@require_permission(\"threads\", \"delete\", owner_check=True, require_existing=True)\nasync def delete_run_feedback(\n    thread_id: ThreadId,\n    run_id: str,\n    request: Request,\n) -> dict[str, bool]:\n    \"\"\"Delete the current user's feedback for a run.\"\"\"\n    user_id = await get_current_user(request)\n    feedback_repo = get_feedback_repo(request)\n    deleted = await feedback_repo.delete_by_run(\n        thread_id=thread_id,\n        run_id=run_id,\n        user_id=user_id,\n    )\n    if not deleted:\n        raise HTTPException(status_code=404, detail=\"No feedback found for this run\")\n    return {\"success\": True}\n\n\n@router.post(\"/{thread_id}/runs/{run_id}/feedback\", response_model=FeedbackResponse)\n@require_permission(\"threads\", \"write\", owner_check=True, require_existing=True)\nasync def create_feedback(\n    thread_id: ThreadId,\n    run_id: str,\n    body: FeedbackCreateRequest,\n    request: Request,\n) -> dict[str, Any]:\n    \"\"\"Submit feedback (thumbs-up/down) for a run.\"\"\"\n    if body.rating not in (1, -1):\n        raise HTTPException(status_code=400, detail=\"rating must be +1 or -1\")\n\n    user_id = await get_current_user(request)\n\n    # Validate run exists and belongs to thread","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/backend/app/gateway/routers/feedback.py#L91-L127","documentation":"Raised by the DELETE /threads/{thread_id}/runs/{run_id}/feedback endpoint when feedback_repo.delete_by_run() reports that no feedback record exists for the current user on that run. It is a 404 Not Found indicating the delete was a no-op — the user never submitted feedback (or already deleted it). This is an idempotency-report error, not a server failure.","triggerScenarios":"Calling DELETE /api/threads/{thread_id}/runs/{run_id}/feedback when the current user has no feedback row for that run: double-clicking the 'remove feedback' button, deleting feedback the UI already removed, or calling delete before any POST .../feedback was made for that user+run pair.","commonSituations":"Frontend optimistic UI that sends a delete without first checking local feedback state; stale UI after feedback was deleted in another tab or by a session-expired re-login as a different user; automated test suites deleting the same feedback twice in teardown.","solutions":["Treat 404 on this endpoint as success in the client (the desired state — no feedback — is achieved) instead of surfacing an error.","Check the current feedback state (GET the run's feedback) before issuing the delete, and disable the delete control when no feedback exists.","If double-deletes are common in your UI, debounce/guard the remove-feedback button while a delete request is in flight."],"exampleFix":"// before\nawait fetch(`/api/threads/${tid}/runs/${rid}/feedback`, { method: 'DELETE' });\nif (!res.ok) throw new Error('delete failed');\n\n// after\nconst res = await fetch(`/api/threads/${tid}/runs/${rid}/feedback`, { method: 'DELETE' });\nif (res.status === 404) { /* already gone — desired state */ }\nelse if (!res.ok) throw new Error(`delete failed: ${res.status}`);","handlingStrategy":"validation","validationCode":"// Only delete when the run currently has the user's feedback\nconst fb = await getUserFeedbackForRun(threadId, runId);\nif (!fb) return { success: true }; // nothing to delete — desired state\nawait del(`/api/threads/${threadId}/runs/${runId}/feedback`);","typeGuard":null,"tryCatchPattern":"try { await del(url); } catch (e) { if (e.status === 404) return OK_ALREADY_GONE; throw e; }","preventionTips":["Treat 404 on feedback delete as idempotent success","Disable the remove-feedback control when no feedback exists","Guard against double-clicks with an in-flight flag"],"tags":["http-404","feedback","idempotency","rest-api"],"backgroundTag":null,"analyzedSha":"1dd6ba1acb03700589994b0366c5d1c7d05e2eff","analyzedAt":"2026-08-14T21:20:34.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}