Fix seeded workflow agent reference

This commit is contained in:
Hermes Agent
2026-06-08 15:13:16 +08:00
parent 0a857986f9
commit 6aba475726
+8 -1
View File
@@ -82,6 +82,13 @@ async def seed_database(db: AsyncSession) -> None:
db.add_all([admin, role, *permissions, *menus, provider, model, agent, workflow, team, announcement]) db.add_all([admin, role, *permissions, *menus, provider, model, agent, workflow, team, announcement])
await db.flush() await db.flush()
workflow.definition["nodes"][1]["data"]["agent_id"] = agent.id workflow.definition = {
"nodes": [
{"id": "start", "type": "start", "data": {}},
{"id": "plan", "type": "agent", "data": {"agent_id": agent.id}},
{"id": "end", "type": "end", "data": {}},
],
"edges": [],
}
team.members = [{"agent_id": agent.id, "role": "planner"}, {"agent_id": agent.id, "role": "reviewer"}] team.members = [{"agent_id": agent.id, "role": "planner"}, {"agent_id": agent.id, "role": "reviewer"}]
await db.commit() await db.commit()