Skip to content

Commit b31ce93

Browse files
committed
🐛 Bugfix: Agent import does not import max steps of agent run #1582
1 parent a7158b5 commit b31ce93

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

backend/database/agent_db.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,15 @@ def create_agent(agent_info, tenant_id: str, user_id: str):
7676
:param user_id:
7777
:return: Created agent object
7878
"""
79-
agent_info.update({
79+
info_with_metadata = dict(agent_info)
80+
info_with_metadata.setdefault("max_steps", 5)
81+
info_with_metadata.update({
8082
"tenant_id": tenant_id,
8183
"created_by": user_id,
8284
"updated_by": user_id,
83-
"max_steps": 5
8485
})
8586
with get_db_session() as session:
86-
new_agent = AgentInfo(**filter_property(agent_info, AgentInfo))
87+
new_agent = AgentInfo(**filter_property(info_with_metadata, AgentInfo))
8788
new_agent.delete_flag = 'N'
8889
session.add(new_agent)
8990
session.flush()

0 commit comments

Comments
 (0)