feat: show network request summary on AI session detail card (#27418)

Frontend for the AI session network summary. Adds Network calls, Blocked
network requests, and Top domains rows to the Session summary card on
the individual AI session detail page, driven by the network fields on
the session threads response.

Renders "Disabled" when network monitoring was not active and "No
activity" when there were no calls. Covered by Storybook stories for
each state.

### PR map (merge strictly bottom-up)

This change is a 4-PR stack. Each PR depends on all the ones below it,
so merge in this exact order:

1. #27417 — backend network summary
2. #27418 — frontend summary rows
3. #27425 — backend per-call list `network_call_logs`
4. #27426 — frontend network-calls panel

Refs AIGOV-463

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Cian Johnston <cian@coder.com>
This commit is contained in:
Sas Swart
2026-07-30 13:23:51 +02:00
committed by GitHub
co-authored by Claude Opus 4.8 Cian Johnston
parent 841a1765f7
commit 3f3fd1c4d7
13 changed files with 241 additions and 44 deletions
+19 -5
View File
@@ -48,12 +48,12 @@ not just what was called.
The sessions page (`http://<deployment-url>/ai-gateway/sessions`) lists all sessions in
reverse-chronological order. Each row shows the last prompt, initiator, provider,
client, token usage, network calls, thread count, and timestamp.
client, token usage, network requests, thread count, and timestamp.
The network calls column reports the total and blocked
[Agent Firewall](../agent-firewall/index.md) calls for the session. It shows
`No activity` when the session made no calls, and `Disabled` when the session
did not pass through Agent Firewall, so no network calls were monitored.
The **Network Requests** column reports the total and blocked
[Agent Firewall](../agent-firewall/index.md) requests for the session. It shows
`No activity` when the session made no requests, and `Disabled` when the session
did not pass through Agent Firewall, so no network requests were monitored.
Select one to view its full details.
@@ -66,6 +66,20 @@ Click into a session to see a chronological causal chain of events.
Within a thread, each step shows token usage, tool call details (including
arguments and MCP server URLs), duration, and any errors or warnings.
The **Session summary** card beside the timeline reports the session's
[Agent Firewall](../agent-firewall/index.md) activity:
- **Network requests** is the total number of requests the session made. It
shows `Disabled` when the session did not pass through Agent Firewall, so
monitoring was not active, and `No activity` when the session made no
requests.
- **Blocked network requests** is the subset of those requests that the
allow-list denied. This row appears only when the session made at least one
request, and is highlighted when any were blocked.
- **Top domains** names the destination host the session contacted most, and
appears whenever at least one domain was recorded. When the session contacted
more than one distinct domain, a `+N more` count follows.
![Session detail](../../images/aibridge/session_detail.png)
## Conducting a forensic audit
+16 -16
View File
@@ -622,22 +622,22 @@
### 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 | | |
| `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 | | |
| 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 requests 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