refactor(security): harden CommandAuthorized plumbing
This commit is contained in:
@@ -73,25 +73,25 @@ export async function getReplyFromConfig(
|
||||
silentToken: SILENT_REPLY_TOKEN,
|
||||
log: defaultRuntime.log,
|
||||
});
|
||||
opts?.onTypingController?.(typing);
|
||||
opts?.onTypingController?.(typing);
|
||||
|
||||
finalizeInboundContext(ctx);
|
||||
const finalized = finalizeInboundContext(ctx);
|
||||
|
||||
await applyMediaUnderstanding({
|
||||
ctx,
|
||||
ctx: finalized,
|
||||
cfg,
|
||||
agentDir,
|
||||
activeModel: { provider, model },
|
||||
});
|
||||
|
||||
const commandAuthorized = ctx.CommandAuthorized ?? false;
|
||||
const commandAuthorized = finalized.CommandAuthorized;
|
||||
resolveCommandAuthorization({
|
||||
ctx,
|
||||
ctx: finalized,
|
||||
cfg,
|
||||
commandAuthorized,
|
||||
});
|
||||
const sessionState = await initSessionState({
|
||||
ctx,
|
||||
ctx: finalized,
|
||||
cfg,
|
||||
commandAuthorized,
|
||||
});
|
||||
@@ -113,7 +113,7 @@ export async function getReplyFromConfig(
|
||||
} = sessionState;
|
||||
|
||||
const directiveResult = await resolveReplyDirectives({
|
||||
ctx,
|
||||
ctx: finalized,
|
||||
cfg,
|
||||
agentId,
|
||||
agentDir,
|
||||
|
||||
Reference in New Issue
Block a user