mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 09:41:11 +00:00
fix(qa-lab): tighten telegram canary matching
This commit is contained in:
@@ -166,6 +166,29 @@ describe("telegram live qa runtime", () => {
|
||||
).toBe("match");
|
||||
});
|
||||
|
||||
it("classifies threaded blank sut replies as matches", () => {
|
||||
expect(
|
||||
__testing.classifyCanaryReply({
|
||||
groupId: "-100123",
|
||||
sutBotId: 88,
|
||||
driverMessageId: 55,
|
||||
message: {
|
||||
updateId: 3,
|
||||
messageId: 11,
|
||||
chatId: -100123,
|
||||
senderId: 88,
|
||||
senderIsBot: true,
|
||||
senderUsername: "sut_bot",
|
||||
text: "",
|
||||
replyToMessageId: 55,
|
||||
timestamp: 1_700_000_002_000,
|
||||
inlineButtons: [],
|
||||
mediaKinds: ["photo"],
|
||||
},
|
||||
}),
|
||||
).toBe("match");
|
||||
});
|
||||
|
||||
it("redacts observed message content by default in artifacts", () => {
|
||||
expect(
|
||||
__testing.buildObservedMessagesArtifact({
|
||||
|
||||
@@ -325,7 +325,7 @@ async function flushTelegramUpdates(token: string) {
|
||||
}
|
||||
offset = (updates.at(-1)?.update_id ?? offset) + 1;
|
||||
}
|
||||
return offset;
|
||||
throw new Error("timed out after 15000ms draining Telegram updates");
|
||||
}
|
||||
|
||||
async function sendGroupMessage(token: string, groupId: string, text: string) {
|
||||
@@ -471,8 +471,7 @@ function classifyCanaryReply(params: {
|
||||
}) {
|
||||
if (
|
||||
params.message.chatId !== Number(params.groupId) ||
|
||||
params.message.senderId !== params.sutBotId ||
|
||||
!params.message.text.trim()
|
||||
params.message.senderId !== params.sutBotId
|
||||
) {
|
||||
return "ignore" as const;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user