Skip to content

feat: add network calls summary to AI session threads API#27417

Draft
SasSwart wants to merge 2 commits into
mainfrom
aigov-463-network-summary
Draft

feat: add network calls summary to AI session threads API#27417
SasSwart wants to merge 2 commits into
mainfrom
aigov-463-network-summary

Conversation

@SasSwart

@SasSwart SasSwart commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

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. feat: add network calls summary to AI session threads API #27417 — backend network summary (base main)
  2. feat(site): show network calls summary on AI session detail card #27418 — frontend summary rows (base feat: add network calls summary to AI session threads API #27417)
  3. feat: add network calls list to AI session threads API #27425 — backend per-call list network_call_logs (base feat(site): show network calls summary on AI session detail card #27418)
  4. feat(site): show network calls list on AI session detail #27426 — frontend network-calls panel (base feat: add network calls list to AI session threads API #27425)

Refs AIGOV-463

🤖 Generated with Claude Code

@linear-code

linear-code Bot commented Jul 22, 2026

Copy link
Copy Markdown

AIGOV-463

@github-actions

Copy link
Copy Markdown

Docs preview

Check 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) <noreply@anthropic.com>
@SasSwart
SasSwart force-pushed the aigov-463-network-summary branch from a4d26be to 8959a08 Compare July 22, 2026 14:04
@SasSwart SasSwart changed the title feat: add network calls summary to AI session detail feat: add network calls summary to AI session threads API Jul 22, 2026
…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) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant