Skip to content

activity: show external agents by name instead of "Unknown" - #2693

Open
peyton-alt wants to merge 8 commits into
mainfrom
fix/activity-external-agent-names
Open

peyton-alt wants to merge 8 commits into
mainfrom
fix/activity-external-agent-names

Conversation

@peyton-alt

@peyton-alt peyton-alt commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

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

Problem

entire activity labels every session and commit from a custom external agent (entire-agent-<name>) as "Unknown". The agent's name is stored correctly; the view folds anything that is not a built-in agent into one bucket.

Change

Session rows and commit badges show the agent's own name when it is not a built-in agent (agentKey / agentDisplayFor in activity_render.go), in the muted style. Built-in agents and empty names are unchanged. The charts still group by built-in agent.

The commits view also depends on the API returning the raw name for /me/commits (entire-api fix/external-agent-names). Sessions work on their own.

Verification

  • TestUniqueCommitAgents_KeepsExternalAgentName, TestRenderSessionRow_AgentLabel: both fail on main.
  • Built binaries from main and this branch against a throwaway repo with a real external agent (the roger-roger test agent): main shows "Unknown", the branch shows "Roger Roger Agent".
  • mise run fmt && mise run lint clean, unit tests pass.

Follow-ups (not in this PR): entire agent list and the status Agents line skip external-agent discovery.


Note

Low Risk
Display-only CLI changes to activity labeling with unit tests; charts and built-in agent behavior are unchanged.

Overview
entire activity no longer collapses unrecognized agents to Unknown in session rows and commit agent badges.

New helpers agentKey and agentDisplayFor keep built-in agent IDs/labels unchanged while using the API’s raw agent name (muted styling) for external agents. uniqueCommitAgents, renderSessionRow, and commit badge rendering route through these helpers; contribution/repo charts still bucket only built-in agents via agentOrder / agentDisplayMap.

Tests cover external agent deduplication in commits and session row labels for built-in, external, and missing agents.

Reviewed by Cursor Bugbot for commit 606067d. Configure here.

End-to-end check (local stack, real external-agent checkpoint)

A roger-roger external agent session was committed and pushed to a native repo on a local core + entire-api, then the same data was read through each combination:

API main API this change
overview agent-activity / contributor-agents unknown Roger Roger Agent
/me/commits agents ["unknown"] ["Roger Roger Agent"]
web main: Overview legend, contributors, sessions Unknown Unknown (no errors)
web this change: Overview legend, contributors, screen-reader text Unknown (sessions list already named) Roger Roger Agent
CLI main entire activity Unknown Unknown
CLI this change: commit badge / session row Unknown / Roger Roger Agent Roger Roger Agent / Roger Roger Agent

🤖 Generated with Claude Code

`entire activity` mapped every agent it did not ship with to "Unknown", so
sessions and commits from external agents all showed the same label even
though the API returns the agent's name. Session rows and commit badges now
show that name; only a missing agent reads "Unknown". The hourly legend and
repo bars still group agents into the known set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Entire-Checkpoint: 01M49F7JJDE6SXQW17RW4J1BV2
@peyton-alt
peyton-alt requested a review from a team as a code owner October 7, 2026 20:36
Copilot AI balanced review requested due to automatic review settings October 7, 2026 20:36

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.

🟡 Changes recommended

External-agent labels must be sanitized before being rendered in terminal output.

1 open finding
What changed in this PR

Updates activity views to display external agents by name instead of “Unknown.”

Changes:

  • Adds external-agent display/key helpers.
  • Applies names to session and commit rows.
  • Adds unit coverage for external labels.
File Description
cmd/​entire/​cli/​activity_render.go Renders external-agent names in activity output.
cmd/​entire/​cli/​activity_render_test.go Tests external-agent labeling and deduplication.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread cmd/entire/cli/activity_render.go Outdated
Comment on lines +130 to +131
if name := strings.TrimSpace(raw); name != "" {
return name
peyton-alt and others added 7 commits October 7, 2026 15:50
The contributions legend and repository bars walked only the built-in
agent list, so an agent outside it was dropped. Render built-ins, then
external agents by name, then Unknown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Entire-Checkpoint: 01M4C8YP3M46G6EY69XFAMGP2K
External agent names are self-reported, so strip control and bidi
characters before printing them, as other untrusted strings are.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Entire-Checkpoint: 01M4C9SSGQMJVJ3RW9XEXYEHA5
entire-api reports Goose and Antigravity as built-in agents, but the CLI
did not list them, so they rendered as raw lowercase ids once unknown
agents kept their names. Add them. Also cap an external agent's label at
24 cells so a long self-reported name cannot wrap session and commit rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Entire-Checkpoint: 01M4CM7704P9PD7NV6YZK0KKZC
- External agents and Unknown fill their bar segment with ▒ instead of the
  empty track's ░, so their share shows without colour.
- Strip invisible format characters (zero-width space, BOM, soft hyphen,
  bidi controls) except the emoji joiner, matching the web and API.
- Cap a self-reported name at 256 runes before measuring it; a huge name
  made truncation quadratic.
- Re-key repo agent counts by agentKey, so names that clean alike are one
  legend entry and bar segment.
- Tighten tests that passed without the behaviour they named.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The CLI records an unidentified agent as "Unknown" (agent.AgentTypeUnknown),
which agentKey kept as an external agent beside the canonical unknown, so
the legend and commit badges could show two Unknown entries. Fold any
casing of it into unknown.

External names that differ only in case ("Grok Bot", "grok bot") now merge
under the most-used spelling, as entire-api merges them for the web charts.

Also fix the stale activityAgentCounts comment and a misplaced import.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Entire-Checkpoint: 01M4GWEZZ6RBA0GWQRRRWWAKMP
…ss repos

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Entire-Checkpoint: 01M4H5JXSGH8D7406RRF5E5M5A
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