Multi-bot thinking indicator for chat channels#5928
Open
wca4a wants to merge 7 commits into
Open
Conversation
…tionComputingState Drop the activeStates[0] truncation so every thinking ship in a conversation is surfaced, sorted by ship (not timing.since, which heartbeat re-publishes would reorder). Combined label resolves display names for two ships and counts for three or more. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Overlapping ContactAvatars pop in/out via ship-keyed AnimatePresence (capped at 3 visible plus +N). Avatars show in group channels always and in DMs only when two or more ships report, so 1:1 DMs keep the avatar-less spinner+text. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The presence pipeline already aggregates group-channel contexts; only the UI gate was DM-only. Notebooks, galleries, and group DMs stay excluded. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Two bugs blocked bot presence in group channels: - a %set with empty disclose fanned out to subscribers but was never stored on the host itself, so the host's own client saw nothing for channels it hosts. Treat empty disclose as public, including us. - a nacked context watch permanently dropped the desire, killing presence for that context until the next full setup. Keep the desire and retry after ~m5, skipping if the context is no longer wanted. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
A nacked context watch previously rescheduled itself every ~m5 forever, so a permanently-failing host (e.g. nuked presence agent) meant an eternal timer per context. Track consecutive nacks per [ship context] in a new state-1 tries map, back off linearly (try * ~m5), and give up after 5 attempts by dropping the desire; the next full setup starts a fresh cycle if the context is still relevant. Tries are pruned on ack, context removal, and full setup. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Computing presence is channel-scoped, so the indicator reflects bots thinking anywhere in the channel; thread-scoped presence contexts are the ideal end state. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
useConversationComputingStateto return per-ship computing states with a combined label ("X and Y are thinking...", "N bots are thinking..."), sorted by ship so heartbeat re-publishes don't reorder.ThinkingStateas an animated avatar stack (max 3 avatars + "+N" overflow) and enables it in group chat channels (dm+chat), gated on read permission.DetailView), above the reply composer.%presenceagent bugs:%setwith emptydisclose(= public) was fanned out to subscribers but never stored on the context host itself, so the host's own client never saw presence for channels it hosts.triesmap in%1state, giving up after 5 consecutive nacks so a permanently-failing host doesn't become an eternal timer.Known limitation: thread indicator is channel-scoped
Computing presence contexts are keyed by channel/DM only (
/channel/chat/~host/name), so the indicator in a thread reflects bots thinking anywhere in that channel, not specifically in that thread. The ideal end state is thread-scoped presence contexts (e.g./channel/chat/~host/name/thread/<parent-post-id>) published by the gateway, with the channel view aggregating thread contexts by prefix. That requires changes across the presence agent, the gateway publisher, and the client presence API, so it's deferred to a follow-up.Test plan
tsc --noEmitclean on packages/app%0→%1state migration)🤖 Generated with Claude Code