

























@@ -1,6 +1,7 @@
11import { resolveSessionAgentId } from "../agents/agent-scope.js";
22import { finalizeInboundContext } from "../auto-reply/reply/inbound-context.js";
33import { dispatchReplyWithBufferedBlockDispatcher } from "../auto-reply/reply/provider-dispatcher.js";
4+import type { ChatType } from "../channels/chat-type.js";
45import { getChannelPlugin, normalizeChannelId } from "../channels/plugins/index.js";
56import { recordInboundSession } from "../channels/session.js";
67import type { CliDeps } from "../cli/deps.types.js";
@@ -149,6 +150,7 @@ type RestartContinuationRoute = {
149150accountId?: string;
150151replyToId?: string;
151152threadId?: string;
153+chatType: ChatType;
152154};
153155154156function resolveRestartContinuationRoute(params: {
@@ -157,6 +159,7 @@ function resolveRestartContinuationRoute(params: {
157159accountId?: string;
158160replyToId?: string;
159161threadId?: string;
162+chatType: ChatType;
160163}): RestartContinuationRoute | undefined {
161164if (!params.channel || !params.to) {
162165return undefined;
@@ -167,6 +170,7 @@ function resolveRestartContinuationRoute(params: {
167170 ...(params.accountId ? { accountId: params.accountId } : {}),
168171 ...(params.replyToId ? { replyToId: params.replyToId } : {}),
169172 ...(params.threadId ? { threadId: params.threadId } : {}),
173+chatType: params.chatType,
170174};
171175}
172176@@ -246,7 +250,7 @@ async function dispatchRestartSentinelContinuation(params: {
246250Timestamp: Date.now(),
247251Provider: route.channel,
248252Surface: route.channel,
249-ChatType: "direct",
253+ChatType: route.chatType,
250254CommandAuthorized: true,
251255ReplyToId: route.replyToId,
252256OriginatingChannel: route.channel,
@@ -337,12 +341,14 @@ async function loadRestartSentinelStartupTask(params: {
337341338342const sentinelContext = payload.deliveryContext;
339343let sessionDeliveryContext = deliveryContextFromSession(entry);
344+let chatType = entry?.origin?.chatType ?? "direct";
340345if (
341346!hasRoutableDeliveryContext(sessionDeliveryContext) &&
342347baseSessionKey &&
343348baseSessionKey !== sessionKey
344349) {
345350const { entry: baseEntry } = loadSessionEntry(baseSessionKey);
351+chatType = entry?.origin?.chatType ?? baseEntry?.origin?.chatType ?? "direct";
346352sessionDeliveryContext = mergeDeliveryContext(
347353sessionDeliveryContext,
348354deliveryContextFromSession(baseEntry),
@@ -426,6 +432,7 @@ async function loadRestartSentinelStartupTask(params: {
426432accountId: origin?.accountId,
427433 replyToId,
428434threadId: resolvedThreadId,
435+ chatType,
429436}),
430437});
431438} catch (err) {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。