Approvals: align native runtime tests

This commit is contained in:
Peter Steinberger
2026-04-07 20:07:41 +01:00
parent 7e2fc57858
commit a51488c13c
2 changed files with 2 additions and 7 deletions

View File

@@ -1,4 +1,3 @@
import { buildChannelApprovalNativeTargetKey } from "openclaw/plugin-sdk/approval-native-runtime";
import { describe, expect, it } from "vitest";
import { discordApprovalNativeRuntime } from "./approval-handler.runtime.js";
@@ -33,10 +32,7 @@ describe("discordApprovalNativeRuntime", () => {
});
expect(prepared).toEqual({
dedupeKey: buildChannelApprovalNativeTargetKey({
to: "123456789",
threadId: "777888999",
}),
dedupeKey: "777888999",
target: {
discordChannelId: "777888999",
},

View File

@@ -19,7 +19,6 @@ import type {
PluginApprovalResolvedView,
} from "openclaw/plugin-sdk/approval-handler-runtime";
import { createChannelApprovalNativeRuntimeAdapter } from "openclaw/plugin-sdk/approval-handler-runtime";
import { buildChannelApprovalNativeTargetKey } from "openclaw/plugin-sdk/approval-native-runtime";
import type { DiscordExecApprovalConfig, OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import type {
ExecApprovalActionDescriptor,
@@ -512,7 +511,7 @@ export const discordApprovalNativeRuntime = createChannelApprovalNativeRuntimeAd
? plannedTarget.target.threadId.trim()
: plannedTarget.target.to;
return {
dedupeKey: buildChannelApprovalNativeTargetKey(plannedTarget.target),
dedupeKey: destinationId,
target: {
discordChannelId: destinationId,
},