fix(dashboard): generate conversation titles for channel threads#461
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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>
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
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()inmaybeUpdateAssistantTitlebecausesetAssistantTitleis a Slack API that only works in DM assistant threads. This guard also preventedconversationTitlefrom ever being stored in session records for channel conversations.Dashboard display priority:
conversation.conversationTitle— was alwaysundefinedfor channel threadsslackLocationLabel()— returns#channel-name← what everyone seesconversation.title— always"Turn <sessionId>"So 100% of channel-based conversations showed the channel label.
Fix
Decouple title generation from the Slack UI side effect:
setAssistantTitlefor DM assistant threads where the Slack API is supportedThe 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
reporting.tscontinues to override titles for private conversationsVerification
tsc --noEmitcleanREDIS_URLin the test environment)Action taken on behalf of David Cramer.
View Session in Sentry