mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add client column to aibridge_interceptions table (#21839)
Adds `client` column to `aibridge_interceptions` table. It is set accordingly to what is passed from AI Bridge in `RecordInterception`. Adds interception filtering by `client` value. Depends on: https://github.com/coder/aibridge/pull/158 Updates aibridge library to include this change. Fixes: https://github.com/coder/aibridge/issues/31
This commit is contained in:
@@ -25,6 +25,25 @@ curl -X GET "https://coder.example.com/api/v2/aibridge/interceptions?q=initiator
|
||||
|
||||
Available query filters:
|
||||
|
||||
- `client` - Filter by client name.
|
||||
<details>
|
||||
<summary>Possible <code>client</code> values</summary>
|
||||
|
||||
> [!NOTE]
|
||||
> Client classification is done on best effort basis using the `User-Agent` header;
|
||||
not all clients send these headers in an easily-identifiable manner.
|
||||
|
||||
- `Claude Code`
|
||||
- `Codex`
|
||||
- `Zed`
|
||||
- `GitHub Copilot (VS Code)`
|
||||
- `GitHub Copilot (CLI)`
|
||||
- `Kilo Code`
|
||||
- `Roo Code`
|
||||
- `Cursor`
|
||||
- `Unknown`
|
||||
|
||||
</details><br>
|
||||
- `initiator` - Filter by user ID or username
|
||||
- `provider` - Filter by AI provider (e.g., `openai`, `anthropic`)
|
||||
- `model` - Filter by model name
|
||||
|
||||
Generated
+1
@@ -32,6 +32,7 @@ curl -X GET http://coder-server:8080/api/v2/aibridge/interceptions \
|
||||
"results": [
|
||||
{
|
||||
"api_key_id": "string",
|
||||
"client": "string",
|
||||
"ended_at": "2019-08-24T14:15:22Z",
|
||||
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
|
||||
"initiator": {
|
||||
|
||||
Generated
+3
@@ -435,6 +435,7 @@
|
||||
```json
|
||||
{
|
||||
"api_key_id": "string",
|
||||
"client": "string",
|
||||
"ended_at": "2019-08-24T14:15:22Z",
|
||||
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
|
||||
"initiator": {
|
||||
@@ -502,6 +503,7 @@
|
||||
| Name | Type | Required | Restrictions | Description |
|
||||
|--------------------|---------------------------------------------------------------------|----------|--------------|-------------|
|
||||
| `api_key_id` | string | false | | |
|
||||
| `client` | string | false | | |
|
||||
| `ended_at` | string | false | | |
|
||||
| `id` | string | false | | |
|
||||
| `initiator` | [codersdk.MinimalUser](#codersdkminimaluser) | false | | |
|
||||
@@ -522,6 +524,7 @@
|
||||
"results": [
|
||||
{
|
||||
"api_key_id": "string",
|
||||
"client": "string",
|
||||
"ended_at": "2019-08-24T14:15:22Z",
|
||||
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
|
||||
"initiator": {
|
||||
|
||||
@@ -51,6 +51,14 @@ Only return interceptions from this provider.
|
||||
|
||||
Only return interceptions from this model.
|
||||
|
||||
### --client
|
||||
|
||||
| | |
|
||||
|------|---------------------|
|
||||
| Type | <code>string</code> |
|
||||
|
||||
Only return interceptions from this client.
|
||||
|
||||
### --after-id
|
||||
|
||||
| | |
|
||||
|
||||
Reference in New Issue
Block a user