Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
SasSwart merged 8 commits into
mainfrom
aigov-463-frontend
Jul 30, 2026
Merged

feat: show network request summary on AI session detail card#27418
SasSwart merged 8 commits into
mainfrom
aigov-463-frontend

Conversation

@SasSwart

@SasSwart SasSwart commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

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

Refs AIGOV-463

🤖 Generated with Claude Code

@linear-code

linear-code Bot commented Jul 22, 2026

Copy link
Copy Markdown

AIGOV-463

@SasSwart SasSwart left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self review complete. I need to check up on some things but its good enough for external review in the mean time.

@SasSwart
SasSwart requested a review from EhabY July 28, 2026 13:49
@SasSwart
SasSwart marked this pull request as ready for review July 28, 2026 13:49
@coderagents

coderagents Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Documentation Check

Updates Needed

  • docs/ai-coder/ai-gateway/audit.md - Addressed in 804a1e9. The Session detail section now documents the Session summary card's Network requests, Blocked network requests, and Top domains rows. Verified against the head revision:

    • Row labels match SessionSummaryTable.tsx exactly (Network requests, Blocked network requests, Top domains), and the card name matches the Session summary heading in SessionThreadsPageView.tsx
    • Disabled / No activity conditions match the networkCalls === undefined and total === 0 branches
    • "appears only when the session made at least one request" matches the total > 0 guard
    • "When the session contacted more than one distinct domain, a +N more count follows" matches the totalCount > 1 guard
    • No emdash, endash, or -- in the added prose
  • docs/ai-coder/ai-gateway/audit.md - Terminology split resolved in 804a1e9. The rename is now complete across every user-facing string, and the docs follow it:

    • ListSessionsPageView.tsx header is now Network Requests, matching the docs' Network Requests column reference
    • The Disabled tooltip and the badge tooltip now read "Network request monitoring was not active for this session." and "Total requests"
    • The two non-numeric states are shared via the new NetworkRequestStates.tsx, so the list and detail card cannot drift apart again
    • The Sessions list paragraph was updated from "network calls" to "network requests" throughout

    Note: call survives only in non-user-facing identifiers (the network_calls JSON field, AIBridgeSessionNetworkCallSummary, NetworkCallBadges). No prose defect, but readers moving between the auto-generated docs/reference/api/ schemas and this page will see network_calls described as "network requests". Worth a one-line mention in the prose if that mismatch is expected to persist.

  • docs/images/aibridge/sessions.png - New: this screenshot shows the sessions list, whose column header changed from Network Calls to Network Requests in 804a1e9. If the header is visible in the capture, the image is now stale and contradicts the prose directly above it.

  • docs/images/aibridge/session_detail.png - Still outstanding. Verify whether this screenshot captures the Session summary card. If it does, it is now stale, since the card gained three rows.


Automated review via Coder Agents

@EhabY EhabY left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few small comments, otherwise LGTM

Comment thread site/src/pages/AIBridgePage/SessionThreadsPage/SessionSummaryTable.tsx Outdated
Comment on lines +59 to +77
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>
);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines +213 to +217
{networkCalls !== undefined && networkCalls.total > 0 && (
<div className="flex items-center justify-between">
<dt className="shrink-0 font-normal whitespace-nowrap">
Blocked network requests
</dt>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose total always includes the blocked requests? (guaranteed by the server)

@EhabY

EhabY commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Nit: I do wonder how useful the block signage here when the column says blocked anyway:
image

Also should we use the same terminalogy? Like Network Calls but then Blocked Network Requests, are the Calls different from the Requests?

@SasSwart
SasSwart requested a review from a team as a code owner July 30, 2026 10:11
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

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.

SasSwart and others added 5 commits July 30, 2026 10:16
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]>
SasSwart and others added 2 commits July 30, 2026 10:18
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]>
@SasSwart
SasSwart force-pushed the aigov-463-frontend branch from 6c2b3be to 9825f4f Compare July 30, 2026 10:19
@SasSwart SasSwart changed the title feat(site): show network calls summary on AI session detail card feat: show network request summary on AI session detail card Jul 30, 2026
Base automatically changed from aigov-463-network-summary to main July 30, 2026 11:09
SasSwart added a commit that referenced this pull request Jul 30, 2026
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]>
@SasSwart
SasSwart merged commit 3f3fd1c into main Jul 30, 2026
36 checks passed
@SasSwart
SasSwart deleted the aigov-463-frontend branch July 30, 2026 11:23
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants