Auto-create AgentConfig for all agents (not just when explicitly passed)
Some checks failed
Deploy Tracker / deploy (push) Failing after 4s

Prevents silent fallback to chat_listen=ALL when config is missing.
This commit is contained in:
markov 2026-02-27 11:10:40 +01:00
parent d6ebb56004
commit f07bbfe6fc

View File

@ -112,14 +112,15 @@ async def create_member(req: MemberCreate, db: AsyncSession = Depends(get_db)):
db.add(member)
await db.flush()
if req.agent_config and req.type == MemberType.AGENT:
if req.type == MemberType.AGENT:
ac = req.agent_config
config = AgentConfig(
member_id=member.id,
capabilities=req.agent_config.capabilities,
chat_listen=req.agent_config.chat_listen,
task_listen=req.agent_config.task_listen,
prompt=req.agent_config.prompt,
model=req.agent_config.model,
capabilities=ac.capabilities if ac else [],
chat_listen=ac.chat_listen if ac else ListenMode.ALL,
task_listen=ac.task_listen if ac else ListenMode.ALL,
prompt=ac.prompt if ac else None,
model=ac.model if ac else None,
)
db.add(config)