Skip to content

feat: show user-set session names in agent labels - #298

Open
Ralphive wants to merge 4 commits into
pixel-agents-hq:mainfrom
Ralphive:feat/session-name-labels
Open

feat: show user-set session names in agent labels#298
Ralphive wants to merge 4 commits into
pixel-agents-hq:mainfrom
Ralphive:feat/session-name-labels

Conversation

@Ralphive

@Ralphive Ralphive commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Description

The small line under an agent's activity label always shows the workspace folder name. With several sessions running from the same folder (or generic folder names), agents are hard to tell apart — while users often already give their sessions meaningful names (Claude Code's /rename, persisted as custom-title records in the transcript).

This PR shows the user-set session name in that line when one exists, falling back to the folder name otherwise:

  • The transcript parser picks up custom-title records live, stores the name on the agent, persists it, and broadcasts a new agentSessionName message.
  • Adopted sessions start reading at the file end, so the most recent custom-title is read from the transcript tail at adoption time (the CLI re-appends it periodically, so a tail scan suffices).
  • existingAgents carries a sessionNames map so freshly connected clients label agents immediately; names survive server restarts via agent persistence.
  • Controlled by a new Session Names in Labels setting (default on), persisted like the other toggles and wired for both the standalone server and the VS Code extension.
  • Protocol additions live in core/asyncapi.yaml (agentSessionName, setShowSessionNames, existingAgents.sessionNames, settingsLoaded.showSessionNames) with messages.ts regenerated via npm run asyncapi:generate.

Type of change

  • New feature

Related issues

None found.

Screenshots / GIFs

Two sessions from the same project: the renamed one shows its session name, the unnamed one falls back as before. The toggle lives in Settings as "Session Names in Labels".

session names in labels

Test plan

  • Rebased on latest main
  • npm run lint, npm run build, npm test all pass
  • New tests in server/__tests__/transcriptParser.test.ts: custom-title parsing (set/change/no-op/trim/unknown agent, 6 cases) and tail reading (latest wins, missing file, malformed lines, 4 cases)
  • Manually verified against the standalone server: a renamed session shows its name on adoption, on rename mid-session, after server restart (persistence), and on fresh client connect (existingAgents); unnamed sessions keep showing the folder name; toggling the setting off restores folder names everywhere

Ralphive added 4 commits June 3, 2026 18:03
The small line under an agent's activity label always showed the
workspace folder name. When several sessions run from the same folder
(or the folder name is generic), they are hard to tell apart — while
users often already give sessions meaningful names (Claude Code's
/rename, persisted as custom-title records in the transcript).

The transcript parser now picks up custom-title records, stores the
name on the agent, and broadcasts an agentSessionName message. The
webview shows the session name in place of the folder name when
available, falling back to the folder name otherwise. existingAgents
carries the names so freshly connected clients get them too.

Controlled by a new 'Session Names in Labels' setting (default on),
persisted like the other toggles and wired for both the standalone
server and the VS Code extension.

Protocol additions are made in core/asyncapi.yaml (agentSessionName
server message, setShowSessionNames client message, sessionNames on
existingAgents, showSessionNames on settingsLoaded) with messages.ts
regenerated. Adds transcript parser tests for the custom-title flow.
Restored agents resume transcript reading at the file end, so titles
recorded earlier in the session were lost on restart. Persist
sessionName with the agent and restore it, and persist on title change.
Adopted sessions start reading at the file end (history is skipped), so
a title set before adoption was never picked up. Read the most recent
custom-title record from the transcript tail when adopting and broadcast
it, so already-named sessions are labeled immediately.
@vercel

vercel Bot commented Jun 4, 2026

Copy link
Copy Markdown

@Ralphive is attempting to deploy a commit to the pablodelucca's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant