Skip to content

fix(client): chats started from new chat no longer come back empty - #106

Merged
enisze merged 1 commit into
mainfrom
feature/fix-empty-chat-lingering-title
Oct 5, 2026
Merged

enisze merged 1 commit into
mainfrom
feature/fix-empty-chat-lingering-title

Conversation

@enisze

@enisze enisze commented Oct 5, 2026

Copy link
Copy Markdown
Owner

If you ran something in a chat started from the new-chat screen (e.g. /simplify) and later went back to it, the chat was empty, though the header still showed its title.

Opening a new chat can subscribe to its thread before the server creates it (an open diff panel does this). The server answers "not found", so the client marks the thread deleted. #105 was meant to undo that when thread.created arrived. But the server never sends thread.created on the thread stream (isThreadDetailEvent in apps/server/src/ws.ts), so the thread stayed deleted. The header takes its title from the shell, while the body fell back to the unsent draft. In the reported thread, the server trace shows the "not found" at 10:20:12 and the thread being created at 10:20:16. After that, the retry subscription received every event for the thread for 33 minutes, and the client ignored all of them.

Now the client treats any event for a thread marked deleted as proof that the thread exists, and reloads its snapshot. It does this at most once per thread state. Archived threads also answer "not found" while their sessions keep streaming, and reloading on every event would never settle.

Tests: the #105 test used a thread.created event that the real server never sends. It now uses the first thread.message-sent and fails without the fix. A second test covers the reload-once behavior and fails without the guard. The fix is in the shared client-runtime state, so web, desktop and mobile all get it.

🤖 Generated with Claude Code using Claude Opus 5.5

Opening a new chat can subscribe to its thread before the server has
created it (an open diff panel does this, for example). The server
answers "not found" and the client marks the thread deleted. The fix in
#105 waited for a thread.created event to undo that, but the server never
sends thread.created on the thread stream, so the chat stayed stuck: the
header showed the server title while the body rendered the empty draft.

Treat any event for a thread marked deleted as proof that it exists and
reload its snapshot. Do it at most once per thread state, because archived
threads also answer "not found" while their sessions keep streaming.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added size:S vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Oct 5, 2026
@enisze
enisze merged commit ab1a3a8 into main Oct 5, 2026
7 of 16 checks passed
@enisze
enisze deleted the feature/fix-empty-chat-lingering-title branch October 5, 2026 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant