mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 12:41:23 +00:00
fix: align draft/outbound typings and tests
This commit is contained in:
@@ -4,8 +4,6 @@ import path from "node:path";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type { ReplyPayload } from "../../auto-reply/types.js";
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import { setActivePluginRegistry } from "../../plugins/runtime.js";
|
||||
import { createTestRegistry } from "../../test-utils/channel-plugins.js";
|
||||
import { typedCases } from "../../test-utils/typed-cases.js";
|
||||
import {
|
||||
ackDelivery,
|
||||
|
||||
@@ -160,7 +160,7 @@ export function resolveOutboundTarget(params: {
|
||||
};
|
||||
}
|
||||
|
||||
const allowFrom =
|
||||
const allowFromRaw =
|
||||
params.allowFrom ??
|
||||
(params.cfg && plugin.config.resolveAllowFrom
|
||||
? plugin.config.resolveAllowFrom({
|
||||
@@ -168,6 +168,7 @@ export function resolveOutboundTarget(params: {
|
||||
accountId: params.accountId ?? undefined,
|
||||
})
|
||||
: undefined);
|
||||
const allowFrom = allowFromRaw?.map((entry) => String(entry));
|
||||
|
||||
// Fall back to per-channel defaultTo when no explicit target is provided.
|
||||
const effectiveTo =
|
||||
@@ -360,12 +361,13 @@ export function resolveHeartbeatSenderContext(params: {
|
||||
const accountId =
|
||||
params.delivery.accountId ??
|
||||
(provider === params.delivery.lastChannel ? params.delivery.lastAccountId : undefined);
|
||||
const allowFrom = provider
|
||||
const allowFromRaw = provider
|
||||
? (getChannelPlugin(provider)?.config.resolveAllowFrom?.({
|
||||
cfg: params.cfg,
|
||||
accountId,
|
||||
}) ?? [])
|
||||
: [];
|
||||
const allowFrom = allowFromRaw.map((entry) => String(entry));
|
||||
|
||||
const sender = resolveHeartbeatSenderId({
|
||||
allowFrom,
|
||||
|
||||
Reference in New Issue
Block a user