





















@@ -19,7 +19,12 @@ import {
1919import { handleCodexAppServerApprovalRequest } from "./approval-bridge.js";
2020import { refreshCodexAppServerAuthTokens } from "./auth-bridge.js";
2121import { isCodexAppServerApprovalRequest, type CodexAppServerClient } from "./client.js";
22-import { readCodexPluginConfig, resolveCodexAppServerRuntimeOptions } from "./config.js";
22+import {
23+readCodexPluginConfig,
24+resolveCodexAppServerRuntimeOptions,
25+shouldAutoApproveCodexAppServerApprovals,
26+type CodexAppServerRuntimeOptions,
27+} from "./config.js";
2328import {
2429emitDynamicToolErrorDiagnostic,
2530emitDynamicToolStartedDiagnostic,
@@ -166,6 +171,8 @@ export async function runCodexAppServerSideQuestion(
166171try {
167172const cwd = binding.cwd || params.workspaceDir || process.cwd();
168173const sideRunParams = buildSideRunAttemptParams(params, { cwd, authProfileId });
174+const approvalPolicy = binding.approvalPolicy ?? appServer.approvalPolicy;
175+const sandbox = binding.sandbox ?? appServer.sandbox;
169176const { sessionAgentId } = resolveSessionAgentIds({
170177sessionKey: params.sessionKey,
171178config: params.cfg,
@@ -212,6 +219,7 @@ export async function runCodexAppServerSideQuestion(
212219threadId: childThreadId,
213220 turnId,
214221 nativeHookRelay,
222+autoApprove: shouldAutoApproveCodexAppServerApprovals({ approvalPolicy, sandbox }),
215223signal: runAbortController.signal,
216224});
217225}
@@ -259,8 +267,6 @@ export async function runCodexAppServerSideQuestion(
259267}
260268});
261269262-const approvalPolicy = binding.approvalPolicy ?? appServer.approvalPolicy;
263-const sandbox = binding.sandbox ?? appServer.sandbox;
264270const serviceTier = binding.serviceTier ?? appServer.serviceTier;
265271const nativeHookRelayEvents = resolveCodexSideNativeHookRelayEvents({
266272configuredEvents: options.nativeHookRelay?.events,
@@ -401,7 +407,7 @@ export async function runCodexAppServerSideQuestion(
401407402408function resolveCodexSideNativeHookRelayEvents(params: {
403409configuredEvents?: readonly NativeHookRelayEvent[];
404-approvalPolicy: ReturnType<typeof resolveCodexAppServerRuntimeOptions>["approvalPolicy"];
410+approvalPolicy: CodexAppServerRuntimeOptions["approvalPolicy"];
405411}): readonly NativeHookRelayEvent[] {
406412if (params.configuredEvents?.length) {
407413return params.configuredEvents;
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。