mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-06 06:41:08 +00:00
fix(infra): restore approval account binding compatibility
This commit is contained in:
@@ -80,7 +80,13 @@ export function resolveApprovalRequestChannelAccountId(params: {
|
||||
if (!expectedChannel) {
|
||||
return null;
|
||||
}
|
||||
return resolveApprovalRequestAccountId(params);
|
||||
const turnSourceChannel = normalizeOptionalChannel(params.request.request.turnSourceChannel);
|
||||
if (!turnSourceChannel || turnSourceChannel === expectedChannel) {
|
||||
return resolveApprovalRequestAccountId(params);
|
||||
}
|
||||
|
||||
const sessionBinding = resolvePersistedApprovalRequestSessionBinding(params);
|
||||
return sessionBinding?.channel === expectedChannel ? (sessionBinding.accountId ?? null) : null;
|
||||
}
|
||||
|
||||
export function doesApprovalRequestMatchChannelAccount(params: {
|
||||
|
||||
@@ -8,6 +8,12 @@ import type { ExecApprovalRequest } from "./exec-approvals.js";
|
||||
import { resolveSessionDeliveryTarget } from "./outbound/targets.js";
|
||||
import type { PluginApprovalRequest } from "./plugin-approvals.js";
|
||||
|
||||
export {
|
||||
doesApprovalRequestMatchChannelAccount,
|
||||
resolveApprovalRequestAccountId,
|
||||
resolveApprovalRequestChannelAccountId,
|
||||
} from "./approval-request-account-binding.js";
|
||||
|
||||
export type ExecApprovalSessionTarget = {
|
||||
channel?: string;
|
||||
to: string;
|
||||
|
||||
Reference in New Issue
Block a user