Skip to content

Commit 90a5c78

Browse files
fix(outbound): enforce context before account inference
1 parent 6fcf4f6 commit 90a5c78

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

‎src/infra/outbound/message-action-runner.ts‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,6 +1273,15 @@ export async function runMessageAction(
12731273
});
12741274

12751275
const channel = await resolveChannel(cfg, params, input.toolContext);
1276+
enforceCrossContextPolicy({
1277+
channel,
1278+
action,
1279+
args: params,
1280+
toolContext: input.toolContext,
1281+
cfg,
1282+
agentId: resolvedAgentId,
1283+
});
1284+
12761285
let accountId = readStringParam(params, "accountId") ?? input.defaultAccountId;
12771286
if (!accountId && resolvedAgentId) {
12781287
accountId = resolveTargetBoundAccountId({
@@ -1352,15 +1361,6 @@ export async function runMessageAction(
13521361
accountId,
13531362
});
13541363

1355-
enforceCrossContextPolicy({
1356-
channel,
1357-
action,
1358-
args: params,
1359-
toolContext: input.toolContext,
1360-
cfg,
1361-
agentId: resolvedAgentId,
1362-
});
1363-
13641364
const gateway = resolveGateway(input);
13651365

13661366
if (action === "send") {

0 commit comments

Comments
 (0)