feat: add network calls column to AI sessions table (#27269)

Add a "Total/blocked network calls" column to the AIBridge sessions
table.

Update `ListAIBridgeSessions` query to calculate network called made and
blocked per session. See query plan
[here](https://explain.dalibo.com/plan/54355c90b165ggb4).

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Sas Swart
2026-07-21 14:34:23 +02:00
committed by GitHub
co-authored by Claude Opus 4.8
parent bce9ba3356
commit a9a1dcc65d
14 changed files with 353 additions and 23 deletions
+4
View File
@@ -121,6 +121,10 @@ Alias: also available at /api/v2/aibridge/sessions for backward compatibility.
"models": [
"string"
],
"network_calls": {
"blocked": 0,
"total": 0
},
"providers": [
"string"
],
+40 -15
View File
@@ -483,6 +483,10 @@
"models": [
"string"
],
"network_calls": {
"blocked": 0,
"total": 0
},
"providers": [
"string"
],
@@ -598,6 +602,10 @@
"models": [
"string"
],
"network_calls": {
"blocked": 0,
"total": 0
},
"providers": [
"string"
],
@@ -614,21 +622,38 @@
### Properties
| Name | Type | Required | Restrictions | Description |
|-----------------------|----------------------------------------------------------------------------------------|----------|--------------|-------------|
| `client` | string | false | | |
| `ended_at` | string | false | | |
| `id` | string | false | | |
| `initiator` | [codersdk.MinimalUser](#codersdkminimaluser) | false | | |
| `last_active_at` | string | false | | |
| `last_prompt` | string | false | | |
| `metadata` | object | false | | |
| » `[any property]` | any | false | | |
| `models` | array of string | false | | |
| `providers` | array of string | false | | |
| `started_at` | string | false | | |
| `threads` | integer | false | | |
| `token_usage_summary` | [codersdk.AIBridgeSessionTokenUsageSummary](#codersdkaibridgesessiontokenusagesummary) | false | | |
| Name | Type | Required | Restrictions | Description |
|-----------------------|------------------------------------------------------------------------------------------|----------|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `client` | string | false | | |
| `ended_at` | string | false | | |
| `id` | string | false | | |
| `initiator` | [codersdk.MinimalUser](#codersdkminimaluser) | false | | |
| `last_active_at` | string | false | | |
| `last_prompt` | string | false | | |
| `metadata` | object | false | | |
| » `[any property]` | any | false | | |
| `models` | array of string | false | | |
| `network_calls` | [codersdk.AIBridgeSessionNetworkCallSummary](#codersdkaibridgesessionnetworkcallsummary) | false | | Network calls summarizes the Agent Firewall network calls made during the session. A nil value means the session did not pass through Agent Firewall, so network call monitoring was not active, which the UI surfaces as "Disabled". |
| `providers` | array of string | false | | |
| `started_at` | string | false | | |
| `threads` | integer | false | | |
| `token_usage_summary` | [codersdk.AIBridgeSessionTokenUsageSummary](#codersdkaibridgesessiontokenusagesummary) | false | | |
## codersdk.AIBridgeSessionNetworkCallSummary
```json
{
"blocked": 0,
"total": 0
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
|-----------|---------|----------|--------------|-------------|
| `blocked` | integer | false | | |
| `total` | integer | false | | |
## codersdk.AIBridgeSessionThreadsResponse