fix: Handle missing crew_team_key column in agents query
- Remove crew_team_key from SELECT (column doesn't exist) - Use pop() to safely handle crew_team_key in data processing - This fixes 500 error on /api/agents/list endpoint
This commit is contained in:
@@ -435,7 +435,6 @@ async def list_agent_summaries(
|
|||||||
pm.slug AS primary_microdao_slug,
|
pm.slug AS primary_microdao_slug,
|
||||||
pm.district AS district,
|
pm.district AS district,
|
||||||
COALESCE(a.public_skills, ARRAY[]::text[]) AS public_skills,
|
COALESCE(a.public_skills, ARRAY[]::text[]) AS public_skills,
|
||||||
a.crew_team_key,
|
|
||||||
-- DAIS & Governance fields (A1, A2)
|
-- DAIS & Governance fields (A1, A2)
|
||||||
a.gov_level,
|
a.gov_level,
|
||||||
a.dais_identity_id,
|
a.dais_identity_id,
|
||||||
@@ -497,8 +496,9 @@ async def list_agent_summaries(
|
|||||||
|
|
||||||
data["public_skills"] = list(data.get("public_skills") or [])
|
data["public_skills"] = list(data.get("public_skills") or [])
|
||||||
|
|
||||||
# Populate crew_info
|
# Populate crew_info (crew_team_key column may not exist)
|
||||||
if data.get("crew_team_key"):
|
crew_team_key = data.pop("crew_team_key", None)
|
||||||
|
if crew_team_key:
|
||||||
# Try to find orchestrator team room for their primary microdao
|
# Try to find orchestrator team room for their primary microdao
|
||||||
# This is a bit expensive for list view, so maybe just return basic info
|
# This is a bit expensive for list view, so maybe just return basic info
|
||||||
data["crew_info"] = {
|
data["crew_info"] = {
|
||||||
|
|||||||
Reference in New Issue
Block a user