cli: show recent sessions (not commits) in entire activity#1650
Merged
Conversation
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
Contributor
There was a problem hiding this comment.
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 activityrecent list switches to sessions; previous commits list is now behind--commits(static + TUI paths). - Adds
/me/sessionstypes, fetching, and day-grouping shared via a genericfetchActivityWithandgroupItemsByDay. - 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. |
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
computermode
approved these changes
Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, butentire activityrendered 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./me/sessionsatlimit=50(mirroring the web'sUSER_OVERVIEW_RECENT_SESSIONS_LIMIT), group by the local day oflastActivityAt(newest first, unknown last), and render one row per session with the same fields the web row shows: display name (capped at 120), repo, apublictag whenisPublic, agent badge, friendly model label, and checkpoint count.entire activity --commits.formatModelported fromentire.io/frontend/src/lib/model.tsto 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'smodel.test.ts.runAuthenticatedActivityAPI, so/me/sessionsgoes 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).fetchActivityWith(activity aggregate + chosen list, fetched concurrently) and a genericgroupItemsByDay, so the session and commit paths don't duplicate the plumbing.entire agent-help activitypicks up the new--commitsflag automatically (it renders live from the cobra tree).Endpoint note
/me/sessionsreportsisPublic: falseunconditionally today (entire-api has no GitHub-login-on-session source), so thepublictag is implemented for correctness but will rarely render from the cell — matching the repo sessions surface.Testing
formatModel(mirrors the web'smodel.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 fmtclean,mise run lint0 issues,mise run test:cigreen (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 activitynow defaults to a recent-sessions list aligned with the entire.io Overview: it callsGET /api/v1/me/sessionswithlimit=50, groups by local day oflastActivityAt, and renders rows (title, repo, optionalpublic, agent, formatted model, checkpoint count). Stat cards, heatmap, and repo chart from/me/activityare unchanged.entire activity --commitsrestores 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
fetchActivityWithloads activity and the chosen list concurrently;groupItemsByDay/localDayOfdedupe day grouping for commits and sessions.formatModelis added in Go to mirror the web’s friendly model labels.Tests cover sessions fetch/render/grouping and
formatModel; existingrunActivitytests pass the newshowCommitsargument.Reviewed by Cursor Bugbot for commit 887f764. Configure here.