Skip to content

Fix DB error: Could not find field at updateOneLibraryAgent.data.Agent.connect #9250

Closed
@Pwuts

Description

Database error updating agent version in library: Could not find field at updateOneLibraryAgent.data.Agent.connect

Seems to be introduced by #9211.

Culprit:

async def update_agent_version_in_library(
     user_id: str, agent_id: str, agent_version: int
 ) -> None:
     """
     Updates the agent version in the library
     """
     try:
         await prisma.models.LibraryAgent.prisma().update(
             where={
                 "userId": user_id,
                 "agentId": agent_id,
                 "useGraphIsActiveVersion": True,
             },
             data=prisma.types.LibraryAgentUpdateInput(
                 Agent=prisma.types.AgentGraphUpdateOneWithoutRelationsInput(
                     connect=prisma.types.AgentGraphWhereUniqueInput(
                         id=agent_id,
                         version=agent_version,
                     ),
                 ),
             ),
         )
     except prisma.errors.PrismaError as e:
         logger.error(f"Database error updating agent version in library: {str(e)}")



         raise backend.server.v2.store.exceptions.DatabaseError(
             "Failed to update agent version in library"
         ) from e

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions