Skip to content

feat(server): let agents name a session when their first publish creates it#5

Merged
benvinegar merged 1 commit into
mainfrom
feat/session-title
Jun 11, 2026
Merged

feat(server): let agents name a session when their first publish creates it#5
benvinegar merged 1 commit into
mainfrom
feat/session-title

Conversation

@benvinegar

Copy link
Copy Markdown
Member

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/sessions already accepts a title, but nothing in the publish path or MCP surface let an agent set one.

What this does

Adds an optional sessionTitle to 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:

  • RESTsessionTitle on the POST /api/snippets body; publishSnippet passes it to createSession.
  • MCP — optional sessionTitle on publish_snippet in both the streamable-HTTP server (server/mcpHttp.ts) and the stdio server (mcp/server.ts, via ensureSession); tool descriptions and INSTRUCTIONS strings note it's honored only on first publish.
  • CLIsideshow publish --session-title <t>, threaded into resolveSession'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: sessionLabel already prefers title.

Tests

  • publish with sessionTitle creates a titled session
  • sessionTitle is ignored when publishing into an existing session (including after a user rename via PATCH)
  • MCP publish_snippet sets it on first publish and ignores it on subsequent ones

Validation: npm test (49 pass), npm run typecheck, npm run lint, npm run format:check, and npm 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

…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>
@benvinegar benvinegar merged commit fbc8f9d into main Jun 11, 2026
6 checks passed
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