Skip to content

feat: support aibridge filtering by multiple clients#22231

Closed
jakehwll wants to merge 14 commits intomainfrom
jakehwll/KIWI-20-aibridge-filter-multiple-clients
Closed

feat: support aibridge filtering by multiple clients#22231
jakehwll wants to merge 14 commits intomainfrom
jakehwll/KIWI-20-aibridge-filter-multiple-clients

Conversation

@jakehwll
Copy link
Contributor

@jakehwll jakehwll commented Feb 21, 2026

Adds a new /aibridge/clients GET endpoint to list AI Bridge clients with filtering and pagination support.

  • Added GET /aibridge/clients endpoint with authentication and pagination
  • Implemented ListAIBridgeClients query with authorization support and prefix-based client filtering
  • Added client filter component with search functionality to the Request Logs page
  • Updated filter parsing to handle quoted values containing spaces

Copy link
Contributor Author

jakehwll commented Feb 21, 2026

@jakehwll jakehwll changed the title feat: support filtering by client feat: support aibridge filtering by multiple clients Feb 21, 2026
@jakehwll jakehwll force-pushed the jakehwll/KIWI-20-aibridge-filter-multiple-clients branch from c76f8f5 to 94f68d1 Compare February 21, 2026 17:26
@jakehwll jakehwll requested a review from pawbana February 24, 2026 12:55
@jakehwll jakehwll marked this pull request as ready for review February 24, 2026 12:55
@coder-tasks
Copy link
Contributor

coder-tasks bot commented Feb 24, 2026

Documentation Check

Updates Needed

  • docs/ai-coder/ai-bridge/monitoring.md - The client filter description under "Available query filters" currently says "Filter by client name" (single value). Now that multi-select is supported, the docs should clarify that multiple client: filters can be chained (e.g., client:Claude Code client:Zed). It may also be worth referencing the new /api/v2/aibridge/clients endpoint as a way to discover valid client values dynamically, rather than relying on the static hardcoded list in the <details> block.

Already Addressed

  • docs/reference/api/aibridge.md - New GET /aibridge/clients endpoint is documented in this PR.

Automated review via Coder Tasks

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f2adee55fa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// Emit each comma-separated part as its own key:value pair so
// the backend's searchTerms parser can handle them via
// url.Values.Add (repeated keys). Quote values with spaces.
for (const part of value.split(",")) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve commas inside filter values during serialization

Serializing by value.split(",") changes the meaning of any value that legitimately contains a comma. In AI Bridge this is especially risky for client, which is stored as free-form text from interception input; a single client like "Foo, Bar" is emitted as two separate client: terms on the next update, so exact matching no longer works and the selected filter can silently drift.

Useful? React with 👍 / 👎.

// Matches key:value pairs where the value is either a quoted string
// or unquoted (no spaces). Repeated keys (e.g. client:A client:"B C")
// are merged into a comma-separated value.
const keyValuePair = /([\w-]+):("([^"]*)"|[^\s]+)/g;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pattern has different character sets for different parts of the filter value ([\w-+], [^"], [^\s]), not sure if that's intentional? If our character set for filter keys/values is known, and consistent, I'd probably suggest making these all use the same ranges as much as possible.

// the backend's searchTerms parser can handle them via
// url.Values.Add (repeated keys). Quote values with spaces.
for (const part of value.split(",")) {
const serialized = part.includes(" ") ? `"${part}"` : part;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's potential for excess whitespace here. Should we consider "${part.trim()}" or similar?

Copy link
Contributor

@pawbana pawbana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

goalng changes LGTM

From manual testing the same issue with eager requests to backend on every input field value change.
Also when filter doesn't match anything spinning wheel is visible which is a bit confusing. Looks like request is in progress. I'd assume some Nothing matches string:
image

@jakehwll jakehwll force-pushed the jakehwll/KIWI-39-filter-interceptions-by-model branch from 3683ce5 to 08fa8ae Compare February 25, 2026 04:17
Base automatically changed from jakehwll/KIWI-39-filter-interceptions-by-model to main February 25, 2026 15:40
@jakehwll jakehwll force-pushed the jakehwll/KIWI-20-aibridge-filter-multiple-clients branch from 12975ca to 650ac3c Compare February 26, 2026 05:19
@jakehwll
Copy link
Contributor Author

jakehwll commented Mar 6, 2026

Closing in favour of #22694, the frontend doesn't have a pretty way to filter against multiple values and I want to look at this harder (I'm pretty unsatisfied with the current state of filtering here).

@jakehwll jakehwll closed this Mar 6, 2026
@github-actions github-actions bot locked and limited conversation to collaborators Mar 6, 2026
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.

3 participants