feat: don't expire on commit (#3384)

This commit is contained in:
cthomas
2025-07-17 13:50:10 -07:00
committed by GitHub
parent f4854e95cd
commit ce2fdf3669
2 changed files with 2 additions and 2 deletions

View File

@@ -78,7 +78,7 @@ class Message(SqlalchemyBase, OrganizationMixin, AgentMixin):
if self.text and not model.content:
model.content = [PydanticTextContent(text=self.text)]
# If there are no tool calls, set tool_calls to None
if len(self.tool_calls) == 0:
if self.tool_calls is None or len(self.tool_calls) == 0:
model.tool_calls = None
return model

View File

@@ -136,7 +136,7 @@ class DatabaseRegistry:
self._setup_pool_monitoring(async_engine, "default_async")
self._async_session_factories["default"] = async_sessionmaker(
expire_on_commit=True,
expire_on_commit=False,
close_resets_only=False,
autocommit=False,
autoflush=False,