Fix Sessions Endpoint in Activity Feed · Entire
Summary
The /me/sessions data is rendered only on the Overview (dashboard/home) page. The React frontend does not call /me/sessions directly — it calls the BFF cache route GET /api/v1/cache/user/sessions?timeframe=…&limit=…, which proxies to the home API's me/sessions and otherwise serves the identical handler locally.
1. Which route/page renders the list
- Route:
/Users/soph/Work/entire/devenv/entire.io/frontend/src/routes/_app/_authenticated/overview.index.tsx— route/_app/_authenticated/overview/, renders<OverviewPage>. Its loader prefetchesuserCheckpointsQueryOptions("last-month")anduserSessionsQueryOptions("last-month", USER_OVERVIEW_RECENT_SESSIONS_LIMIT). - Page:
/Users/soph/Work/entire/devenv/entire.io/frontend/src/domains/platform/users/pages/OverviewPage.tsx— renders aSessionssection that mounts<RecentSessionsList sessions={recentSessions} />. - The list component (the row rendering):
/Users/soph/Work/entire/devenv/entire.io/frontend/src/domains/platform/users/components/RecentSessionsList.tsx. - Data fetch + type mapping:
/Users/soph/Work/entire/devenv/entire.io/frontend/src/domains/platform/users/api.ts(fetchUserSessions,userSessionsQueryOptions,USER_OVERVIEW_RECENT_SESSIONS_LIMIT = 50). - Data hook:
/Users/soph/Work/entire/devenv/entire.io/frontend/src/domains/platform/users/hooks/useUserDashboardData.ts. - API layer: BFF route handler
handleUserSessionsin/Users/soph/Work/entire/devenv/entire.io/api/src/routes/cache.ts(~line 1846), backed bylistSessionsForUserin/Users/soph/Work/entire/devenv/entire.io/api/src/lib/planetscale/sessions.ts(line 620). Types in/Users/soph/Work/entire/devenv/entire.io/api/src/lib/db/db-types.ts(SessionListItem/UserSessionListItem, lines 187–219).
2. Fields displayed per session ROW
Important: although the API envelope carries token and attribution fields, the frontend UserSession type drops them — api.ts only maps: sessionId, displayName, isPublic, agent, model, prompt, startedAt, lastActivityAt, checkpointCount, stepCount, org, repo, repoFullName, isPrivate. And of those, the row renders only a subset. prompt, stepCount, startedAt, customName, firstCommitAuthorUsername, and all token/attribution counts are not shown in the row.
The row JSX (RecentSessionsList.tsx lines 67–104):
const agentConfig = getAgent(session.agent)
const modelLabel = formatModel(session.model)
const title =
session.displayName.length > 120
? `${session.displayName.slice(0, 120)}...`
: session.displayName
<ListViewItem
href={`/gh/${org}/${repo}/session/${sessionId}`}
...
>
<span className="flex min-w-0 flex-1 items-center gap-2 md:flex-initial">
<span className="truncate text-sm font-medium text-default">{title}</span>
{session.isPublic && <PublicSessionBadge />}
</span>
<span className="shrink-0 text-xs text-muted">{session.repoFullName}</span>
<span aria-hidden className="basis-full md:hidden" />
<span className="... font-mono text-xs text-muted md:ml-auto ...">
<AgentBadge agent={session.agent} className="shrink-0" />
<span className="shrink-0 md:w-28 md:truncate md:text-right" title={modelLabel || undefined} ...>
{modelLabel ?? ""}
</span>
<span className="shrink-0 md:w-28 md:text-right">
{session.checkpointCount}{