You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: get_accessible_agents() called with wrong signature in monitoring router — 500 for non-admin fleet status #682
GET /api/ops/fleet/status throws a 500 TypeError for non-admin users because monitoring.py calls get_accessible_agents() with the old two-argument signature (email, agent_names). The function was refactored to accept a single User object, and every other call site was updated — only monitoring.py:104 was missed. Admin users are unaffected (they bypass the call).
P2 — fleet status is broken for non-admin users; admins see it fine
Error
File "/app/routers/monitoring.py", line 104, in get_fleet_status
accessible = get_accessible_agents(current_user.email, all_agent_names)
TypeError: get_accessible_agents() takes 1 positional argument but 2 were given
Location
File: src/backend/routers/monitoring.py
Line: 104
Function: get_fleet_status
Root Cause
get_accessible_agents was refactored in services/agent_service/helpers.py to accept (current_user: User) — it now fetches the agent list internally via list_all_agents_fast() rather than receiving it as a parameter. All call sites in agents.py, notifications.py, systems.py, fleet.py, and activities.py were updated to get_accessible_agents(current_user). The call in monitoring.py:104 was not updated.
Reproduction Steps
Create a non-admin user account
Log in as that user
Call GET /api/ops/fleet/status (or open the Fleet / Dashboard page in the frontend)
Observe 500 Internal Server Error with TypeError: get_accessible_agents() takes 1 positional argument but 2 were given
Admin users are unaffected — the branch at line ~101 (if current_user.role != "admin":) bypasses the call for admins.
Suggested Fix
In src/backend/routers/monitoring.py, replace the stale two-argument call with the current signature:
# REMOVE the separate agent list pre-fetch (monitoring.py already builds all_agents above)# and replace lines ~101-107 with:ifcurrent_user.role!="admin":
accessible=get_accessible_agents(current_user)
agent_names= [a["name"] forainaccessible]
else:
agent_names=all_agent_names
get_accessible_agents(current_user) already calls list_all_agents_fast() internally, so the pre-fetched all_agent_names list can be dropped from the non-admin branch (admins still use all_agent_names directly).
Activity
fix(monitoring): correct get_accessible_agents call signature (#682)
fix(monitoring): correct get_accessible_agents call signature (#682) (#…
vybe commentedon Jun 1, 2026
Shipped in v0.6.0 (released via #998).
Release: v0.6.1 (#1171)