feat: add virtual_key_id and user_id multi-select filters to MCP sessions - #5921
Conversation
|
|
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe PR adds virtual key and user ID filters across MCP session contracts, queries, HTTP parsing, API requests, URL state, and filter controls. It also adds optional user search registration and reformats MCP client form markup. ChangesMCP session identity filters
MCP client form markup cleanup
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant MCPSessionsFilterSidebar
participant MCPSessionsPage
participant mcpSessionsApi
participant MCPHTTPHandler
participant ConfigstoreRDB
MCPSessionsFilterSidebar->>MCPSessionsPage: update virtual key and user selections
MCPSessionsPage->>mcpSessionsApi: request sessions with selected filters
mcpSessionsApi->>MCPHTTPHandler: send comma-separated query parameters
MCPHTTPHandler->>ConfigstoreRDB: apply VirtualKeyIDs and UserIDs
ConfigstoreRDB-->>MCPSessionsPage: return filtered MCP sessions
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@ui/app/workspace/mcp-sessions/views/mcpSessionsFilterSidebar.tsx`:
- Around line 483-506: Pass the Virtual Key query error state from
useGetVirtualKeysQuery into SearchableCheckboxList at
ui/app/workspace/mcp-sessions/views/mcpSessionsFilterSidebar.tsx:483-506 and
render the list’s distinct error state. Do the same for the Users query at
ui/app/workspace/mcp-sessions/views/mcpSessionsFilterSidebar.tsx:530-555. Extend
UserSearchQueryResult in ui/lib/registries/userPicker.tsx:56-65 with the
error-state field so registered and fallback user-search hooks share the same
contract.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 860433e8-5173-451f-b78c-696da5559fea
📒 Files selected for processing (9)
framework/configstore/rdb.goframework/configstore/store.gotransports/bifrost-http/handlers/mcpsessions.goui/app/workspace/mcp-registry/views/mcpClientSheet.tsxui/app/workspace/mcp-sessions/page.tsxui/app/workspace/mcp-sessions/views/mcpSessionsFilterSidebar.tsxui/lib/registries/userPicker.tsxui/lib/store/apis/mcpSessionsApi.tsui/lib/types/mcpSessions.ts
569aa6e to
c80bf09
Compare
a2fd13b to
6dab3c7
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
c80bf09 to
a096a8a
Compare
6dab3c7 to
06551aa
Compare
Merge activity
|
The base branch was changed.
06551aa to
11ca207
Compare

Summary
Adds
virtual_key_idanduser_idas multi-select filter facets on the MCP Sessions list, allowing operators to narrow sessions down to specific virtual keys or users. The Users filter is enterprise-only (renders nothing in OSS builds where no user directory is available).Changes
VirtualKeyIDsandUserIDsfields toMCPSessionsFilterParamsin the configstore, with correspondingWHERE ... IN ?clauses applied inapplyMCPSessionFilters.virtual_key_idanduser_idas query parameters in the HTTP handler (parseMCPSessionsListQuery).MCPSessionsQueryParams(TypeScript types),buildMCPSessionsListParams(API layer), and the MCP Sessions page URL state to carry and serialize the new filter values.VirtualKeyFilterSectionto the filter sidebar: a lazy-loaded, searchable checkbox list backed by the existinguseGetVirtualKeysQueryhook, fetching one page at a time to handle large VK counts.UsersFilterSectionto the filter sidebar: mirrorsVirtualKeyFilterSectionbut uses a registry-injected search hook (getUserSearchQuery) so OSS builds render nothing while enterprise builds plug in their user directory.registerUserSearchQuery/getUserSearchQueryinui/lib/registries/userPicker.tsxalongside the existing single-select picker registry, following the same load-once contract.<div className="rounded-md border p-4">around the headersFormFieldinmcpClientSheet.tsx, and corrected indentation throughout that file.Type of change
Affected areas
How to test
virtual_key_id.user_id.virtual_key_idanduser_idarrays and survives a page reload.Breaking changes
Related issues
Security considerations
virtual_key_idanduser_idfilter values are passed as parameterizedIN ?clauses via GORM — no raw string interpolation. The Users filter section is gated behind an enterprise-only registry hook, so no user directory data is exposed in OSS builds.Checklist
docs/contributing/README.mdand followed the guidelines