Fix task message routing fallbacks

This commit is contained in:
klopez4212
2026-06-30 13:55:20 +01:00
parent c3d6efa6d9
commit 80cfc27ee6
2 changed files with 11 additions and 2 deletions
@@ -76,7 +76,10 @@ async function fetchRouteTargetEvents(
}
const targetThreadRef = getThreadReference(targetEvent.tags);
const threadRootId = targetThreadRootId ?? targetThreadRef.rootId ?? null;
const threadRootId =
targetThreadRootId ??
targetThreadRef.rootId ??
(targetAgentConversationReplyId ? targetEvent.id : null);
if (threadRootId && !eventsById.has(threadRootId)) {
addEvent(await fetchRouteEvent(threadRootId));
}
@@ -6,6 +6,7 @@ import {
formatDayHeading,
formatTime,
} from "@/features/messages/lib/dateFormatters";
import { isBroadcastReply } from "@/features/messages/lib/threading";
import type { TimelineMessage } from "@/features/messages/types";
import {
resolveUserLabel,
@@ -209,9 +210,14 @@ export function ChannelTasksView({
messageById.get(marker.threadRootId) ??
messageById.get(marker.parentMessageId ?? "") ??
null;
const isBroadcastTaskSource = message
? isBroadcastReply(message.tags ?? [])
: false;
const threadMessage =
resolvedThreadMessage ??
(marker.threadRootId === marker.agentReplyId ? message : null);
(marker.threadRootId === marker.agentReplyId || isBroadcastTaskSource
? message
: null);
return {
marker,
message,