Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
chore: use selectinload instead of joinedload in conversation query (#33014)
Eric Cao18e4ec73d6b1
diff --git a/api/controllers/console/app/conversation.py b/api/controllers/console/app/conversation.pyindex 5eb61493c38..74750981dd5 100644--- a/api/controllers/console/app/conversation.py+++ b/api/controllers/console/app/conversation.py@@ -5,7 +5,7 @@ from flask import abort, requestfrom flask_restx import Resource, fields, marshal_withfrom pydantic import BaseModel, Field, field_validatorfrom sqlalchemy import func, or_-from sqlalchemy.orm import joinedload+from sqlalchemy.orm import selectinloadfrom werkzeug.exceptions import NotFoundfrom controllers.console import console_ns@@ -376,8 +376,12 @@ class CompletionConversationApi(Resource):# FIXME, the type ignore in this fileif args.annotation_status == "annotated":- query = query.options(joinedload(Conversation.message_annotations)).join( # type: ignore- MessageAnnotation, MessageAnnotation.conversation_id == Conversation.id+ query = (+ query.options(selectinload(Conversation.message_annotations)) # type: ignore[arg-type]+ .join( # type: ignore+ MessageAnnotation, MessageAnnotation.conversation_id == Conversation.id+ )+ .distinct())elif args.annotation_status == "not_annotated":query = (@@ -511,8 +515,12 @@ class ChatConversationApi(Resource):match args.annotation_status:case "annotated":- query = query.options(joinedload(Conversation.message_annotations)).join( # type: ignore- MessageAnnotation, MessageAnnotation.conversation_id == Conversation.id+ query = (+ query.options(selectinload(Conversation.message_annotations)) # type: ignore[arg-type]+ .join( # type: ignore+ MessageAnnotation, MessageAnnotation.conversation_id == Conversation.id+ )+ .distinct())case "not_annotated":query = (