mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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:
co-authored by
Claude Opus 4.8
parent
bce9ba3356
commit
a9a1dcc65d
@@ -1114,6 +1114,15 @@ func AIBridgeSession(row database.ListAIBridgeSessionsRow) codersdk.AIBridgeSess
|
||||
CacheWriteInputTokens: row.CacheWriteInputTokens,
|
||||
},
|
||||
}
|
||||
// NetworkCalls is only meaningful when the session passed through Agent
|
||||
// Firewall. When it did not, leave it nil so the UI renders "Disabled"
|
||||
// rather than a misleading zero count.
|
||||
if row.FirewallActive {
|
||||
session.NetworkCalls = &codersdk.AIBridgeSessionNetworkCallSummary{
|
||||
Total: row.NetworkCallsTotal,
|
||||
Blocked: row.NetworkCallsBlocked,
|
||||
}
|
||||
}
|
||||
// Ensure non-nil slices for JSON serialization.
|
||||
if session.Providers == nil {
|
||||
session.Providers = []string{}
|
||||
|
||||
Reference in New Issue
Block a user