fix(gateway): enforce owner boundary for agent runs

This commit is contained in:
Peter Steinberger
2026-03-02 00:27:32 +00:00
parent 9005e8bc0a
commit 58659b931b
10 changed files with 123 additions and 1 deletions

View File

@@ -163,6 +163,7 @@ function runAgentAttempt(params: {
onAgentEvent: (evt: { stream: string; data?: Record<string, unknown> }) => void;
primaryProvider: string;
}) {
const senderIsOwner = params.opts.senderIsOwner ?? true;
const effectivePrompt = resolveFallbackRetryPrompt({
body: params.body,
isFallbackRetry: params.isFallbackRetry,
@@ -209,7 +210,7 @@ function runAgentAttempt(params: {
currentThreadTs: params.runContext.currentThreadTs,
replyToMode: params.runContext.replyToMode,
hasRepliedRef: params.runContext.hasRepliedRef,
senderIsOwner: true,
senderIsOwner,
sessionFile: params.sessionFile,
workspaceDir: params.workspaceDir,
config: params.cfg,