@openclaw/codex 2026.7.2-beta.4 → 2026.7.2-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/{app-server-policy-BO3jYBkv.js → app-server-policy-BmDgseo_.js} +1 -1
  2. package/dist/attempt-client-cleanup-Ia52yRWc.js +127 -0
  3. package/dist/{attempt-notifications-DdmnBMUp.js → attempt-notifications-CMR2_fmR.js} +1 -1
  4. package/dist/{bounded-turn-CaQL96kg.js → bounded-turn-FEbUXoYT.js} +36 -13
  5. package/dist/{capabilities-CLICvTxf.js → capabilities-BHRSI6Cn.js} +1 -1
  6. package/dist/cli-metadata.js +1 -1
  7. package/dist/{command-formatters-DgADqnHa.js → command-formatters-ico4ZFnk.js} +2 -2
  8. package/dist/{command-handlers-l_lVPNlB.js → command-handlers-CRmnwI2N.js} +1232 -1221
  9. package/dist/{compact-CC5KhBzX.js → compact-dEN49UH6.js} +7 -7
  10. package/dist/{computer-use-Ip1-QGa-.js → computer-use-BjGylO-E.js} +16 -6
  11. package/dist/{conversation-control-sNPsbTCP.js → conversation-control-DE7d9DOj.js} +6 -6
  12. package/dist/doctor-contract-api.js +24 -86
  13. package/dist/{dynamic-tools-CQI3UwqY.js → dynamic-tools-LIt9ojep.js} +50 -46
  14. package/dist/{event-projector-usage-D6tE7_qD.js → event-projector-usage-tvgb1NCX.js} +2 -2
  15. package/dist/harness.js +14 -13
  16. package/dist/index.js +208 -267
  17. package/dist/media-understanding-provider.js +6 -1
  18. package/dist/{models-BNeMlHgg.js → models-BA01NEez.js} +2 -2
  19. package/dist/{notification-correlation-BGLixv5_.js → notification-correlation-Bj_Ak_jI.js} +3 -3
  20. package/dist/{plugin-app-cache-key-CvzvmBRz.js → plugin-app-cache-key-DSXX-rXO.js} +5 -5
  21. package/dist/{transcript-mirror-2p7kl6e4.js → protocol-validators-Dm4eXZmt.js} +2 -550
  22. package/dist/{rate-limits-D0IJT-a6.js → rate-limits-S_PXs0ul.js} +1 -1
  23. package/dist/realtime-voice-api-BPcA1uN9.js +494 -0
  24. package/dist/realtime-voice-api.js +2 -0
  25. package/dist/{request-BTccUTD3.js → request-CXpPennK.js} +1 -1
  26. package/dist/{run-attempt--858NXDl.js → run-attempt-C5GTPJOE.js} +417 -237
  27. package/dist/{session-binding-ZSMX1omP.js → session-binding-DlVQ-Pxs.js} +952 -890
  28. package/dist/{session-catalog-DsKaezgR.js → session-catalog-CP2oCcEb.js} +32 -23
  29. package/dist/{session-cli-CYJTfRLG.js → session-cli-CqZ0Fp2a.js} +2 -2
  30. package/dist/{session-upstream-marker-D7XlI9us.js → session-upstream-marker-QE-m5QFG.js} +1 -1
  31. package/dist/{settled-turn-finalizer-DHltNgtF.js → settled-turn-finalizer-CA_2QXIE.js} +2 -2
  32. package/dist/{shared-client-wmgNFNYp.js → shared-client-BVKE40c-.js} +1863 -1707
  33. package/dist/{side-question-BfFZCsJ-.js → side-question-CO12sHxo.js} +11 -9
  34. package/dist/{thread-lifecycle-cqrOlJkq.js → thread-lifecycle-DRg_FdzC.js} +12 -132
  35. package/dist/transcript-mirror-uKA-A4tB.js +550 -0
  36. package/dist/{upstream-session-fork-vPjwkT1i.js → upstream-session-fork-_Vrz4WJr.js} +3 -3
  37. package/dist/{usage-DM_I3mPT.js → usage-UpVbdX5G.js} +3 -3
  38. package/dist/{web-search-provider.runtime-Bx6HAc_k.js → web-search-provider.runtime-CaQMYDbp.js} +3 -3
  39. package/package.json +4 -5
  40. package/npm-shrinkwrap.json +0 -202
  41. package/dist/{auth-binding-C1czuHPA.js → auth-binding-B4FfbcCg.js} +1 -1
