fix(mcp): direct messages find channels in the store, reaction set stays small
- a channel is recognized from the stored channels, not the sidebar that may still be loading - a direct reaction that falls back to review or goes stale leaves the in-flight set Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@@ -77,7 +77,7 @@ fn send_message(state: &Entity<AppState>, entry: ProposalEntry, cx: &mut App) {
77
77
agent_api::hold_for_review(&conversation_id, cx);
78
78
return;
79
79
};
80
let in_channel = state.read(cx).channel_team_id(&conversation_id).is_some();
80
let in_channel = state.read(cx).store.channel(&conversation_id).ok().flatten().is_some();
81
81
let target_message = entry
82
82
.proposal
83
83
.reply_to_message_id
@@ -126,10 +126,12 @@ fn add_reaction(
126
126
let (conversation_id, message_id) = (reaction.conversation_id.clone(), reaction.message_id.clone());
127
127
let Some(engine) = live_engine(state, cx) else {
128
128
agent_api::hold_reaction_for_review(&conversation_id, &message_id, cx);
129
reacting.borrow_mut().remove(&reaction.id);
129
130
return;
130
131
};
131
132
if message(state, &conversation_id, &message_id, cx).is_none() {
132
133
agent_api::resolve_reaction_proposal(&conversation_id, &message_id, &reaction.id, ReactionOutcome::Stale, cx);
134
reacting.borrow_mut().remove(&reaction.id);
133
135
return;
134
136
}
135
137
let reaction_type = api_reaction(&reaction_glyph(&reaction.emoji));
@@ -77,7 +77,7 @@ fn send_message(state: &Entity<AppState>, entry: ProposalEntry, cx: &mut App) {77
agent_api::hold_for_review(&conversation_id, cx);77
agent_api::hold_for_review(&conversation_id, cx);78
return;78
return;79
};79
};80
let in_channel = state.read(cx).channel_team_id(&conversation_id).is_some();80
let in_channel = state.read(cx).store.channel(&conversation_id).ok().flatten().is_some();81
let target_message = entry81
let target_message = entry82
.proposal82
.proposal83
.reply_to_message_id83
.reply_to_message_id@@ -126,10 +126,12 @@ fn add_reaction(126
let (conversation_id, message_id) = (reaction.conversation_id.clone(), reaction.message_id.clone());126
let (conversation_id, message_id) = (reaction.conversation_id.clone(), reaction.message_id.clone());127
let Some(engine) = live_engine(state, cx) else {127
let Some(engine) = live_engine(state, cx) else {128
agent_api::hold_reaction_for_review(&conversation_id, &message_id, cx);128
agent_api::hold_reaction_for_review(&conversation_id, &message_id, cx);129
reacting.borrow_mut().remove(&reaction.id);129
return;130
return;130
};131
};131
if message(state, &conversation_id, &message_id, cx).is_none() {132
if message(state, &conversation_id, &message_id, cx).is_none() {132
agent_api::resolve_reaction_proposal(&conversation_id, &message_id, &reaction.id, ReactionOutcome::Stale, cx);133
agent_api::resolve_reaction_proposal(&conversation_id, &message_id, &reaction.id, ReactionOutcome::Stale, cx);134
reacting.borrow_mut().remove(&reaction.id);133
return;135
return;134
}136
}135
let reaction_type = api_reaction(&reaction_glyph(&reaction.emoji));137
let reaction_type = api_reaction(&reaction_glyph(&reaction.emoji));