feat: show network request summary on AI session detail card - #27418
Conversation
da2a0a6 to
734e63e
Compare
734e63e to
3a7959b
Compare
SasSwart
left a comment
There was a problem hiding this comment.
Self review complete. I need to check up on some things but its good enough for external review in the mean time.
Documentation CheckUpdates Needed
Automated review via Coder Agents |
EhabY
left a comment
There was a problem hiding this comment.
Few small comments, otherwise LGTM
| let networkCallsValue: ReactNode; | ||
| if (networkCalls === undefined) { | ||
| networkCallsValue = ( | ||
| <span className="inline-flex items-center gap-1 whitespace-nowrap text-content-secondary"> | ||
| Disabled | ||
| <InfoTooltip message="Network call monitoring was not active for this session." /> | ||
| </span> | ||
| ); | ||
| } else if (networkCalls.total === 0) { | ||
| networkCallsValue = ( | ||
| <span className="whitespace-nowrap text-content-secondary"> | ||
| No activity | ||
| </span> | ||
| ); | ||
| } else { | ||
| networkCallsValue = ( | ||
| <Badge>{networkCalls.total.toLocaleString("en-US")}</Badge> | ||
| ); | ||
| } |
There was a problem hiding this comment.
This seems to be almost identical to NetworkCallBadges.tsx:20-33, I wonder if we can use a shared component so that if they drift then they drift together
| {networkCalls !== undefined && networkCalls.total > 0 && ( | ||
| <div className="flex items-center justify-between"> | ||
| <dt className="shrink-0 font-normal whitespace-nowrap"> | ||
| Blocked network requests | ||
| </dt> |
There was a problem hiding this comment.
I suppose total always includes the blocked requests? (guaranteed by the server)
Docs previewCheck off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here. |
Expose total and blocked network calls plus top destination domains on the AI session threads endpoint. Total and blocked reuse the existing Agent Firewall aggregation from the sessions list query; top domains are a new GetAIBridgeSessionTopDomains aggregation over boundary logs using the same interception-window correlation. Refs AIGOV-463 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…fetch Add multi-interception and shared-firewall-session tests asserting the network_calls summary total/blocked and top-domains counts partition correctly across consecutive windows and do not bleed across AI sessions that share one firewall session. Reduce the top-domains fetch to a single row, since the summary card renders only the most-contacted domain plus a "+N more" count derived from NetworkDomainCount (a window aggregate independent of the row cap). Document that the domain-extraction regex assumes scheme+host(+port) detail without userinfo or IPv6 literal hosts, and add a port-suffixed test row that pins host stripping. Refs AIGOV-463 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: Cian Johnston <[email protected]>
Add Network calls, Blocked network requests, and Top domains rows to the Session summary card, driven by the network fields on the session threads response. Renders Disabled when monitoring was not active and No activity when there were no calls. Refs AIGOV-463 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
6c2b3be to
9825f4f
Compare
Backend for the AI session network summary. Exposes total/blocked
network calls and top destination domains on the session threads
endpoint (`GET /api/v2/ai-gateway/sessions/{id}`).
Total and blocked reuse the existing Agent Firewall aggregation from the
sessions list query, so the numbers match the sessions table. Top
domains are a new server-side aggregation
(`GetAIBridgeSessionTopDomains`) over boundary logs, using the same
interception-window correlation. There is no network-error state,
matching the current data model.
Frontend consuming these fields is in a separate stacked PR.
### 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 (base `main`)
2. #27418 — frontend summary rows (base #27417)
3. #27425 — backend per-call list `network_call_logs` (base #27418)
4. #27426 — frontend network-calls panel (base #27425)
Refs AIGOV-463
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: Cian Johnston <[email protected]>

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:
network_call_logsRefs AIGOV-463
🤖 Generated with Claude Code