@@ -1,15 +1,15 @@
1
- import { B as isCodexAppServerApprovalRequest, Q as isJsonObject, T as resolveCodexAppServerPreparedAuthHandoff, a as getLeasedSharedCodexAppServerClient, g as ensureCodexAppServerClientRuntime, p as withLeasedCodexAppServerClientStartSelectionRetry, s as releaseCodexAppServerClientLease, v as readRecentCodexRateLimits } from "./shared-client-wmgNFNYp.js";
2
- import { O as resolveOpenClawExecPolicyForCodexAppServer, T as resolveCodexModelBackedReviewerPolicyContext, b as readCodexPluginConfig, k as shouldAutoApproveCodexAppServerApprovals, l as sessionBindingIdentity, m as canUseCodexModelBackedApprovalsReviewerForModel } from "./session-binding-ZSMX1omP.js";
3
- import { A as resolveCodexDynamicToolsLoading, C as readCodexSupportedReasoningEfforts, J as buildCodexPluginAppsConfigPatchFromPolicyContext, Q as mergeCodexThreadConfigs, S as resolveReasoningEffort, T as filterCodexDynamicTools, _ as CODEX_NATIVE_PERSONALITY_NONE, f as buildCodexRuntimeThreadConfig, h as resolveCodexWebSearchPlan, v as resolveCodexAppServerModelProvider, x as resolveCodexBindingModelProviderFallback, y as resolveCodexAppServerRequestModelSelection } from "./thread-lifecycle-cqrOlJkq.js";
4
- import { S as readCodexTurn, h as assertCodexThreadForkResponse, v as assertCodexTurnStartResponse, y as readCodexDynamicToolCallParams } from "./transcript-mirror-2p7kl6e4.js";
5
- import { n as formatCodexUsageLimitErrorMessage } from "./rate-limits-D0IJT-a6.js";
6
- import { t as resolveCodexAppServerForModelProvider } from "./app-server-policy-BO3jYBkv.js";
1
+ import { D as ensureCodexAppServerClientRuntime, I as resolveCodexAppServerPreparedAuthHandoff, V as isJsonObject, a as getLeasedSharedCodexAppServerClient, c as releaseCodexAppServerClientLease, k as readRecentCodexRateLimits, m as withLeasedCodexAppServerClientStartSelectionRetry, y as isCodexAppServerApprovalRequest } from "./shared-client-BVKE40c-.js";
2
+ import { D as resolveOpenClawExecPolicyForCodexAppServer, S as resolveCodexModelBackedReviewerPolicyContext, T as readCodexPluginConfig, b as canUseCodexModelBackedApprovalsReviewerForModel, l as sessionBindingIdentity, v as shouldAutoApproveCodexAppServerApprovals } from "./session-binding-DlVQ-Pxs.js";
3
+ import { A as resolveCodexDynamicToolsLoading, C as readCodexSupportedReasoningEfforts, G as mergeCodexThreadConfigs, S as resolveReasoningEffort, T as filterCodexDynamicTools, V as buildCodexPluginAppsConfigPatchFromPolicyContext, _ as CODEX_NATIVE_PERSONALITY_NONE, f as buildCodexRuntimeThreadConfig, h as resolveCodexWebSearchPlan, v as resolveCodexAppServerModelProvider, x as resolveCodexBindingModelProviderFallback, y as resolveCodexAppServerRequestModelSelection } from "./thread-lifecycle-DRg_FdzC.js";
4
+ import { a as assertCodexTurnStartResponse, l as readCodexTurn, n as assertCodexThreadForkResponse, o as readCodexDynamicToolCallParams } from "./protocol-validators-Dm4eXZmt.js";
5
+ import { n as formatCodexUsageLimitErrorMessage } from "./rate-limits-S_PXs0ul.js";
6
+ import { t as resolveCodexAppServerForModelProvider } from "./app-server-policy-BmDgseo_.js";
7
7
  import { n as resolveCodexNativeExecutionBlock } from "./sandbox-guard-D1Wky__S.js";
8
- import { a as resolveCodexBindingAppServerConnection, i as requireCodexSupervisionModelSelection, n as readCodexNotificationThreadId, r as readCodexNotificationTurnId } from "./notification-correlation-BGLixv5_.js";
9
- import { C as CodexNativeToolLifecycleProjector, D as buildCodexNativeHookRelayDisabledConfig, E as buildCodexNativeHookRelayConfig, L as resolveDynamicToolCallTimeoutMs, N as handleDynamicToolCallWithTimeout, S as filterToolsForVisionInputs, U as resolveCodexToolAbortTerminalReason, _ as resolveCodexMessageToolProvider, a as emitDynamicToolStartedDiagnostic, c as resolveCodexProviderWebSearchSupportForClient, i as emitDynamicToolErrorDiagnostic, k as emitCodexNativePreToolUseFailureDiagnostic, n as handleCodexAppServerApprovalRequest, o as emitDynamicToolTerminalDiagnostic, r as handleCodexAppServerElicitationRequest, t as createCodexDynamicToolBridge, w as CODEX_NATIVE_HOOK_RELAY_EVENTS, y as shouldEnableCodexAppServerNativeToolSurface } from "./dynamic-tools-CQI3UwqY.js";
8
+ import { a as resolveCodexBindingAppServerConnection, i as requireCodexSupervisionModelSelection, n as readCodexNotificationThreadId, r as readCodexNotificationTurnId } from "./notification-correlation-Bj_Ak_jI.js";
9
+ import { C as CodexNativeToolLifecycleProjector, D as buildCodexNativeHookRelayDisabledConfig, E as buildCodexNativeHookRelayConfig, L as resolveDynamicToolCallTimeoutMs, N as handleDynamicToolCallWithTimeout, S as filterToolsForVisionInputs, U as resolveCodexToolAbortTerminalReason, _ as resolveCodexMessageToolProvider, a as emitDynamicToolStartedDiagnostic, c as resolveCodexProviderWebSearchSupportForClient, i as emitDynamicToolErrorDiagnostic, k as emitCodexNativePreToolUseFailureDiagnostic, n as handleCodexAppServerApprovalRequest, o as emitDynamicToolTerminalDiagnostic, r as handleCodexAppServerElicitationRequest, t as createCodexDynamicToolBridge, w as CODEX_NATIVE_HOOK_RELAY_EVENTS, y as shouldEnableCodexAppServerNativeToolSurface } from "./dynamic-tools-LIt9ojep.js";
10
+ import { buildAgentHookContextChannelFields, embeddedAgentLog, formatErrorMessage, registerNativeHookRelay, resolveAgentDir, resolveAttemptSpawnWorkspaceDir, resolveModelAuthMode, resolveSandboxContext, resolveSessionAgentIds, supportsModelTools } from "openclaw/plugin-sdk/agent-harness-runtime";
10
11
  import { randomUUID } from "node:crypto";
11
12
  import { loadExecApprovals } from "openclaw/plugin-sdk/exec-approvals-runtime";
12
- import { buildAgentHookContextChannelFields, embeddedAgentLog, formatErrorMessage, registerNativeHookRelay, resolveAgentDir, resolveAttemptSpawnWorkspaceDir, resolveModelAuthMode, resolveSandboxContext, resolveSessionAgentIds, supportsModelTools } from "openclaw/plugin-sdk/agent-harness-runtime";
13
13
  //#region extensions/codex/src/app-server/side-question.ts
14
14
  const SIDE_QUESTION_COMPLETION_TIMEOUT_MS = 6e5;
15
15
  var CodexSideQuestionTimeoutError = class extends Error {
@@ -78,6 +78,7 @@ async function runCodexAppServerSideQuestion(params, options) {
78
78
  authProfileId: preparedRuntimeAuth.plan.forwardedAuthProfileId,
79
79
  authProfileStore: preparedRuntimeAuth.authProfileStore,
80
80
  agentDir: params.agentDir,
81
+ ...pluginConfig.appServer?.homeScope ? { homeScope: pluginConfig.appServer.homeScope } : {},
81
82
  config: params.cfg,
82
83
  subscriptionProfileRequiredError: "Prepared Codex subscription route requires a scoped native OAuth or token profile.",
83
84
  subscriptionProfileUnusableError: `Prepared Codex auth profile "${preparedRuntimeAuth.plan.forwardedAuthProfileId}" is unusable.`
@@ -674,6 +675,7 @@ async function createCodexSideToolBridge(input) {
674
675
  hookContext: {
675
676
  agentId: input.sessionAgentId,
676
677
  config: input.params.cfg,
678
+ contextWindowTokens: runtimeModel.contextWindow,
677
679
  sessionId: input.params.sessionId,
678
680
  sessionKey: input.params.sessionKey,
679
681
  runId: input.runId,
@@ -1,13 +1,15 @@
1
- import { G as isCodexAppServerPrewriteRequestCancellationError, H as isCodexAppServerConnectionClosedError, Q as isJsonObject, R as CodexAppServerRpcError, Z as flattenCodexDynamicToolFunctions, d as retireSharedCodexAppServerClientIfCurrent, n as clearSharedCodexAppServerClientIfCurrentAndUnclaimed, o as isCodexAppServerStartSelectionChangedError, q as resolveCodexAppServerClientInstanceId, t as clearSharedCodexAppServerClientIfCurrent, z as getCodexAppServerClientInstanceId } from "./shared-client-wmgNFNYp.js";
2
- import { E as resolveCodexPluginsPolicy, a as hashCodexAppServerBindingFingerprint, c as reclaimCurrentCodexSessionGeneration, d as CODEX_PLUGINS_MARKETPLACE_NAME, f as CODEX_PLUGINS_WORKSPACE_MARKETPLACE_NAME, g as codexSandboxPolicyForTurn, i as createCodexSessionGenerationSupersededError, l as sessionBindingIdentity, n as assertCodexBindingMayBeReplaced, o as isCodexAppServerNativeAuthProfile, s as normalizeCodexAppServerBindingModelProvider } from "./session-binding-ZSMX1omP.js";
3
- import { _ as assertCodexThreadStartResponse, a as projectBoundedCodexThreadHistory, g as assertCodexThreadResumeResponse, h as assertCodexThreadForkResponse } from "./transcript-mirror-2p7kl6e4.js";
4
- import { a as serializeCodexAppInventoryError, i as defaultCodexAppInventoryCache, t as buildCodexAppServerConnectionFingerprint } from "./plugin-app-cache-key-CvzvmBRz.js";
1
+ import { B as flattenCodexDynamicToolFunctions, E as resolveCodexAppServerClientInstanceId, V as isJsonObject, _ as CodexAppServerRpcError, s as isCodexAppServerStartSelectionChangedError, v as getCodexAppServerClientInstanceId, w as isCodexAppServerPrewriteRequestCancellationError, x as isCodexAppServerConnectionClosedError } from "./shared-client-BVKE40c-.js";
2
+ import { A as CODEX_PLUGINS_WORKSPACE_MARKETPLACE_NAME, E as resolveCodexPluginsPolicy, a as hashCodexAppServerBindingFingerprint, c as reclaimCurrentCodexSessionGeneration, f as codexSandboxPolicyForTurn, i as createCodexSessionGenerationSupersededError, k as CODEX_PLUGINS_MARKETPLACE_NAME, l as sessionBindingIdentity, n as assertCodexBindingMayBeReplaced, o as isCodexAppServerNativeAuthProfile, s as normalizeCodexAppServerBindingModelProvider } from "./session-binding-DlVQ-Pxs.js";
3
+ import { a as closeCodexStartupClientBestEffort, c as isCodexAppServerUnsafeSubscriptionError, i as assertCodexThreadResumeSubscription, n as CODEX_APP_SERVER_UNSUBSCRIBE_TIMEOUT_MS, r as CodexAppServerUnsafeSubscriptionError, u as unsubscribeCodexThreadBestEffort } from "./attempt-client-cleanup-Ia52yRWc.js";
4
+ import { i as assertCodexThreadStartResponse, n as assertCodexThreadForkResponse, r as assertCodexThreadResumeResponse } from "./protocol-validators-Dm4eXZmt.js";
5
+ import { a as serializeCodexAppInventoryError, i as defaultCodexAppInventoryCache, t as buildCodexAppServerConnectionFingerprint } from "./plugin-app-cache-key-DSXX-rXO.js";
5
6
  import { t as isIncognitoSessionKey } from "./incognito-session-ET_ufDH-.js";
6
- import { sliceUtf16Safe, truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
7
+ import { a as projectBoundedCodexThreadHistory } from "./transcript-mirror-uKA-A4tB.js";
8
+ import { SKILL_WORKSHOP_TOOL_NAME, buildSkillWorkshopPromptSection, embeddedAgentLog, formatErrorMessage, isActiveHarnessContextEngine, isHostScopedAgentToolActive } from "openclaw/plugin-sdk/agent-harness-runtime";
7
9
  import * as crypto$1 from "node:crypto";
8
10
  import crypto from "node:crypto";
9
11
  import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
10
- import { SKILL_WORKSHOP_TOOL_NAME, buildSkillWorkshopPromptSection, embeddedAgentLog, formatErrorMessage, isActiveHarnessContextEngine, isHostScopedAgentToolActive } from "openclaw/plugin-sdk/agent-harness-runtime";
12
+ import { sliceUtf16Safe, truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
11
13
  import { redactSensitiveFieldValue, redactToolPayloadText } from "openclaw/plugin-sdk/logging-core";
12
14
  import { buildCodexUserMcpServersThreadConfigPatchForRuntime } from "openclaw/plugin-sdk/codex-mcp-projection";
13
15
  import { isDiagnosticFlagEnabled } from "openclaw/plugin-sdk/diagnostic-runtime";
@@ -1277,129 +1279,6 @@ function compareJsonFingerprint(left, right) {
1277
1279
  return JSON.stringify(left).localeCompare(JSON.stringify(right));
1278
1280
  }
1279
1281
  //#endregion
1280
- //#region extensions/codex/src/app-server/attempt-client-cleanup.ts
1281
- /**
1282
- * Best-effort cleanup helpers for Codex app-server startup attempts and turns.
1283
- */
1284
- /** Timeout for best-effort app-server turn interruption during cleanup. */
1285
- const CODEX_APP_SERVER_INTERRUPT_TIMEOUT_MS = 5e3;
1286
- /** Timeout for best-effort thread unsubscribe during cleanup. */
1287
- const CODEX_APP_SERVER_UNSUBSCRIBE_TIMEOUT_MS = 5e3;
1288
- /** Raised when a thread subscription may be live on a client OpenClaw no longer controls. */
1289
- var CodexAppServerUnsafeSubscriptionError = class extends Error {
1290
- constructor(message, options) {
1291
- super(message, options);
1292
- this.name = "CodexAppServerUnsafeSubscriptionError";
1293
- }
1294
- };
1295
- function isCodexAppServerUnsafeSubscriptionError(error) {
1296
- return error instanceof CodexAppServerUnsafeSubscriptionError;
1297
- }
1298
- /** Asserts Codex resumed the exact thread this attempt subscribed to. */
1299
- function assertCodexThreadResumeSubscription(requestedThreadId, returnedThreadId) {
1300
- if (returnedThreadId !== requestedThreadId) throw new CodexAppServerUnsafeSubscriptionError(`Codex thread/resume returned ${returnedThreadId} for ${requestedThreadId}`);
1301
- }
1302
- async function closeClientAndWaitIfAvailable(client) {
1303
- const closeable = client;
1304
- if (typeof closeable.closeAndWait === "function") {
1305
- await closeable.closeAndWait();
1306
- return;
1307
- }
1308
- closeable.close?.();
1309
- }
1310
- async function closeCodexStartupClientBestEffort(client) {
1311
- if (!client) return;
1312
- const unclaimedSharedClient = clearSharedCodexAppServerClientIfCurrentAndUnclaimed(client);
1313
- if (unclaimedSharedClient.closed) {
1314
- await closeClientAndWaitIfAvailable(client);
1315
- return;
1316
- }
1317
- if (unclaimedSharedClient.found) {
1318
- if (retireSharedCodexAppServerClientIfCurrent(client)?.closed) await closeClientAndWaitIfAvailable(client);
1319
- return;
1320
- }
1321
- const retiredSharedClient = retireSharedCodexAppServerClientIfCurrent(client);
1322
- if (retiredSharedClient) {
1323
- if (retiredSharedClient.closed) await closeClientAndWaitIfAvailable(client);
1324
- return;
1325
- }
1326
- if (clearSharedCodexAppServerClientIfCurrent(client)) {
1327
- await closeClientAndWaitIfAvailable(client);
1328
- return;
1329
- }
1330
- await closeClientAndWaitIfAvailable(client);
1331
- }
1332
- /** Sends a turn interrupt without blocking abort cleanup on app-server errors. */
1333
- function interruptCodexTurnBestEffort(client, params) {
1334
- const requestOptions = params.timeoutMs && Number.isFinite(params.timeoutMs) && params.timeoutMs > 0 ? { timeoutMs: params.timeoutMs } : void 0;
1335
- const requestParams = {
1336
- threadId: params.threadId,
1337
- turnId: params.turnId
1338
- };
1339
- try {
1340
- const interrupt = requestOptions ? client.request("turn/interrupt", requestParams, requestOptions) : client.request("turn/interrupt", requestParams);
1341
- Promise.resolve(interrupt).catch((error) => {
1342
- embeddedAgentLog.debug("codex app-server turn interrupt failed during abort", { error });
1343
- });
1344
- } catch (error) {
1345
- embeddedAgentLog.debug("codex app-server turn interrupt failed during abort", { error });
1346
- }
1347
- }
1348
- /** Unsubscribes from a thread while swallowing cleanup-only failures. */
1349
- async function unsubscribeCodexThreadBestEffort(client, params) {
1350
- try {
1351
- await client.request("thread/unsubscribe", { threadId: params.threadId }, { timeoutMs: params.timeoutMs });
1352
- return true;
1353
- } catch (error) {
1354
- embeddedAgentLog.debug("codex app-server thread unsubscribe cleanup failed", {
1355
- threadId: params.threadId,
1356
- error
1357
- });
1358
- return false;
1359
- }
1360
- }
1361
- /**
1362
- * Retires the shared client after a timed-out turn so later runs do not reuse a
1363
- * potentially wedged app-server connection.
1364
- */
1365
- async function retireCodexAppServerClientAfterTimedOutTurn(client, params) {
1366
- const retiredSharedClient = retireSharedCodexAppServerClientIfCurrent(client, { failActiveLeases: params.suspectPhysicalClient });
1367
- const detachedSharedClient = Boolean(retiredSharedClient);
1368
- if (!(params.suspectPhysicalClient && (retiredSharedClient?.closed ?? false))) {
1369
- interruptCodexTurnBestEffort(client, {
1370
- threadId: params.threadId,
1371
- turnId: params.turnId,
1372
- timeoutMs: CODEX_APP_SERVER_INTERRUPT_TIMEOUT_MS
1373
- });
1374
- await unsubscribeCodexThreadBestEffort(client, {
1375
- threadId: params.threadId,
1376
- timeoutMs: CODEX_APP_SERVER_UNSUBSCRIBE_TIMEOUT_MS
1377
- });
1378
- }
1379
- let closedClient = retiredSharedClient?.closed ?? false;
1380
- if (!detachedSharedClient) {
1381
- const close = client.close;
1382
- if (typeof close === "function") try {
1383
- close.call(client);
1384
- closedClient = true;
1385
- } catch (error) {
1386
- embeddedAgentLog.debug("codex app-server client close failed during timeout cleanup", {
1387
- threadId: params.threadId,
1388
- turnId: params.turnId,
1389
- error
1390
- });
1391
- }
1392
- }
1393
- embeddedAgentLog.warn("codex app-server client retired after timed-out turn", {
1394
- threadId: params.threadId,
1395
- turnId: params.turnId,
1396
- reason: params.reason,
1397
- detachedSharedClient,
1398
- closedClient,
1399
- activeSharedClientLeases: retiredSharedClient?.activeLeases ?? 0
1400
- });
1401
- }
1402
- //#endregion
1403
1282
  //#region extensions/codex/src/app-server/dynamic-tool-profile.ts
1404
1283
  /** Tool names owned by Codex app-server and normally excluded from OpenClaw dynamic tools. */
1405
1284
  const CODEX_APP_SERVER_OWNED_DYNAMIC_TOOL_EXCLUDES = [
@@ -1476,7 +1355,8 @@ function filterCodexDynamicToolsWithOpenClawShell(tools, config, env = process.e
1476
1355
  function filterCodexDynamicToolsWithOptions(tools, config, env, options) {
1477
1356
  const excludes = /* @__PURE__ */ new Set();
1478
1357
  for (const name of CODEX_NATIVE_GOAL_TOOL_EXCLUDES) excludes.add(name);
1479
- if (!isForcedPrivateQaCodexRuntime(env)) for (const name of CODEX_APP_SERVER_OWNED_DYNAMIC_TOOL_EXCLUDES) {
1358
+ if (isForcedPrivateQaCodexRuntime(env)) excludes.add("apply_patch");
1359
+ else for (const name of CODEX_APP_SERVER_OWNED_DYNAMIC_TOOL_EXCLUDES) {
1480
1360
  if (options.preserveOpenClawShell && CODEX_APP_SERVER_OWNED_SHELL_TOOL_EXCLUDES.has(name)) continue;
1481
1361
  excludes.add(name);
1482
1362
  }
@@ -3282,7 +3162,7 @@ function buildTurnStartParams(params, options) {
3282
3162
  cwd: options.cwd,
3283
3163
  approvalPolicy: options.appServer.approvalPolicy,
3284
3164
  approvalsReviewer: options.appServer.approvalsReviewer,
3285
- ...useThreadPermissionProfile ? {} : { sandboxPolicy: options.sandboxPolicy ?? codexSandboxPolicyForTurn(options.appServer.sandbox, options.cwd) },
3165
+ ...useThreadPermissionProfile ? {} : { sandboxPolicy: options.sandboxPolicy ?? codexSandboxPolicyForTurn(options.appServer.sandbox, options.cwd, options.appServer.start?.args) },
3286
3166
  ...modelSelection ? {
3287
3167
  model: modelSelection.model,
3288
3168
  personality: CODEX_NATIVE_PERSONALITY_NONE
@@ -3350,4 +3230,4 @@ function joinPresentSections(...sections) {
3350
3230
  return sections.filter((section) => Boolean(section?.trim())).join("\n\n");
3351
3231
  }
3352
3232
  //#endregion
3353
- export { shouldBuildCodexPluginThreadConfig as $, resolveCodexDynamicToolsLoading as A, codexDynamicToolsFingerprint as B, readCodexSupportedReasoningEfforts as C, isForcedPrivateQaCodexRuntime as D, filterCodexDynamicToolsWithOpenClawShell as E, closeCodexStartupClientBestEffort as F, projectContextEngineAssemblyForCodex as G, buildContextEngineBinding as H, interruptCodexTurnBestEffort as I, buildCodexPluginAppsConfigPatchFromPolicyContext as J, resolveCodexContextEngineProjectionMaxChars as K, retireCodexAppServerClientAfterTimedOutTurn as L, CODEX_APP_SERVER_INTERRUPT_TIMEOUT_MS as M, CODEX_APP_SERVER_UNSUBSCRIBE_TIMEOUT_MS as N, isSystemAgentOnlyCodexDynamicToolAllowlist as O, CodexAppServerUnsafeSubscriptionError as P, mergeCodexThreadConfigs as Q, unsubscribeCodexThreadBestEffort as R, resolveReasoningEffort as S, filterCodexDynamicTools as T, isContextEngineBindingCompatible as U, codexLegacyDynamicToolsFingerprint as V, fitCodexProjectedContextForTurnStart as W, buildCodexPluginThreadConfigInputFingerprint as X, buildCodexPluginThreadConfig as Y, buildCodexPluginThreadConfigTimeoutFallback as Z, CODEX_NATIVE_PERSONALITY_NONE as _, sanitizeCodexHistoryImagePayloads as a, readCodexErrorNotificationMessage as at, resolveCodexAppServerThreadModelSelection as b, resumeCodexAppServerThread as c, readItemString as ct, buildCodexRingZeroThreadConfigPatch as d, readNonNegativeInteger as dt, ensureCodexPluginActivation as et, buildCodexRuntimeThreadConfig as f, readNullableString as ft, buildDeveloperInstructions as g, resolveCodexWebSearchPlan as h, splitPlanText as ht, invalidInlineImageText as i, normalizeNonEmptyString as it, resolveCodexDynamicToolsLoadingForRuntime as j, normalizeCodexDynamicToolName as k, assertCodexRingZeroHasNoManagedHooks as l, readNonEmptyString as lt, buildCodexNativeWebSearchThreadConfig as m, readString as mt, buildTurnStartParams as n, resolveRecoverableCodexPluginConfigKeys as nt, sanitizeInlineImageDataUrl$1 as o, readHookOutputEntries as ot, readCodexInheritedMcpServerNames as p, readNumber as pt, resolveCodexContextEngineProjectionReserveTokens as q, buildCodexUserInput as r, extractRawAssistantText as rt, startOrResumeThread as s, readItem as st, buildTurnCollaborationMode as t, pluginReadParams as tt, attestCodexRingZeroThreadHasNoMcpServers as u, readNonEmptyStringArray as ut, resolveCodexAppServerModelProvider as v, isCodexAppServerProfilerEnabled as w, resolveCodexBindingModelProviderFallback as x, resolveCodexAppServerRequestModelSelection as y, areCodexDynamicToolFingerprintsCompatible as z };
3233
+ export { readHookOutputEntries as $, resolveCodexDynamicToolsLoading as A, resolveCodexContextEngineProjectionReserveTokens as B, readCodexSupportedReasoningEfforts as C, isForcedPrivateQaCodexRuntime as D, filterCodexDynamicToolsWithOpenClawShell as E, buildContextEngineBinding as F, mergeCodexThreadConfigs as G, buildCodexPluginThreadConfig as H, isContextEngineBindingCompatible as I, pluginReadParams as J, shouldBuildCodexPluginThreadConfig as K, fitCodexProjectedContextForTurnStart as L, areCodexDynamicToolFingerprintsCompatible as M, codexDynamicToolsFingerprint as N, isSystemAgentOnlyCodexDynamicToolAllowlist as O, codexLegacyDynamicToolsFingerprint as P, readCodexErrorNotificationMessage as Q, projectContextEngineAssemblyForCodex as R, resolveReasoningEffort as S, filterCodexDynamicTools as T, buildCodexPluginThreadConfigInputFingerprint as U, buildCodexPluginAppsConfigPatchFromPolicyContext as V, buildCodexPluginThreadConfigTimeoutFallback as W, extractRawAssistantText as X, resolveRecoverableCodexPluginConfigKeys as Y, normalizeNonEmptyString as Z, CODEX_NATIVE_PERSONALITY_NONE as _, sanitizeCodexHistoryImagePayloads as a, readNullableString as at, resolveCodexAppServerThreadModelSelection as b, resumeCodexAppServerThread as c, splitPlanText as ct, buildCodexRingZeroThreadConfigPatch as d, readItem as et, buildCodexRuntimeThreadConfig as f, buildDeveloperInstructions as g, resolveCodexWebSearchPlan as h, invalidInlineImageText as i, readNonNegativeInteger as it, resolveCodexDynamicToolsLoadingForRuntime as j, normalizeCodexDynamicToolName as k, assertCodexRingZeroHasNoManagedHooks as l, buildCodexNativeWebSearchThreadConfig as m, buildTurnStartParams as n, readNonEmptyString as nt, sanitizeInlineImageDataUrl$1 as o, readNumber as ot, readCodexInheritedMcpServerNames as p, ensureCodexPluginActivation as q, buildCodexUserInput as r, readNonEmptyStringArray as rt, startOrResumeThread as s, readString as st, buildTurnCollaborationMode as t, readItemString as tt, attestCodexRingZeroThreadHasNoMcpServers as u, resolveCodexAppServerModelProvider as v, isCodexAppServerProfilerEnabled as w, resolveCodexBindingModelProviderFallback as x, resolveCodexAppServerRequestModelSelection as y, resolveCodexContextEngineProjectionMaxChars as z };