Repository navigation
feat(site/src): use the search filter on the AI Gateway sessions list - #31040
Merged
Merged
Conversation
Replace the sessions list search box and User, Provider, Client, and Model dropdowns with the FilterBudugbox search filter used on the Workspaces page. Each former dropdown becomes a filter category. The date range keeps its own picker; its bounds are kept out of the search input and merged back into the query on change.
tracyjohnsonux
added a commit
that referenced
this pull request
Oct 20, 2026
Places the Columns menu beside the new search filter and updates the view test for the filter's new props and auth requirement.
…lter # Conflicts: # site/src/api/queries/aiBridge.ts
…sessions list The sessions search API does not filter by organization yet, so the token defaults to the default organization, shows as a chip, and is left out of the request.
Resolve the sessions filter story conflict and adapt its shared option loaders and cache keys to the current filter API. Generated by Coder Agents on behalf of Jake Howell (@jakehwll).
mollymaefraser
added a commit
that referenced
this pull request
Nov 19, 2026
…32260) Adds an organization filter to the AI Gateway sessions list, using the `organization` search key added in #32057. Choosing an organization adds `organization:<name>` to the sessions query, so the list shows sessions with at least one interception attributed to that organization. The filter is a new `OrganizationFilter` in `pages/AIBridgePage/filters/`, shaped like the provider, client and model filters, with options from the shared `getOrganizationFilterOptions` helper (the same source as the Connection Logs and Audit filters). The shared `useOrganizationsFilterMenu` it first reused was removed in #32367. It is shown only when `useDashboard().showOrganizations` is true, so single-organization deployments see no change. The AI Gateway audit docs mention the new filter. Refs AIGOV-754. Stacked on #32057. ## Open questions for reviewers - **Permission behind the org list:** the menu lists only organizations where the user can read **audit logs** (`organizationCheck` in `filters/OrganizationFilter.tsx`), not AI Gateway interceptions. Owners and auditors, who can see this page today, have both. A custom role that can see sessions but not audit logs would get an empty list. Connection Logs has the same behavior. Is this acceptable, or should it check AI Gateway interceptions instead (a one-line change)? - **#31040 (Tracy):** that draft reworks this filter bar and already has an Organization option. This PR adds the filter to the current bar; if #31040 lands first, this moves into it. ## Notes for reviewers - **Tests:** `ListSessionsPage.test.tsx` checks that picking an organization sends `organization:<name>` in the request. The `WithOrganizations` story shows the opened menu, and `Default` shows the bar without it. Hiding the filter on single-org deployments has no Vitest test, because FE1 does not allow presence assertions. It is the same one-line `showOrganizations` check as Connection Logs. - The filter starts at "All organizations", not the default organization. - The cost shown for a session is the whole session's cost, even with the filter on, as agreed for AIGOV-754. <details> <summary>Decisions and plan</summary> - **Scope (call with Sas and Susana, 13 Nov):** filter only, no Organization column. No backend change for cost: show the whole session's cost, not per org. Org logic is per page. - **Approach:** build on the current filter bar rather than wait for #31040, which is a draft and conflicts with `main`. Follow the Connection Logs pattern (`ConnectionLogPage.tsx`, `ConnectionLogFilter.tsx`). - **Stack:** #32057 (backend) → this PR (list filter) → follow-up PR for the organization row on the session detail page (`SessionSummaryTable.tsx`). - **Single-org:** no UI change on single-org deployments. - **Checks run:** `pnpm lint:types`, Biome, the `ListSessionsPage` Vitest suite, `frontend-review` (FE1 to FE10), `frontend-deep-review` (all findings fixed), and doc-check on `audit.md` (no blocking findings). </details> --- Code written by @mollymaefraser, with Coder Agents used as a guide: explaining the existing code path, reviewing each step, running tests and reviews, and writing parts of the test setup.
…lter # Conflicts: # site/src/api/queries/aiBridge.ts # site/src/pages/AIBridgePage/ListSessionsPage/ListSessionsFilter.stories.tsx # site/src/pages/AIBridgePage/ListSessionsPage/ListSessionsFilter.tsx # site/src/pages/AIBridgePage/ListSessionsPage/ListSessionsPage.tsx
tracyjohnsonux
marked this pull request as ready for review
November 24, 2026 17:49
| value: provider.name, | ||
| startIcon: <ProviderIcon provider={provider.type} icon={provider.icon} />, | ||
| })); | ||
| return [...filterOptionsByText(options, query)]; |
Collaborator
There was a problem hiding this comment.
as of f683c53, getOptions expects the thunk to return a readonly FilterOption[]. if you use that return type here, this spread is probably unnecessary
Collaborator
Author
There was a problem hiding this comment.
Done in fdc8f56: getProviderFilterOptions now returns Promise<readonly FilterOption[]> and passes filterOptionsByText through without the spread.
Generated by Coder Agents on behalf of @tracyjohnsonux.
jeremyruppel
approved these changes
Nov 24, 2026
…lter # Conflicts: # site/src/pages/AIBridgePage/ListSessionsPage/ListSessionsFilter.stories.tsx # site/src/pages/AIBridgePage/ListSessionsPage/ListSessionsFilter.tsx
…er options without copying
aqandrew
had a problem deploying
to
docs-preview
November 24, 2026 20:22 — with
GitHub Actions
Failure
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Replaces the AI Gateway sessions list filter (search box plus User, Provider, Client, and Model dropdowns) with the
FilterBudugboxsearch filter used on the Workspaces page.initiator(User),provider_name,client,model. Option loaders live inListSessionsPage/categoryOptions.tsxand go through new React Query definitions inapi/queries/aiBridge.ts. The User category reuses the WorkspacesgetUserFilterOptions(sessions are admin-only, so all users are listed).DateTimeRangePicker, now to the right of the search input.started_after/started_beforeare stripped from the Budugbox value and merged back on change (withoutTimeRange,queryWithSearch,queryWithTimeRangeintimeRange.ts). A bound typed in the search overrides only that bound.fallbackFilter. Uses the sessionsorganizationsearch key (feat: show and filter by organization in AI Gateway sessions API #32057) and replaces the Organization dropdown from feat(site/src): add organization filter to AI Gateway sessions list #32260; the now-unused dropdown code is removed: theAIBridgePage/filters/components,components/Filter/UserFilter.tsx,components/Filter/menu.ts,MockMenu, andMenuSkeleton.ErrorAlertabove the filter, matchingWorkspacesPageView. Validation errors show under the search input.ProviderFilter/ClientFilter/ModelFiltercomponents stay because the Spend page still uses them.Known limitation (accepted for now): the sessions search backend has no default key, so typed free text returns
no search key specified, shown under the input.Decision log
FilterBudugboxchange).viewDeploymentConfiggate, since only admins can view sessions.ErrorAlertfor non-validation errors....-v2:0) are quoted; covered byListSessionsFilter.test.tsx.organizationsearch key.provider(type) andsession_idare not added as categories.Frontend review:
frontend-review(FE1 to FE10) andfrontend-deep-reviewpass after fixes. One DF6 finding (category array identity) was dropped becausesrc/pages/AIBridgePage/is compiled by React Compiler, which memoizes it.Generated by Coder Agents on behalf of @tracyjohnsonux.