@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,6 +1,6 @@
1
1
  import { n as isJsonObject } from "./protocol-dh-ETiNd.js";
2
- import { n as canUseCodexModelBackedApprovalsReviewerForModel } from "./config-CszD0vP3.js";
3
- import { a as hasCodexRateLimitSnapshots, c as summarizeCodexAccountRateLimits, u as summarizeCodexRateLimits } from "./provider-B-OHpbD3.js";
2
+ import { n as canUseCodexModelBackedApprovalsReviewerForModel } from "./config-C_whBx3M.js";
3
+ import { c as hasCodexRateLimitSnapshots, d as summarizeCodexAccountRateLimits, p as summarizeCodexRateLimits } from "./provider-DosqwRb6.js";
4
4
  //#region extensions/codex/src/command-formatters.ts
5
5
  /** Formats the combined `/codex status` probe result. */
6
6
  function formatCodexStatus(probes) {
@@ -1,5 +1,5 @@
1
1
  import { n as isJsonObject } from "./protocol-dh-ETiNd.js";
2
- import { B as isCodexNotificationForTurn } from "./thread-lifecycle-DtT3-ehU.js";
2
+ import { V as isCodexNotificationForTurn } from "./thread-lifecycle-DeSMZSXr.js";
3
3
  import { asBoolean } from "openclaw/plugin-sdk/string-coerce-runtime";
4
4
  //#region extensions/codex/src/app-server/attempt-notifications.ts
5
5
  /**
@@ -34,6 +34,30 @@ function updateActiveTurnItemIds(notification, activeItemIds) {
34
34
  }
35
35
  activeItemIds.delete(itemId);
36
36
  }
37
+ function updateActiveCompletionBlockerItemIds(notification, activeItemIds) {
38
+ if (notification.method !== "item/started" && notification.method !== "item/completed") return;
39
+ const itemId = readNotificationItemId(notification);
40
+ if (!itemId) return;
41
+ if (notification.method === "item/completed") {
42
+ activeItemIds.delete(itemId);
43
+ return;
44
+ }
45
+ const item = readCodexNotificationItem(notification.params);
46
+ if (item && isCompletionBlockingItem(item)) activeItemIds.add(itemId);
47
+ }
48
+ function isCompletionBlockingItem(item) {
49
+ switch (item.type) {
50
+ case "collabAgentToolCall":
51
+ case "commandExecution":
52
+ case "dynamicToolCall":
53
+ case "fileChange":
54
+ case "imageGeneration":
55
+ case "imageView":
56
+ case "mcpToolCall":
57
+ case "webSearch": return true;
58
+ default: return false;
59
+ }
60
+ }
37
61
  function isCompletedAssistantNotification(notification) {
38
62
  if (!isJsonObject(notification.params)) return false;
39
63
  if (notification.method !== "item/completed") return false;
@@ -255,4 +279,4 @@ function isNonEmptyString(value) {
255
279
  return typeof value === "string" && value.length > 0;
256
280
  }
257
281
  //#endregion
258
- export { readCodexNotificationItem as C, updateActiveTurnItemIds as D, shouldDisarmAssistantCompletionIdleWatch as E, isTurnNotification as S, readRawResponseToolCallId as T, isRawToolOutputCompletionNotification as _, isCodexNotificationOutsideActiveRun as a, isRetryableErrorNotification as b, isCurrentThreadOptionalTurnRequestParams as c, isNativeResponseStreamDeltaNotification as d, isNativeToolProgressNotification as f, isRawReasoningCompletionNotification as g, isRawFunctionToolOutputCompletionNotification as h, isAssistantCompletionReleaseNotification as i, isCurrentThreadTurnRequestParams as l, isRawAssistantProgressNotification as m, describeNotificationActivity as n, isCodexTurnAbortMarkerNotification as o, isPendingOpenClawDynamicToolCompletionNotification as p, isAssistantCommentaryCompletionNotification as r, isCurrentApprovalTurnRequestParams as s, codexExecutionToolName as t, isFileChangePatchUpdatedNotification as u, isReasoningItemCompletionNotification as v, readNotificationItemId as w, isTerminalTurnStatus as x, isReasoningProgressNotification as y };
282
+ export { readCodexNotificationItem as C, updateActiveCompletionBlockerItemIds as D, shouldDisarmAssistantCompletionIdleWatch as E, updateActiveTurnItemIds as O, isTurnNotification as S, readRawResponseToolCallId as T, isRawToolOutputCompletionNotification as _, isCodexNotificationOutsideActiveRun as a, isRetryableErrorNotification as b, isCurrentThreadOptionalTurnRequestParams as c, isNativeResponseStreamDeltaNotification as d, isNativeToolProgressNotification as f, isRawReasoningCompletionNotification as g, isRawFunctionToolOutputCompletionNotification as h, isAssistantCompletionReleaseNotification as i, isCurrentThreadTurnRequestParams as l, isRawAssistantProgressNotification as m, describeNotificationActivity as n, isCodexTurnAbortMarkerNotification as o, isPendingOpenClawDynamicToolCompletionNotification as p, isAssistantCommentaryCompletionNotification as r, isCurrentApprovalTurnRequestParams as s, codexExecutionToolName as t, isFileChangePatchUpdatedNotification as u, isReasoningItemCompletionNotification as v, readNotificationItemId as w, isTerminalTurnStatus as x, isReasoningProgressNotification as y };
@@ -1,5 +1,5 @@
1
1
  import { r as isRpcResponse } from "./protocol-dh-ETiNd.js";
2
- import { d as resolveCodexAppServerRuntimeOptions } from "./config-CszD0vP3.js";
2
+ import { d as resolveCodexAppServerRuntimeOptions } from "./config-C_whBx3M.js";
3
3
  import { materializeWindowsSpawnProgram, resolveWindowsSpawnProgram } from "openclaw/plugin-sdk/windows-spawn";
4
4
  import { OPENCLAW_VERSION, embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
5
5
  import { createInterface } from "node:readline";
@@ -637,6 +637,9 @@ function assertSupportedCodexAppServerVersion(response) {
637
637
  if (compareCodexAppServerVersions(detectedVersion, "0.125.0") < 0) throw new Error(`Codex app-server ${MIN_CODEX_APP_SERVER_VERSION} or newer is required, but detected ${detectedVersion}. Update the configured Codex app-server binary, or remove custom command overrides to use the managed binary.`);
638
638
  return detectedVersion;
639
639
  }
640
+ function isUnsupportedCodexAppServerVersionError(error) {
641
+ return error instanceof Error && error.message.startsWith(`Codex app-server 0.125.0 or newer is required`);
642
+ }
640
643
  function buildCodexAppServerRuntimeIdentity(response, serverVersion) {
641
644
  const userAgent = readNonEmptyInitializeString(response.userAgent);
642
645
  const codexHome = readNonEmptyInitializeString(response.codexHome);
@@ -726,4 +729,4 @@ function formatExitValue(value) {
726
729
  return "unknown";
727
730
  }
728
731
  //#endregion
729
- export { isCodexAppServerConnectionClosedError as a, resolveCodexAppServerSpawnEnv as c, isCodexAppServerApprovalRequest as i, CodexAppServerRpcError as n, MANAGED_CODEX_APP_SERVER_PACKAGE as o, compareCodexAppServerVersions as r, MIN_CODEX_SANDBOX_EXEC_SERVER_APP_SERVER_VERSION as s, CodexAppServerClient as t };
732
+ export { isCodexAppServerConnectionClosedError as a, MIN_CODEX_SANDBOX_EXEC_SERVER_APP_SERVER_VERSION as c, isCodexAppServerApprovalRequest as i, resolveCodexAppServerSpawnEnv as l, CodexAppServerRpcError as n, isUnsupportedCodexAppServerVersionError as o, compareCodexAppServerVersions as r, MANAGED_CODEX_APP_SERVER_PACKAGE as s, CodexAppServerClient as t };
@@ -1,7 +1,7 @@
1
1
  //#region extensions/codex/src/app-server/client-factory.ts
2
2
  let sharedClientModulePromise = null;
3
3
  const loadSharedClientModule = async () => {
4
- sharedClientModulePromise ??= import("./shared-client-Dtx5i7Ez.js").then((n) => n.c);
4
+ sharedClientModulePromise ??= import("./shared-client-rR6TDJA3.js").then((n) => n.c);
5
5
  return await sharedClientModulePromise;
6
6
  };
7
7
  /** Returns a leased shared client so startup can release ownership explicitly. */
@@ -1,14 +1,14 @@
1
1
  import { n as isJsonObject } from "./protocol-dh-ETiNd.js";
2
- import { d as resolveCodexAppServerRuntimeOptions, o as isCodexFastServiceTier } from "./config-CszD0vP3.js";
3
- import { n as listCodexAppServerModels, t as listAllCodexAppServerModels } from "./models-CAmfBWRl.js";
4
- import { l as summarizeCodexAccountUsage } from "./provider-B-OHpbD3.js";
5
- import { l as writeCodexAppServerBinding, n as clearCodexAppServerBinding, o as readCodexAppServerBinding } from "./session-binding-HOuPt-E0.js";
6
- import { i as describeControlFailure, r as CODEX_CONTROL_METHODS } from "./plugin-app-cache-key-C9ILt7bl.js";
7
- import { a as formatCodexDisplayText, c as formatList, d as formatThreads, f as readString$1, i as formatAccount, l as formatModels, o as formatCodexStatus, r as buildHelp, s as formatComputerUseStatus, u as formatSkills } from "./app-server-policy-BPTiVNsW.js";
8
- import { n as resolveCodexNativeExecutionBlock, r as resolveCodexNativeSandboxBlock } from "./sandbox-guard-3tnjhjFb.js";
9
- import { _ as steerCodexConversationTurn, b as readCodexConversationBindingData, d as parseCodexFastModeArg, f as parseCodexPermissionsModeArg, g as setCodexConversationPermissions, h as setCodexConversationModel, m as setCodexConversationFastMode, o as formatCodexCliSessions, p as readCodexConversationActiveTurn, r as startCodexConversationThread, u as formatPermissionsMode, v as stopCodexConversationTurn, x as resolveCodexDefaultWorkspaceDir, y as createCodexCliNodeConversationBindingData } from "./conversation-binding-t0XMLz-j.js";
10
- import { t as requestCodexAppServerJson } from "./request-Dcd452Nk.js";
11
- import { n as installCodexComputerUse, r as readCodexComputerUseStatus } from "./computer-use-ClrJwoFp.js";
2
+ import { d as resolveCodexAppServerRuntimeOptions, o as isCodexFastServiceTier } from "./config-C_whBx3M.js";
3
+ import { n as listCodexAppServerModels, t as listAllCodexAppServerModels } from "./models-Ccy1_7nN.js";
4
+ import { f as summarizeCodexAccountUsage } from "./provider-DosqwRb6.js";
5
+ import { l as writeCodexAppServerBinding, n as clearCodexAppServerBinding, o as readCodexAppServerBinding } from "./session-binding-Cm0Gg7Z1.js";
6
+ import { i as describeControlFailure, r as CODEX_CONTROL_METHODS } from "./plugin-app-cache-key-CDioyur-.js";
7
+ import { a as formatCodexDisplayText, c as formatList, d as formatThreads, f as readString$1, i as formatAccount, l as formatModels, o as formatCodexStatus, r as buildHelp, s as formatComputerUseStatus, u as formatSkills } from "./app-server-policy-xi0ZmBGO.js";
8
+ import { n as resolveCodexNativeExecutionBlock, r as resolveCodexNativeSandboxBlock } from "./sandbox-guard-pTY2COoC.js";
9
+ import { C as canMutateCodexHost, S as CODEX_NATIVE_EXECUTION_AUTH_ERROR, _ as steerCodexConversationTurn, b as readCodexConversationBindingData, d as parseCodexFastModeArg, f as parseCodexPermissionsModeArg, g as setCodexConversationPermissions, h as setCodexConversationModel, m as setCodexConversationFastMode, o as formatCodexCliSessions, p as readCodexConversationActiveTurn, r as startCodexConversationThread, u as formatPermissionsMode, v as stopCodexConversationTurn, x as resolveCodexDefaultWorkspaceDir, y as createCodexCliNodeConversationBindingData } from "./conversation-binding-CEE2UyYb.js";
10
+ import { t as requestCodexAppServerJson } from "./request-BQuSQF29.js";
11
+ import { n as installCodexComputerUse, r as readCodexComputerUseStatus } from "./computer-use-FPGG-mtX.js";
12
12
  import { n as rememberCodexRateLimits } from "./rate-limit-cache-C7qmZ0Jh.js";
13
13
  import { parseStrictPositiveInteger } from "openclaw/plugin-sdk/number-runtime";
14
14
  import { normalizeOptionalString, normalizeUniqueStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -349,7 +349,7 @@ async function handleCodexPluginsSubcommand(ctx, rest, io) {
349
349
  if (normalized === "enable" || normalized === "disable") {
350
350
  if (args.length === 0) return buildPluginNamePickerReply(normalized, await io.readConfig());
351
351
  if (!target || args.length > 1) return { text: `Usage: /codex plugins ${normalized} <name>` };
352
- if (!canMutateCodexPlugins(ctx)) return { text: `Only an owner or operator.admin gateway client can run /codex plugins ${normalized}.` };
352
+ if (!canMutateCodexHost(ctx)) return { text: `Only an owner or operator.admin gateway client can run /codex plugins ${normalized}.` };
353
353
  const wantEnabled = normalized === "enable";
354
354
  if (!((await io.readConfig()).plugins ?? {})[target]) return { text: `Codex sub-plugin '${formatCodexDisplayText(target)}' is not configured. Run '/codex plugins list' to see configured plugins.` };
355
355
  await io.mutate((block) => {
@@ -440,10 +440,6 @@ function buildPluginNamePickerReply(verb, current) {
440
440
  presentation: buildCodexCommandPickerPresentation("Codex sub-plugins", `Pick a Codex sub-plugin to ${verb}:`, buttons)
441
441
  };
442
442
  }
443
- function canMutateCodexPlugins(ctx) {
444
- if (ctx.senderIsOwner === true) return true;
445
- return ctx.gatewayClientScopes?.includes("operator.admin") === true;
446
- }
447
443
  function buildPluginsHelp() {
448
444
  return [
449
445
  "Codex sub-plugin management (writes only to ~/.openclaw/openclaw.json, never to ~/.codex/config.toml):",
@@ -588,6 +584,12 @@ const CODEX_NATIVE_EXECUTION_SUBCOMMANDS = new Set([
588
584
  "compact",
589
585
  "review"
590
586
  ]);
587
+ const CODEX_NATIVE_CONTROL_SUBCOMMANDS = new Set([
588
+ ...CODEX_NATIVE_EXECUTION_SUBCOMMANDS,
589
+ "detach",
590
+ "unbind",
591
+ "stop"
592
+ ]);
591
593
  const lastCodexDiagnosticsUploadByThread = /* @__PURE__ */ new Map();
592
594
  const lastCodexDiagnosticsUploadByScope = /* @__PURE__ */ new Map();
593
595
  const pendingCodexDiagnosticsConfirmations = /* @__PURE__ */ new Map();
@@ -725,6 +727,7 @@ async function handleCodexSubcommand(ctx, options) {
725
727
  const [subcommand = "status", ...rest] = args;
726
728
  const normalized = subcommand.toLowerCase();
727
729
  if (normalized === "help") return { text: buildHelp() };
730
+ if (CODEX_NATIVE_CONTROL_SUBCOMMANDS.has(normalized) && !returnsBeforeNativeCodexExecution(normalized, rest) && !canMutateCodexHost(ctx)) return { text: CODEX_NATIVE_EXECUTION_AUTH_ERROR };
728
731
  const sandboxBlock = resolveCodexNativeCommandSandboxBlock(ctx, normalized, rest);
729
732
  if (sandboxBlock) return { text: sandboxBlock };
730
733
  if (normalized === "plugins") {
@@ -770,7 +773,7 @@ async function handleCodexSubcommand(ctx, options) {
770
773
  if (normalized === "diagnostics") return await handleCodexDiagnosticsFeedback(deps, ctx, options.pluginConfig, rest.join(" "), "/codex diagnostics");
771
774
  if (normalized === "computer-use" || normalized === "computeruse") {
772
775
  if (isMenuVerb(rest)) return buildCodexComputerUseMenuReply();
773
- return { text: await handleComputerUseCommand(deps, options.pluginConfig, rest) };
776
+ return { text: await handleComputerUseCommand(deps, ctx, options.pluginConfig, rest) };
774
777
  }
775
778
  if (normalized === "mcp") {
776
779
  if (rest.length > 0) return { text: "Usage: /codex mcp" };
@@ -820,6 +823,8 @@ function returnsBeforeNativeCodexExecution(subcommand, args) {
820
823
  case "permissions": return args.length === 0 || args.length > 1 || parseCodexPermissionsModeArg(args[0]) === void 0;
821
824
  case "compact":
822
825
  case "review":
826
+ case "detach":
827
+ case "unbind":
823
828
  case "stop": return args.length > 0;
824
829
  default: return false;
825
830
  }
@@ -836,9 +841,10 @@ function returnsBeforeNativeCodexResume(args) {
836
841
  if (parsed.host) return !normalizedThreadId || parsed.bindHere !== true;
837
842
  return !normalizedThreadId || args.length !== 1;
838
843
  }
839
- async function handleComputerUseCommand(deps, pluginConfig, args) {
844
+ async function handleComputerUseCommand(deps, ctx, pluginConfig, args) {
840
845
  const parsed = parseComputerUseArgs(args);
841
846
  if (parsed.help) return ["Usage: /codex computer-use [status|install] [--source <marketplace-source>] [--marketplace-path <path>] [--marketplace <name>]", "Checks or installs the configured Codex Computer Use plugin through app-server."].join("\n");
847
+ if (parsed.action === "install" && !canMutateCodexHost(ctx)) return "Only an owner or operator.admin gateway client can configure Codex Computer Use.";
842
848
  const params = {
843
849
  pluginConfig,
844
850
  forceEnable: parsed.action === "install" || parsed.hasOverrides,
@@ -1046,11 +1052,11 @@ async function setConversationFastMode(deps, ctx, pluginConfig, args) {
1046
1052
  }
1047
1053
  async function setConversationPermissions(deps, ctx, pluginConfig, args) {
1048
1054
  if (args.length > 1) return "Usage: /codex permissions [default|yolo|status]";
1049
- const target = await resolveControlTarget(ctx);
1050
- if (!target) return "Cannot set Codex permissions because this command did not include an OpenClaw session file.";
1051
1055
  const value = args[0];
1052
1056
  const parsed = parseCodexPermissionsModeArg(value);
1053
1057
  if (value && !parsed && value.trim().toLowerCase() !== "status") return "Usage: /codex permissions [default|yolo|status]";
1058
+ const target = await resolveControlTarget(ctx);
1059
+ if (!target) return "Cannot set Codex permissions because this command did not include an OpenClaw session file.";
1054
1060
  return await deps.setCodexConversationPermissions({
1055
1061
  sessionFile: target.sessionFile,
1056
1062
  pluginConfig,
@@ -1,8 +1,8 @@
1
- import { d as resolveCodexAppServerRuntimeOptions } from "./config-CszD0vP3.js";
2
- import { c as withCodexAppServerBindingLock, l as writeCodexAppServerBinding, o as readCodexAppServerBinding, t as CODEX_APP_SERVER_BINDING_GUARDED_REQUEST_TIMEOUT_MS } from "./session-binding-HOuPt-E0.js";
3
- import { o as releaseLeasedSharedCodexAppServerClient } from "./shared-client-Dtx5i7Ez.js";
4
- import { n as resolveCodexNativeExecutionBlock } from "./sandbox-guard-3tnjhjFb.js";
5
- import { t as defaultLeasedCodexAppServerClientFactory } from "./client-factory-Bm6HsGob.js";
1
+ import { d as resolveCodexAppServerRuntimeOptions } from "./config-C_whBx3M.js";
2
+ import { c as withCodexAppServerBindingLock, l as writeCodexAppServerBinding, o as readCodexAppServerBinding, t as CODEX_APP_SERVER_BINDING_GUARDED_REQUEST_TIMEOUT_MS } from "./session-binding-Cm0Gg7Z1.js";
3
+ import { o as releaseLeasedSharedCodexAppServerClient } from "./shared-client-rR6TDJA3.js";
4
+ import { n as resolveCodexNativeExecutionBlock } from "./sandbox-guard-pTY2COoC.js";
5
+ import { t as defaultLeasedCodexAppServerClientFactory } from "./client-factory-CwjdQQ4j.js";
6
6
  import { embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
7
7
  //#region extensions/codex/src/app-server/compact.ts
8
8
  /**
@@ -1,6 +1,6 @@
1
- import { d as resolveCodexAppServerRuntimeOptions, f as resolveCodexComputerUseConfig } from "./config-CszD0vP3.js";
2
- import { i as describeControlFailure } from "./plugin-app-cache-key-C9ILt7bl.js";
3
- import { t as requestCodexAppServerJson } from "./request-Dcd452Nk.js";
1
+ import { d as resolveCodexAppServerRuntimeOptions, f as resolveCodexComputerUseConfig } from "./config-C_whBx3M.js";
2
+ import { i as describeControlFailure } from "./plugin-app-cache-key-CDioyur-.js";
3
+ import { t as requestCodexAppServerJson } from "./request-BQuSQF29.js";
4
4
  import { existsSync } from "node:fs";
5
5
  //#region extensions/codex/src/app-server/computer-use.ts
6
6
  /**
@@ -46,7 +46,11 @@ const codexAppServerApprovalsReviewerSchema = z.enum([
46
46
  "guardian_subagent"
47
47
  ]);
48
48
  const codexDynamicToolsLoadingSchema = z.enum(["searchable", "direct"]);
49
- const codexPluginDestructivePolicySchema = z.union([z.boolean(), z.literal("auto")]);
49
+ const codexPluginDestructivePolicySchema = z.union([
50
+ z.boolean(),
51
+ z.literal("auto"),
52
+ z.literal("ask")
53
+ ]);
50
54
  const codexAppServerServiceTierSchema = z.preprocess((value) => value === null ? null : normalizeCodexServiceTier(value), z.string().trim().min(1).nullable().optional()).optional();
51
55
  const codexAppServerExperimentalSchema = z.object({ sandboxExecServer: z.boolean().optional() }).strict();
52
56
  const codexAppServerRemoteWorkspaceRootSchema = z.string().trim().min(1);
@@ -167,9 +171,9 @@ function resolveCodexPluginsPolicy(pluginConfig) {
167
171
  };
168
172
  }
169
173
  function resolveCodexPluginDestructivePolicy(policy) {
170
- if (policy === "auto") return {
174
+ if (policy === "auto" || policy === "ask") return {
171
175
  allowDestructiveActions: true,
172
- destructiveApprovalMode: "auto"
176
+ destructiveApprovalMode: policy
173
177
  };
174
178
  return {
175
179
  allowDestructiveActions: policy,
@@ -366,6 +370,7 @@ function codexAppServerStartOptionsKey(options, params = {}) {
366
370
  transport: options.transport,
367
371
  command: options.command,
368
372
  commandSource: options.commandSource ?? null,
373
+ managedFallbackCommandPaths: [...options.managedFallbackCommandPaths ?? []],
369
374
  args: options.args,
370
375
  url: options.url ?? null,
371
376
  authToken: hashSecretForKey(options.authToken, "authToken"),
@@ -1,12 +1,12 @@
1
1
  import { n as isJsonObject } from "./protocol-dh-ETiNd.js";
2
- import { H as readCodexNotificationTurnId, V as readCodexNotificationThreadId, d as resolveCodexAppServerRequestModelSelection, p as resolveCodexBindingModelProviderFallback, t as CODEX_NATIVE_PERSONALITY_NONE } from "./thread-lifecycle-DtT3-ehU.js";
3
- import { d as resolveCodexAppServerRuntimeOptions, h as resolveOpenClawExecPolicyForCodexAppServer, i as codexSandboxPolicyForTurn, n as canUseCodexModelBackedApprovalsReviewerForModel, o as isCodexFastServiceTier, p as resolveCodexModelBackedReviewerPolicyContext } from "./config-CszD0vP3.js";
4
- import { r as assertCodexThreadStartResponse } from "./protocol-validators-B19q5BIX.js";
5
- import { a as normalizeCodexAppServerBindingModelProvider, i as isCodexAppServerNativeAuthProfile, l as writeCodexAppServerBinding, n as clearCodexAppServerBinding, o as readCodexAppServerBinding } from "./session-binding-HOuPt-E0.js";
6
- import { r as CODEX_CONTROL_METHODS } from "./plugin-app-cache-key-C9ILt7bl.js";
7
- import { a as formatCodexDisplayText, t as resolveCodexAppServerForModelProvider } from "./app-server-policy-BPTiVNsW.js";
8
- import { a as getLeasedSharedCodexAppServerClient, o as releaseLeasedSharedCodexAppServerClient, p as resolveCodexAppServerAuthProfileIdForAgent } from "./shared-client-Dtx5i7Ez.js";
9
- import { n as resolveCodexNativeExecutionBlock, r as resolveCodexNativeSandboxBlock } from "./sandbox-guard-3tnjhjFb.js";
2
+ import { H as readCodexNotificationThreadId, U as readCodexNotificationTurnId, d as resolveCodexAppServerRequestModelSelection, p as resolveCodexBindingModelProviderFallback, t as CODEX_NATIVE_PERSONALITY_NONE } from "./thread-lifecycle-DeSMZSXr.js";
3
+ import { d as resolveCodexAppServerRuntimeOptions, h as resolveOpenClawExecPolicyForCodexAppServer, i as codexSandboxPolicyForTurn, n as canUseCodexModelBackedApprovalsReviewerForModel, o as isCodexFastServiceTier, p as resolveCodexModelBackedReviewerPolicyContext } from "./config-C_whBx3M.js";
4
+ import { r as assertCodexThreadStartResponse } from "./protocol-validators-CB4mtyrs.js";
5
+ import { a as normalizeCodexAppServerBindingModelProvider, i as isCodexAppServerNativeAuthProfile, l as writeCodexAppServerBinding, n as clearCodexAppServerBinding, o as readCodexAppServerBinding } from "./session-binding-Cm0Gg7Z1.js";
6
+ import { r as CODEX_CONTROL_METHODS } from "./plugin-app-cache-key-CDioyur-.js";
7
+ import { a as formatCodexDisplayText, t as resolveCodexAppServerForModelProvider } from "./app-server-policy-xi0ZmBGO.js";
8
+ import { a as getLeasedSharedCodexAppServerClient, o as releaseLeasedSharedCodexAppServerClient, p as resolveCodexAppServerAuthProfileIdForAgent } from "./shared-client-rR6TDJA3.js";
9
+ import { n as resolveCodexNativeExecutionBlock, r as resolveCodexNativeSandboxBlock } from "./sandbox-guard-pTY2COoC.js";
10
10
  import fs from "node:fs/promises";
11
11
  import path from "node:path";
12
12
  import { resolveTimerTimeoutMs, timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
@@ -18,9 +18,16 @@ import { loadExecApprovals } from "openclaw/plugin-sdk/exec-approvals-runtime";
18
18
  import { materializeWindowsSpawnProgram, resolveWindowsSpawnProgram } from "openclaw/plugin-sdk/windows-spawn";
19
19
  import { formatErrorMessage, resolveSandboxContext } from "openclaw/plugin-sdk/agent-harness-runtime";
20
20
  import { spawn } from "node:child_process";
21
- import { loadSessionStore, resolveSessionStoreEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
21
+ import { getSessionEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
22
22
  import { fileURLToPath } from "node:url";
23
23
  import process$1 from "node:process";
24
+ import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
25
+ //#region extensions/codex/src/command-authorization.ts
26
+ const CODEX_NATIVE_EXECUTION_AUTH_ERROR = "Only an owner or operator.admin can control Codex native execution.";
27
+ function canMutateCodexHost(ctx) {
28
+ return ctx.senderIsOwner === true || ctx.gatewayClientScopes?.includes("operator.admin") === true;
29
+ }
30
+ //#endregion
24
31
  //#region extensions/codex/src/conversation-binding-data.ts
25
32
  const BINDING_DATA_VERSION = 1;
26
33
  function createCodexConversationBindingData(params) {
@@ -942,7 +949,8 @@ function normalizeTimeoutMs(value) {
942
949
  return typeof value === "number" && Number.isFinite(value) && value > 0 ? Math.min(60 * 6e4, Math.floor(value)) : DEFAULT_RESUME_TIMEOUT_MS;
943
950
  }
944
951
  function truncateText(value, max) {
945
- return value.length > max ? `${value.slice(0, max - 3)}...` : value;
952
+ if (value.length <= max) return value;
953
+ return `${truncateUtf16Safe(value, Math.max(0, max - 3))}...`;
946
954
  }
947
955
  function compareOptionalStringsDesc(a, b) {
948
956
  return (b ?? "").localeCompare(a ?? "");
@@ -1054,6 +1062,10 @@ async function handleCodexConversationInboundClaim(event, ctx, options = {}) {
1054
1062
  if (event.commandAuthorized !== true) return { handled: true };
1055
1063
  const prompt = event.bodyForAgent?.trim() || event.content?.trim() || "";
1056
1064
  if (!prompt) return { handled: true };
1065
+ if (!canMutateCodexHost(event)) return {
1066
+ handled: true,
1067
+ reply: { text: CODEX_NATIVE_EXECUTION_AUTH_ERROR }
1068
+ };
1057
1069
  const nativeExecutionBlock = data.kind === "codex-cli-node-session" ? resolveCodexNativeSandboxBlock({
1058
1070
  config: options.config,
1059
1071
  sessionKey: event.sessionKey ?? ctx.sessionKey,
@@ -1466,10 +1478,11 @@ function readSessionExecOverrides(params) {
1466
1478
  agentId: params.agentId,
1467
1479
  sessionKey
1468
1480
  })) return;
1469
- const entry = resolveSessionStoreEntry({
1470
- store: loadSessionStore(resolveStorePath(params.config.session?.store, { agentId: params.agentId }), { skipCache: true }),
1471
- sessionKey
1472
- }).existing;
1481
+ const entry = getSessionEntry({
1482
+ storePath: resolveStorePath(params.config.session?.store, { agentId: params.agentId }),
1483
+ sessionKey,
1484
+ readConsistency: "latest"
1485
+ });
1473
1486
  if (!entry?.execSecurity && !entry?.execAsk) return;
1474
1487
  return {
1475
1488
  security: entry.execSecurity,
@@ -1554,4 +1567,4 @@ function buildAgentLookup(params) {
1554
1567
  };
1555
1568
  }
1556
1569
  //#endregion
1557
- export { steerCodexConversationTurn as _, createCodexCliSessionNodeInvokePolicies as a, readCodexConversationBindingData as b, resolveCodexCliSessionForBindingOnNode as c, parseCodexFastModeArg as d, parseCodexPermissionsModeArg as f, setCodexConversationPermissions as g, setCodexConversationModel as h, createCodexCliSessionNodeHostCommands as i, resumeCodexCliSessionOnNode as l, setCodexConversationFastMode as m, handleCodexConversationInboundClaim as n, formatCodexCliSessions as o, readCodexConversationActiveTurn as p, startCodexConversationThread as r, listCodexCliSessionsOnNode as s, handleCodexConversationBindingResolved as t, formatPermissionsMode as u, stopCodexConversationTurn as v, resolveCodexDefaultWorkspaceDir as x, createCodexCliNodeConversationBindingData as y };
1570
+ export { canMutateCodexHost as C, CODEX_NATIVE_EXECUTION_AUTH_ERROR as S, steerCodexConversationTurn as _, createCodexCliSessionNodeInvokePolicies as a, readCodexConversationBindingData as b, resolveCodexCliSessionForBindingOnNode as c, parseCodexFastModeArg as d, parseCodexPermissionsModeArg as f, setCodexConversationPermissions as g, setCodexConversationModel as h, createCodexCliSessionNodeHostCommands as i, resumeCodexCliSessionOnNode as l, setCodexConversationFastMode as m, handleCodexConversationInboundClaim as n, formatCodexCliSessions as o, readCodexConversationActiveTurn as p, startCodexConversationThread as r, listCodexCliSessionsOnNode as s, handleCodexConversationBindingResolved as t, formatPermissionsMode as u, stopCodexConversationTurn as v, resolveCodexDefaultWorkspaceDir as x, createCodexCliNodeConversationBindingData as y };
package/dist/harness.js CHANGED
@@ -32,25 +32,25 @@ function createCodexAppServerAgentHarness(options) {
32
32
  };
33
33
  },
34
34
  runAttempt: async (params) => {
35
- const { runCodexAppServerAttempt } = await import("./run-attempt-CXxtFC9d.js");
35
+ const { runCodexAppServerAttempt } = await import("./run-attempt-O3Zs32KI.js");
36
36
  return runCodexAppServerAttempt(params, {
37
37
  pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
38
38
  nativeHookRelay: { enabled: true }
39
39
  });
40
40
  },
41
41
  runSideQuestion: async (params) => {
42
- const { runCodexAppServerSideQuestion } = await import("./side-question-C-DhgJOd.js");
42
+ const { runCodexAppServerSideQuestion } = await import("./side-question-DDVgFmpv.js");
43
43
  return runCodexAppServerSideQuestion(params, {
44
44
  pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
45
45
  nativeHookRelay: { enabled: true }
46
46
  });
47
47
  },
48
48
  compact: async (params) => {
49
- const { maybeCompactCodexAppServerSession } = await import("./compact-aQJ0ZKhe.js");
49
+ const { maybeCompactCodexAppServerSession } = await import("./compact-BzB9AqN1.js");
50
50
  return maybeCompactCodexAppServerSession(params, { pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig });
51
51
  },
52
52
  compactAfterContextEngine: async (params) => {
53
- const { maybeCompactCodexAppServerSession } = await import("./compact-aQJ0ZKhe.js");
53
+ const { maybeCompactCodexAppServerSession } = await import("./compact-BzB9AqN1.js");
54
54
  return maybeCompactCodexAppServerSession(params, {
55
55
  pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
56
56
  allowNonManualNativeRequest: true
@@ -58,12 +58,12 @@ function createCodexAppServerAgentHarness(options) {
58
58
  },
59
59
  reset: async (params) => {
60
60
  if (params.sessionFile) {
61
- const { clearCodexAppServerBinding } = await import("./session-binding-HOuPt-E0.js").then((n) => n.s);
61
+ const { clearCodexAppServerBinding } = await import("./session-binding-Cm0Gg7Z1.js").then((n) => n.s);
62
62
  await clearCodexAppServerBinding(params.sessionFile);
63
63
  }
64
64
  },
65
65
  dispose: async () => {
66
- const { clearSharedCodexAppServerClientAndWait } = await import("./shared-client-Dtx5i7Ez.js").then((n) => n.c);
66
+ const { clearSharedCodexAppServerClientAndWait } = await import("./shared-client-rR6TDJA3.js").then((n) => n.c);
67
67
  await clearSharedCodexAppServerClientAndWait();
68
68
  }
69
69
  };
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { createCodexAppServerAgentHarness } from "./harness.js";
2
- import { F as ensureCodexPluginActivation, I as pluginReadParams, R as defaultCodexAppInventoryCache } from "./thread-lifecycle-DtT3-ehU.js";
3
- import { d as resolveCodexAppServerRuntimeOptions, t as CODEX_PLUGINS_MARKETPLACE_NAME, u as readCodexPluginConfig } from "./config-CszD0vP3.js";
4
- import { t as buildCodexProvider } from "./provider-B-OHpbD3.js";
5
- import { t as buildCodexMediaUnderstandingProvider } from "./media-understanding-provider-ZUQHN7gT.js";
6
- import { i as describeControlFailure, n as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-C9ILt7bl.js";
7
- import { a as formatCodexDisplayText } from "./app-server-policy-BPTiVNsW.js";
8
- import { a as getLeasedSharedCodexAppServerClient, d as resolveCodexAppServerAuthAccountCacheKey, m as resolveCodexAppServerFallbackApiKeyCacheKey, o as releaseLeasedSharedCodexAppServerClient, p as resolveCodexAppServerAuthProfileIdForAgent, r as clearSharedCodexAppServerClientIfCurrentAndWait } from "./shared-client-Dtx5i7Ez.js";
9
- import { a as createCodexCliSessionNodeInvokePolicies, c as resolveCodexCliSessionForBindingOnNode, i as createCodexCliSessionNodeHostCommands, l as resumeCodexCliSessionOnNode, n as handleCodexConversationInboundClaim, s as listCodexCliSessionsOnNode, t as handleCodexConversationBindingResolved } from "./conversation-binding-t0XMLz-j.js";
10
- import { t as requestCodexAppServerJson } from "./request-Dcd452Nk.js";
2
+ import { I as ensureCodexPluginActivation, L as pluginReadParams, z as defaultCodexAppInventoryCache } from "./thread-lifecycle-DeSMZSXr.js";
3
+ import { d as resolveCodexAppServerRuntimeOptions, t as CODEX_PLUGINS_MARKETPLACE_NAME, u as readCodexPluginConfig } from "./config-C_whBx3M.js";
4
+ import { t as buildCodexProvider } from "./provider-DosqwRb6.js";
5
+ import { t as buildCodexMediaUnderstandingProvider } from "./media-understanding-provider-C5yYzx_6.js";
6
+ import { i as describeControlFailure, n as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-CDioyur-.js";
7
+ import { a as formatCodexDisplayText } from "./app-server-policy-xi0ZmBGO.js";
8
+ import { a as getLeasedSharedCodexAppServerClient, d as resolveCodexAppServerAuthAccountCacheKey, m as resolveCodexAppServerFallbackApiKeyCacheKey, o as releaseLeasedSharedCodexAppServerClient, p as resolveCodexAppServerAuthProfileIdForAgent, r as clearSharedCodexAppServerClientIfCurrentAndWait } from "./shared-client-rR6TDJA3.js";
9
+ import { a as createCodexCliSessionNodeInvokePolicies, c as resolveCodexCliSessionForBindingOnNode, i as createCodexCliSessionNodeHostCommands, l as resumeCodexCliSessionOnNode, n as handleCodexConversationInboundClaim, s as listCodexCliSessionsOnNode, t as handleCodexConversationBindingResolved } from "./conversation-binding-CEE2UyYb.js";
10
+ import { t as requestCodexAppServerJson } from "./request-BQuSQF29.js";
11
11
  import { t as createCodexWebSearchProviderBase } from "./web-search-provider.shared-BrZmlqyR.js";
12
12
  import { mutateConfigFile } from "openclaw/plugin-sdk/config-mutation";
13
13
  import { resolveLivePluginConfigObject, resolvePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
@@ -52,7 +52,7 @@ async function handleCodexCommand(ctx, options = {}) {
52
52
  }
53
53
  }
54
54
  async function loadDefaultCodexSubcommandHandler() {
55
- const { handleCodexSubcommand } = await import("./command-handlers-DEPTJYk0.js");
55
+ const { handleCodexSubcommand } = await import("./command-handlers-vZy8xX5X.js");
56
56
  return handleCodexSubcommand;
57
57
  }
58
58
  //#endregion
@@ -950,9 +950,11 @@ function isLegacyDestructivePolicyRepair(existing, nextEntry) {
950
950
  const normalizedEntries = Object.entries(normalizedExisting);
951
951
  return normalizedEntries.length === Object.keys(nextEntry).length && normalizedEntries.every(([key, value]) => nextEntry[key] === value);
952
952
  }
953
- function isLegacyDestructivePolicyConfigEntryRepair(existing, pluginName) {
953
+ function readExistingPluginAllowDestructiveActions(existing, pluginName) {
954
954
  const existingEntry = isRecord(existing) ? existing : void 0;
955
- return existingEntry?.allow_destructive_actions === "on-request" && existingEntry.pluginName === pluginName;
955
+ if (existingEntry?.pluginName !== pluginName) return;
956
+ const normalized = normalizeExistingAllowDestructiveActions(existingEntry.allow_destructive_actions);
957
+ return normalized === "auto" || normalized === "ask" ? normalized : void 0;
956
958
  }
957
959
  function buildPluginItems(ctx, plugins) {
958
960
  const baseCounts = /* @__PURE__ */ new Map();
@@ -971,7 +973,10 @@ function buildPluginItems(ctx, plugins) {
971
973
  enabled: true,
972
974
  marketplaceName: CODEX_PLUGINS_MARKETPLACE_NAME,
973
975
  pluginName: plugin.pluginName,
974
- ...isLegacyDestructivePolicyConfigEntryRepair(existingPluginEntries[configKey], plugin.pluginName) ? { allow_destructive_actions: "auto" } : {}
976
+ ...(() => {
977
+ const allowDestructiveActions = readExistingPluginAllowDestructiveActions(existingPluginEntries[configKey], plugin.pluginName);
978
+ return allowDestructiveActions ? { allow_destructive_actions: allowDestructiveActions } : {};
979
+ })()
975
980
  };
976
981
  const conflict = !ctx.overwrite && hasExistingCodexPluginEntry(existingPluginEntries, configKey, plugin.pluginName, plannedEntry);
977
982
  items.push(createMigrationItem({
@@ -989,7 +994,7 @@ function buildPluginItems(ctx, plugins) {
989
994
  pluginName: plugin.pluginName,
990
995
  sourceInstalled: plugin.installed === true,
991
996
  sourceEnabled: plugin.enabled === true,
992
- ...plannedEntry.allow_destructive_actions === "auto" ? { allowDestructiveActions: "auto" } : {},
997
+ ...plannedEntry.allow_destructive_actions === "auto" || plannedEntry.allow_destructive_actions === "ask" ? { allowDestructiveActions: plannedEntry.allow_destructive_actions } : {},
993
998
  ...plugin.apps && plugin.apps.length > 0 && !shouldVerifyPluginApps(ctx) ? { sourceAppVerification: CODEX_PLUGIN_SOURCE_APP_VERIFICATION_UNVERIFIED } : {}
994
999
  }
995
1000
  }));
@@ -1032,18 +1037,21 @@ function readCodexPluginMigrationConfigEntry(item, enabled) {
1032
1037
  const marketplaceName = item.details?.marketplaceName;
1033
1038
  const pluginName = item.details?.pluginName;
1034
1039
  if (item.kind !== "plugin" || item.action !== "install" || typeof configKey !== "string" || marketplaceName !== "openai-curated" || typeof pluginName !== "string") return;
1040
+ const allowDestructiveActions = item.details?.allowDestructiveActions;
1035
1041
  return {
1036
1042
  configKey,
1037
1043
  pluginName,
1038
1044
  enabled,
1039
- ...item.details?.allowDestructiveActions === "auto" ? { allowDestructiveActions: "auto" } : {}
1045
+ ...allowDestructiveActions === "auto" || allowDestructiveActions === "ask" ? { allowDestructiveActions } : {}
1040
1046
  };
1041
1047
  }
1042
1048
  function readExistingAllowDestructiveActions(config) {
1043
1049
  return normalizeExistingAllowDestructiveActions(readMigrationConfigPath(config, [...CODEX_PLUGIN_NATIVE_CONFIG_PATH, "allow_destructive_actions"]));
1044
1050
  }
1045
1051
  function normalizeExistingAllowDestructiveActions(value) {
1046
- return value === "auto" || value === "on-request" ? "auto" : asBoolean(value);
1052
+ if (value === "auto" || value === "on-request") return "auto";
1053
+ if (value === "ask") return "ask";
1054
+ return asBoolean(value);
1047
1055
  }
1048
1056
  function readExistingPluginPolicyRepairs(config) {
1049
1057
  if (config === void 0) return {};
@@ -1542,7 +1550,7 @@ function buildCodexMigrationProvider(params = {}) {
1542
1550
  //#region extensions/codex/src/web-search-provider.ts
1543
1551
  let codexWebSearchRuntimePromise;
1544
1552
  function loadCodexWebSearchRuntime() {
1545
- codexWebSearchRuntimePromise ??= import("./web-search-provider.runtime-CkwxrXQj.js");
1553
+ codexWebSearchRuntimePromise ??= import("./web-search-provider.runtime-Q89rQhsL.js");
1546
1554
  return codexWebSearchRuntimePromise;
1547
1555
  }
1548
1556
  const CodexWebSearchSchema = {
@@ -1,10 +1,10 @@
1
1
  import { CODEX_PROVIDER_ID, FALLBACK_CODEX_MODELS } from "./provider-catalog.js";
2
2
  import { n as isJsonObject } from "./protocol-dh-ETiNd.js";
3
- import { N as mergeCodexThreadConfigs, r as buildCodexRuntimeThreadConfig } from "./thread-lifecycle-DtT3-ehU.js";
4
- import { C as readCodexNotificationItem } from "./attempt-notifications-BYnndyFl.js";
5
- import { d as resolveCodexAppServerRuntimeOptions } from "./config-CszD0vP3.js";
6
- import { i as assertCodexTurnStartResponse, l as readCodexTurnCompletedNotification, o as readCodexErrorNotification, r as assertCodexThreadStartResponse } from "./protocol-validators-B19q5BIX.js";
7
- import { i as readModelListResult } from "./models-CAmfBWRl.js";
3
+ import { P as mergeCodexThreadConfigs, r as buildCodexRuntimeThreadConfig } from "./thread-lifecycle-DeSMZSXr.js";
4
+ import { C as readCodexNotificationItem } from "./attempt-notifications-l9LElGOU.js";
5
+ import { d as resolveCodexAppServerRuntimeOptions } from "./config-C_whBx3M.js";
6
+ import { i as assertCodexTurnStartResponse, l as readCodexTurnCompletedNotification, o as readCodexErrorNotification, r as assertCodexThreadStartResponse } from "./protocol-validators-CB4mtyrs.js";
7
+ import { i as readModelListResult } from "./models-Ccy1_7nN.js";
8
8
  import { validateJsonSchemaValue } from "openclaw/plugin-sdk/json-schema-runtime";
9
9
  import fs from "node:fs/promises";
10
10
  import path from "node:path";
@@ -51,7 +51,7 @@ async function runBoundedCodexAppServerTurnInWorkspace(params, appServer, worksp
51
51
  const agentDir = params.agentDir?.trim() || void 0;
52
52
  const startOptions = workspace.codexHome ? buildPrivateCodexAppServerStartOptions(appServer.start, workspace.codexHome) : appServer.start;
53
53
  const ownsClient = !params.options.clientFactory;
54
- const client = params.options.clientFactory ? await params.options.clientFactory(startOptions, params.profile, agentDir, params.config, { timeoutMs }) : await import("./shared-client-Dtx5i7Ez.js").then((n) => n.c).then(({ createIsolatedCodexAppServerClient }) => createIsolatedCodexAppServerClient({
54
+ const client = params.options.clientFactory ? await params.options.clientFactory(startOptions, params.profile, agentDir, params.config, { timeoutMs }) : await import("./shared-client-rR6TDJA3.js").then((n) => n.c).then(({ createIsolatedCodexAppServerClient }) => createIsolatedCodexAppServerClient({
55
55
  startOptions,
56
56
  timeoutMs,
57
57
  authProfileId: params.profile,
@@ -1,2 +1,2 @@
1
- import { t as buildCodexMediaUnderstandingProvider } from "./media-understanding-provider-ZUQHN7gT.js";
1
+ import { t as buildCodexMediaUnderstandingProvider } from "./media-understanding-provider-C5yYzx_6.js";
2
2
  export { buildCodexMediaUnderstandingProvider };
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { s as readCodexModelListResponse } from "./protocol-validators-B19q5BIX.js";
2
+ import { s as readCodexModelListResponse } from "./protocol-validators-CB4mtyrs.js";
3
3
  import { uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
4
4
  //#region extensions/codex/src/app-server/models.ts
5
5
  /**
@@ -46,7 +46,7 @@ async function listAllCodexAppServerModels(options = {}) {
46
46
  async function withCodexAppServerModelClient(options, run) {
47
47
  const timeoutMs = options.timeoutMs ?? 2500;
48
48
  const useSharedClient = options.sharedClient !== false;
49
- const { createIsolatedCodexAppServerClient, getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("./shared-client-Dtx5i7Ez.js").then((n) => n.c);
49
+ const { createIsolatedCodexAppServerClient, getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("./shared-client-rR6TDJA3.js").then((n) => n.c);
50
50
  const client = useSharedClient ? await getLeasedSharedCodexAppServerClient({
51
51
  startOptions: options.startOptions,
52
52
  timeoutMs,
@@ -1,7 +1,10 @@
1
- import { L as buildCodexAppInventoryCacheKey } from "./thread-lifecycle-DtT3-ehU.js";
2
- import { n as CodexAppServerRpcError } from "./client-CLrtWgrD.js";
3
- import { h as resolveCodexAppServerHomeDir } from "./shared-client-Dtx5i7Ez.js";
1
+ import { R as buildCodexAppInventoryCacheKey } from "./thread-lifecycle-DeSMZSXr.js";
2
+ import { n as CodexAppServerRpcError } from "./client-IcTBKEqA.js";
3
+ import { h as resolveCodexAppServerHomeDir } from "./shared-client-rR6TDJA3.js";
4
+ import { createRequire } from "node:module";
4
5
  import { createHash } from "node:crypto";
6
+ import { OPENCLAW_VERSION } from "openclaw/plugin-sdk/agent-harness-runtime";
7
+ import { readPluginPackageVersion } from "openclaw/plugin-sdk/extension-shared";
5
8
  //#region extensions/codex/src/app-server/capabilities.ts
6
9
  /**
7
10
  * Capability helpers for optional Codex app-server control-plane methods.
@@ -32,6 +35,7 @@ function isUnsupportedControlError(error) {
32
35
  * Builds stable Codex plugin/app inventory cache keys from app-server startup,
33
36
  * auth, account, and version inputs without storing secret material.
34
37
  */
38
+ const CODEX_PLUGIN_VERSION = readPluginPackageVersion({ require: createRequire(import.meta.url) });
35
39
  /** Builds the full app inventory cache key for Codex plugin/app discovery. */
36
40
  function buildCodexPluginAppCacheKey(params) {
37
41
  return buildCodexAppInventoryCacheKey({
@@ -42,7 +46,7 @@ function buildCodexPluginAppCacheKey(params) {
42
46
  envApiKeyFingerprint: params.envApiKeyFingerprint,
43
47
  appServerVersion: params.appServerVersion ?? params.runtimeIdentity?.serverVersion,
44
48
  runtimeIdentity: params.runtimeIdentity
45
- });
49
+ }, OPENCLAW_VERSION, CODEX_PLUGIN_VERSION);
46
50
  }
47
51
  /** Builds a durable thread-binding fingerprint for one initialized app-server runtime. */
48
52
  function buildCodexAppServerRuntimeFingerprint(params) {