mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 16:14:58 +00:00
refactor(channels): share native command session targets
This commit is contained in:
@@ -14,6 +14,7 @@ import { finalizeInboundContext } from "../auto-reply/reply/inbound-context.js";
|
||||
import { dispatchReplyWithBufferedBlockDispatcher } from "../auto-reply/reply/provider-dispatcher.js";
|
||||
import { listSkillCommandsForAgents } from "../auto-reply/skill-commands.js";
|
||||
import { resolveCommandAuthorizedFromAuthorizers } from "../channels/command-gating.js";
|
||||
import { resolveNativeCommandSessionTargets } from "../channels/native-command-session-targets.js";
|
||||
import { createReplyPrefixOptions } from "../channels/reply-prefix.js";
|
||||
import { recordInboundSessionMetaSafe } from "../channels/session-meta.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
@@ -638,6 +639,13 @@ export const registerTelegramNativeCommands = ({
|
||||
groupConfig,
|
||||
topicConfig,
|
||||
});
|
||||
const { sessionKey: commandSessionKey, commandTargetSessionKey } =
|
||||
resolveNativeCommandSessionTargets({
|
||||
agentId: route.agentId,
|
||||
sessionPrefix: "telegram:slash",
|
||||
userId: String(senderId || chatId),
|
||||
targetSessionKey: sessionKey,
|
||||
});
|
||||
const conversationLabel = isGroup
|
||||
? msg.chat.title
|
||||
? `${msg.chat.title} id:${chatId}`
|
||||
@@ -665,9 +673,9 @@ export const registerTelegramNativeCommands = ({
|
||||
WasMentioned: true,
|
||||
CommandAuthorized: commandAuthorized,
|
||||
CommandSource: "native" as const,
|
||||
SessionKey: `agent:${route.agentId}:telegram:slash:${senderId || chatId}`,
|
||||
SessionKey: commandSessionKey,
|
||||
AccountId: route.accountId,
|
||||
CommandTargetSessionKey: sessionKey,
|
||||
CommandTargetSessionKey: commandTargetSessionKey,
|
||||
MessageThreadId: threadSpec.id,
|
||||
IsForum: isForum,
|
||||
// Originating context for sub-agent announce routing
|
||||
|
||||
Reference in New Issue
Block a user