refactor: align same-chat approval routing

This commit is contained in:
Peter Steinberger
2026-03-30 06:52:09 +09:00
parent f16c176a4c
commit 3ec000b995
12 changed files with 141 additions and 105 deletions

View File

@@ -191,6 +191,7 @@ export function createExecApprovalHandlers(
const hasExecApprovalClients = context.hasExecApprovalClients?.(client?.connId) ?? false;
const hasTurnSourceRoute = hasApprovalTurnSourceRoute({
turnSourceChannel: record.request.turnSourceChannel,
turnSourceAccountId: record.request.turnSourceAccountId,
});
let forwarded = false;
if (opts?.forwarder) {

View File

@@ -124,6 +124,7 @@ export function createPluginApprovalHandlers(
const hasApprovalClients = context.hasExecApprovalClients?.(client?.connId) ?? false;
const hasTurnSourceRoute = hasApprovalTurnSourceRoute({
turnSourceChannel: record.request.turnSourceChannel,
turnSourceAccountId: record.request.turnSourceAccountId,
});
if (!hasApprovalClients && !forwarded && !hasTurnSourceRoute) {
manager.expire(record.id, "no-approval-route");