Skip to content

fix(dashboard): generate conversation titles for channel threads#461

Merged
dcramer merged 2 commits into
mainfrom
fix/channel-conversation-titles
May 31, 2026
Merged

fix(dashboard): generate conversation titles for channel threads#461
dcramer merged 2 commits into
mainfrom
fix/channel-conversation-titles

Conversation

@sentry-junior
Copy link
Copy Markdown
Contributor

@sentry-junior sentry-junior Bot commented May 31, 2026

Problem

The dashboard conversation list shows only the channel name (e.g. #proj-junior) as the title for all non-DM Slack conversations. The actual AI-generated conversation title never appears.

Root Cause

Title generation was fully gated on isDmChannel() in maybeUpdateAssistantTitle because setAssistantTitle is a Slack API that only works in DM assistant threads. This guard also prevented conversationTitle from ever being stored in session records for channel conversations.

Dashboard display priority:

  1. conversation.conversationTitle — was always undefined for channel threads
  2. slackLocationLabel() — returns #channel-name ← what everyone sees
  3. conversation.title — always "Turn <sessionId>"

So 100% of channel-based conversations showed the channel label.

Fix

Decouple title generation from the Slack UI side effect:

  • Generate and store a conversation title for ALL Slack conversation types (channel, private channel, group DM, DM)
  • Only call setAssistantTitle for DM assistant threads where the Slack API is supported
  • Fix the permission-error path so a Slack DM title update failure no longer discards the generated title for dashboard reporting

The existing cost controls remain intact: fast model, 500-char input cap, 60-char output cap, and per-source-message dedup via assistantTitleSourceMessageId.

What's not changed

  • The Slack DM thread title UI behavior is unchanged
  • Privacy masking in reporting.ts continues to override titles for private conversations
  • Existing conversations won't backfill; the title appears on the next turn

Verification

  • 877 unit tests pass
  • tsc --noEmit clean
  • No new test failures (4 pre-existing integration test failures are unrelated to this change — they fail due to missing REDIS_URL in the test environment)

Action taken on behalf of David Cramer.


View Session in Sentry

Previously title generation was gated on isDmChannel() because
setAssistantTitle is a Slack DM-only API. This also prevented dashboard
conversationTitle from being stored for any non-DM conversation, so the
dashboard always fell back to showing the channel name as the title.

Decouple the two responsibilities:
- Generate and persist a conversation title for ALL Slack conversations
  (channel, private channel, group DM, DM).
- Only call Slack setAssistantTitle for DM assistant threads where the
  API is supported.

Also split error handling so a Slack permission failure on setAssistantTitle
no longer suppresses the generated title for dashboard reporting purposes.

Fixes: dashboard conversation list showing #channel-name as title for
all non-DM conversations.

Co-authored-by: David Cramer <noreply>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview, Comment May 31, 2026 6:55pm

Request Review

Covers the key behaviors introduced in the channel-title fix:
- Channel threads generate a title but never call setAssistantTitle
- DM threads generate a title and call setAssistantTitle
- DM Slack permission errors return the generated title (not undefined)
- DM non-permission Slack errors also return the generated title
- Missing context, empty conversation, dedup, and generation failures
  all return undefined without a model call

Co-authored-by: David Cramer <david@sentry.io>
@sentry-junior sentry-junior Bot marked this pull request as ready for review May 31, 2026 18:54
@dcramer dcramer merged commit aec60dd into main May 31, 2026
16 checks passed
@dcramer dcramer deleted the fix/channel-conversation-titles branch May 31, 2026 18:59
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