@openclaw/codex 2026.5.16-beta.3 → 2026.5.16-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { c as resolveCodexAppServerRuntimeOptions } from "./config-3ATInASk.js";
1
+ import { c as resolveCodexAppServerRuntimeOptions } from "./config-B5pq6hEz.js";
2
2
  import { n as isRpcResponse } from "./protocol-C9UWI98H.js";
3
3
  import { createInterface } from "node:readline";
4
4
  import { OPENCLAW_VERSION, embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
@@ -1,5 +1,5 @@
1
1
  //#region extensions/codex/src/app-server/client-factory.ts
2
- const defaultCodexAppServerClientFactory = (startOptions, authProfileId, agentDir, config) => import("./shared-client-CnbrvEfV.js").then((n) => n.a).then(({ getSharedCodexAppServerClient }) => getSharedCodexAppServerClient({
2
+ const defaultCodexAppServerClientFactory = (startOptions, authProfileId, agentDir, config) => import("./shared-client-DlvmoLBJ.js").then((n) => n.a).then(({ getSharedCodexAppServerClient }) => getSharedCodexAppServerClient({
3
3
  startOptions,
4
4
  authProfileId,
5
5
  agentDir,
@@ -1,14 +1,14 @@
1
- import { a as isCodexFastServiceTier, c as resolveCodexAppServerRuntimeOptions } from "./config-3ATInASk.js";
2
- import { n as listCodexAppServerModels, t as listAllCodexAppServerModels } from "./models-BZLMz9WS.js";
1
+ import { a as isCodexFastServiceTier, c as resolveCodexAppServerRuntimeOptions } from "./config-B5pq6hEz.js";
2
+ import { n as listCodexAppServerModels, t as listAllCodexAppServerModels } from "./models-C1zn2RN0.js";
3
3
  import { t as isJsonObject } from "./protocol-C9UWI98H.js";
4
- import { i as describeControlFailure, r as CODEX_CONTROL_METHODS, t as requestCodexAppServerJson } from "./request-Czoa60Nt.js";
4
+ import { i as describeControlFailure, r as CODEX_CONTROL_METHODS, t as requestCodexAppServerJson } from "./request-XPjLayGw.js";
5
5
  import { a as formatComputerUseStatus, c as formatThreads, i as formatCodexStatus, l as readString$1, n as formatAccount, o as formatList, p as summarizeCodexAccountUsage, r as formatCodexDisplayText, s as formatModels, t as buildHelp } from "./command-formatters-BRW7_Nu7.js";
6
- import { i as readCodexAppServerBinding, o as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-DbdVqMzW.js";
7
- import { _ as steerCodexConversationTurn, b as readCodexConversationBindingData, d as parseCodexFastModeArg, f as parseCodexPermissionsModeArg, g as setCodexConversationPermissions, h as setCodexConversationModel, l as startCodexConversationThread, m as setCodexConversationFastMode, p as readCodexConversationActiveTurn, r as formatCodexCliSessions, u as formatPermissionsMode, v as stopCodexConversationTurn, x as resolveCodexDefaultWorkspaceDir, y as createCodexCliNodeConversationBindingData } from "./node-cli-sessions-BLDFnUEF.js";
8
- import { n as installCodexComputerUse, r as readCodexComputerUseStatus } from "./computer-use-BX02ojP4.js";
6
+ import { i as readCodexAppServerBinding, o as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-DqApZIgD.js";
7
+ import { _ as steerCodexConversationTurn, b as readCodexConversationBindingData, d as parseCodexFastModeArg, f as parseCodexPermissionsModeArg, g as setCodexConversationPermissions, h as setCodexConversationModel, l as startCodexConversationThread, m as setCodexConversationFastMode, p as readCodexConversationActiveTurn, r as formatCodexCliSessions, u as formatPermissionsMode, v as stopCodexConversationTurn, x as resolveCodexDefaultWorkspaceDir, y as createCodexCliNodeConversationBindingData } from "./node-cli-sessions-C9rlYMPw.js";
8
+ import { n as installCodexComputerUse, r as readCodexComputerUseStatus } from "./computer-use-UJ3dxrXF.js";
9
9
  import { n as rememberCodexRateLimits } from "./rate-limit-cache-dvhq-4pi.js";
10
10
  import crypto from "node:crypto";
11
- import { ensureAuthProfileStore, findNormalizedProviderValue, resolveAuthProfileEligibility, resolveAuthProfileOrder, resolveDefaultAgentDir, resolveProfileUnusableUntilForDisplay } from "openclaw/plugin-sdk/agent-runtime";
11
+ import { ensureAuthProfileStore, findNormalizedProviderValue, resolveAgentDir, resolveAuthProfileEligibility, resolveAuthProfileOrder, resolveDefaultAgentDir, resolveProfileUnusableUntilForDisplay, resolveSessionAgentIds } from "openclaw/plugin-sdk/agent-runtime";
12
12
  //#region extensions/codex/src/command-account.ts
13
13
  const OPENAI_PROVIDER_ID = "openai";
14
14
  const OPENAI_CODEX_PROVIDER_ID = "openai-codex";
@@ -308,6 +308,7 @@ async function codexControlRequest(pluginConfig, method, requestParams, options
308
308
  startOptions: runtime.start,
309
309
  config: options.config,
310
310
  authProfileId: options.authProfileId,
311
+ agentDir: options.agentDir,
311
312
  isolated: options.isolated
312
313
  });
313
314
  }
@@ -466,20 +467,28 @@ async function bindConversation(deps, ctx, pluginConfig, args) {
466
467
  const parsed = parseBindArgs(args);
467
468
  if (parsed.help) return { text: "Usage: /codex bind [thread-id] [--cwd <path>] [--model <model>] [--provider <provider>]" };
468
469
  if (!ctx.sessionFile) return { text: "Cannot bind Codex because this command did not include an OpenClaw session file." };
470
+ const scope = resolveCodexConversationControlScope(ctx);
469
471
  const workspaceDir = parsed.cwd ?? deps.resolveCodexDefaultWorkspaceDir(pluginConfig);
470
- const authProfileId = (await deps.readCodexAppServerBinding(ctx.sessionFile))?.authProfileId;
472
+ const authProfileId = (await deps.readCodexAppServerBinding(ctx.sessionFile, {
473
+ agentDir: scope.agentDir,
474
+ config: ctx.config
475
+ }))?.authProfileId;
471
476
  const startParams = {
472
477
  pluginConfig,
473
478
  config: ctx.config,
474
479
  sessionFile: ctx.sessionFile,
475
480
  workspaceDir,
481
+ agentDir: scope.agentDir,
476
482
  threadId: parsed.threadId,
477
483
  model: parsed.model,
478
484
  modelProvider: parsed.provider
479
485
  };
480
486
  if (authProfileId) startParams.authProfileId = authProfileId;
481
487
  const data = await deps.startCodexConversationThread(startParams);
482
- const threadId = (await deps.readCodexAppServerBinding(ctx.sessionFile))?.threadId ?? parsed.threadId ?? "new thread";
488
+ const threadId = (await deps.readCodexAppServerBinding(ctx.sessionFile, {
489
+ agentDir: scope.agentDir,
490
+ config: ctx.config
491
+ }))?.threadId ?? parsed.threadId ?? "new thread";
483
492
  const summary = `Codex app-server thread ${formatCodexDisplayText(threadId)} in ${formatCodexDisplayText(workspaceDir)}`;
484
493
  let request;
485
494
  try {
@@ -516,7 +525,10 @@ async function describeConversationBinding(deps, ctx) {
516
525
  `- Workspace: ${formatCodexDisplayText(data.cwd ?? "unknown")}`,
517
526
  "- Active run: not tracked"
518
527
  ].join("\n");
519
- const threadBinding = await deps.readCodexAppServerBinding(data.sessionFile);
528
+ const threadBinding = await deps.readCodexAppServerBinding(data.sessionFile, {
529
+ agentDir: data.agentDir,
530
+ config: ctx.config
531
+ });
520
532
  const active = deps.readCodexConversationActiveTurn(data.sessionFile);
521
533
  return [
522
534
  "Codex conversation binding:",
@@ -590,67 +602,98 @@ async function bindCodexCliNodeSession(deps, ctx, parsed) {
590
602
  return formatCodexDisplayText(request.message);
591
603
  }
592
604
  async function stopConversationTurn(deps, ctx, pluginConfig) {
593
- const sessionFile = await resolveControlSessionFile(ctx);
594
- if (!sessionFile) return "Cannot stop Codex because this command did not include an OpenClaw session file.";
605
+ const target = await resolveControlTarget(ctx);
606
+ if (!target) return "Cannot stop Codex because this command did not include an OpenClaw session file.";
595
607
  return (await deps.stopCodexConversationTurn({
596
- sessionFile,
597
- pluginConfig
608
+ sessionFile: target.sessionFile,
609
+ pluginConfig,
610
+ agentDir: target.agentDir,
611
+ config: ctx.config
598
612
  })).message;
599
613
  }
600
614
  async function steerConversationTurn(deps, ctx, pluginConfig, message) {
601
- const sessionFile = await resolveControlSessionFile(ctx);
602
- if (!sessionFile) return "Cannot steer Codex because this command did not include an OpenClaw session file.";
615
+ const target = await resolveControlTarget(ctx);
616
+ if (!target) return "Cannot steer Codex because this command did not include an OpenClaw session file.";
603
617
  return (await deps.steerCodexConversationTurn({
604
- sessionFile,
618
+ sessionFile: target.sessionFile,
605
619
  pluginConfig,
606
- message
620
+ message,
621
+ agentDir: target.agentDir,
622
+ config: ctx.config
607
623
  })).message;
608
624
  }
609
625
  async function setConversationModel(deps, ctx, pluginConfig, args) {
610
626
  if (args.length > 1) return "Usage: /codex model <model>";
611
- const sessionFile = await resolveControlSessionFile(ctx);
612
- if (!sessionFile) return "Cannot set Codex model because this command did not include an OpenClaw session file.";
627
+ const target = await resolveControlTarget(ctx);
628
+ if (!target) return "Cannot set Codex model because this command did not include an OpenClaw session file.";
613
629
  const [model = ""] = args;
614
630
  const normalized = model.trim();
615
631
  if (!normalized) {
616
- const binding = await deps.readCodexAppServerBinding(sessionFile);
632
+ const binding = await deps.readCodexAppServerBinding(target.sessionFile, {
633
+ agentDir: target.agentDir,
634
+ config: ctx.config
635
+ });
617
636
  return binding?.model ? `Codex model: ${formatCodexDisplayText(binding.model)}` : "Usage: /codex model <model>";
618
637
  }
619
638
  return await deps.setCodexConversationModel({
620
- sessionFile,
639
+ sessionFile: target.sessionFile,
621
640
  pluginConfig,
622
- model: normalized
641
+ model: normalized,
642
+ agentDir: target.agentDir,
643
+ config: ctx.config
623
644
  });
624
645
  }
625
646
  async function setConversationFastMode(deps, ctx, pluginConfig, args) {
626
647
  if (args.length > 1) return "Usage: /codex fast [on|off|status]";
627
- const sessionFile = await resolveControlSessionFile(ctx);
628
- if (!sessionFile) return "Cannot set Codex fast mode because this command did not include an OpenClaw session file.";
648
+ const target = await resolveControlTarget(ctx);
649
+ if (!target) return "Cannot set Codex fast mode because this command did not include an OpenClaw session file.";
629
650
  const value = args[0];
630
651
  const parsed = parseCodexFastModeArg(value);
631
652
  if (value && parsed == null && value.trim().toLowerCase() !== "status") return "Usage: /codex fast [on|off|status]";
632
653
  return await deps.setCodexConversationFastMode({
633
- sessionFile,
654
+ sessionFile: target.sessionFile,
634
655
  pluginConfig,
635
- enabled: parsed
656
+ enabled: parsed,
657
+ agentDir: target.agentDir,
658
+ config: ctx.config
636
659
  });
637
660
  }
638
661
  async function setConversationPermissions(deps, ctx, pluginConfig, args) {
639
662
  if (args.length > 1) return "Usage: /codex permissions [default|yolo|status]";
640
- const sessionFile = await resolveControlSessionFile(ctx);
641
- if (!sessionFile) return "Cannot set Codex permissions because this command did not include an OpenClaw session file.";
663
+ const target = await resolveControlTarget(ctx);
664
+ if (!target) return "Cannot set Codex permissions because this command did not include an OpenClaw session file.";
642
665
  const value = args[0];
643
666
  const parsed = parseCodexPermissionsModeArg(value);
644
667
  if (value && !parsed && value.trim().toLowerCase() !== "status") return "Usage: /codex permissions [default|yolo|status]";
645
668
  return await deps.setCodexConversationPermissions({
646
- sessionFile,
669
+ sessionFile: target.sessionFile,
647
670
  pluginConfig,
648
- mode: parsed
671
+ mode: parsed,
672
+ agentDir: target.agentDir,
673
+ config: ctx.config
649
674
  });
650
675
  }
651
- async function resolveControlSessionFile(ctx) {
676
+ async function resolveControlTarget(ctx) {
652
677
  const data = readCodexConversationBindingData(await ctx.getCurrentConversationBinding());
653
- return data?.kind === "codex-app-server-session" ? data.sessionFile : ctx.sessionFile;
678
+ const scope = resolveCodexConversationControlScope(ctx);
679
+ if (data?.kind === "codex-app-server-session") return {
680
+ sessionFile: data.sessionFile,
681
+ agentDir: data.agentDir ?? scope.agentDir
682
+ };
683
+ return ctx.sessionFile ? {
684
+ sessionFile: ctx.sessionFile,
685
+ agentDir: scope.agentDir
686
+ } : void 0;
687
+ }
688
+ async function resolveControlSessionFile(ctx) {
689
+ return (await resolveControlTarget(ctx))?.sessionFile;
690
+ }
691
+ function resolveCodexConversationControlScope(ctx) {
692
+ const { sessionAgentId } = resolveSessionAgentIds({
693
+ sessionKey: ctx.sessionKey,
694
+ config: ctx.config
695
+ });
696
+ return { agentDir: resolveAgentDir(ctx.config, sessionAgentId) };
654
697
  }
655
698
  async function handleCodexDiagnosticsFeedback(deps, ctx, pluginConfig, args, commandPrefix) {
656
699
  if (ctx.senderIsOwner !== true) return { text: "Only an owner can send Codex diagnostics." };
@@ -1120,15 +1163,26 @@ function normalizeCodexDiagnosticsScopeField(value) {
1120
1163
  }
1121
1164
  async function startThreadAction(deps, ctx, pluginConfig, method, label, args) {
1122
1165
  if (args.length > 0) return `Usage: /codex ${label === "compaction" ? "compact" : label}`;
1123
- const sessionFile = await resolveControlSessionFile(ctx);
1124
- if (!sessionFile) return `Cannot start Codex ${label} because this command did not include an OpenClaw session file.`;
1125
- const binding = await deps.readCodexAppServerBinding(sessionFile);
1166
+ const target = await resolveControlTarget(ctx);
1167
+ if (!target) return `Cannot start Codex ${label} because this command did not include an OpenClaw session file.`;
1168
+ const binding = await deps.readCodexAppServerBinding(target.sessionFile, {
1169
+ agentDir: target.agentDir,
1170
+ config: ctx.config
1171
+ });
1126
1172
  if (!binding?.threadId) return `No Codex thread is attached to this OpenClaw session yet.`;
1127
1173
  if (method === CODEX_CONTROL_METHODS.review) await deps.codexControlRequest(pluginConfig, method, {
1128
1174
  threadId: binding.threadId,
1129
1175
  target: { type: "uncommittedChanges" }
1176
+ }, {
1177
+ agentDir: target.agentDir,
1178
+ authProfileId: binding.authProfileId,
1179
+ config: ctx.config
1180
+ });
1181
+ else await deps.codexControlRequest(pluginConfig, method, { threadId: binding.threadId }, {
1182
+ agentDir: target.agentDir,
1183
+ authProfileId: binding.authProfileId,
1184
+ config: ctx.config
1130
1185
  });
1131
- else await deps.codexControlRequest(pluginConfig, method, { threadId: binding.threadId });
1132
1186
  return `Started Codex ${label} for thread ${formatCodexDisplayText(binding.threadId)}.`;
1133
1187
  }
1134
1188
  function splitArgs(value) {
@@ -1,7 +1,7 @@
1
- import { c as resolveCodexAppServerRuntimeOptions } from "./config-3ATInASk.js";
1
+ import { c as resolveCodexAppServerRuntimeOptions } from "./config-B5pq6hEz.js";
2
2
  import { t as isJsonObject } from "./protocol-C9UWI98H.js";
3
- import { i as readCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-DbdVqMzW.js";
4
- import { t as defaultCodexAppServerClientFactory } from "./client-factory-DwzPofwS.js";
3
+ import { i as readCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-DqApZIgD.js";
4
+ import { t as defaultCodexAppServerClientFactory } from "./client-factory-9L6Ie1dC.js";
5
5
  import { embeddedAgentLog, formatErrorMessage, isActiveHarnessContextEngine, resolveContextEngineOwnerPluginId, runHarnessContextEngineMaintenance } from "openclaw/plugin-sdk/agent-harness-runtime";
6
6
  //#region extensions/codex/src/app-server/compact.ts
7
7
  const DEFAULT_CODEX_COMPACTION_WAIT_TIMEOUT_MS = 300 * 1e3;
@@ -1,5 +1,5 @@
1
- import { c as resolveCodexAppServerRuntimeOptions, l as resolveCodexComputerUseConfig } from "./config-3ATInASk.js";
2
- import { i as describeControlFailure, t as requestCodexAppServerJson } from "./request-Czoa60Nt.js";
1
+ import { c as resolveCodexAppServerRuntimeOptions, l as resolveCodexComputerUseConfig } from "./config-B5pq6hEz.js";
2
+ import { i as describeControlFailure, t as requestCodexAppServerJson } from "./request-XPjLayGw.js";
3
3
  import { existsSync } from "node:fs";
4
4
  //#region extensions/codex/src/app-server/computer-use.ts
5
5
  var CodexComputerUseSetupError = class extends Error {
@@ -3,7 +3,8 @@ import { readFileSync } from "node:fs";
3
3
  import { hostname } from "node:os";
4
4
  import { z } from "zod";
5
5
  //#region extensions/codex/src/app-server/config.ts
6
- const START_OPTIONS_KEY_SECRET = randomBytes(32);
6
+ const START_OPTIONS_KEY_SECRET_SYMBOL = Symbol.for("openclaw.codexAppServerStartOptionsKeySecret");
7
+ const START_OPTIONS_KEY_SECRET = getStartOptionsKeySecret();
7
8
  const UNIX_CODEX_REQUIREMENTS_PATH = "/etc/codex/requirements.toml";
8
9
  const WINDOWS_CODEX_REQUIREMENTS_SUFFIX = "\\OpenAI\\Codex\\requirements.toml";
9
10
  const CODEX_PLUGINS_MARKETPLACE_NAME = "openai-curated";
@@ -472,6 +473,11 @@ function hashSecretForKey(value, label) {
472
473
  if (!value) return null;
473
474
  return createHmac("sha256", START_OPTIONS_KEY_SECRET).update(label).update("\0").update(value).digest("hex");
474
475
  }
476
+ function getStartOptionsKeySecret() {
477
+ const globalState = globalThis;
478
+ globalState[START_OPTIONS_KEY_SECRET_SYMBOL] ??= randomBytes(32);
479
+ return globalState[START_OPTIONS_KEY_SECRET_SYMBOL];
480
+ }
475
481
  function splitShellWords(value) {
476
482
  const words = [];
477
483
  let current = "";
package/dist/harness.js CHANGED
@@ -18,28 +18,31 @@ function createCodexAppServerAgentHarness(options) {
18
18
  };
19
19
  },
20
20
  runAttempt: async (params) => {
21
- const { runCodexAppServerAttempt } = await import("./run-attempt-B3nk5oT1.js");
21
+ const { runCodexAppServerAttempt } = await import("./run-attempt-Bssnu2uw.js");
22
22
  return runCodexAppServerAttempt(params, {
23
23
  pluginConfig: options?.pluginConfig,
24
24
  nativeHookRelay: { enabled: true }
25
25
  });
26
26
  },
27
27
  runSideQuestion: async (params) => {
28
- const { runCodexAppServerSideQuestion } = await import("./side-question-D3nH-Jk1.js");
29
- return runCodexAppServerSideQuestion(params, { pluginConfig: options?.pluginConfig });
28
+ const { runCodexAppServerSideQuestion } = await import("./side-question-DgVgwmjR.js");
29
+ return runCodexAppServerSideQuestion(params, {
30
+ pluginConfig: options?.pluginConfig,
31
+ nativeHookRelay: { enabled: true }
32
+ });
30
33
  },
31
34
  compact: async (params) => {
32
- const { maybeCompactCodexAppServerSession } = await import("./compact-96QPqIAu.js");
35
+ const { maybeCompactCodexAppServerSession } = await import("./compact-UKyG6Pw2.js");
33
36
  return maybeCompactCodexAppServerSession(params, { pluginConfig: options?.pluginConfig });
34
37
  },
35
38
  reset: async (params) => {
36
39
  if (params.sessionFile) {
37
- const { clearCodexAppServerBinding } = await import("./session-binding-DbdVqMzW.js").then((n) => n.a);
40
+ const { clearCodexAppServerBinding } = await import("./session-binding-DqApZIgD.js").then((n) => n.a);
38
41
  await clearCodexAppServerBinding(params.sessionFile);
39
42
  }
40
43
  },
41
44
  dispose: async () => {
42
- const { clearSharedCodexAppServerClientAndWait } = await import("./shared-client-CnbrvEfV.js").then((n) => n.a);
45
+ const { clearSharedCodexAppServerClientAndWait } = await import("./shared-client-DlvmoLBJ.js").then((n) => n.a);
43
46
  await clearSharedCodexAppServerClientAndWait();
44
47
  }
45
48
  };
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { createCodexAppServerAgentHarness } from "./harness.js";
2
- import { c as resolveCodexAppServerRuntimeOptions, s as readCodexPluginConfig, t as CODEX_PLUGINS_MARKETPLACE_NAME } from "./config-3ATInASk.js";
2
+ import { c as resolveCodexAppServerRuntimeOptions, s as readCodexPluginConfig, t as CODEX_PLUGINS_MARKETPLACE_NAME } from "./config-B5pq6hEz.js";
3
3
  import { buildCodexMediaUnderstandingProvider } from "./media-understanding-provider.js";
4
4
  import { buildCodexProvider } from "./provider.js";
5
- import { i as describeControlFailure, n as buildCodexPluginAppCacheKey, t as requestCodexAppServerJson } from "./request-Czoa60Nt.js";
5
+ import { i as describeControlFailure, n as buildCodexPluginAppCacheKey, t as requestCodexAppServerJson } from "./request-XPjLayGw.js";
6
6
  import { r as formatCodexDisplayText } from "./command-formatters-BRW7_Nu7.js";
7
- import { c as resolveCodexAppServerAuthAccountCacheKey, d as resolveCodexAppServerEnvApiKeyCacheKey, i as getSharedCodexAppServerClient, t as clearSharedCodexAppServerClientAndWait, u as resolveCodexAppServerAuthProfileIdForAgent } from "./shared-client-CnbrvEfV.js";
8
- import { a as resolveCodexCliSessionForBindingOnNode, c as handleCodexConversationInboundClaim, i as listCodexCliSessionsOnNode, n as createCodexCliSessionNodeInvokePolicies, o as resumeCodexCliSessionOnNode, s as handleCodexConversationBindingResolved, t as createCodexCliSessionNodeHostCommands } from "./node-cli-sessions-BLDFnUEF.js";
9
- import { a as defaultCodexAppInventoryCache, n as pluginReadParams, t as ensureCodexPluginActivation } from "./plugin-activation-BDU4e-NA.js";
7
+ import { c as resolveCodexAppServerAuthAccountCacheKey, d as resolveCodexAppServerEnvApiKeyCacheKey, i as getSharedCodexAppServerClient, n as clearSharedCodexAppServerClientIfCurrentAndWait, u as resolveCodexAppServerAuthProfileIdForAgent } from "./shared-client-DlvmoLBJ.js";
8
+ import { a as resolveCodexCliSessionForBindingOnNode, c as handleCodexConversationInboundClaim, i as listCodexCliSessionsOnNode, n as createCodexCliSessionNodeInvokePolicies, o as resumeCodexCliSessionOnNode, s as handleCodexConversationBindingResolved, t as createCodexCliSessionNodeHostCommands } from "./node-cli-sessions-C9rlYMPw.js";
9
+ import { a as defaultCodexAppInventoryCache, n as pluginReadParams, t as ensureCodexPluginActivation } from "./plugin-activation-B49xb7pI.js";
10
10
  import { resolveLivePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
11
11
  import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
12
12
  import os from "node:os";
@@ -38,7 +38,7 @@ async function handleCodexCommand(ctx, options = {}) {
38
38
  }
39
39
  }
40
40
  async function loadDefaultCodexSubcommandHandler() {
41
- const { handleCodexSubcommand } = await import("./command-handlers-C4F8BChC.js");
41
+ const { handleCodexSubcommand } = await import("./command-handlers-DcoFMn4e.js");
42
42
  return handleCodexSubcommand;
43
43
  }
44
44
  //#endregion
@@ -765,15 +765,18 @@ function shouldReturnCodexPluginConfigPatch(ctx) {
765
765
  function prepareTargetCodexAppServer(ctx) {
766
766
  const appServer = resolveTargetCodexAppServer(ctx);
767
767
  const targets = resolveCodexMigrationTargets(ctx);
768
+ let warmedClient;
768
769
  const ready = getSharedCodexAppServerClient({
769
770
  startOptions: appServer.start,
770
771
  timeoutMs: 6e4,
771
772
  agentDir: targets.agentDir,
772
773
  config: ctx.config
773
- }).then(() => void 0, () => void 0);
774
+ }).then((client) => {
775
+ warmedClient = client;
776
+ }, () => void 0);
774
777
  return { async dispose() {
775
778
  await ready;
776
- await clearSharedCodexAppServerClientAndWait({
779
+ await clearSharedCodexAppServerClientIfCurrentAndWait(warmedClient, {
777
780
  exitTimeoutMs: 2e3,
778
781
  forceKillDelayMs: 250
779
782
  });
@@ -1,7 +1,7 @@
1
1
  import { CODEX_PROVIDER_ID, FALLBACK_CODEX_MODELS } from "./provider-catalog.js";
2
- import { c as resolveCodexAppServerRuntimeOptions } from "./config-3ATInASk.js";
2
+ import { c as resolveCodexAppServerRuntimeOptions } from "./config-B5pq6hEz.js";
3
3
  import { i as assertCodexTurnStartResponse, l as readCodexTurnCompletedNotification, o as readCodexErrorNotification, r as assertCodexThreadStartResponse } from "./protocol-validators-BGBspNmF.js";
4
- import { i as readModelListResult } from "./models-BZLMz9WS.js";
4
+ import { i as readModelListResult } from "./models-C1zn2RN0.js";
5
5
  import { t as isJsonObject } from "./protocol-C9UWI98H.js";
6
6
  import { validateJsonSchemaValue } from "openclaw/plugin-sdk/json-schema-runtime";
7
7
  //#region extensions/codex/media-understanding-provider.ts
@@ -62,7 +62,7 @@ async function runBoundedCodexVisionTurn(params) {
62
62
  const appServer = resolveCodexAppServerRuntimeOptions({ pluginConfig: params.options.pluginConfig });
63
63
  const timeoutMs = Math.max(100, params.timeoutMs);
64
64
  const ownsClient = !params.options.clientFactory;
65
- const client = params.options.clientFactory ? await params.options.clientFactory(appServer.start, params.profile) : await import("./shared-client-CnbrvEfV.js").then((n) => n.a).then(({ createIsolatedCodexAppServerClient }) => createIsolatedCodexAppServerClient({
65
+ const client = params.options.clientFactory ? await params.options.clientFactory(appServer.start, params.profile) : await import("./shared-client-DlvmoLBJ.js").then((n) => n.a).then(({ createIsolatedCodexAppServerClient }) => createIsolatedCodexAppServerClient({
66
66
  startOptions: appServer.start,
67
67
  timeoutMs,
68
68
  authProfileId: params.profile
@@ -39,7 +39,7 @@ async function listAllCodexAppServerModels(options = {}) {
39
39
  async function withCodexAppServerModelClient(options, run) {
40
40
  const timeoutMs = options.timeoutMs ?? 2500;
41
41
  const useSharedClient = options.sharedClient !== false;
42
- const { createIsolatedCodexAppServerClient, getSharedCodexAppServerClient } = await import("./shared-client-CnbrvEfV.js").then((n) => n.a);
42
+ const { createIsolatedCodexAppServerClient, getSharedCodexAppServerClient } = await import("./shared-client-DlvmoLBJ.js").then((n) => n.a);
43
43
  const client = useSharedClient ? await getSharedCodexAppServerClient({
44
44
  startOptions: options.startOptions,
45
45
  timeoutMs,