feat: show user-set session names in agent labels - #298
Open
Ralphive wants to merge 4 commits into
Open
Conversation
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.
|
@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. |
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.
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 ascustom-titlerecords in the transcript).This PR shows the user-set session name in that line when one exists, falling back to the folder name otherwise:
custom-titlerecords live, stores the name on the agent, persists it, and broadcasts a newagentSessionNamemessage.custom-titleis read from the transcript tail at adoption time (the CLI re-appends it periodically, so a tail scan suffices).existingAgentscarries asessionNamesmap so freshly connected clients label agents immediately; names survive server restarts via agent persistence.core/asyncapi.yaml(agentSessionName,setShowSessionNames,existingAgents.sessionNames,settingsLoaded.showSessionNames) withmessages.tsregenerated vianpm run asyncapi:generate.Type of change
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".
Test plan
mainnpm run lint,npm run build,npm testall passserver/__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)