mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-20 21:51:28 +00:00
test: avoid plugin fallback in agents tests
This commit is contained in:
@@ -1,5 +1,18 @@
|
||||
import { parseThreadSessionSuffix } from "../sessions/session-key-utils.js";
|
||||
import { createTestRegistry } from "./channel-plugins.js";
|
||||
|
||||
function resolveGenericSessionConversation(params: { rawId: string }) {
|
||||
const parsed = parseThreadSessionSuffix(params.rawId);
|
||||
const id = parsed.baseSessionKey ?? params.rawId;
|
||||
return {
|
||||
id,
|
||||
threadId: parsed.threadId,
|
||||
baseConversationId: id,
|
||||
parentConversationCandidates:
|
||||
parsed.threadId && parsed.baseSessionKey ? [parsed.baseSessionKey] : [],
|
||||
};
|
||||
}
|
||||
|
||||
function resolveTelegramSessionConversation(params: { kind: "group" | "channel"; rawId: string }) {
|
||||
if (params.kind !== "group") {
|
||||
return null;
|
||||
@@ -52,6 +65,7 @@ export function createSessionConversationTestRegistry() {
|
||||
},
|
||||
capabilities: { chatTypes: ["direct", "channel", "thread"] },
|
||||
messaging: {
|
||||
resolveSessionConversation: resolveGenericSessionConversation,
|
||||
resolveSessionTarget: ({ id }: { id: string }) => `channel:${id}`,
|
||||
},
|
||||
config: {
|
||||
@@ -74,6 +88,7 @@ export function createSessionConversationTestRegistry() {
|
||||
},
|
||||
capabilities: { chatTypes: ["direct", "channel", "thread"] },
|
||||
messaging: {
|
||||
resolveSessionConversation: resolveGenericSessionConversation,
|
||||
resolveSessionTarget: ({ id }: { id: string }) => `channel:${id}`,
|
||||
},
|
||||
config: {
|
||||
@@ -96,6 +111,7 @@ export function createSessionConversationTestRegistry() {
|
||||
},
|
||||
capabilities: { chatTypes: ["direct", "channel", "thread"] },
|
||||
messaging: {
|
||||
resolveSessionConversation: resolveGenericSessionConversation,
|
||||
resolveSessionTarget: ({ id }: { id: string }) => `channel:${id}`,
|
||||
},
|
||||
config: {
|
||||
|
||||
Reference in New Issue
Block a user