-
Notifications
You must be signed in to change notification settings - Fork 458
Open
Labels
Milestone
Description
Problem
The admin UI supports team_id scoping via /admin?team_id=..., but the HTMX partial endpoints for tools/resources/prompts don't accept team_id, and the templates don't pass it. As a result, once the HTMX tables load or paginate, they ignore the selected team and show all accessible items (owner/team/public).
Affected Endpoints
GET /admin/tools/partial— noteam_idparamGET /admin/resources/partial— noteam_idparamGET /admin/prompts/partial— noteam_idparamGET /admin/servers/partial— noteam_idparamGET /admin/gateways/partial— noteam_idparamGET /admin/a2a/partial— noteam_idparam
Root Cause
- The main admin page (
/admin) acceptsteam_idas a query parameter and filters data on initial load using_call_list_with_team_support() selected_team_idis passed to the template context (line 3009 in admin.py)- However, the HTMX
hx-getrequests inadmin.htmldo NOT includeteam_id - The partial endpoints do not accept
team_idas a parameter
Steps to Reproduce
- Navigate to
/admin?team_id=<TEAM_ID>#tools(same for resources/prompts) - Observe the table after HTMX loads or after pagination
- Items are not restricted to the selected team (team filter is lost)
Expected Behavior
HTMX partials should respect team_id so the view stays team-scoped across load/pagination/search.
Actual Behavior
HTMX partials ignore team_id and fall back to access-control scope only (owner + team visibility + public).
Suggested Fix
- Add optional
team_id: Optional[str] = Query(None)param to all partial endpoints - Apply team filtering in the query (consistent with existing admin UI team scoping)
- Propagate
selected_team_idin HTMXhx-getURLs and pagination controls inadmin.html:hx-get="{{ root_path }}/admin/tools/partial?page=1&per_page=20{% if selected_team_id %}&team_id={{ selected_team_id }}{% endif %}" - Include
team_idin pagination link generation within the partial endpoints