test: avoid plugin fallback in agents tests

This commit is contained in:
Peter Steinberger
2026-04-10 15:59:44 +01:00
parent 4fb393980c
commit 5c67fa7cc0
3 changed files with 22 additions and 14 deletions

View File

@@ -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: {