refactor(agent-task/capi): remove unused slice

Signed-off-by: Babak K. Shandiz <babakks@github.com>
This commit is contained in:
Babak K. Shandiz 2025-09-18 15:05:28 +01:00
parent 3ed9034ff8
commit b6816ad89a
No known key found for this signature in database
GPG key ID: 9472CAEFF56C742E

View file

@ -108,7 +108,6 @@ func (c *CAPIClient) ListLatestSessionsForViewer(ctx context.Context, limit int)
url := baseCAPIURL + "/agents/sessions"
pageSize := defaultSessionsPerPage
sessions := make([]session, 0, limit+pageSize)
seenResources := make(map[int64]struct{})
latestSessions := make([]session, 0, limit)
for page := 1; ; page++ {
@ -140,7 +139,6 @@ func (c *CAPIClient) ListLatestSessionsForViewer(ctx context.Context, limit int)
// Process only the newly fetched page worth of sessions.
pageSessions := response.Sessions
sessions = append(sessions, pageSessions...)
// De-duplicate sessions by resource ID.
// Because the API returns newest first, once we've seen