Admin: Enable gateway filtering for search & fix selection persistence #1561
+1,896
−239
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes issue #1566
This PR adds gateway-based filtering support to Admin search endpoints for Tools, Resources, and Prompts, allowing filtering by one or more gateway IDs—including items with no gateway (
NULL).It also improves Admin UI clarity by updating the gateway label and fixes a selection persistence issue on the Add/Edit Virtual Server pages.
✅ Changes Introduced
🛠 API Enhancements – Gateway Filtering
Added a new optional
gateway_idquery parameter (comma-separated) to:admin_search_toolsadmin_search_resourcesadmin_search_promptsSupports:
"null"Updated:
📄 Endpoint docstrings
⚙️ SQL filtering logic to correctly handle:
NULLgateway values🎨 Admin UI Improvements
Updated the gateway filter label:
Clarifies that the option includes both REST and A2A gateways
🐞 Bug Fixes
Fixed tool/prompt/resource selection persistence in:
🔍 How to Test – Virtual Server (Selection Persistence)
Navigate to Admin → Virtual Server → Add/Edit page.
Apply a gateway filter using:
"null"to include items with no assigned gatewayVerify that the displayed results match the applied filter conditions.
Search for a tool, prompt, or resource and select one or more items.
Clear the search keyword from the search box.
Change the selected gateway ID and repeat the above steps.
Confirm that the selected tools, prompts, and resources persist correctly.