Skip to content

cli: show recent sessions (not commits) in entire activity#1650

Merged
Soph merged 2 commits into
mainfrom
soph/cli-activity-sessions-list
Jul 6, 2026
Merged

cli: show recent sessions (not commits) in entire activity#1650
Soph merged 2 commits into
mainfrom
soph/cli-activity-sessions-list

Conversation

@Soph

@Soph Soph commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

https://entire.io/gh/entireio/cli/trails/769

Why

The entire.io Overview page renders a recent-sessions feed from GET /api/v1/me/sessions, but entire activity rendered a recent-commits feed from /me/commits. The two surfaces listed different things, so a session with no resulting commit never showed in the CLI, and a commit bundling several sessions showed as one row — the lists never lined up.

What

Make sessions the default recent-list in entire activity, matching the web exactly. The stat cards, contribution heatmap, and repo chart (all from /me/activity) are unchanged; only the bottom list changes.

  • Sessions feed — fetch /me/sessions at limit=50 (mirroring the web's USER_OVERVIEW_RECENT_SESSIONS_LIMIT), group by the local day of lastActivityAt (newest first, unknown last), and render one row per session with the same fields the web row shows: display name (capped at 120), repo, a public tag when isPublic, agent badge, friendly model label, and checkpoint count.
  • Commits stay available behind entire activity --commits.
  • formatModel ported from entire.io/frontend/src/lib/model.ts to Go so labels read identically (claude-opus-4-6 → "Opus 4.6", gpt-4o → "GPT-4o", gemini-2.0-flash → "Gemini 2.0 Flash", legacy date suffixes stripped). Same test cases as the web's model.test.ts.
  • Routing — reuses the existing runAuthenticatedActivityAPI, so /me/sessions goes to the caller's home entire-api cell with the data-API fallback (the routing landed in cli: cell-routing foundation — client factory, generic repo→cell resolver, multi-cell fan-out #1641).
  • Dedup — extracts fetchActivityWith (activity aggregate + chosen list, fetched concurrently) and a generic groupItemsByDay, so the session and commit paths don't duplicate the plumbing.

entire agent-help activity picks up the new --commits flag automatically (it renders live from the cobra tree).

Endpoint note

/me/sessions reports isPublic: false unconditionally today (entire-api has no GitHub-login-on-session source), so the public tag is implemented for correctness but will rarely render from the cell — matching the repo sessions surface.

Testing

  • New unit tests: formatModel (mirrors the web's model.test.ts), groupSessionsByDay (ordering + unknown-date handling), fetchSessions (path/window/envelope parsing via httptest), and session-row rendering (fields, singular/plural, untitled fallback).
  • mise run fmt clean, mise run lint 0 issues, mise run test:ci green (unit + integration + Vogon canary).

🤖 Generated with Claude Code


Note

Low Risk
User-facing CLI display and read-only API calls only; commits remain available via --commits, with solid unit test coverage.

Overview
entire activity now defaults to a recent-sessions list aligned with the entire.io Overview: it calls GET /api/v1/me/sessions with limit=50, groups by local day of lastActivityAt, and renders rows (title, repo, optional public, agent, formatted model, checkpoint count). Stat cards, heatmap, and repo chart from /me/activity are unchanged.

entire activity --commits restores the previous recent-commits behavior. Static and TUI paths both branch on that flag; the header vs list rendering is split (renderActivityHeader + session or commit list).

Plumbing: generic fetchActivityWith loads activity and the chosen list concurrently; groupItemsByDay / localDayOf dedupe day grouping for commits and sessions. formatModel is added in Go to mirror the web’s friendly model labels.

Tests cover sessions fetch/render/grouping and formatModel; existing runActivity tests pass the new showCommits argument.

Reviewed by Cursor Bugbot for commit 887f764. Configure here.

The entire.io Overview page renders a recent-sessions feed from
GET /api/v1/me/sessions, but `entire activity` rendered a commits feed
from /me/commits, so the two surfaces listed different things.

Make sessions the default recent-list in `entire activity`, matching the
web: fetch /me/sessions (limit 50, mirroring the web's
USER_OVERVIEW_RECENT_SESSIONS_LIMIT), group by local day of lastActivityAt
(newest first), and render one row per session with the same fields the
web row shows — display name, repo, public tag, agent badge, friendly
model label, and checkpoint count. The stat cards, contribution heatmap,
and repo chart (all from /me/activity) are unchanged.

Commits stay available behind `entire activity --commits`.

- Port entire.io's formatModel (frontend/src/lib/model.ts) to Go so model
  labels read identically (claude-opus-4-6 -> "Opus 4.6", gpt-4o ->
  "GPT-4o", gemini-2.0-flash -> "Gemini 2.0 Flash").
- Extract the shared always-fetch-activity-plus-a-list plumbing
  (fetchActivityWith) and day-grouping (groupItemsByDay) so the commit and
  session paths don't duplicate it.
- Routes through the existing runAuthenticatedActivityAPI, so /me/sessions
  goes to the caller's home entire-api cell with the data-API fallback.

Stacked on #1641.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 5df0b30804c2
@Soph Soph requested a review from a team as a code owner July 6, 2026 13:54
Copilot AI review requested due to automatic review settings July 6, 2026 13:54

Copilot AI 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.

Pull request overview

This PR updates entire activity so its default “recent list” matches the entire.io Overview page by showing recent sessions (from GET /api/v1/me/sessions) instead of recent commits, while keeping the prior commits list available via --commits. It also adds a Go port of the web’s model-label formatting to ensure session rows display model names identically to the web UI.

Changes:

  • Default entire activity recent list switches to sessions; previous commits list is now behind --commits (static + TUI paths).
  • Adds /me/sessions types, fetching, and day-grouping shared via a generic fetchActivityWith and groupItemsByDay.
  • Introduces formatModel + tests to mirror entire.io’s friendly model labels in the session list.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
cmd/entire/cli/activity_cmd.go Adds --commits, introduces concurrent fetchActivityWith, implements /me/sessions fetch, and groups sessions by local day.
cmd/entire/cli/activity_cmd_test.go Updates existing tests for the new runActivity(..., showCommits) signature.
cmd/entire/cli/activity_render.go Splits shared header rendering and adds session list + row rendering (model labels, agent badge, checkpoint counts).
cmd/entire/cli/activity_sessions_test.go Adds unit tests for session grouping, /me/sessions fetching/parsing, and session row/list rendering.
cmd/entire/cli/activity_tui.go Threads showCommits through TUI model and renders either sessions or commits list accordingly.
cmd/entire/cli/activity_types.go Adds /me/sessions response/session structs and sessionDay grouping type.
cmd/entire/cli/model_label.go Implements formatModel (Claude/GPT/Gemini) to mirror entire.io’s model label formatting.
cmd/entire/cli/model_label_test.go Adds test coverage for formatModel, mirroring the web’s test cases.

Comment thread cmd/entire/cli/activity_render.go
The 120 is a cap on the display-name content, matching entire.io's
`slice(0, 120) + "…"`; the ellipsis is appended on top, so the rendered
title can be 121 runes. Reword the comment so it doesn't read as a hard
total-length cap. No behavior change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 01KWVW5EG0CXK0W1F2C8MPNJBV
@Soph Soph merged commit 4c764e3 into main Jul 6, 2026
10 checks passed
@Soph Soph deleted the soph/cli-activity-sessions-list branch July 6, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants