@openclaw/codex 2026.7.2-beta.2 → 2026.7.2-beta.3

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-Scc-Wevo.js → app-server-policy-DUMF2Xyr.js} +1 -1
  2. package/dist/{attempt-notifications-BFmNhqFl.js → attempt-notifications-Ecjyzufe.js} +1 -1
  3. package/dist/cli-metadata.js +1 -1
  4. package/dist/{command-formatters-Dq9InZUK.js → command-formatters-NCTL7A2q.js} +7 -3
  5. package/dist/{command-handlers-IgqmL_kv.js → command-handlers-DtFbZiba.js} +69 -11
  6. package/dist/{compact-DCTmg3id.js → compact-Kgy26gIM.js} +4 -4
  7. package/dist/{computer-use-CPcU8TjG.js → computer-use-C7x4ZaqR.js} +4 -4
  8. package/dist/{conversation-control-CGkBlfc5.js → conversation-control-B0s3aIjT.js} +5 -5
  9. package/dist/doctor-contract-api.js +1 -1
  10. package/dist/{dynamic-tools-C_1tEs34.js → dynamic-tools-D_vSVmv9.js} +253 -114
  11. package/dist/harness.js +8 -7
  12. package/dist/index.js +16 -16
  13. package/dist/{media-understanding-provider-D31dOJwb.js → media-understanding-provider-IPNNQre6.js} +6 -6
  14. package/dist/media-understanding-provider.js +1 -1
  15. package/dist/{models-uh26C8QU.js → models-DD5zBdX5.js} +1 -1
  16. package/dist/{notification-correlation-KmfV4EkP.js → notification-correlation-C8DVQ_Bq.js} +3 -3
  17. package/dist/{plugin-app-cache-key-Ceb-lm2c.js → plugin-app-cache-key-DJbhLYSK.js} +2 -2
  18. package/dist/{rate-limits-DyXaYAxU.js → rate-limits-CqhWQ2R9.js} +3 -1
  19. package/dist/{request-B_oQsCXy.js → request-9yf9pZjf.js} +1 -1
  20. package/dist/{run-attempt-MLzoMe_m.js → run-attempt-BIoO8ISr.js} +158 -76
  21. package/dist/{session-binding-h1mmCGnl.js → session-binding-Bmt20HfB.js} +2 -0
  22. package/dist/{session-catalog-CEvoXWHA.js → session-catalog-CA7R-hX2.js} +43 -22
  23. package/dist/{session-cli-XsEuWb_C.js → session-cli-Bxk3-Wqz.js} +2 -2
  24. package/dist/{shared-client-JiAnW6pc.js → shared-client-CSXLtCLE.js} +52 -3
  25. package/dist/{side-question-DqDvIwSU.js → side-question-DtzquMOb.js} +7 -7
  26. package/dist/{thread-lifecycle-CN_pPtPh.js → thread-lifecycle-CQ_9mAa1.js} +40 -9
  27. package/dist/{usage-D5Rohxoc.js → usage-CuPpFgTc.js} +3 -3
  28. package/dist/{web-search-provider.runtime-CKVBn3fP.js → web-search-provider.runtime-_x5XTeqh.js} +3 -3
  29. package/npm-shrinkwrap.json +30 -30
  30. package/openclaw.plugin.json +11 -1
  31. package/package.json +5 -5
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { C as resolveCodexComputerUseConfig, S as resolveCodexAppServerUserHomeDir, a as isCodexAppServerNativeAuthProfile, b as resolveCodexAppServerRuntimeOptions, m as codexAppServerStartOptionsKey, x as resolveCodexAppServerStartOptionsForAgent } from "./session-binding-h1mmCGnl.js";
2
+ import { C as resolveCodexComputerUseConfig, S as resolveCodexAppServerUserHomeDir, a as isCodexAppServerNativeAuthProfile, b as resolveCodexAppServerRuntimeOptions, m as codexAppServerStartOptionsKey, x as resolveCodexAppServerStartOptionsForAgent } from "./session-binding-Bmt20HfB.js";
3
3
  import { n as resolveCodexAppServerSpawnEnv, t as createStdioTransport } from "./transport-stdio-DXgGZ7Ib.js";
4
4
  import { createRequire } from "node:module";
5
5
  import fs, { access } from "node:fs/promises";
@@ -191,6 +191,8 @@ function signalCodexAppServerTransport(child, signal) {
191
191
  */
192
192
  /** Minimum Codex app-server version supported by the OpenClaw Codex bridge. */
193
193
  const MIN_CODEX_APP_SERVER_VERSION = "0.143.0";
194
+ /** Newest Codex app-server version validated by the OpenClaw Codex bridge. */
195
+ const MAX_CODEX_APP_SERVER_VERSION = "0.144.6";
194
196
  /** npm package name for the managed Codex app-server binary. */
195
197
  const MANAGED_CODEX_APP_SERVER_PACKAGE = "@openai/codex";
196
198
  //#endregion
@@ -205,6 +207,9 @@ const CODEX_APP_SERVER_PARSE_BUFFER_MAX = 8 * 1024 * 1024;
205
207
  const CODEX_APP_SERVER_PARSE_BUFFER_MAX_LINES = 1e3;
206
208
  const CODEX_DYNAMIC_TOOL_SERVER_REQUEST_TIMEOUT_MS = 6e5;
207
209
  const CODEX_APP_SERVER_STDERR_TAIL_MAX = 2e3;
210
+ const CODEX_APP_SERVER_OVERLOADED_ERROR_CODE = -32001;
211
+ const CODEX_APP_SERVER_OVERLOAD_MAX_RETRIES = 3;
212
+ const CODEX_APP_SERVER_OVERLOAD_RETRY_BASE_MS = 50;
208
213
  const CODEX_APP_SERVER_CLIENT_INSTANCE_IDS = /* @__PURE__ */ new WeakMap();
209
214
  const UNPAIRED_SURROGATE_RE = /[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g;
210
215
  /** Process-local generation fence for bindings tied to one app-server client instance. */
@@ -432,6 +437,50 @@ var CodexAppServerClient = class CodexAppServerClient {
432
437
  return this.requestWithoutThreadSessionGuard(method, params, options);
433
438
  }
434
439
  requestWithoutThreadSessionGuard(method, params, options, onWriteAttempt) {
440
+ return this.requestWithOverloadRetry(method, params, options, onWriteAttempt);
441
+ }
442
+ async requestWithOverloadRetry(method, params, options, onWriteAttempt) {
443
+ const deadline = options.timeoutMs !== void 0 && Number.isFinite(options.timeoutMs) ? Date.now() + options.timeoutMs : void 0;
444
+ for (let retry = 0;; retry += 1) {
445
+ if (options.signal?.aborted) throw new CodexAppServerLocalRequestCancellationError(method, "aborted", false);
446
+ const remainingTimeoutMs = deadline === void 0 ? void 0 : deadline - Date.now();
447
+ if (remainingTimeoutMs !== void 0 && remainingTimeoutMs <= 0) throw new CodexAppServerLocalRequestCancellationError(method, "timed out", false);
448
+ try {
449
+ return await this.requestOnce(method, params, {
450
+ ...options,
451
+ ...remainingTimeoutMs !== void 0 ? { timeoutMs: remainingTimeoutMs } : {}
452
+ }, onWriteAttempt);
453
+ } catch (error) {
454
+ if (!(error instanceof CodexAppServerRpcError) || error.code !== CODEX_APP_SERVER_OVERLOADED_ERROR_CODE || retry >= CODEX_APP_SERVER_OVERLOAD_MAX_RETRIES) throw error;
455
+ const backoffMs = Math.round(CODEX_APP_SERVER_OVERLOAD_RETRY_BASE_MS * 2 ** retry * (.75 + Math.random() * .5));
456
+ await this.waitForOverloadRetry(method, backoffMs, deadline, options.signal);
457
+ }
458
+ }
459
+ }
460
+ async waitForOverloadRetry(method, backoffMs, deadline, signal) {
461
+ if (signal?.aborted) throw new CodexAppServerLocalRequestCancellationError(method, "aborted", false);
462
+ const remainingMs = deadline === void 0 ? void 0 : deadline - Date.now();
463
+ if (remainingMs !== void 0 && remainingMs <= 0) throw new CodexAppServerLocalRequestCancellationError(method, "timed out", false);
464
+ const delayMs = remainingMs === void 0 ? backoffMs : Math.min(backoffMs, remainingMs);
465
+ await new Promise((resolve, reject) => {
466
+ const timer = setTimeout(() => {
467
+ cleanup();
468
+ resolve();
469
+ }, delayMs);
470
+ timer.unref?.();
471
+ const abortListener = () => {
472
+ cleanup();
473
+ reject(new CodexAppServerLocalRequestCancellationError(method, "aborted", false));
474
+ };
475
+ const cleanup = () => {
476
+ clearTimeout(timer);
477
+ signal?.removeEventListener("abort", abortListener);
478
+ };
479
+ signal?.addEventListener("abort", abortListener, { once: true });
480
+ if (signal?.aborted) abortListener();
481
+ });
482
+ }
483
+ requestOnce(method, params, options, onWriteAttempt) {
435
484
  if (this.closed) return Promise.reject(this.closeError ?? /* @__PURE__ */ new Error("codex app-server client is closed"));
436
485
  if (options.signal?.aborted) return Promise.reject(new CodexAppServerLocalRequestCancellationError(method, "aborted", false));
437
486
  const id = this.nextId++;
@@ -759,7 +808,7 @@ function timeoutServerRequestResponse(request) {
759
808
  var CodexAppServerVersionError = class extends Error {
760
809
  constructor(detectedVersion) {
761
810
  const detected = detectedVersion ? `detected ${detectedVersion}` : "OpenClaw could not determine the running Codex version";
762
- super(`Codex app-server ${MIN_CODEX_APP_SERVER_VERSION} or newer is required, but ${detected}. Update the configured Codex app-server binary, or remove custom command overrides to use the managed binary.`);
811
+ super(`A stable Codex app-server from ${MIN_CODEX_APP_SERVER_VERSION} through ${MAX_CODEX_APP_SERVER_VERSION} is required, but ${detected}. Update the configured Codex app-server binary, or remove custom command overrides to use the managed binary.`);
763
812
  this.name = "CodexAppServerVersionError";
764
813
  this.detectedVersion = detectedVersion;
765
814
  }
@@ -767,7 +816,7 @@ var CodexAppServerVersionError = class extends Error {
767
816
  function assertSupportedCodexAppServerVersion(response) {
768
817
  const detectedVersion = readCodexVersionFromUserAgent(response.userAgent);
769
818
  const parsedVersion = parse(detectedVersion ?? "");
770
- if (!detectedVersion || !parsedVersion || parsedVersion.compare("0.143.0") < 0 || parsedVersion.version === "0.143.0" && parsedVersion.build.length > 0) throw new CodexAppServerVersionError(detectedVersion);
819
+ if (!detectedVersion || !parsedVersion || parsedVersion.compare("0.143.0") < 0 || parsedVersion.compare("0.144.6") > 0 || parsedVersion.prerelease.length > 0 || parsedVersion.build.length > 0) throw new CodexAppServerVersionError(detectedVersion);
771
820
  return detectedVersion;
772
821
  }
773
822
  function isUnsupportedCodexAppServerVersionError(error) {
@@ -1,12 +1,12 @@
1
- import { B as isCodexAppServerApprovalRequest, T as resolveCodexAppServerPreparedAuthHandoff, Z as isJsonObject, a as getLeasedSharedCodexAppServerClient, g as ensureCodexAppServerClientRuntime, p as withLeasedCodexAppServerClientStartSelectionRetry, s as releaseCodexAppServerClientLease, v as readRecentCodexRateLimits } from "./shared-client-JiAnW6pc.js";
2
- import { D as resolveOpenClawExecPolicyForCodexAppServer, O as shouldAutoApproveCodexAppServerApprovals, c as sessionBindingIdentity, p as canUseCodexModelBackedApprovalsReviewerForModel, w as resolveCodexModelBackedReviewerPolicyContext, y as readCodexPluginConfig } from "./session-binding-h1mmCGnl.js";
1
+ import { B as isCodexAppServerApprovalRequest, T as resolveCodexAppServerPreparedAuthHandoff, Z as isJsonObject, a as getLeasedSharedCodexAppServerClient, g as ensureCodexAppServerClientRuntime, p as withLeasedCodexAppServerClientStartSelectionRetry, s as releaseCodexAppServerClientLease, v as readRecentCodexRateLimits } from "./shared-client-CSXLtCLE.js";
2
+ import { D as resolveOpenClawExecPolicyForCodexAppServer, O as shouldAutoApproveCodexAppServerApprovals, c as sessionBindingIdentity, p as canUseCodexModelBackedApprovalsReviewerForModel, w as resolveCodexModelBackedReviewerPolicyContext, y as readCodexPluginConfig } from "./session-binding-Bmt20HfB.js";
3
3
  import { f as assertCodexTurnStartResponse, g as readCodexTurn, l as assertCodexThreadForkResponse, p as readCodexDynamicToolCallParams } from "./transcript-mirror-D9rTxx2P.js";
4
- import { E as resolveCodexDynamicToolsLoading, J as mergeCodexThreadConfigs, W as buildCodexPluginAppsConfigPatchFromPolicyContext, _ as resolveCodexBindingModelProviderFallback, d as resolveCodexWebSearchPlan, h as resolveCodexAppServerRequestModelSelection, l as buildCodexRuntimeThreadConfig, m as resolveCodexAppServerModelProvider, p as CODEX_NATIVE_PERSONALITY_NONE, v as resolveReasoningEffort, x as filterCodexDynamicTools, y as readCodexSupportedReasoningEfforts } from "./thread-lifecycle-CN_pPtPh.js";
5
- import { n as formatCodexUsageLimitErrorMessage } from "./rate-limits-DyXaYAxU.js";
6
- import { t as resolveCodexAppServerForModelProvider } from "./app-server-policy-Scc-Wevo.js";
4
+ import { E as resolveCodexDynamicToolsLoading, J as mergeCodexThreadConfigs, W as buildCodexPluginAppsConfigPatchFromPolicyContext, _ as resolveCodexBindingModelProviderFallback, d as resolveCodexWebSearchPlan, h as resolveCodexAppServerRequestModelSelection, l as buildCodexRuntimeThreadConfig, m as resolveCodexAppServerModelProvider, p as CODEX_NATIVE_PERSONALITY_NONE, v as resolveReasoningEffort, x as filterCodexDynamicTools, y as readCodexSupportedReasoningEfforts } from "./thread-lifecycle-CQ_9mAa1.js";
5
+ import { n as formatCodexUsageLimitErrorMessage } from "./rate-limits-CqhWQ2R9.js";
6
+ import { t as resolveCodexAppServerForModelProvider } from "./app-server-policy-DUMF2Xyr.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-KmfV4EkP.js";
9
- import { A as CODEX_NATIVE_HOOK_RELAY_EVENTS, F as emitCodexNativePreToolUseFailureDiagnostic, M as buildCodexNativeHookRelayConfig, N as buildCodexNativeHookRelayDisabledConfig, S as filterToolsForVisionInputs, U as resolveDynamicToolCallTimeoutMs, Y as resolveCodexToolAbortTerminalReason, _ as resolveCodexMessageToolProvider, a as emitDynamicToolStartedDiagnostic, c as resolveCodexProviderWebSearchSupportForClient, i as emitDynamicToolErrorDiagnostic, k as CodexNativeToolLifecycleProjector, n as handleCodexAppServerApprovalRequest, o as emitDynamicToolTerminalDiagnostic, r as handleCodexAppServerElicitationRequest, t as createCodexDynamicToolBridge, y as shouldEnableCodexAppServerNativeToolSurface, z as handleDynamicToolCallWithTimeout } from "./dynamic-tools-C_1tEs34.js";
8
+ import { a as resolveCodexBindingAppServerConnection, i as requireCodexSupervisionModelSelection, n as readCodexNotificationThreadId, r as readCodexNotificationTurnId } from "./notification-correlation-C8DVQ_Bq.js";
9
+ import { A as CODEX_NATIVE_HOOK_RELAY_EVENTS, F as emitCodexNativePreToolUseFailureDiagnostic, M as buildCodexNativeHookRelayConfig, N as buildCodexNativeHookRelayDisabledConfig, S as filterToolsForVisionInputs, U as resolveDynamicToolCallTimeoutMs, Y as resolveCodexToolAbortTerminalReason, _ as resolveCodexMessageToolProvider, a as emitDynamicToolStartedDiagnostic, c as resolveCodexProviderWebSearchSupportForClient, i as emitDynamicToolErrorDiagnostic, k as CodexNativeToolLifecycleProjector, n as handleCodexAppServerApprovalRequest, o as emitDynamicToolTerminalDiagnostic, r as handleCodexAppServerElicitationRequest, t as createCodexDynamicToolBridge, y as shouldEnableCodexAppServerNativeToolSurface, z as handleDynamicToolCallWithTimeout } from "./dynamic-tools-D_vSVmv9.js";
10
10
  import { randomUUID } from "node:crypto";
11
11
  import { loadExecApprovals } from "openclaw/plugin-sdk/exec-approvals-runtime";
12
12
  import { buildAgentHookContextChannelFields, embeddedAgentLog, formatErrorMessage, registerNativeHookRelay, resolveAgentDir, resolveAttemptSpawnWorkspaceDir, resolveModelAuthMode, resolveSandboxContext, resolveSessionAgentIds, supportsModelTools } from "openclaw/plugin-sdk/agent-harness-runtime";
@@ -1,7 +1,7 @@
1
- import { G as isCodexAppServerPrewriteRequestCancellationError, H as isCodexAppServerConnectionClosedError, R as CodexAppServerRpcError, X as flattenCodexDynamicToolFunctions, Z as isJsonObject, d as retireSharedCodexAppServerClientIfCurrent, n as clearSharedCodexAppServerClientIfCurrentAndUnclaimed, o as isCodexAppServerStartSelectionChangedError, t as clearSharedCodexAppServerClientIfCurrent, z as getCodexAppServerClientInstanceId } from "./shared-client-JiAnW6pc.js";
2
- import { T as resolveCodexPluginsPolicy, a as isCodexAppServerNativeAuthProfile, c as sessionBindingIdentity, d as CODEX_PLUGINS_WORKSPACE_MARKETPLACE_NAME, h as codexSandboxPolicyForTurn, i as hashCodexAppServerBindingFingerprint, n as assertCodexBindingMayBeReplaced, o as normalizeCodexAppServerBindingModelProvider, s as reclaimCurrentCodexSessionGeneration, u as CODEX_PLUGINS_MARKETPLACE_NAME } from "./session-binding-h1mmCGnl.js";
1
+ import { G as isCodexAppServerPrewriteRequestCancellationError, H as isCodexAppServerConnectionClosedError, R as CodexAppServerRpcError, X as flattenCodexDynamicToolFunctions, Z as isJsonObject, d as retireSharedCodexAppServerClientIfCurrent, n as clearSharedCodexAppServerClientIfCurrentAndUnclaimed, o as isCodexAppServerStartSelectionChangedError, t as clearSharedCodexAppServerClientIfCurrent, z as getCodexAppServerClientInstanceId } from "./shared-client-CSXLtCLE.js";
2
+ import { T as resolveCodexPluginsPolicy, a as isCodexAppServerNativeAuthProfile, c as sessionBindingIdentity, d as CODEX_PLUGINS_WORKSPACE_MARKETPLACE_NAME, h as codexSandboxPolicyForTurn, i as hashCodexAppServerBindingFingerprint, n as assertCodexBindingMayBeReplaced, o as normalizeCodexAppServerBindingModelProvider, s as reclaimCurrentCodexSessionGeneration, u as CODEX_PLUGINS_MARKETPLACE_NAME } from "./session-binding-Bmt20HfB.js";
3
3
  import { a as projectBoundedCodexThreadHistory, d as assertCodexThreadStartResponse, l as assertCodexThreadForkResponse, u as assertCodexThreadResumeResponse } from "./transcript-mirror-D9rTxx2P.js";
4
- import { a as serializeCodexAppInventoryError, i as defaultCodexAppInventoryCache, t as buildCodexAppServerConnectionFingerprint } from "./plugin-app-cache-key-Ceb-lm2c.js";
4
+ import { a as serializeCodexAppInventoryError, i as defaultCodexAppInventoryCache, t as buildCodexAppServerConnectionFingerprint } from "./plugin-app-cache-key-DJbhLYSK.js";
5
5
  import { sliceUtf16Safe, truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
6
6
  import * as crypto$1 from "node:crypto";
7
7
  import crypto from "node:crypto";
@@ -1189,6 +1189,10 @@ function stabilizeJsonValue(value) {
1189
1189
  function readActiveCodexTurnIds(thread) {
1190
1190
  return (thread.turns ?? []).filter((turn) => turn.status === "inProgress").map((turn) => typeof turn.id === "string" ? turn.id : "").filter((turnId) => turnId.trim().length > 0);
1191
1191
  }
1192
+ function readActiveCodexTurnIdsFromResume(response) {
1193
+ const pagedTurns = response.initialTurnsPage?.data;
1194
+ return readActiveCodexTurnIds(Array.isArray(pagedTurns) ? { turns: pagedTurns } : response.thread);
1195
+ }
1192
1196
  const LEGACY_EMPTY_DYNAMIC_TOOLS_FINGERPRINT = legacyFingerprintDynamicTools([]);
1193
1197
  const EMPTY_DYNAMIC_TOOLS_FINGERPRINT = hashCodexAppServerBindingFingerprint(LEGACY_EMPTY_DYNAMIC_TOOLS_FINGERPRINT);
1194
1198
  function areDynamicToolFingerprintsCompatible(previous, next, nextLegacy) {
@@ -1345,6 +1349,11 @@ const CODEX_APP_SERVER_OWNED_DYNAMIC_TOOL_EXCLUDES = [
1345
1349
  "tool_search",
1346
1350
  "tool_search_code"
1347
1351
  ];
1352
+ const CODEX_NATIVE_GOAL_TOOL_EXCLUDES = [
1353
+ "get_goal",
1354
+ "create_goal",
1355
+ "update_goal"
1356
+ ];
1348
1357
  const CODEX_APP_SERVER_OWNED_SHELL_TOOL_EXCLUDES = /* @__PURE__ */ new Set(["exec", "process"]);
1349
1358
  const DYNAMIC_TOOL_NAME_ALIASES = {
1350
1359
  bash: "exec",
@@ -1400,6 +1409,7 @@ function filterCodexDynamicToolsWithOpenClawShell(tools, config, env = process.e
1400
1409
  }
1401
1410
  function filterCodexDynamicToolsWithOptions(tools, config, env, options) {
1402
1411
  const excludes = /* @__PURE__ */ new Set();
1412
+ for (const name of CODEX_NATIVE_GOAL_TOOL_EXCLUDES) excludes.add(name);
1403
1413
  if (!isForcedPrivateQaCodexRuntime(env)) for (const name of CODEX_APP_SERVER_OWNED_DYNAMIC_TOOL_EXCLUDES) {
1404
1414
  if (options.preserveOpenClawShell && CODEX_APP_SERVER_OWNED_SHELL_TOOL_EXCLUDES.has(name)) continue;
1405
1415
  excludes.add(name);
@@ -1746,12 +1756,17 @@ const CODEX_CODE_MODE_THREAD_CONFIG = {
1746
1756
  "features.code_mode_only": false,
1747
1757
  "features.apply_patch_streaming_events": true
1748
1758
  };
1759
+ const CODEX_GOAL_CONTINUATION_DISABLED_THREAD_CONFIG = { "features.goals": false };
1749
1760
  const CODEX_CODE_MODE_DISABLED_THREAD_CONFIG = {
1750
1761
  "features.code_mode": false,
1751
1762
  "features.code_mode_only": false
1752
1763
  };
1753
1764
  const CODEX_LIGHTWEIGHT_CONTEXT_THREAD_CONFIG = { project_doc_max_bytes: 0 };
1754
1765
  const CODEX_TOOL_SEARCH_UNSUPPORTED_THREAD_CONFIG = { "features.multi_agent": false };
1766
+ const CODEX_DELEGATION_DISABLED_THREAD_CONFIG = {
1767
+ "features.multi_agent": false,
1768
+ "features.multi_agent_v2": false
1769
+ };
1755
1770
  const CODEX_RING_ZERO_THREAD_CONFIG = {
1756
1771
  "features.apps": false,
1757
1772
  "features.current_time_reminder": false,
@@ -1871,6 +1886,12 @@ function buildThreadResumeParams(params, options) {
1871
1886
  });
1872
1887
  return {
1873
1888
  threadId: options.threadId,
1889
+ excludeTurns: true,
1890
+ initialTurnsPage: {
1891
+ limit: 1,
1892
+ sortDirection: "desc",
1893
+ itemsView: "notLoaded"
1894
+ },
1874
1895
  ...modelSelection ? {
1875
1896
  model: modelSelection.model,
1876
1897
  ...modelSelection.modelProvider ? { modelProvider: modelSelection.modelProvider } : {}
@@ -1899,15 +1920,19 @@ function buildCodexRuntimeThreadConfig(config, options = {}) {
1899
1920
  "features.code_mode_only": options.nativeCodeModeOnlyEnabled === true
1900
1921
  };
1901
1922
  if (options.nativeCodeModeEnabled === false) {
1902
- const disabledConfig = mergeCodexThreadConfigs(config, CODEX_CODE_MODE_DISABLED_THREAD_CONFIG) ?? { ...CODEX_CODE_MODE_DISABLED_THREAD_CONFIG };
1923
+ const disabledConfig = mergeCodexThreadConfigs(config, CODEX_CODE_MODE_DISABLED_THREAD_CONFIG, CODEX_GOAL_CONTINUATION_DISABLED_THREAD_CONFIG) ?? { ...CODEX_CODE_MODE_DISABLED_THREAD_CONFIG };
1903
1924
  delete disabledConfig["features.apply_patch_streaming_events"];
1904
1925
  return disabledConfig;
1905
1926
  }
1906
- if (options.nativeCodeModeOnlyEnabled === true) return ensureDirectOnlyToolNamespaces(mergeCodexThreadConfigs(codeModeConfig, config, { "features.code_mode_only": true }) ?? {
1927
+ if (options.nativeCodeModeOnlyEnabled === true) return ensureDirectOnlyToolNamespaces(mergeCodexThreadConfigs(codeModeConfig, config, CODEX_GOAL_CONTINUATION_DISABLED_THREAD_CONFIG, { "features.code_mode_only": true }) ?? {
1907
1928
  ...codeModeConfig,
1929
+ ...CODEX_GOAL_CONTINUATION_DISABLED_THREAD_CONFIG,
1908
1930
  "features.code_mode_only": true
1909
1931
  }, options.directOnlyToolNamespaces);
1910
- return ensureDirectOnlyToolNamespaces(mergeCodexThreadConfigs(codeModeConfig, config) ?? { ...codeModeConfig }, options.directOnlyToolNamespaces);
1932
+ return ensureDirectOnlyToolNamespaces(mergeCodexThreadConfigs(codeModeConfig, config, CODEX_GOAL_CONTINUATION_DISABLED_THREAD_CONFIG) ?? {
1933
+ ...codeModeConfig,
1934
+ ...CODEX_GOAL_CONTINUATION_DISABLED_THREAD_CONFIG
1935
+ }, options.directOnlyToolNamespaces);
1911
1936
  }
1912
1937
  function ensureDirectOnlyToolNamespaces(config, requiredNamespaces) {
1913
1938
  if (!requiredNamespaces?.length) return config;
@@ -1934,7 +1959,7 @@ function buildCodexRuntimeThreadConfigForRun(params, config, options = {}) {
1934
1959
  webSearchAllowed: options.webSearchAllowed
1935
1960
  }).threadConfig;
1936
1961
  const baseConfig = buildCodexRuntimeThreadConfig(mergeCodexThreadConfigs(config, webSearchConfig), options);
1937
- const runtimeConfig = mergeCodexThreadConfigs(baseConfig, options.appServer?.networkProxy?.configPatch, shouldDisableCodexToolSearchForModel(params.modelId) ? CODEX_TOOL_SEARCH_UNSUPPORTED_THREAD_CONFIG : void 0, buildCodexRingZeroThreadConfigPatch(params, options.hostSystemAgentActive, ringZeroMcpServerNames)) ?? baseConfig;
1962
+ const runtimeConfig = mergeCodexThreadConfigs(baseConfig, options.appServer?.networkProxy?.configPatch, shouldDisableCodexToolSearchForModel(params.modelId) ? CODEX_TOOL_SEARCH_UNSUPPORTED_THREAD_CONFIG : void 0, params.delegationCapability === "report_only" ? CODEX_DELEGATION_DISABLED_THREAD_CONFIG : void 0, buildCodexRingZeroThreadConfigPatch(params, options.hostSystemAgentActive, ringZeroMcpServerNames)) ?? baseConfig;
1938
1963
  if (params.bootstrapContextMode !== "lightweight") return runtimeConfig;
1939
1964
  return mergeCodexThreadConfigs(runtimeConfig, CODEX_LIGHTWEIGHT_CONTEXT_THREAD_CONFIG) ?? {
1940
1965
  ...runtimeConfig,
@@ -2153,7 +2178,7 @@ async function resumeExistingCodexThread(params, context) {
2153
2178
  threadId: response.thread.id,
2154
2179
  action: "resumed"
2155
2180
  });
2156
- const activeTurnIds = readActiveCodexTurnIds(response.thread);
2181
+ const activeTurnIds = readActiveCodexTurnIdsFromResume(response);
2157
2182
  return {
2158
2183
  ...resumeBinding,
2159
2184
  threadId: response.thread.id,
@@ -2884,7 +2909,8 @@ async function startOrResumeThread(params) {
2884
2909
  config: params.params.config
2885
2910
  });
2886
2911
  const startModelProvider = startModelSelection.modelProvider;
2887
- let preserveExistingBinding = !ringZeroActive && params.nativeProviderWebSearchSupport === "unknown" && !binding?.threadId;
2912
+ const transientDelegationRestriction = params.params.delegationCapability === "report_only";
2913
+ let preserveExistingBinding = transientDelegationRestriction || !ringZeroActive && params.nativeProviderWebSearchSupport === "unknown" && !binding?.threadId;
2888
2914
  let rotatedContextEngineBinding = false;
2889
2915
  let prebuiltPluginThreadConfig;
2890
2916
  const webSearchBindingChanged = binding?.threadId && binding.webSearchThreadConfigFingerprint !== webSearchThreadConfigFingerprint;
@@ -2922,6 +2948,11 @@ async function startOrResumeThread(params) {
2922
2948
  preserveExistingBinding = true;
2923
2949
  binding = void 0;
2924
2950
  }
2951
+ if (binding?.threadId && transientDelegationRestriction) {
2952
+ assertCodexBindingMayBeReplaced(binding, "starting a delegation-restricted turn");
2953
+ embeddedAgentLog.debug("codex app-server delegation restricted for turn; starting transient thread", { threadId: binding.threadId });
2954
+ binding = void 0;
2955
+ }
2925
2956
  if (binding?.threadId && (binding.contextEngine || contextEngineBinding)) {
2926
2957
  if (!contextEngineBinding || !isContextEngineBindingCompatible(binding.contextEngine, contextEngineBinding)) {
2927
2958
  embeddedAgentLog.debug("codex app-server context-engine binding changed; starting a new thread", {
@@ -1,6 +1,6 @@
1
- import { b as resolveCodexAppServerRuntimeOptions } from "./session-binding-h1mmCGnl.js";
2
- import { t as buildCodexAppServerUsageSnapshot } from "./rate-limits-DyXaYAxU.js";
3
- import { t as readCodexAppServerUsage } from "./request-B_oQsCXy.js";
1
+ import { b as resolveCodexAppServerRuntimeOptions } from "./session-binding-Bmt20HfB.js";
2
+ import { t as buildCodexAppServerUsageSnapshot } from "./rate-limits-CqhWQ2R9.js";
3
+ import { t as readCodexAppServerUsage } from "./request-9yf9pZjf.js";
4
4
  import { CODEX_APP_SERVER_AUTH_MARKER } from "openclaw/plugin-sdk/agent-runtime";
5
5
  //#region extensions/codex/src/app-server/usage.ts
6
6
  /** Handles the synthetic usage credential for a Codex-backed OpenAI route. */
@@ -1,6 +1,6 @@
1
- import { Z as isJsonObject } from "./shared-client-JiAnW6pc.js";
2
- import { u as buildCodexNativeWebSearchThreadConfig } from "./thread-lifecycle-CN_pPtPh.js";
3
- import { n as runBoundedCodexAppServerTurn } from "./media-understanding-provider-D31dOJwb.js";
1
+ import { Z as isJsonObject } from "./shared-client-CSXLtCLE.js";
2
+ import { u as buildCodexNativeWebSearchThreadConfig } from "./thread-lifecycle-CQ_9mAa1.js";
3
+ import { n as runBoundedCodexAppServerTurn } from "./media-understanding-provider-IPNNQre6.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,14 +1,14 @@
1
1
  {
2
2
  "name": "@openclaw/codex",
3
- "version": "2026.7.2-beta.2",
3
+ "version": "2026.7.2-beta.3",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@openclaw/codex",
9
- "version": "2026.7.2-beta.2",
9
+ "version": "2026.7.2-beta.3",
10
10
  "dependencies": {
11
- "@openai/codex": "0.144.5",
11
+ "@openai/codex": "0.144.6",
12
12
  "semver": "7.8.5",
13
13
  "smol-toml": "1.7.0",
14
14
  "typebox": "1.3.3",
@@ -17,9 +17,9 @@
17
17
  }
18
18
  },
19
19
  "node_modules/@openai/codex": {
20
- "version": "0.144.5",
21
- "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.144.5.tgz",
22
- "integrity": "sha512-jjB+K+OMv572mKhS+2QuLxWXDJNdpwbPenf+V+8bdq7wg4Scqt3cn6WEekD8wPqDVZqck0HSX17K9rD9kbDJQA==",
20
+ "version": "0.144.6",
21
+ "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.144.6.tgz",
22
+ "integrity": "sha512-wk+2CWiBNXiJLBoN2D08N9RceWkSBnlgk5g2K1a4CXrP/C0gdlHyRUG7RFzm9y41DCK/7tvCct233JVxyFmznw==",
23
23
  "license": "Apache-2.0",
24
24
  "bin": {
25
25
  "codex": "bin/codex.js"
@@ -28,19 +28,19 @@
28
28
  "node": ">=16"
29
29
  },
30
30
  "optionalDependencies": {
31
- "@openai/codex-darwin-arm64": "npm:@openai/codex@0.144.5-darwin-arm64",
32
- "@openai/codex-darwin-x64": "npm:@openai/codex@0.144.5-darwin-x64",
33
- "@openai/codex-linux-arm64": "npm:@openai/codex@0.144.5-linux-arm64",
34
- "@openai/codex-linux-x64": "npm:@openai/codex@0.144.5-linux-x64",
35
- "@openai/codex-win32-arm64": "npm:@openai/codex@0.144.5-win32-arm64",
36
- "@openai/codex-win32-x64": "npm:@openai/codex@0.144.5-win32-x64"
31
+ "@openai/codex-darwin-arm64": "npm:@openai/codex@0.144.6-darwin-arm64",
32
+ "@openai/codex-darwin-x64": "npm:@openai/codex@0.144.6-darwin-x64",
33
+ "@openai/codex-linux-arm64": "npm:@openai/codex@0.144.6-linux-arm64",
34
+ "@openai/codex-linux-x64": "npm:@openai/codex@0.144.6-linux-x64",
35
+ "@openai/codex-win32-arm64": "npm:@openai/codex@0.144.6-win32-arm64",
36
+ "@openai/codex-win32-x64": "npm:@openai/codex@0.144.6-win32-x64"
37
37
  }
38
38
  },
39
39
  "node_modules/@openai/codex-darwin-arm64": {
40
40
  "name": "@openai/codex",
41
- "version": "0.144.5-darwin-arm64",
42
- "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.144.5-darwin-arm64.tgz",
43
- "integrity": "sha512-zcT6NfBCqLFt+BReNSETTZW6v6PdbH0dzNtm9j7l7mDGqwPbKZDGJdnpkBao2389I0ZacyIKgSZoI0vez1d4Dw==",
41
+ "version": "0.144.6-darwin-arm64",
42
+ "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.144.6-darwin-arm64.tgz",
43
+ "integrity": "sha512-6zgvh70MzBNSeT17HEhSOrmmGGZGAKzSC7x6JAq+edkJkdPYA9P0I1tG7aJ49GlBkBxuC+MKBH1qm6+2Cghcww==",
44
44
  "cpu": [
45
45
  "arm64"
46
46
  ],
@@ -55,9 +55,9 @@
55
55
  },
56
56
  "node_modules/@openai/codex-darwin-x64": {
57
57
  "name": "@openai/codex",
58
- "version": "0.144.5-darwin-x64",
59
- "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.144.5-darwin-x64.tgz",
60
- "integrity": "sha512-//Mo0m1MwaoT6psu5xsmofXpKx4/0irIkeq10xJvk59+886EG355ibjA+ZmlRcKhE3bLjsKD7p81nTbAdRL/bw==",
58
+ "version": "0.144.6-darwin-x64",
59
+ "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.144.6-darwin-x64.tgz",
60
+ "integrity": "sha512-THRyPG0zSU6M8NQAge1LHEHsJDnoH4BpKsfJHB/qe3Fm+Wf6zqAmWJFlOKzBm27m0K2Hq3za4Ac2I5p5i4yp/A==",
61
61
  "cpu": [
62
62
  "x64"
63
63
  ],
@@ -72,9 +72,9 @@
72
72
  },
73
73
  "node_modules/@openai/codex-linux-arm64": {
74
74
  "name": "@openai/codex",
75
- "version": "0.144.5-linux-arm64",
76
- "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.144.5-linux-arm64.tgz",
77
- "integrity": "sha512-zAHggxVwR2TBxKmybXY7ZMiB0G8DMonY2YPdwNNjwXcf+LOIqNGgswwNCDMbP/HEe6r8j+R9ZX/yYoo8f+n/RQ==",
75
+ "version": "0.144.6-linux-arm64",
76
+ "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.144.6-linux-arm64.tgz",
77
+ "integrity": "sha512-PGiLXMN+2IQRkf7tOLi64dMInjU1pRLbz0Rwfj/yt2Y97SZQqAjFQoi2wmswmqtqMDnfwCPTC1DRXVQkvU6T6Q==",
78
78
  "cpu": [
79
79
  "arm64"
80
80
  ],
@@ -89,9 +89,9 @@
89
89
  },
90
90
  "node_modules/@openai/codex-linux-x64": {
91
91
  "name": "@openai/codex",
92
- "version": "0.144.5-linux-x64",
93
- "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.144.5-linux-x64.tgz",
94
- "integrity": "sha512-FalLJlBQGFdK8Gc3kj9sa/ekNdgkHhUawLaKkvy5CtB18JaP2YxtTP/Pe1pD2iBiq8mMUliRnafpF6AdBdQMbg==",
92
+ "version": "0.144.6-linux-x64",
93
+ "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.144.6-linux-x64.tgz",
94
+ "integrity": "sha512-4E7EnzCg0OnBxCyYnwJ+qnZwWHYe0YScr5ucKWbngE9u4+0XrpWELqq2Kn9jl5GZK8MDjU7PrJwFIwusHOHjuw==",
95
95
  "cpu": [
96
96
  "x64"
97
97
  ],
@@ -106,9 +106,9 @@
106
106
  },
107
107
  "node_modules/@openai/codex-win32-arm64": {
108
108
  "name": "@openai/codex",
109
- "version": "0.144.5-win32-arm64",
110
- "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.144.5-win32-arm64.tgz",
111
- "integrity": "sha512-0Pj7iqjEOEvPQPO3kFfCy9vGX4BTu76ChFFZHr2eNNIfVc3FOENAv/X98u4L+iIUtDOK9DbqmfUudW3DPapshg==",
109
+ "version": "0.144.6-win32-arm64",
110
+ "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.144.6-win32-arm64.tgz",
111
+ "integrity": "sha512-SpMjXJLW43JzMP0K62mVcYfmFcpk0BK4AOgYmWSfyZHs3iRtHMd0UYw7605n/9lwkT2EqbwQLT2omZFeKJFzwA==",
112
112
  "cpu": [
113
113
  "arm64"
114
114
  ],
@@ -123,9 +123,9 @@
123
123
  },
124
124
  "node_modules/@openai/codex-win32-x64": {
125
125
  "name": "@openai/codex",
126
- "version": "0.144.5-win32-x64",
127
- "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.144.5-win32-x64.tgz",
128
- "integrity": "sha512-DnsSTlnnzleTxvLwIGnBitKInscxn2I7qASqosS8Fv+qysBygd+ZiBn/SQsRCgQ28PAlsNzmd3Gf3ZTecolAmg==",
126
+ "version": "0.144.6-win32-x64",
127
+ "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.144.6-win32-x64.tgz",
128
+ "integrity": "sha512-dN39VnjEthKz5io1RNWwZDtErdSn07nW3pGUgvlA6DMxgm/nuGaIAZO/sG/Hgxq/x5j9HteAENfrFgVkpZ0lFg==",
129
129
  "cpu": [
130
130
  "x64"
131
131
  ],
@@ -279,6 +279,11 @@
279
279
  "minimum": 1,
280
280
  "default": 60000
281
281
  },
282
+ "turnAssistantCompletionIdleTimeoutMs": {
283
+ "type": "number",
284
+ "minimum": 1,
285
+ "default": 10000
286
+ },
282
287
  "postToolRawAssistantCompletionIdleTimeoutMs": {
283
288
  "type": "number",
284
289
  "minimum": 1,
@@ -536,7 +541,7 @@
536
541
  },
537
542
  "appServer.transport": {
538
543
  "label": "Transport",
539
- "help": "Use stdio to spawn Codex locally, unix for the shared local control socket, or websocket for a remote app-server.",
544
+ "help": "Use stdio to spawn Codex locally or unix for the shared local control socket. Remote websocket transport is experimental and unsupported by Codex.",
540
545
  "advanced": true
541
546
  },
542
547
  "appServer.homeScope": {
@@ -601,6 +606,11 @@
601
606
  "help": "Maximum quiet time after Codex accepts a turn or after a turn-scoped app-server request before OpenClaw interrupts the turn while waiting for turn/completed.",
602
607
  "advanced": true
603
608
  },
609
+ "appServer.turnAssistantCompletionIdleTimeoutMs": {
610
+ "label": "Assistant Completion Idle Timeout",
611
+ "help": "Short quiet-time guard after Codex reports a completed assistant message before OpenClaw releases the turn.",
612
+ "advanced": true
613
+ },
604
614
  "appServer.postToolRawAssistantCompletionIdleTimeoutMs": {
605
615
  "label": "Post-Tool Continuation Idle Timeout",
606
616
  "help": "Completion-idle and progress guard after a tool handoff, native tool completion, or post-tool raw assistant progress while waiting for turn/completed. Defaults to 300000 ms when unset.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/codex",
3
- "version": "2026.7.2-beta.2",
3
+ "version": "2026.7.2-beta.3",
4
4
  "description": "OpenClaw Codex app-server harness and native session supervision plugin.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "type": "module",
10
10
  "dependencies": {
11
- "@openai/codex": "0.144.5",
11
+ "@openai/codex": "0.144.6",
12
12
  "semver": "7.8.5",
13
13
  "smol-toml": "1.7.0",
14
14
  "typebox": "1.3.3",
@@ -36,10 +36,10 @@
36
36
  ]
37
37
  },
38
38
  "compat": {
39
- "pluginApi": ">=2026.7.2-beta.2"
39
+ "pluginApi": ">=2026.7.2-beta.3"
40
40
  },
41
41
  "build": {
42
- "openclawVersion": "2026.7.2-beta.2"
42
+ "openclawVersion": "2026.7.2-beta.3"
43
43
  },
44
44
  "release": {
45
45
  "publishToClawHub": true,
@@ -60,7 +60,7 @@
60
60
  "README.md"
61
61
  ],
62
62
  "peerDependencies": {
63
- "openclaw": ">=2026.7.2-beta.2"
63
+ "openclaw": ">=2026.7.2-beta.3"
64
64
  },
65
65
  "peerDependenciesMeta": {
66
66
  "openclaw": {