mirror of https://github.com/openclaw/openclaw.git
fix(infra): restore approval account binding compatibility
This commit is contained in:
parent
af7c6f4c68
commit
21ca006eca
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue