Skip to content

feat(site/src): add organization filter to AI Gateway sessions list - #32260

Merged
mollymaefraser merged 2 commits into
mainfrom
molly/aigov-754-sessions-org-frontend
Nov 19, 2026
Merged

mollymaefraser merged 2 commits into
mainfrom
molly/aigov-754-sessions-org-frontend

Conversation

@mollymaefraser

@mollymaefraser mollymaefraser commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

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)?
  • feat(site/src): use the search filter on the AI Gateway sessions list #31040 (Tracy): that draft reworks this filter bar and already has an Organization option. This PR adds the filter to the current bar; if feat(site/src): use the search filter on the AI Gateway sessions list #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.
Decisions and plan
  • 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 feat(site/src): use the search filter on the AI Gateway sessions list #31040, which is a draft and conflicts with main. Follow the Connection Logs pattern (ConnectionLogPage.tsx, ConnectionLogFilter.tsx).
  • Stack: feat: show and filter by organization in AI Gateway sessions API #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).

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.

@linear-code

linear-code Bot commented Nov 16, 2026

Copy link
Copy Markdown

AIGOV-754

Copy link
Copy Markdown
Collaborator Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@mollymaefraser mollymaefraser changed the title feat(site/src/pages/AIBridgePage/ListSessionsPage): add organization filter to AI Gateway sessions list feat(site/src): add organization filter to AI Gateway sessions list Nov 17, 2026
@mollymaefraser
mollymaefraser marked this pull request as ready for review November 17, 2026 09:43
@mollymaefraser
mollymaefraser marked this pull request as draft November 18, 2026 14:56
@mollymaefraser
mollymaefraser marked this pull request as ready for review November 18, 2026 15:20
@mollymaefraser
mollymaefraser force-pushed the molly/aigov-754-sessions-org-backend branch from 000e30f to 8dcefea Compare November 19, 2026 08:47
@mollymaefraser
mollymaefraser force-pushed the molly/aigov-754-sessions-org-frontend branch from cb6ae17 to 1164a4e Compare November 19, 2026 09:07
Base automatically changed from molly/aigov-754-sessions-org-backend to main November 19, 2026 09:08
@mollymaefraser
mollymaefraser merged commit a50d929 into main Nov 19, 2026
31 of 32 checks passed
@mollymaefraser
mollymaefraser deleted the molly/aigov-754-sessions-org-frontend branch November 19, 2026 12:11
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 19, 2026

This branch had an error being deployed

1 failed and 1 inactive deployments
docs-preview — d253442e Deployed Nov 19, 2026 by mollymaefraser via cleanup #253
main — d253442e Deployed Nov 19, 2026 by mollymaefraser via cla #260191
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants