@openclaw/codex 2026.6.11 → 2026.7.1-beta.1

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 (31) hide show
  1. package/dist/{app-server-policy-BPTiVNsW.js → app-server-policy-xi0ZmBGO.js} +2 -2
  2. package/dist/{attempt-notifications-BYnndyFl.js → attempt-notifications-l9LElGOU.js} +26 -2
  3. package/dist/{client-CLrtWgrD.js → client-IcTBKEqA.js} +5 -2
  4. package/dist/{client-factory-Bm6HsGob.js → client-factory-CwjdQQ4j.js} +1 -1
  5. package/dist/{command-handlers-DEPTJYk0.js → command-handlers-vZy8xX5X.js} +25 -19
  6. package/dist/{compact-aQJ0ZKhe.js → compact-BzB9AqN1.js} +5 -5
  7. package/dist/{computer-use-ClrJwoFp.js → computer-use-FPGG-mtX.js} +3 -3
  8. package/dist/{config-CszD0vP3.js → config-C_whBx3M.js} +8 -3
  9. package/dist/{conversation-binding-t0XMLz-j.js → conversation-binding-CEE2UyYb.js} +28 -15
  10. package/dist/harness.js +6 -6
  11. package/dist/index.js +25 -17
  12. package/dist/{media-understanding-provider-ZUQHN7gT.js → media-understanding-provider-C5yYzx_6.js} +6 -6
  13. package/dist/media-understanding-provider.js +1 -1
  14. package/dist/{models-CAmfBWRl.js → models-Ccy1_7nN.js} +2 -2
  15. package/dist/{plugin-app-cache-key-C9ILt7bl.js → plugin-app-cache-key-CDioyur-.js} +8 -4
  16. package/dist/{protocol-validators-B19q5BIX.js → protocol-validators-CB4mtyrs.js} +106 -12
  17. package/dist/{provider-B-OHpbD3.js → provider-DosqwRb6.js} +53 -18
  18. package/dist/{provider-capabilities-D7hnTO76.js → provider-capabilities-CE5k8cmO.js} +179 -15
  19. package/dist/provider-catalog.js +4 -2
  20. package/dist/provider.js +2 -2
  21. package/dist/{request-Dcd452Nk.js → request-BQuSQF29.js} +2 -2
  22. package/dist/{run-attempt-CXxtFC9d.js → run-attempt-O3Zs32KI.js} +106 -29
  23. package/dist/{sandbox-guard-3tnjhjFb.js → sandbox-guard-pTY2COoC.js} +2 -0
  24. package/dist/{session-binding-HOuPt-E0.js → session-binding-Cm0Gg7Z1.js} +2 -1
  25. package/dist/{shared-client-Dtx5i7Ez.js → shared-client-rR6TDJA3.js} +98 -47
  26. package/dist/{side-question-C-DhgJOd.js → side-question-DDVgFmpv.js} +12 -12
  27. package/dist/{thread-lifecycle-DtT3-ehU.js → thread-lifecycle-DeSMZSXr.js} +148 -42
  28. package/dist/{web-search-provider.runtime-CkwxrXQj.js → web-search-provider.runtime-Q89rQhsL.js} +2 -2
  29. package/npm-shrinkwrap.json +30 -30
  30. package/openclaw.plugin.json +3 -3
  31. package/package.json +5 -5
@@ -1,10 +1,10 @@
1
1
  import { n as isJsonObject, t as flattenCodexDynamicToolFunctions } from "./protocol-dh-ETiNd.js";
2
- import { i as codexSandboxPolicyForTurn, m as resolveCodexPluginsPolicy, t as CODEX_PLUGINS_MARKETPLACE_NAME } from "./config-CszD0vP3.js";
3
- import { n as assertCodexThreadResumeResponse, r as assertCodexThreadStartResponse } from "./protocol-validators-B19q5BIX.js";
2
+ import { i as codexSandboxPolicyForTurn, m as resolveCodexPluginsPolicy, t as CODEX_PLUGINS_MARKETPLACE_NAME } from "./config-C_whBx3M.js";
3
+ import { n as assertCodexThreadResumeResponse, r as assertCodexThreadStartResponse } from "./protocol-validators-CB4mtyrs.js";
4
4
  import { CODEX_GPT5_HEARTBEAT_PROMPT_OVERLAY } from "./prompt-overlay.js";
5
- import { r as isModernCodexModel } from "./provider-B-OHpbD3.js";
6
- import { a as isCodexAppServerConnectionClosedError, n as CodexAppServerRpcError } from "./client-CLrtWgrD.js";
7
- import { i as isCodexAppServerNativeAuthProfile, l as writeCodexAppServerBinding, n as clearCodexAppServerBinding, o as readCodexAppServerBinding } from "./session-binding-HOuPt-E0.js";
5
+ import { a as readCodexSupportedReasoningEfforts, i as isModernCodexModel, o as resolveCodexSupportedReasoningEffort, r as isMaxReasoningCodexModel } from "./provider-DosqwRb6.js";
6
+ import { a as isCodexAppServerConnectionClosedError, n as CodexAppServerRpcError } from "./client-IcTBKEqA.js";
7
+ import { i as isCodexAppServerNativeAuthProfile, l as writeCodexAppServerBinding, n as clearCodexAppServerBinding, o as readCodexAppServerBinding } from "./session-binding-Cm0Gg7Z1.js";
8
8
  import "node:fs/promises";
9
9
  import "node:path";
10
10
  import { isFutureDateTimestampMs, resolveDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
@@ -74,6 +74,7 @@ function readString(record, key) {
74
74
  const value = record[key];
75
75
  return typeof value === "string" && value.trim() ? value.trim() : void 0;
76
76
  }
77
+ const CODEX_TARGETED_APP_INVENTORY_LIMIT = 1e3;
77
78
  const MAX_SERIALIZED_ERROR_MESSAGE_LENGTH = 500;
78
79
  /** In-memory app inventory cache with coalesced refreshes per key. */
79
80
  var CodexAppInventoryCache = class {
@@ -212,9 +213,11 @@ function serializeCodexAppInventoryError(error) {
212
213
  }
213
214
  /** Shared app inventory cache used by Codex app-server runtime paths. */
214
215
  const defaultCodexAppInventoryCache = new CodexAppInventoryCache();
215
- /** Builds a stable cache key from runtime identity fields. */
216
- function buildCodexAppInventoryCacheKey(input) {
216
+ /** Builds a stable cache key from build versions and runtime identity fields. */
217
+ function buildCodexAppInventoryCacheKey(input, openClawVersion, codexPluginVersion) {
217
218
  return JSON.stringify({
219
+ openClawVersion,
220
+ codexPluginVersion,
218
221
  codexHome: input.codexHome ?? null,
219
222
  endpoint: input.endpoint ?? null,
220
223
  runtimeIdentity: normalizeRuntimeIdentityForCacheKey(input.runtimeIdentity),
@@ -235,18 +238,21 @@ function normalizeRuntimeIdentityForCacheKey(value) {
235
238
  async function listAllApps(request, forceRefetch, targetAppIds = []) {
236
239
  const apps = [];
237
240
  const targetIds = new Set(targetAppIds.filter(Boolean));
238
- const foundTargetIds = /* @__PURE__ */ new Set();
241
+ const remainingTargetIds = new Set(targetIds);
242
+ const seenCursors = /* @__PURE__ */ new Set();
239
243
  let cursor;
240
244
  do {
241
245
  const response = await request("app/list", {
242
246
  cursor,
243
- limit: 100,
247
+ limit: targetIds.size > 0 ? CODEX_TARGETED_APP_INVENTORY_LIMIT : 100,
244
248
  forceRefetch
245
249
  });
246
250
  apps.push(...response.data);
247
- for (const app of response.data) if (targetIds.has(app.id)) foundTargetIds.add(app.id);
251
+ for (const app of response.data) remainingTargetIds.delete(app.id);
252
+ if (targetIds.size > 0 && remainingTargetIds.size === 0) break;
248
253
  cursor = response.nextCursor;
249
- if (targetIds.size > 0 && foundTargetIds.size === targetIds.size) break;
254
+ if (cursor && seenCursors.has(cursor)) throw new Error(`app/list returned repeated cursor ${cursor}`);
255
+ if (cursor) seenCursors.add(cursor);
250
256
  } while (cursor);
251
257
  return apps;
252
258
  }
@@ -290,6 +296,7 @@ function isSensitiveErrorDataKey(key) {
290
296
  * Reads Codex plugin marketplace state and app inventory to decide which
291
297
  * plugin-owned apps can be exposed to a native Codex thread.
292
298
  */
299
+ const CODEX_PLUGINS_REMOTE_MARKETPLACE_NAME = `${CODEX_PLUGINS_MARKETPLACE_NAME}-remote`;
293
300
  /** Reads configured Codex plugin state and maps owned apps to readiness diagnostics. */
294
301
  async function readCodexPluginInventory(params) {
295
302
  const policy = params.policy ?? resolveCodexPluginsPolicy(params.pluginConfig);
@@ -302,7 +309,8 @@ async function readCodexPluginInventory(params) {
302
309
  }]
303
310
  };
304
311
  const appInventory = readCachedAppInventory(params);
305
- const marketplaceEntry = (await params.request("plugin/list", { cwds: [] })).marketplaces.find((marketplace) => marketplace.name === CODEX_PLUGINS_MARKETPLACE_NAME);
312
+ const listed = await params.request("plugin/list", { cwds: [] });
313
+ const marketplaceEntry = listed.marketplaces.find(isOpenAiCuratedMarketplace);
306
314
  if (!marketplaceEntry) return {
307
315
  policy,
308
316
  records: [],
@@ -313,7 +321,7 @@ async function readCodexPluginInventory(params) {
313
321
  })),
314
322
  ...appInventory ? { appInventory } : {}
315
323
  };
316
- const marketplace = marketplaceRef(marketplaceEntry);
324
+ let marketplace = marketplaceRef(marketplaceEntry);
317
325
  const diagnostics = [];
318
326
  const records = [];
319
327
  if (appInventory?.state === "missing") diagnostics.push({
@@ -326,8 +334,8 @@ async function readCodexPluginInventory(params) {
326
334
  });
327
335
  for (const pluginPolicy of policy.pluginPolicies) {
328
336
  if (!pluginPolicy.enabled) continue;
329
- const summary = findPluginSummary(marketplaceEntry, pluginPolicy.pluginName);
330
- if (!summary) {
337
+ const resolvedPlugin = findOpenAiCuratedMarketplacePlugin(listed, pluginPolicy.pluginName);
338
+ if (!resolvedPlugin) {
331
339
  diagnostics.push({
332
340
  code: "plugin_missing",
333
341
  plugin: pluginPolicy,
@@ -335,7 +343,10 @@ async function readCodexPluginInventory(params) {
335
343
  });
336
344
  continue;
337
345
  }
338
- const detail = await readPluginDetail(params, marketplace, pluginPolicy, diagnostics);
346
+ const { summary } = resolvedPlugin;
347
+ const pluginMarketplace = marketplaceRef(resolvedPlugin.marketplace);
348
+ if (records.length === 0) marketplace = pluginMarketplace;
349
+ const detail = await readPluginDetail(params, pluginMarketplace, pluginPolicy, summary, diagnostics);
339
350
  const ownedAppIds = detail?.apps.map((app) => app.id).filter(Boolean).toSorted() ?? [];
340
351
  const appOwnership = resolveAppOwnership({
341
352
  detail,
@@ -378,12 +389,10 @@ async function readCodexPluginInventory(params) {
378
389
  }
379
390
  /** Finds one plugin summary in the OpenAI curated marketplace response. */
380
391
  function findOpenAiCuratedPluginSummary(listed, pluginName) {
381
- const marketplaceEntry = listed.marketplaces.find((marketplace) => marketplace.name === CODEX_PLUGINS_MARKETPLACE_NAME);
382
- if (!marketplaceEntry) return;
383
- const summary = findPluginSummary(marketplaceEntry, pluginName);
384
- return summary ? {
385
- marketplace: marketplaceRef(marketplaceEntry),
386
- summary
392
+ const resolved = findOpenAiCuratedMarketplacePlugin(listed, pluginName);
393
+ return resolved ? {
394
+ marketplace: marketplaceRef(resolved.marketplace),
395
+ summary: resolved.summary
387
396
  } : void 0;
388
397
  }
389
398
  /** Builds plugin/read or plugin/install params from a marketplace reference. */
@@ -404,10 +413,10 @@ function readCachedAppInventory(params) {
404
413
  suppressRefresh: params.suppressAppInventoryRefresh
405
414
  });
406
415
  }
407
- async function readPluginDetail(params, marketplace, pluginPolicy, diagnostics) {
416
+ async function readPluginDetail(params, marketplace, pluginPolicy, summary, diagnostics) {
408
417
  if (params.readPluginDetails === false) return;
409
418
  try {
410
- return (await params.request("plugin/read", pluginReadParams(marketplace, pluginPolicy.pluginName))).plugin;
419
+ return (await params.request("plugin/read", pluginReadParams(marketplace, marketplace.remoteMarketplaceName && summary.remotePluginId ? summary.remotePluginId : pluginPolicy.pluginName))).plugin;
411
420
  } catch (error) {
412
421
  diagnostics.push({
413
422
  code: "plugin_detail_unavailable",
@@ -454,6 +463,16 @@ function resolveOwnedApps(params) {
454
463
  function findPluginSummary(marketplace, pluginName) {
455
464
  return marketplace.plugins.find((plugin) => plugin.name === pluginName || plugin.id === pluginName || plugin.id === `${pluginName}@${marketplace.name}` || pluginNameFromPluginId(plugin.id, marketplace.name) === pluginName);
456
465
  }
466
+ function findOpenAiCuratedMarketplacePlugin(listed, pluginName) {
467
+ for (const marketplace of listed.marketplaces) {
468
+ if (!isOpenAiCuratedMarketplace(marketplace)) continue;
469
+ const summary = findPluginSummary(marketplace, pluginName);
470
+ if (summary) return {
471
+ marketplace,
472
+ summary
473
+ };
474
+ }
475
+ }
457
476
  function pluginNameFromPluginId(pluginId, marketplaceName) {
458
477
  const trimmed = pluginId.trim();
459
478
  if (!trimmed) return;
@@ -467,6 +486,9 @@ function marketplaceRef(marketplace) {
467
486
  ...!marketplace.path ? { remoteMarketplaceName: marketplace.name } : {}
468
487
  };
469
488
  }
489
+ function isOpenAiCuratedMarketplace(marketplace) {
490
+ return marketplace.name === "openai-curated" || marketplace.name === CODEX_PLUGINS_REMOTE_MARKETPLACE_NAME;
491
+ }
470
492
  //#endregion
471
493
  //#region extensions/codex/src/app-server/plugin-activation.ts
472
494
  /** Installs/enables a configured Codex plugin and refreshes plugin/app state. */
@@ -486,7 +508,7 @@ async function ensureCodexPluginActivation(params) {
486
508
  marketplace: resolved.marketplace,
487
509
  diagnostics: []
488
510
  };
489
- const installResponse = await params.request("plugin/install", pluginReadParams(resolved.marketplace, params.identity.pluginName));
511
+ const installResponse = await params.request("plugin/install", pluginReadParams(resolved.marketplace, resolved.marketplace.remoteMarketplaceName && resolved.summary.remotePluginId ? resolved.summary.remotePluginId : params.identity.pluginName));
490
512
  const refreshDiagnostics = [];
491
513
  let refreshFailed = false;
492
514
  try {
@@ -593,9 +615,10 @@ async function buildCodexPluginThreadConfig(params) {
593
615
  nowMs: params.nowMs,
594
616
  suppressAppInventoryRefresh: true
595
617
  });
618
+ const appInventoryRefreshDeferredForActivation = inventory.records.some((record) => record.activationRequired) && shouldRefreshMissingAppInventory(params, policy, inventory);
596
619
  if (shouldWaitForInitialAppInventory(params, policy, inventory)) {
597
620
  await refreshAppInventoryNow(params, appCache, {
598
- forceRefetch: true,
621
+ forceRefetch: false,
599
622
  reason: "initial_missing",
600
623
  targetAppIds: collectInventoryOwnedAppIds(inventory)
601
624
  });
@@ -630,10 +653,12 @@ async function buildCodexPluginThreadConfig(params) {
630
653
  message: activation.diagnostics.map((item) => item.message).join(" ") || activation.reason
631
654
  });
632
655
  }
633
- if (activationResults.some((activation) => activation.ok && activation.installAttempted)) {
656
+ const postInstallRefreshRequired = activationResults.some((activation) => activation.ok && activation.installAttempted);
657
+ const deferredMissingRefreshRequired = appInventoryRefreshDeferredForActivation && !postInstallRefreshRequired && shouldRefreshMissingAppInventory(params, policy, inventory);
658
+ if (postInstallRefreshRequired || deferredMissingRefreshRequired) {
634
659
  await refreshAppInventoryNow(params, appCache, {
635
660
  forceRefetch: true,
636
- reason: "post_install",
661
+ reason: postInstallRefreshRequired ? "post_install" : "deferred_missing",
637
662
  targetAppIds: collectInventoryOwnedAppIds(inventory)
638
663
  });
639
664
  inventory = await readCodexPluginInventory({
@@ -677,29 +702,36 @@ async function buildCodexPluginThreadConfig(params) {
677
702
  const policyApps = {};
678
703
  const pluginAppIds = {};
679
704
  for (const record of inventory.records) {
680
- if (record.activationRequired) {
681
- if (!activationResults.find((item) => item.identity.configKey === record.policy.configKey)?.ok) continue;
682
- }
705
+ const activation = activationResults.find((item) => item.identity.configKey === record.policy.configKey);
706
+ if (activation?.ok === false || record.activationRequired && !activation?.ok) continue;
683
707
  if (record.appOwnership !== "proven") continue;
684
708
  pluginAppIds[record.policy.configKey] = [...record.ownedAppIds].toSorted();
685
709
  for (const app of resolveThreadConfigAppsForRecord({
686
710
  record,
687
711
  inventory
688
712
  })) {
689
- if (!app.accessible || !app.enabled) {
713
+ if (!isPluginAppReadyForThreadStart(app)) {
690
714
  diagnostics.push({
691
715
  code: "app_not_ready",
692
716
  plugin: record.policy,
693
- message: `${app.id} is not accessible or enabled for ${record.policy.pluginName}.`
717
+ message: `${app.id} is not accessible for ${record.policy.pluginName}.`
694
718
  });
695
719
  continue;
696
720
  }
721
+ if (record.policy.destructiveApprovalMode === "ask" && !await clearPersistedAppToolApprovalOverrides({
722
+ request: params.request,
723
+ configCwd: params.configCwd,
724
+ plugin: record.policy,
725
+ app,
726
+ diagnostics
727
+ })) continue;
697
728
  const appConfig = {
698
729
  enabled: true,
699
730
  destructive_enabled: record.policy.allowDestructiveActions,
700
731
  open_world_enabled: true,
701
732
  default_tools_approval_mode: "auto"
702
733
  };
734
+ if (record.policy.destructiveApprovalMode === "ask") appConfig.approvals_reviewer = "user";
703
735
  apps[app.id] = appConfig;
704
736
  policyApps[app.id] = {
705
737
  configKey: record.policy.configKey,
@@ -766,6 +798,22 @@ function buildDisabledAppsConfigPatch() {
766
798
  open_world_enabled: false
767
799
  } } };
768
800
  }
801
+ /** Rebuilds the safe per-thread apps patch persisted with a Codex thread binding. */
802
+ function buildCodexPluginAppsConfigPatchFromPolicyContext(policyContext) {
803
+ const apps = { _default: {
804
+ enabled: false,
805
+ destructive_enabled: false,
806
+ open_world_enabled: false
807
+ } };
808
+ for (const [appId, policy] of Object.entries(policyContext.apps).toSorted(([left], [right]) => left.localeCompare(right))) apps[appId] = {
809
+ enabled: true,
810
+ destructive_enabled: policy.allowDestructiveActions,
811
+ open_world_enabled: true,
812
+ default_tools_approval_mode: "auto",
813
+ ...policy.destructiveApprovalMode === "ask" ? { approvals_reviewer: "user" } : {}
814
+ };
815
+ return { apps };
816
+ }
769
817
  function buildPluginAppPolicyContext(apps, pluginAppIds) {
770
818
  return {
771
819
  fingerprint: fingerprintJson({
@@ -777,8 +825,53 @@ function buildPluginAppPolicyContext(apps, pluginAppIds) {
777
825
  pluginAppIds
778
826
  };
779
827
  }
828
+ async function clearPersistedAppToolApprovalOverrides(params) {
829
+ try {
830
+ const overrideNames = await readPersistedAppToolApprovalOverrideNames(params);
831
+ for (const toolName of overrideNames) if (isOverriddenConfigWriteResponse(await params.request("config/value/write", {
832
+ keyPath: `apps.${quoteConfigKeyPathSegment(params.app.id)}.tools.${quoteConfigKeyPathSegment(toolName)}.approval_mode`,
833
+ value: null,
834
+ mergeStrategy: "replace"
835
+ }))) throw new Error(`approval override for ${toolName} is controlled by another config layer`);
836
+ const remainingOverrideNames = await readPersistedAppToolApprovalOverrideNames(params);
837
+ if (remainingOverrideNames.length > 0) throw new Error(`effective approval overrides remain for ${remainingOverrideNames.join(", ")}`);
838
+ return true;
839
+ } catch (error) {
840
+ params.diagnostics.push({
841
+ code: "approval_overrides_clear_failed",
842
+ plugin: params.plugin,
843
+ message: `Could not clear durable Codex app approval overrides for ${params.app.id}: ${error instanceof Error ? error.message : String(error)}`
844
+ });
845
+ return false;
846
+ }
847
+ }
848
+ async function readPersistedAppToolApprovalOverrideNames(params) {
849
+ const response = await params.request("config/read", {
850
+ includeLayers: false,
851
+ ...params.configCwd ? { cwd: params.configCwd } : {}
852
+ });
853
+ const config = isJsonObject(response) ? response.config : void 0;
854
+ const appsRoot = isJsonObject(config) ? config.apps : void 0;
855
+ const nestedApps = isJsonObject(appsRoot) ? appsRoot.apps : void 0;
856
+ const appConfig = isJsonObject(appsRoot) ? appsRoot[params.app.id] ?? (isJsonObject(nestedApps) ? nestedApps[params.app.id] : void 0) : void 0;
857
+ const tools = isJsonObject(appConfig) ? appConfig.tools : void 0;
858
+ if (!isJsonObject(tools)) return [];
859
+ return Object.entries(tools).filter(([, value]) => hasPersistedToolApprovalOverride(value)).map(([toolName]) => toolName).toSorted();
860
+ }
861
+ function hasPersistedToolApprovalOverride(value) {
862
+ return isJsonObject(value) && (value.approval_mode !== void 0 || value.approvalMode !== void 0);
863
+ }
864
+ function isOverriddenConfigWriteResponse(response) {
865
+ return isJsonObject(response) && response.status === "okOverridden";
866
+ }
867
+ function quoteConfigKeyPathSegment(segment) {
868
+ return `"${segment.replace(/["\\]/g, (char) => `\\${char}`)}"`;
869
+ }
780
870
  function shouldWaitForInitialAppInventory(params, policy, inventory) {
781
871
  if (inventory.records.some((record) => record.activationRequired)) return false;
872
+ return shouldRefreshMissingAppInventory(params, policy, inventory);
873
+ }
874
+ function shouldRefreshMissingAppInventory(params, policy, inventory) {
782
875
  return Boolean(params.appCacheKey && policy.pluginPolicies.some((plugin) => plugin.enabled) && inventory.appInventory?.state === "missing");
783
876
  }
784
877
  async function refreshAppInventoryNow(params, appCache, options = {}) {
@@ -809,10 +902,13 @@ function resolveThreadConfigAppsForRecord(params) {
809
902
  if (params.inventory.appInventory?.state === "missing") return [];
810
903
  return params.record.apps;
811
904
  }
905
+ function isPluginAppReadyForThreadStart(app) {
906
+ return app.accessible;
907
+ }
812
908
  function shouldForceRefreshForNotReadyPluginApps(params, policy, inventory) {
813
909
  if (!params.appCacheKey || !policy.pluginPolicies.some((plugin) => plugin.enabled)) return false;
814
910
  if (inventory.appInventory?.state === "missing") return false;
815
- return inventory.records.some((record) => record.appOwnership === "proven" && record.ownedAppIds.length > 0 && (record.apps.length === 0 || record.apps.some((app) => !app.accessible || !app.enabled)));
911
+ return inventory.records.some((record) => record.appOwnership === "proven" && record.ownedAppIds.length > 0 && (record.apps.length === 0 || record.apps.some((app) => !app.accessible)));
816
912
  }
817
913
  function policyFingerprint(policy) {
818
914
  return {
@@ -1598,7 +1694,8 @@ async function startOrResumeThread(params) {
1598
1694
  configPatch: params.finalConfigPatch,
1599
1695
  nativeHookRelayGeneration: params.nativeHookRelayGeneration
1600
1696
  };
1601
- const resumeConfig = mergeCodexThreadConfigs(params.config, userMcpServersConfigPatch, finalConfigPatch.configPatch);
1697
+ const pluginAppsConfigPatch = params.pluginThreadConfig?.enabled && resumeBinding.pluginAppPolicyContext ? buildCodexPluginAppsConfigPatchFromPolicyContext(resumeBinding.pluginAppPolicyContext) : void 0;
1698
+ const resumeConfig = mergeCodexThreadConfigs(params.config, userMcpServersConfigPatch, pluginAppsConfigPatch, finalConfigPatch.configPatch);
1602
1699
  const resumeParams = lifecycleTiming.measureSync("thread-resume-params", () => buildThreadResumeParams(params.params, {
1603
1700
  threadId: resumeBinding.threadId,
1604
1701
  authProfileId,
@@ -1907,7 +2004,7 @@ function buildThreadStartParams(params, options) {
1907
2004
  ...modelSelection.modelProvider ? { modelProvider: modelSelection.modelProvider } : {},
1908
2005
  cwd: options.cwd,
1909
2006
  approvalPolicy: options.appServer.approvalPolicy,
1910
- approvalsReviewer: options.appServer.approvalsReviewer,
2007
+ approvalsReviewer: resolveCodexThreadApprovalsReviewer(options.appServer, options.config),
1911
2008
  ...codexThreadSandboxOrPermissions(options.appServer),
1912
2009
  ...options.appServer.serviceTier !== void 0 ? { serviceTier: options.appServer.serviceTier } : {},
1913
2010
  personality: CODEX_NATIVE_PERSONALITY_NONE,
@@ -1957,7 +2054,7 @@ function buildThreadResumeParams(params, options) {
1957
2054
  model: modelSelection.model,
1958
2055
  ...modelSelection.modelProvider ? { modelProvider: modelSelection.modelProvider } : {},
1959
2056
  approvalPolicy: options.appServer.approvalPolicy,
1960
- approvalsReviewer: options.appServer.approvalsReviewer,
2057
+ approvalsReviewer: resolveCodexThreadApprovalsReviewer(options.appServer, options.config),
1961
2058
  ...codexThreadSandboxOrPermissions(options.appServer),
1962
2059
  ...options.appServer.serviceTier !== void 0 ? { serviceTier: options.appServer.serviceTier } : {},
1963
2060
  personality: CODEX_NATIVE_PERSONALITY_NONE,
@@ -2082,7 +2179,7 @@ function buildTurnStartParams(params, options) {
2082
2179
  model: modelSelection.model,
2083
2180
  personality: CODEX_NATIVE_PERSONALITY_NONE,
2084
2181
  ...options.appServer.serviceTier !== void 0 ? { serviceTier: options.appServer.serviceTier } : {},
2085
- effort: resolveReasoningEffort(params.thinkLevel, modelSelection.model),
2182
+ effort: resolveReasoningEffort(params.thinkLevel, modelSelection.model, readCodexSupportedReasoningEfforts(params.model?.compat)),
2086
2183
  ...options.environmentSelection ? { environments: options.environmentSelection } : {},
2087
2184
  collaborationMode: buildTurnCollaborationMode(params, {
2088
2185
  model: modelSelection.model,
@@ -2093,6 +2190,9 @@ function buildTurnStartParams(params, options) {
2093
2190
  })
2094
2191
  };
2095
2192
  }
2193
+ function resolveCodexThreadApprovalsReviewer(appServer, config) {
2194
+ return config?.approvals_reviewer === "user" ? "user" : appServer.approvalsReviewer;
2195
+ }
2096
2196
  function codexThreadSandboxOrPermissions(appServer) {
2097
2197
  if (appServer.networkProxy) return {};
2098
2198
  return { sandbox: appServer.sandbox };
@@ -2108,7 +2208,7 @@ function buildTurnCollaborationMode(params, options = {}) {
2108
2208
  mode: "default",
2109
2209
  settings: {
2110
2210
  model,
2111
- reasoning_effort: resolveReasoningEffort(params.thinkLevel, model),
2211
+ reasoning_effort: resolveReasoningEffort(params.thinkLevel, model, readCodexSupportedReasoningEfforts(params.model?.compat)),
2112
2212
  developer_instructions: buildTurnScopedCollaborationInstructions(params, options)
2113
2213
  }
2114
2214
  };
@@ -2116,7 +2216,7 @@ function buildTurnCollaborationMode(params, options = {}) {
2116
2216
  function buildTurnScopedCollaborationInstructions(params, options = {}) {
2117
2217
  const contextInstructions = joinPresentSections(options.turnScopedDeveloperInstructions, options.memoryCollaborationInstructions, options.skillsCollaborationInstructions);
2118
2218
  if (params.trigger === "cron") return joinPresentSections(buildCronCollaborationInstructions(), contextInstructions);
2119
- if (params.trigger === "heartbeat") return joinPresentSections(buildHeartbeatCollaborationInstructions(), contextInstructions, options.heartbeatCollaborationInstructions);
2219
+ if (params.trigger === "heartbeat" && params.bootstrapContextRunKind !== "commitment-only") return joinPresentSections(buildHeartbeatCollaborationInstructions(), contextInstructions, options.heartbeatCollaborationInstructions);
2120
2220
  if (contextInstructions?.trim()) return joinPresentSections(buildDefaultCollaborationInstructions(), contextInstructions);
2121
2221
  return null;
2122
2222
  }
@@ -2259,10 +2359,16 @@ function resolveCodexAppServerModelProvider(params) {
2259
2359
  if (isCodexAppServerNativeAuthProfile(params) && normalizedLower === "openai") return;
2260
2360
  return normalizedLower === "openai" ? "openai" : normalized;
2261
2361
  }
2262
- function resolveReasoningEffort(thinkLevel, modelId) {
2362
+ function resolveReasoningEffort(thinkLevel, modelId, supportedReasoningEfforts) {
2363
+ if (thinkLevel === "off" || thinkLevel === "adaptive") return null;
2364
+ if (supportedReasoningEfforts) return resolveCodexSupportedReasoningEffort({
2365
+ requested: thinkLevel,
2366
+ supportedReasoningEfforts
2367
+ }) ?? null;
2263
2368
  if (thinkLevel === "minimal") return isModernCodexModel(modelId) ? "low" : "minimal";
2264
2369
  if (thinkLevel === "low" || thinkLevel === "medium" || thinkLevel === "high" || thinkLevel === "xhigh") return thinkLevel;
2370
+ if (thinkLevel === "max" && isMaxReasoningCodexModel(modelId)) return "max";
2265
2371
  return null;
2266
2372
  }
2267
2373
  //#endregion
2268
- export { resolveCodexContextEngineProjectionReserveTokens as A, isCodexNotificationForTurn as B, isForcedPrivateQaCodexRuntime as C, fitCodexProjectedContextForTurnStart as D, resolveCodexDynamicToolsLoadingForRuntime as E, ensureCodexPluginActivation as F, readCodexNotificationTurnId as H, pluginReadParams as I, buildCodexAppInventoryCacheKey as L, buildCodexPluginThreadConfigInputFingerprint as M, mergeCodexThreadConfigs as N, projectContextEngineAssemblyForCodex as O, shouldBuildCodexPluginThreadConfig as P, defaultCodexAppInventoryCache as R, filterCodexDynamicTools as S, resolveCodexDynamicToolsLoading as T, readCodexNotificationThreadId as V, resolveCodexWebSearchPlan as _, buildDeveloperInstructions as a, sanitizeCodexHistoryImagePayloads as b, codexDynamicToolsFingerprint as c, resolveCodexAppServerRequestModelSelection as d, resolveCodexAppServerThreadModelSelection as f, buildCodexNativeWebSearchThreadConfig as g, startOrResumeThread as h, buildContextEngineBinding as i, buildCodexPluginThreadConfig as j, resolveCodexContextEngineProjectionMaxChars as k, isContextEngineBindingCompatible as l, resolveReasoningEffort as m, areCodexDynamicToolFingerprintsCompatible as n, buildTurnCollaborationMode as o, resolveCodexBindingModelProviderFallback as p, buildCodexRuntimeThreadConfig as r, buildTurnStartParams as s, CODEX_NATIVE_PERSONALITY_NONE as t, resolveCodexAppServerModelProvider as u, isCodexAppServerProfilerEnabled as v, normalizeCodexDynamicToolName as w, sanitizeInlineImageDataUrl$1 as x, invalidInlineImageText as y, describeCodexNotificationCorrelation as z };
2374
+ export { resolveCodexContextEngineProjectionReserveTokens as A, describeCodexNotificationCorrelation as B, isForcedPrivateQaCodexRuntime as C, fitCodexProjectedContextForTurnStart as D, resolveCodexDynamicToolsLoadingForRuntime as E, shouldBuildCodexPluginThreadConfig as F, readCodexNotificationThreadId as H, ensureCodexPluginActivation as I, pluginReadParams as L, buildCodexPluginThreadConfig as M, buildCodexPluginThreadConfigInputFingerprint as N, projectContextEngineAssemblyForCodex as O, mergeCodexThreadConfigs as P, buildCodexAppInventoryCacheKey as R, filterCodexDynamicTools as S, resolveCodexDynamicToolsLoading as T, readCodexNotificationTurnId as U, isCodexNotificationForTurn as V, resolveCodexWebSearchPlan as _, buildDeveloperInstructions as a, sanitizeCodexHistoryImagePayloads as b, codexDynamicToolsFingerprint as c, resolveCodexAppServerRequestModelSelection as d, resolveCodexAppServerThreadModelSelection as f, buildCodexNativeWebSearchThreadConfig as g, startOrResumeThread as h, buildContextEngineBinding as i, buildCodexPluginAppsConfigPatchFromPolicyContext as j, resolveCodexContextEngineProjectionMaxChars as k, isContextEngineBindingCompatible as l, resolveReasoningEffort as m, areCodexDynamicToolFingerprintsCompatible as n, buildTurnCollaborationMode as o, resolveCodexBindingModelProviderFallback as p, buildCodexRuntimeThreadConfig as r, buildTurnStartParams as s, CODEX_NATIVE_PERSONALITY_NONE as t, resolveCodexAppServerModelProvider as u, isCodexAppServerProfilerEnabled as v, normalizeCodexDynamicToolName as w, sanitizeInlineImageDataUrl$1 as x, invalidInlineImageText as y, defaultCodexAppInventoryCache as z };
@@ -1,6 +1,6 @@
1
1
  import { n as isJsonObject } from "./protocol-dh-ETiNd.js";
2
- import { g as buildCodexNativeWebSearchThreadConfig } from "./thread-lifecycle-DtT3-ehU.js";
3
- import { n as runBoundedCodexAppServerTurn } from "./media-understanding-provider-ZUQHN7gT.js";
2
+ import { g as buildCodexNativeWebSearchThreadConfig } from "./thread-lifecycle-DeSMZSXr.js";
3
+ import { n as runBoundedCodexAppServerTurn } from "./media-understanding-provider-C5yYzx_6.js";
4
4
  import { readStringParam, resolveSearchTimeoutSeconds, wrapWebContent } from "openclaw/plugin-sdk/provider-web-search";
5
5
  //#region extensions/codex/src/web-search-provider.runtime.ts
6
6
  async function executeCodexWebSearchProviderTool(ctx, args, executionContext, options) {
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "name": "@openclaw/codex",
3
- "version": "2026.6.11",
3
+ "version": "2026.7.1-beta.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@openclaw/codex",
9
- "version": "2026.6.11",
9
+ "version": "2026.7.1-beta.1",
10
10
  "dependencies": {
11
- "@openai/codex": "0.139.0",
11
+ "@openai/codex": "0.142.4",
12
12
  "typebox": "1.1.39",
13
13
  "ws": "8.21.0",
14
14
  "zod": "4.4.3"
15
15
  }
16
16
  },
17
17
  "node_modules/@openai/codex": {
18
- "version": "0.139.0",
19
- "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.139.0.tgz",
20
- "integrity": "sha512-wr2fRE+fzW0CjEbfFsLh1ftarVEcw0CMLWS7QyA0nyOz5qacQPVq3cq2+/U7oEbwm1TOqoi0Fm1nxniB5FkpmA==",
18
+ "version": "0.142.4",
19
+ "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.142.4.tgz",
20
+ "integrity": "sha512-BW9+3Cs7tChgkc0QhUsZIDm6XgpSDSeJkljRSHhJZqDwlaxDnNVhRP/sZwhgrTn3f2jPn3jc4WTKfLOTk+g5pA==",
21
21
  "license": "Apache-2.0",
22
22
  "bin": {
23
23
  "codex": "bin/codex.js"
@@ -26,19 +26,19 @@
26
26
  "node": ">=16"
27
27
  },
28
28
  "optionalDependencies": {
29
- "@openai/codex-darwin-arm64": "npm:@openai/codex@0.139.0-darwin-arm64",
30
- "@openai/codex-darwin-x64": "npm:@openai/codex@0.139.0-darwin-x64",
31
- "@openai/codex-linux-arm64": "npm:@openai/codex@0.139.0-linux-arm64",
32
- "@openai/codex-linux-x64": "npm:@openai/codex@0.139.0-linux-x64",
33
- "@openai/codex-win32-arm64": "npm:@openai/codex@0.139.0-win32-arm64",
34
- "@openai/codex-win32-x64": "npm:@openai/codex@0.139.0-win32-x64"
29
+ "@openai/codex-darwin-arm64": "npm:@openai/codex@0.142.4-darwin-arm64",
30
+ "@openai/codex-darwin-x64": "npm:@openai/codex@0.142.4-darwin-x64",
31
+ "@openai/codex-linux-arm64": "npm:@openai/codex@0.142.4-linux-arm64",
32
+ "@openai/codex-linux-x64": "npm:@openai/codex@0.142.4-linux-x64",
33
+ "@openai/codex-win32-arm64": "npm:@openai/codex@0.142.4-win32-arm64",
34
+ "@openai/codex-win32-x64": "npm:@openai/codex@0.142.4-win32-x64"
35
35
  }
36
36
  },
37
37
  "node_modules/@openai/codex-darwin-arm64": {
38
38
  "name": "@openai/codex",
39
- "version": "0.139.0-darwin-arm64",
40
- "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.139.0-darwin-arm64.tgz",
41
- "integrity": "sha512-o+0ZKWwgDFMMLO7rwinzO0PQsgK+Vme1pMN2GeAxsX29ZgGZcyPICfpJbeGSUO1mb2a36Skjx6nfdRnxMY0r7w==",
39
+ "version": "0.142.4-darwin-arm64",
40
+ "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.142.4-darwin-arm64.tgz",
41
+ "integrity": "sha512-CfXp5jilBOxD8zLuG6Nk7w5ZPP3roE3s1rsr60za9PQKI7kaJ/5G+oP3Z0N1CoB4mpy+5JHkMLTZAZZPGFlSgQ==",
42
42
  "cpu": [
43
43
  "arm64"
44
44
  ],
@@ -53,9 +53,9 @@
53
53
  },
54
54
  "node_modules/@openai/codex-darwin-x64": {
55
55
  "name": "@openai/codex",
56
- "version": "0.139.0-darwin-x64",
57
- "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.139.0-darwin-x64.tgz",
58
- "integrity": "sha512-9gkBWzu6DB2rqU4DbpxD3DE5bofGpsK46Lp0h0I+bKWc2IIcxvSi8K2utKmBLoJCbKrn4JQu7dFNGRqEfENung==",
56
+ "version": "0.142.4-darwin-x64",
57
+ "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.142.4-darwin-x64.tgz",
58
+ "integrity": "sha512-H9ia31pkJFtBk+UrREAfJiTUfcvgactKbG4W4SF2LFfJOTRsrsJZGtscHQ8/lLGeKEfOk/psrbSOPDyrZnxvnQ==",
59
59
  "cpu": [
60
60
  "x64"
61
61
  ],
@@ -70,9 +70,9 @@
70
70
  },
71
71
  "node_modules/@openai/codex-linux-arm64": {
72
72
  "name": "@openai/codex",
73
- "version": "0.139.0-linux-arm64",
74
- "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.139.0-linux-arm64.tgz",
75
- "integrity": "sha512-tBQE5lZciRHeWZGuURgjP9S717MvTIpQMc593+DNxY2LQxozkngOkzFSQd1+/UmQKGrCqdFLu5irIwPXpSZyEw==",
73
+ "version": "0.142.4-linux-arm64",
74
+ "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.142.4-linux-arm64.tgz",
75
+ "integrity": "sha512-/bBcEm+OKmlGHH0c88jrVgYMRyaNC/hGOW/znP/PiHQEeIf4UdsUGQ7x4FAZm648140cgaeKYIBoRBbHizS+5w==",
76
76
  "cpu": [
77
77
  "arm64"
78
78
  ],
@@ -87,9 +87,9 @@
87
87
  },
88
88
  "node_modules/@openai/codex-linux-x64": {
89
89
  "name": "@openai/codex",
90
- "version": "0.139.0-linux-x64",
91
- "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.139.0-linux-x64.tgz",
92
- "integrity": "sha512-14UgzDS+X4crkvdt6S02A/ZZOrS8ZyWiuTRpguCtnhNamb7unSuDxy86BWgpAl3sqiTaN2CP8VLyp2ohQ8Nbzw==",
90
+ "version": "0.142.4-linux-x64",
91
+ "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.142.4-linux-x64.tgz",
92
+ "integrity": "sha512-t3tNOkDdiO5/gRqkTmuMcAj5JjCbeWotOJzxV7pPkD2u2KvzVRrk7jPAjuy+85wPc12lsIupYgxHlK7CkVLOjA==",
93
93
  "cpu": [
94
94
  "x64"
95
95
  ],
@@ -104,9 +104,9 @@
104
104
  },
105
105
  "node_modules/@openai/codex-win32-arm64": {
106
106
  "name": "@openai/codex",
107
- "version": "0.139.0-win32-arm64",
108
- "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.139.0-win32-arm64.tgz",
109
- "integrity": "sha512-nlwRjsYotH1Rtqu/Q0VwQbIeO2UX1mkHK84Ov9qn/hl29QqqoBtno0tRyqIPbkXFIVQuWiAYXlV3ugLwH5fTrQ==",
107
+ "version": "0.142.4-win32-arm64",
108
+ "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.142.4-win32-arm64.tgz",
109
+ "integrity": "sha512-QBGeoYk3pmVscVIxeW21cvPJIjsnmD5dOTqMAzypXGik5soNIKHbps2Kj1LBKOjVbbx5qoDEbTwDfYmnjfqgdQ==",
110
110
  "cpu": [
111
111
  "arm64"
112
112
  ],
@@ -121,9 +121,9 @@
121
121
  },
122
122
  "node_modules/@openai/codex-win32-x64": {
123
123
  "name": "@openai/codex",
124
- "version": "0.139.0-win32-x64",
125
- "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.139.0-win32-x64.tgz",
126
- "integrity": "sha512-lQrVLNz+90wdvWVNFDvCkHQRiAK9ZllmkTka3c8eqSDqdJk35Gpgppfv9Xtw5M2ZBtTq0sBdWBiCMyzGDBSpmQ==",
124
+ "version": "0.142.4-win32-x64",
125
+ "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.142.4-win32-x64.tgz",
126
+ "integrity": "sha512-W0rSPT0t7FnKlJYNu9/HpHzaSOutuSSYjIVunKorYmrScXk9pQxBEhEuyn16JOtywc/2nX8nHEmWsuj2sd8suw==",
127
127
  "cpu": [
128
128
  "x64"
129
129
  ],
@@ -101,7 +101,7 @@
101
101
  "default": false
102
102
  },
103
103
  "allow_destructive_actions": {
104
- "oneOf": [{ "type": "boolean" }, { "const": "auto" }],
104
+ "oneOf": [{ "type": "boolean" }, { "const": "auto" }, { "const": "ask" }],
105
105
  "default": true
106
106
  },
107
107
  "plugins": {
@@ -121,7 +121,7 @@
121
121
  "type": "string"
122
122
  },
123
123
  "allow_destructive_actions": {
124
- "oneOf": [{ "type": "boolean" }, { "const": "auto" }]
124
+ "oneOf": [{ "type": "boolean" }, { "const": "auto" }, { "const": "ask" }]
125
125
  }
126
126
  }
127
127
  }
@@ -343,7 +343,7 @@
343
343
  },
344
344
  "codexPlugins.allow_destructive_actions": {
345
345
  "label": "Allow Destructive Plugin Actions",
346
- "help": "Default policy for plugin app write or destructive action elicitations. Use true to accept safe schemas without prompting, false to decline, or auto to ask through plugin approvals.",
346
+ "help": "Default policy for plugin app write or destructive action elicitations. Use true to accept safe schemas without prompting, false to decline, auto to ask through plugin approvals when Codex requires approval, or ask to prompt for every write/destructive action without durable approval.",
347
347
  "advanced": true
348
348
  },
349
349
  "codexPlugins.plugins": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/codex",
3
- "version": "2026.6.11",
3
+ "version": "2026.7.1-beta.1",
4
4
  "description": "OpenClaw Codex app-server harness and model provider plugin with a Codex-managed GPT catalog.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "type": "module",
10
10
  "dependencies": {
11
- "@openai/codex": "0.139.0",
11
+ "@openai/codex": "0.142.4",
12
12
  "typebox": "1.1.39",
13
13
  "ws": "8.21.0",
14
14
  "zod": "4.4.3"
@@ -34,10 +34,10 @@
34
34
  ]
35
35
  },
36
36
  "compat": {
37
- "pluginApi": ">=2026.6.11"
37
+ "pluginApi": ">=2026.7.1-beta.1"
38
38
  },
39
39
  "build": {
40
- "openclawVersion": "2026.6.11"
40
+ "openclawVersion": "2026.7.1-beta.1"
41
41
  },
42
42
  "release": {
43
43
  "publishToClawHub": true,
@@ -55,7 +55,7 @@
55
55
  "README.md"
56
56
  ],
57
57
  "peerDependencies": {
58
- "openclaw": ">=2026.6.11"
58
+ "openclaw": ">=2026.7.1-beta.1"
59
59
  },
60
60
  "peerDependenciesMeta": {
61
61
  "openclaw": {