Skip to content

fix: update chat title immediately on send#66

Merged
wesbillman merged 1 commit intomainfrom
fix/chat-title-immediate-update
Apr 1, 2026
Merged

fix: update chat title immediately on send#66
wesbillman merged 1 commit intomainfrom
fix/chat-title-immediate-update

Conversation

@wesbillman
Copy link
Copy Markdown
Collaborator

Problem

When opening a "New Chat" tab and sending a message, the session title in the sidebar and tab bar stays as "New Chat" until the entire AI response finishes streaming. For long responses with tool calls, this means the title can be generic for the entire conversation.

Root Cause

The title was only set in two places, both late in the response lifecycle:

  1. acp:done handler in useAcpStream.ts — sets first 40 chars of user message as fallback, but only fires after the full response completes
  2. acp:session_info event — backend-generated title that can arrive even later

Neither triggers at message send time.

Note: Starting a chat from the home screen didn't have this bug because AppShell.tsx already passes initialMessage?.slice(0, 40) as the title at session creation time.

Fix

In useChat.ts's sendMessage, immediately set the session title from the user's message text (first 40 chars) when the session still has the default "New Chat" title. This happens before streaming begins, giving instant feedback.

The acp:session_info handler will upgrade to a better backend-generated title if one arrives later. The acp:done fallback correctly skips since the title is no longer "New Chat".

Changes

  • src/features/chat/hooks/useChat.ts — Added immediate title update in sendMessage (+13 lines)

When a user sends a message from a "New Chat" tab, the session title
now updates instantly from the message text instead of waiting for the
full AI response to complete (acp:done) or the backend title generation
(acp:session_info). This gives immediate feedback in the sidebar and
tab bar.

The backend-generated title from acp:session_info will still overwrite
this initial title if it arrives later, providing the best of both
worlds: instant feedback + quality titles.
@wesbillman wesbillman merged commit 1e09e09 into main Apr 1, 2026
7 checks passed
@wesbillman wesbillman deleted the fix/chat-title-immediate-update branch April 1, 2026 21:40
tellaho added a commit to tellaho/goose2 that referenced this pull request Apr 2, 2026
Merges 7 commits from main into tho/boss-ui:
- Image paste support in chat input (block#68)
- Tab name text unselectable (block#67)
- Chat title immediate update on send (block#66)
- Artifact v1 file viewing (block#63)
- Cmd+W tab close (block#64)
- Chat activity/unread state tracking (block#62)
- Sidebar hierarchy polish + faster reloads (block#61)

Key conflict resolutions:
- Keep Tailwind v4 CSS-based config (delete tailwind.config.js)
- Keep boss-ui dialog.tsx, add showCloseButton prop from main
- Add text-foreground-subtle token to boss-ui theme system
- Keep ToolCallAdapter (boss-ui), adopt ToolChainCards pattern from main
- Delete MarkdownContent/ToolCallCard (replaced by boss-ui ai-elements)
- Adopt SessionActivityIndicator from main into sidebar
- Adopt ClickableImage/ImageLightbox from main
- Merge drag-and-drop image support into ChatInput
- Keep boss-ui hover:bg-accent/50 treatment throughout sidebar

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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