feat(server): let agents name a session when their first publish creates it#5
Merged
Conversation
…tes it
Sessions created by agents over MCP or bare CLI publish had no title, so
the viewer sidebar became a wall of identical "claude-code session" rows.
An optional sessionTitle now threads through all three tiers — REST publish
body, both MCP publish_snippet tools, and `sideshow publish --session-title`
— and applies only when the publish creates the session, so it can never
clobber a rename the user made in the viewer. The skill, setup block, and
design guide tell agents to name the task ("Auth refactor"), not the tool.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Problem
Sessions created by agents over MCP or bare CLI publish have no title, so the viewer sidebar shows an indistinguishable wall of "claude-code session" rows once a few conversations exist.
POST /api/sessionsalready accepts a title, but nothing in the publish path or MCP surface let an agent set one.What this does
Adds an optional
sessionTitleto the publish flow, applied only when the publish auto-creates a session — it never retitles an existing session, so agent writes can't clobber a rename the user made in the viewer.Threaded through all three integration tiers:
sessionTitleon thePOST /api/snippetsbody;publishSnippetpasses it tocreateSession.sessionTitleonpublish_snippetin both the streamable-HTTP server (server/mcpHttp.ts) and the stdio server (mcp/server.ts, viaensureSession); tool descriptions and INSTRUCTIONS strings note it's honored only on first publish.sideshow publish --session-title <t>, threaded intoresolveSession's session creation (the CLI pre-creates sessions, so the flag is applied there) and sent with the publish body; added to HELP.Docs (
skills/sideshow/SKILL.md,guide/AGENT_SETUP.md,guide/DESIGN_GUIDE.md) teach agents to pass a short task-level title on the first publish — name the task ("Auth refactor"), not the tool. The viewer needs no changes:sessionLabelalready preferstitle.Tests
sessionTitlecreates a titled sessionsessionTitleis ignored when publishing into an existing session (including after a user rename via PATCH)publish_snippetsets it on first publish and ignores it on subsequent onesValidation:
npm test(49 pass),npm run typecheck,npm run lint,npm run format:check, andnpm run test:e2e(10 pass, chromium + webkit) all green. Also smoke-tested the CLI flag end-to-end against a live server.🤖 Generated with Claude Code