@openclaw/codex 2026.6.1 → 2026.6.5-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/client-factory-Bt49r45B.js +17 -0
  2. package/dist/{client-BnOmn0y-.js → client-kMCtlApt.js} +43 -1
  3. package/dist/{command-handlers-VhJdcXcI.js → command-handlers-DMn2M7W7.js} +10 -10
  4. package/dist/{compact-D1dSrNrT.js → compact-CwnPeYnM.js} +16 -5
  5. package/dist/{computer-use-DYLSxIfq.js → computer-use-ClweWaMz.js} +12 -2
  6. package/dist/{config-AlzuNKCY.js → config-BT6SLiE6.js} +4 -12
  7. package/dist/{conversation-binding-CqVPKJPp.js → conversation-binding-CzpvaBs1.js} +8 -8
  8. package/dist/doctor-contract-api.js +5 -0
  9. package/dist/harness.js +9 -5
  10. package/dist/index.js +12 -13
  11. package/dist/media-understanding-provider.js +14 -6
  12. package/dist/{models-DAJvlyJu.js → models-DXorTaja.js} +9 -2
  13. package/dist/{native-hook-relay-CIJt8cLN.js → native-hook-relay-DZ3Oon0b.js} +61 -3
  14. package/dist/{notification-correlation-BykOI_jh.js → notification-correlation-o8quHmTK.js} +30 -1
  15. package/dist/prompt-overlay.js +7 -0
  16. package/dist/{protocol-validators-DIt7cXIp.js → protocol-validators-CIpP8IJ2.js} +13 -0
  17. package/dist/provider-catalog.js +8 -0
  18. package/dist/provider-discovery.js +1 -0
  19. package/dist/provider.js +17 -2
  20. package/dist/{rate-limit-cache-N66I-Rd7.js → rate-limit-cache-C7qmZ0Jh.js} +2 -0
  21. package/dist/{request-CPtFWp-f.js → request-D64BfplD.js} +16 -4
  22. package/dist/{run-attempt-DM53zFlW.js → run-attempt-B_6VkFQN.js} +432 -35
  23. package/dist/{sandbox-guard-DMCJlzmz.js → sandbox-guard-C-Yv9uwY.js} +5 -0
  24. package/dist/{session-binding-DWiEGATW.js → session-binding-BgTv_YGm.js} +13 -2
  25. package/dist/{shared-client-DUWLidr5.js → shared-client-xytpSKD0.js} +92 -5
  26. package/dist/{side-question-dIZf9RBV.js → side-question-BEpALo9c.js} +10 -10
  27. package/dist/{thread-lifecycle-6nrEQZMV.js → thread-lifecycle-BJsazZ8j.js} +79 -46
  28. package/npm-shrinkwrap.json +2 -2
  29. package/openclaw.plugin.json +1 -1
  30. package/package.json +4 -4
  31. package/dist/client-factory-3ykiiX2z.js +0 -20
@@ -0,0 +1,17 @@
1
+ //#region extensions/codex/src/app-server/client-factory.ts
2
+ let sharedClientModulePromise = null;
3
+ const loadSharedClientModule = async () => {
4
+ sharedClientModulePromise ??= import("./shared-client-xytpSKD0.js").then((n) => n.c);
5
+ return await sharedClientModulePromise;
6
+ };
7
+ /** Returns a leased shared client so startup can release ownership explicitly. */
8
+ const defaultLeasedCodexAppServerClientFactory = (startOptions, authProfileId, agentDir, config, options) => loadSharedClientModule().then(({ getLeasedSharedCodexAppServerClient }) => getLeasedSharedCodexAppServerClient({
9
+ startOptions,
10
+ authProfileId,
11
+ agentDir,
12
+ config,
13
+ onStartedClient: options?.onStartedClient,
14
+ abandonSignal: options?.abandonSignal
15
+ }));
16
+ //#endregion
17
+ export { defaultLeasedCodexAppServerClientFactory as t };
@@ -1,4 +1,4 @@
1
- import { d as resolveCodexAppServerRuntimeOptions } from "./config-AlzuNKCY.js";
1
+ import { l as resolveCodexAppServerRuntimeOptions } from "./config-BT6SLiE6.js";
2
2
  import { materializeWindowsSpawnProgram, resolveWindowsSpawnProgram } from "openclaw/plugin-sdk/windows-spawn";
3
3
  import { OPENCLAW_VERSION, embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
4
4
  import { createInterface } from "node:readline";
@@ -15,6 +15,10 @@ function isRpcResponse(message) {
15
15
  }
16
16
  //#endregion
17
17
  //#region extensions/codex/src/app-server/transport-stdio.ts
18
+ /**
19
+ * Creates and configures stdio-backed Codex app-server transports, including
20
+ * Windows spawn normalization and environment filtering.
21
+ */
18
22
  const UNSAFE_ENVIRONMENT_KEYS = new Set([
19
23
  "__proto__",
20
24
  "constructor",
@@ -25,6 +29,7 @@ const DEFAULT_SPAWN_RUNTIME = {
25
29
  env: process.env,
26
30
  execPath: process.execPath
27
31
  };
32
+ /** Resolves the concrete command/argv/shell settings used to spawn Codex app-server. */
28
33
  function resolveCodexAppServerSpawnInvocation(options, runtime = DEFAULT_SPAWN_RUNTIME) {
29
34
  if (options.commandSource === "managed") throw new Error("Managed Codex app-server start options must be resolved before spawn.");
30
35
  const resolved = materializeWindowsSpawnProgram(resolveWindowsSpawnProgram({
@@ -41,6 +46,7 @@ function resolveCodexAppServerSpawnInvocation(options, runtime = DEFAULT_SPAWN_R
41
46
  windowsHide: resolved.windowsHide
42
47
  };
43
48
  }
49
+ /** Merges app-server environment overrides while honoring clearEnv and unsafe key filtering. */
44
50
  function resolveCodexAppServerSpawnEnv(options, baseEnv = process.env, platform = process.platform) {
45
51
  const env = Object.create(null);
46
52
  copySafeEnvironmentEntries(env, baseEnv);
@@ -66,6 +72,7 @@ function copySafeEnvironmentEntries(target, source) {
66
72
  target[key] = value;
67
73
  }
68
74
  }
75
+ /** Spawns the Codex app-server process and returns the shared transport interface. */
69
76
  function createStdioTransport(options) {
70
77
  const env = resolveCodexAppServerSpawnEnv(options);
71
78
  const invocation = resolveCodexAppServerSpawnInvocation(options, {
@@ -87,6 +94,11 @@ function createStdioTransport(options) {
87
94
  }
88
95
  //#endregion
89
96
  //#region extensions/codex/src/app-server/transport-websocket.ts
97
+ /**
98
+ * Adapts a remote Codex app-server WebSocket endpoint to the shared stdio-like
99
+ * transport interface.
100
+ */
101
+ /** Opens a WebSocket app-server transport and maps newline-delimited frames to stdout/stdin. */
90
102
  function createWebSocketTransport(options) {
91
103
  if (!options.url) throw new Error("codex app-server websocket transport requires plugins.entries.codex.config.appServer.url");
92
104
  const events = new EventEmitter();
@@ -152,6 +164,7 @@ function websocketFrameToText(data) {
152
164
  }
153
165
  //#endregion
154
166
  //#region extensions/codex/src/app-server/transport.ts
167
+ /** Starts graceful transport shutdown and schedules a force kill fallback. */
155
168
  function closeCodexAppServerTransport(child, options = {}) {
156
169
  child.stdin.end?.();
157
170
  child.stdin.destroy?.();
@@ -171,6 +184,7 @@ function closeCodexAppServerTransport(child, options = {}) {
171
184
  child.stderr.unref?.();
172
185
  child.stdin.unref?.();
173
186
  }
187
+ /** Closes a transport and waits briefly for an exit event. */
174
188
  async function closeCodexAppServerTransportAndWait(child, options = {}) {
175
189
  if (!hasCodexAppServerTransportExited(child)) closeCodexAppServerTransport(child, options);
176
190
  return await waitForCodexAppServerTransportExit(child, options.exitTimeoutMs ?? 2e3);
@@ -206,17 +220,28 @@ function signalCodexAppServerTransport(child, signal) {
206
220
  }
207
221
  //#endregion
208
222
  //#region extensions/codex/src/app-server/version.ts
223
+ /**
224
+ * Version and package pins for the managed Codex app-server runtime.
225
+ */
226
+ /** Minimum Codex app-server version supported by the OpenClaw Codex bridge. */
209
227
  const MIN_CODEX_APP_SERVER_VERSION = "0.125.0";
228
+ /** Minimum Codex app-server version that supports sandbox exec-server environments. */
210
229
  const MIN_CODEX_SANDBOX_EXEC_SERVER_APP_SERVER_VERSION = "0.132.0";
230
+ /** npm package name for the managed Codex app-server binary. */
211
231
  const MANAGED_CODEX_APP_SERVER_PACKAGE = "@openai/codex";
212
232
  //#endregion
213
233
  //#region extensions/codex/src/app-server/client.ts
234
+ /**
235
+ * JSON-RPC client for Codex app-server transports, including request/response
236
+ * routing, notification fanout, server request handlers, and version checks.
237
+ */
214
238
  const CODEX_APP_SERVER_PARSE_LOG_MAX = 500;
215
239
  const CODEX_APP_SERVER_PARSE_BUFFER_MAX = 1e6;
216
240
  const CODEX_APP_SERVER_PARSE_BUFFER_MAX_LINES = 1e3;
217
241
  const CODEX_DYNAMIC_TOOL_SERVER_REQUEST_TIMEOUT_MS = 6e5;
218
242
  const CODEX_APP_SERVER_STDERR_TAIL_MAX = 2e3;
219
243
  const UNPAIRED_SURROGATE_RE = /[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g;
244
+ /** RPC error wrapper that preserves app-server error code and data. */
220
245
  var CodexAppServerRpcError = class extends Error {
221
246
  constructor(error, method) {
222
247
  super(formatCodexAppServerRpcErrorMessage(error, method));
@@ -241,10 +266,12 @@ function readCodexAppServerRpcReloginDetail(data) {
241
266
  function isJsonObject(value) {
242
267
  return Boolean(value && typeof value === "object" && !Array.isArray(value));
243
268
  }
269
+ /** Returns true for errors that mean the app-server transport is closed. */
244
270
  function isCodexAppServerConnectionClosedError(error) {
245
271
  if (!(error instanceof Error)) return false;
246
272
  return error.message === "codex app-server client is closed" || error.message.startsWith("codex app-server exited:");
247
273
  }
274
+ /** Stateful app-server JSON-RPC client over stdio or websocket transport. */
248
275
  var CodexAppServerClient = class CodexAppServerClient {
249
276
  constructor(child) {
250
277
  this.pending = /* @__PURE__ */ new Map();
@@ -270,6 +297,7 @@ var CodexAppServerClient = class CodexAppServerClient {
270
297
  });
271
298
  child.stdin.on?.("error", (error) => this.closeWithError(error instanceof Error ? error : new Error(String(error))));
272
299
  }
300
+ /** Starts a new app-server client using resolved runtime start options. */
273
301
  static start(options) {
274
302
  const defaults = resolveCodexAppServerRuntimeOptions().start;
275
303
  const startOptions = {
@@ -281,9 +309,11 @@ var CodexAppServerClient = class CodexAppServerClient {
281
309
  if (startOptions.transport === "websocket") return new CodexAppServerClient(createWebSocketTransport(startOptions));
282
310
  return new CodexAppServerClient(createStdioTransport(startOptions));
283
311
  }
312
+ /** Builds a client around a fake transport for tests. */
284
313
  static fromTransportForTests(child) {
285
314
  return new CodexAppServerClient(child);
286
315
  }
316
+ /** Performs the app-server initialize handshake and validates protocol version. */
287
317
  async initialize() {
288
318
  if (this.initialized) return;
289
319
  const response = await this.request("initialize", {
@@ -298,6 +328,7 @@ var CodexAppServerClient = class CodexAppServerClient {
298
328
  this.notify("initialized");
299
329
  this.initialized = true;
300
330
  }
331
+ /** Returns the version detected during initialize. */
301
332
  getServerVersion() {
302
333
  return this.serverVersion;
303
334
  }
@@ -361,34 +392,42 @@ var CodexAppServerClient = class CodexAppServerClient {
361
392
  }
362
393
  });
363
394
  }
395
+ /** Sends a fire-and-forget JSON-RPC notification to the app-server. */
364
396
  notify(method, params) {
365
397
  this.writeMessage({
366
398
  method,
367
399
  params
368
400
  });
369
401
  }
402
+ /** Registers a handler for app-server requests sent back to OpenClaw. */
370
403
  addRequestHandler(handler) {
371
404
  this.requestHandlers.add(handler);
372
405
  return () => this.requestHandlers.delete(handler);
373
406
  }
407
+ /** Registers a notification handler and returns its disposer. */
374
408
  addNotificationHandler(handler) {
375
409
  this.notificationHandlers.add(handler);
376
410
  return () => this.notificationHandlers.delete(handler);
377
411
  }
412
+ /** Installs a lease-count provider used to route unscoped notifications. */
378
413
  setActiveSharedLeaseCountProviderForUnscopedNotifications(provider) {
379
414
  this.activeSharedLeaseCountProvider = provider;
380
415
  }
416
+ /** Reads the active shared-client lease count when available. */
381
417
  getActiveSharedLeaseCountForUnscopedNotifications() {
382
418
  return this.activeSharedLeaseCountProvider?.();
383
419
  }
420
+ /** Registers a close handler and returns its disposer. */
384
421
  addCloseHandler(handler) {
385
422
  this.closeHandlers.add(handler);
386
423
  return () => this.closeHandlers.delete(handler);
387
424
  }
425
+ /** Closes the transport without waiting for process/socket shutdown. */
388
426
  close() {
389
427
  if (!this.markClosed(/* @__PURE__ */ new Error("codex app-server client is closed"))) return;
390
428
  closeCodexAppServerTransport(this.child);
391
429
  }
430
+ /** Closes the transport and waits for shutdown according to transport policy. */
392
431
  async closeAndWait(options) {
393
432
  this.markClosed(/* @__PURE__ */ new Error("codex app-server client is closed"));
394
433
  await closeCodexAppServerTransportAndWait(this.child, options);
@@ -600,9 +639,11 @@ function assertSupportedCodexAppServerVersion(response) {
600
639
  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.`);
601
640
  return detectedVersion;
602
641
  }
642
+ /** Extracts the Codex version from the app-server initialize user-agent field. */
603
643
  function readCodexVersionFromUserAgent(userAgent) {
604
644
  return (userAgent?.match(/^[^/]+\/(\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?)(?:[\s(]|$)/))?.[1];
605
645
  }
646
+ /** Compares stable Codex app-server versions for protocol floor checks. */
606
647
  function compareCodexAppServerVersions(left, right) {
607
648
  const leftVersion = parseVersionForComparison(left);
608
649
  const rightVersion = parseVersionForComparison(right);
@@ -660,6 +701,7 @@ const CODEX_APP_SERVER_APPROVAL_REQUEST_METHODS = new Set([
660
701
  "item/fileChange/requestApproval",
661
702
  "item/permissions/requestApproval"
662
703
  ]);
704
+ /** Returns true for app-server approval request methods OpenClaw can answer. */
663
705
  function isCodexAppServerApprovalRequest(method) {
664
706
  return CODEX_APP_SERVER_APPROVAL_REQUEST_METHODS.has(method);
665
707
  }
@@ -1,13 +1,13 @@
1
- import { d as resolveCodexAppServerRuntimeOptions, o as isCodexFastServiceTier } from "./config-AlzuNKCY.js";
2
- import { n as listCodexAppServerModels, t as listAllCodexAppServerModels } from "./models-DAJvlyJu.js";
3
- import { l as isJsonObject } from "./client-BnOmn0y-.js";
4
- import { a as readCodexAppServerBinding, s as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-DWiEGATW.js";
5
- import { i as describeControlFailure, r as CODEX_CONTROL_METHODS, t as requestCodexAppServerJson } from "./request-CPtFWp-f.js";
6
- import { a as buildHelp, c as formatCodexStatus, d as formatModels, f as formatSkills, l as formatComputerUseStatus, m as readString$1, o as formatAccount, p as formatThreads, s as formatCodexDisplayText, u as formatList, v as summarizeCodexAccountUsage } from "./notification-correlation-BykOI_jh.js";
7
- import { n as resolveCodexNativeExecutionBlock, r as resolveCodexNativeSandboxBlock } from "./sandbox-guard-DMCJlzmz.js";
8
- 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-CqVPKJPp.js";
9
- import { n as installCodexComputerUse, r as readCodexComputerUseStatus } from "./computer-use-DYLSxIfq.js";
10
- import { n as rememberCodexRateLimits } from "./rate-limit-cache-N66I-Rd7.js";
1
+ import { a as isCodexFastServiceTier, l as resolveCodexAppServerRuntimeOptions } from "./config-BT6SLiE6.js";
2
+ import { n as listCodexAppServerModels, t as listAllCodexAppServerModels } from "./models-DXorTaja.js";
3
+ import { l as isJsonObject } from "./client-kMCtlApt.js";
4
+ import { a as readCodexAppServerBinding, s as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-BgTv_YGm.js";
5
+ import { i as describeControlFailure, r as CODEX_CONTROL_METHODS, t as requestCodexAppServerJson } from "./request-D64BfplD.js";
6
+ import { a as buildHelp, c as formatCodexStatus, d as formatModels, f as formatSkills, l as formatComputerUseStatus, m as readString$1, o as formatAccount, p as formatThreads, s as formatCodexDisplayText, u as formatList, v as summarizeCodexAccountUsage } from "./notification-correlation-o8quHmTK.js";
7
+ import { n as resolveCodexNativeExecutionBlock, r as resolveCodexNativeSandboxBlock } from "./sandbox-guard-C-Yv9uwY.js";
8
+ 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-CzpvaBs1.js";
9
+ import { n as installCodexComputerUse, r as readCodexComputerUseStatus } from "./computer-use-ClweWaMz.js";
10
+ import { n as rememberCodexRateLimits } from "./rate-limit-cache-C7qmZ0Jh.js";
11
11
  import { parseStrictPositiveInteger } from "openclaw/plugin-sdk/number-runtime";
12
12
  import crypto from "node:crypto";
13
13
  import { normalizeOptionalString, normalizeUniqueStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -1,10 +1,18 @@
1
- import { d as resolveCodexAppServerRuntimeOptions } from "./config-AlzuNKCY.js";
2
- import { a as readCodexAppServerBinding } from "./session-binding-DWiEGATW.js";
3
- import { n as resolveCodexNativeExecutionBlock } from "./sandbox-guard-DMCJlzmz.js";
4
- import { t as defaultCodexAppServerClientFactory } from "./client-factory-3ykiiX2z.js";
1
+ import { l as resolveCodexAppServerRuntimeOptions } from "./config-BT6SLiE6.js";
2
+ import { a as readCodexAppServerBinding } from "./session-binding-BgTv_YGm.js";
3
+ import { o as releaseLeasedSharedCodexAppServerClient } from "./shared-client-xytpSKD0.js";
4
+ import { n as resolveCodexNativeExecutionBlock } from "./sandbox-guard-C-Yv9uwY.js";
5
+ import { t as defaultLeasedCodexAppServerClientFactory } from "./client-factory-Bt49r45B.js";
5
6
  import { embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
6
7
  //#region extensions/codex/src/app-server/compact.ts
8
+ /**
9
+ * Native Codex app-server compaction bridge for bound OpenClaw sessions.
10
+ */
7
11
  const warnedIgnoredCompactionOverrides = /* @__PURE__ */ new Set();
12
+ /**
13
+ * Starts native Codex compaction for a manually requested bound session, or
14
+ * reports why Codex-owned automatic compaction should handle the trigger.
15
+ */
8
16
  async function maybeCompactCodexAppServerSession(params, options = {}) {
9
17
  warnIfIgnoringOpenClawCompactionOverrides(params);
10
18
  return compactCodexNativeThread(params, options);
@@ -109,7 +117,8 @@ async function compactCodexNativeThread(params, options = {}) {
109
117
  compacted: false,
110
118
  reason: "auth profile mismatch for session binding"
111
119
  };
112
- const client = await (options.clientFactory ?? defaultCodexAppServerClientFactory)(appServer.start, requestedAuthProfileId ?? binding.authProfileId, params.agentDir, params.config);
120
+ const shouldReleaseDefaultLease = !options.clientFactory;
121
+ const client = await (options.clientFactory ?? defaultLeasedCodexAppServerClientFactory)(appServer.start, requestedAuthProfileId ?? binding.authProfileId, params.agentDir, params.config);
113
122
  try {
114
123
  await client.request("thread/compact/start", { threadId: binding.threadId });
115
124
  embeddedAgentLog.info("started codex app-server compaction", {
@@ -133,6 +142,8 @@ async function compactCodexNativeThread(params, options = {}) {
133
142
  compacted: false,
134
143
  reason: formatCompactionError(error)
135
144
  };
145
+ } finally {
146
+ if (shouldReleaseDefaultLease) releaseLeasedSharedCodexAppServerClient(client);
136
147
  }
137
148
  const resultDetails = {
138
149
  backend: "codex-app-server",
@@ -1,7 +1,11 @@
1
- import { d as resolveCodexAppServerRuntimeOptions, f as resolveCodexComputerUseConfig } from "./config-AlzuNKCY.js";
2
- import { i as describeControlFailure, t as requestCodexAppServerJson } from "./request-CPtFWp-f.js";
1
+ import { l as resolveCodexAppServerRuntimeOptions, u as resolveCodexComputerUseConfig } from "./config-BT6SLiE6.js";
2
+ import { i as describeControlFailure, t as requestCodexAppServerJson } from "./request-D64BfplD.js";
3
3
  import { existsSync } from "node:fs";
4
4
  //#region extensions/codex/src/app-server/computer-use.ts
5
+ /**
6
+ * Computer Use plugin/MCP readiness checks and optional install flow for Codex
7
+ * app-server sessions.
8
+ */
5
9
  var CodexComputerUseSetupError = class extends Error {
6
10
  constructor(status) {
7
11
  super(status.message);
@@ -16,6 +20,7 @@ const COMPUTER_USE_MARKETPLACE_NAME_PRIORITY = [
16
20
  "local"
17
21
  ];
18
22
  const DEFAULT_CODEX_BUNDLED_MARKETPLACE_PATH = "/Applications/Codex.app/Contents/Resources/plugins/openai-bundled";
23
+ /** Reads Computer Use readiness without installing or mutating app-server state. */
19
24
  async function readCodexComputerUseStatus(params = {}) {
20
25
  const config = resolveComputerUseConfig(params);
21
26
  if (!config.enabled) return disabledStatus(config);
@@ -29,6 +34,10 @@ async function readCodexComputerUseStatus(params = {}) {
29
34
  return unavailableStatus(config, "check_failed", `Computer Use check failed: ${describeControlFailure(error)}`);
30
35
  }
31
36
  }
37
+ /**
38
+ * Ensures Computer Use is ready when enabled, optionally installing when config
39
+ * allows safe auto-install.
40
+ */
32
41
  async function ensureCodexComputerUse(params = {}) {
33
42
  const config = resolveComputerUseConfig(params);
34
43
  if (!config.enabled) return disabledStatus(config);
@@ -52,6 +61,7 @@ async function ensureCodexComputerUse(params = {}) {
52
61
  if (!status.ready) throw new CodexComputerUseSetupError(status);
53
62
  return status;
54
63
  }
64
+ /** Forces Computer Use plugin installation and returns the ready status. */
55
65
  async function installCodexComputerUse(params = {}) {
56
66
  const config = resolveComputerUseConfig({
57
67
  ...params,
@@ -13,15 +13,7 @@ const START_OPTIONS_KEY_SECRET = getStartOptionsKeySecret();
13
13
  const UNIX_CODEX_REQUIREMENTS_PATH = "/etc/codex/requirements.toml";
14
14
  const WINDOWS_CODEX_REQUIREMENTS_SUFFIX = "\\OpenAI\\Codex\\requirements.toml";
15
15
  const PLAIN_DECIMAL_NUMBER_RE = /^[+-]?(?:(?:\d+\.?\d*)|(?:\.\d+))$/;
16
- const CODEX_PLUGINS_MARKETPLACE_NAMES = [
17
- "openai-curated",
18
- "openai-bundled",
19
- "openai-primary-runtime"
20
- ];
21
16
  const CODEX_PLUGINS_MARKETPLACE_NAME = "openai-curated";
22
- function isCodexPluginsMarketplaceName(name) {
23
- return name !== void 0 && CODEX_PLUGINS_MARKETPLACE_NAMES.includes(name);
24
- }
25
17
  function shouldAutoApproveCodexAppServerApprovals(appServer) {
26
18
  return appServer.approvalPolicy === "never" && appServer.sandbox === "danger-full-access";
27
19
  }
@@ -51,7 +43,7 @@ const codexAppServerServiceTierSchema = z.preprocess((value) => value === null ?
51
43
  const codexAppServerExperimentalSchema = z.object({ sandboxExecServer: z.boolean().optional() }).strict();
52
44
  const codexPluginEntryConfigSchema = z.object({
53
45
  enabled: z.boolean().optional(),
54
- marketplaceName: z.enum(CODEX_PLUGINS_MARKETPLACE_NAMES).optional(),
46
+ marketplaceName: z.literal(CODEX_PLUGINS_MARKETPLACE_NAME).optional(),
55
47
  pluginName: z.string().trim().min(1).optional(),
56
48
  allow_destructive_actions: z.boolean().optional()
57
49
  }).strict();
@@ -130,10 +122,10 @@ function resolveCodexPluginsPolicy(pluginConfig) {
130
122
  enabled,
131
123
  allowDestructiveActions,
132
124
  pluginPolicies: Object.entries(config?.plugins ?? {}).flatMap(([configKey, entry]) => {
133
- if (!isCodexPluginsMarketplaceName(entry.marketplaceName) || !entry.pluginName) return [];
125
+ if (entry.marketplaceName !== "openai-curated" || !entry.pluginName) return [];
134
126
  return [{
135
127
  configKey,
136
- marketplaceName: entry.marketplaceName,
128
+ marketplaceName: CODEX_PLUGINS_MARKETPLACE_NAME,
137
129
  pluginName: entry.pluginName,
138
130
  enabled: enabled && entry.enabled !== false,
139
131
  allowDestructiveActions: entry.allow_destructive_actions ?? allowDestructiveActions
@@ -765,4 +757,4 @@ function splitShellWords(value) {
765
757
  return words;
766
758
  }
767
759
  //#endregion
768
- export { isCodexAppServerApprovalPolicyAllowedByRequirements as a, isCodexSandboxExecServerEnabled as c, resolveCodexAppServerRuntimeOptions as d, resolveCodexComputerUseConfig as f, withMcpElicitationsApprovalPolicy as g, shouldAutoApproveCodexAppServerApprovals as h, codexSandboxPolicyForTurn as i, normalizeCodexServiceTier as l, resolveOpenClawExecPolicyForCodexAppServer as m, CODEX_PLUGINS_MARKETPLACE_NAMES as n, isCodexFastServiceTier as o, resolveCodexPluginsPolicy as p, codexAppServerStartOptionsKey as r, isCodexPluginsMarketplaceName as s, CODEX_PLUGINS_MARKETPLACE_NAME as t, readCodexPluginConfig as u };
760
+ export { isCodexFastServiceTier as a, readCodexPluginConfig as c, resolveCodexPluginsPolicy as d, resolveOpenClawExecPolicyForCodexAppServer as f, isCodexAppServerApprovalPolicyAllowedByRequirements as i, resolveCodexAppServerRuntimeOptions as l, withMcpElicitationsApprovalPolicy as m, codexAppServerStartOptionsKey as n, isCodexSandboxExecServerEnabled as o, shouldAutoApproveCodexAppServerApprovals as p, codexSandboxPolicyForTurn as r, normalizeCodexServiceTier as s, CODEX_PLUGINS_MARKETPLACE_NAME as t, resolveCodexComputerUseConfig as u };
@@ -1,11 +1,11 @@
1
- import { d as resolveCodexAppServerRuntimeOptions, i as codexSandboxPolicyForTurn, m as resolveOpenClawExecPolicyForCodexAppServer, o as isCodexFastServiceTier } from "./config-AlzuNKCY.js";
2
- import { l as isJsonObject } from "./client-BnOmn0y-.js";
3
- import { t as CODEX_NATIVE_PERSONALITY_NONE } from "./thread-lifecycle-6nrEQZMV.js";
4
- import { a as readCodexAppServerBinding, i as normalizeCodexAppServerBindingModelProvider, r as isCodexAppServerNativeAuthProfile, s as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-DWiEGATW.js";
5
- import { r as CODEX_CONTROL_METHODS } from "./request-CPtFWp-f.js";
6
- import { i as readCodexNotificationTurnId, r as readCodexNotificationThreadId, s as formatCodexDisplayText } from "./notification-correlation-BykOI_jh.js";
7
- import { a as releaseLeasedSharedCodexAppServerClient, f as resolveCodexAppServerAuthProfileIdForAgent, i as getLeasedSharedCodexAppServerClient } from "./shared-client-DUWLidr5.js";
8
- import { n as resolveCodexNativeExecutionBlock, r as resolveCodexNativeSandboxBlock } from "./sandbox-guard-DMCJlzmz.js";
1
+ import { a as isCodexFastServiceTier, f as resolveOpenClawExecPolicyForCodexAppServer, l as resolveCodexAppServerRuntimeOptions, r as codexSandboxPolicyForTurn } from "./config-BT6SLiE6.js";
2
+ import { l as isJsonObject } from "./client-kMCtlApt.js";
3
+ import { t as CODEX_NATIVE_PERSONALITY_NONE } from "./thread-lifecycle-BJsazZ8j.js";
4
+ import { a as readCodexAppServerBinding, i as normalizeCodexAppServerBindingModelProvider, r as isCodexAppServerNativeAuthProfile, s as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-BgTv_YGm.js";
5
+ import { r as CODEX_CONTROL_METHODS } from "./request-D64BfplD.js";
6
+ import { i as readCodexNotificationTurnId, r as readCodexNotificationThreadId, s as formatCodexDisplayText } from "./notification-correlation-o8quHmTK.js";
7
+ import { a as getLeasedSharedCodexAppServerClient, o as releaseLeasedSharedCodexAppServerClient, p as resolveCodexAppServerAuthProfileIdForAgent } from "./shared-client-xytpSKD0.js";
8
+ import { n as resolveCodexNativeExecutionBlock, r as resolveCodexNativeSandboxBlock } from "./sandbox-guard-C-Yv9uwY.js";
9
9
  import { resolveTimerTimeoutMs, timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
10
10
  import os from "node:os";
11
11
  import { loadExecApprovals } from "openclaw/plugin-sdk/exec-approvals-runtime";
@@ -5,6 +5,7 @@ function asRecord(value) {
5
5
  function hasRetiredDynamicToolsProfile(value) {
6
6
  return Object.hasOwn(asRecord(value) ?? {}, "codexDynamicToolsProfile");
7
7
  }
8
+ /** Legacy Codex config keys that doctor should report or repair. */
8
9
  const legacyConfigRules = [{
9
10
  path: [
10
11
  "plugins",
@@ -15,6 +16,9 @@ const legacyConfigRules = [{
15
16
  message: "plugins.entries.codex.config.codexDynamicToolsProfile is retired; Codex app-server always keeps Codex-native workspace tools native. Run \"openclaw doctor --fix\".",
16
17
  match: hasRetiredDynamicToolsProfile
17
18
  }];
19
+ /**
20
+ * Removes retired Codex plugin config keys while preserving unrelated config.
21
+ */
18
22
  function normalizeCompatibilityConfig({ cfg }) {
19
23
  const rawPluginConfig = asRecord(asRecord(cfg.plugins?.entries?.codex)?.config);
20
24
  if (!rawPluginConfig || !hasRetiredDynamicToolsProfile(rawPluginConfig)) return {
@@ -33,6 +37,7 @@ function normalizeCompatibilityConfig({ cfg }) {
33
37
  changes: ["Removed retired plugins.entries.codex.config.codexDynamicToolsProfile; Codex app-server always keeps Codex-native workspace tools native."]
34
38
  };
35
39
  }
40
+ /** Session/auth ownership metadata used by doctor route-state checks. */
36
41
  const sessionRouteStateOwners = [{
37
42
  id: "codex",
38
43
  label: "Codex",
package/dist/harness.js CHANGED
@@ -9,6 +9,10 @@ const CODEX_APP_SERVER_CONTEXT_ENGINE_HOST_CAPABILITIES = [
9
9
  "runtime-llm-complete",
10
10
  "thread-bootstrap-projection"
11
11
  ];
12
+ /**
13
+ * Creates the Codex app-server harness used for attempts, side questions,
14
+ * compaction, reset, and disposal.
15
+ */
12
16
  function createCodexAppServerAgentHarness(options) {
13
17
  const providerIds = new Set([...options?.providerIds ?? DEFAULT_CODEX_HARNESS_PROVIDER_IDS].map((id) => id.trim().toLowerCase()));
14
18
  return {
@@ -28,31 +32,31 @@ function createCodexAppServerAgentHarness(options) {
28
32
  };
29
33
  },
30
34
  runAttempt: async (params) => {
31
- const { runCodexAppServerAttempt } = await import("./run-attempt-DM53zFlW.js");
35
+ const { runCodexAppServerAttempt } = await import("./run-attempt-B_6VkFQN.js");
32
36
  return runCodexAppServerAttempt(params, {
33
37
  pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
34
38
  nativeHookRelay: { enabled: true }
35
39
  });
36
40
  },
37
41
  runSideQuestion: async (params) => {
38
- const { runCodexAppServerSideQuestion } = await import("./side-question-dIZf9RBV.js");
42
+ const { runCodexAppServerSideQuestion } = await import("./side-question-BEpALo9c.js");
39
43
  return runCodexAppServerSideQuestion(params, {
40
44
  pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
41
45
  nativeHookRelay: { enabled: true }
42
46
  });
43
47
  },
44
48
  compact: async (params) => {
45
- const { maybeCompactCodexAppServerSession } = await import("./compact-D1dSrNrT.js");
49
+ const { maybeCompactCodexAppServerSession } = await import("./compact-CwnPeYnM.js");
46
50
  return maybeCompactCodexAppServerSession(params, { pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig });
47
51
  },
48
52
  reset: async (params) => {
49
53
  if (params.sessionFile) {
50
- const { clearCodexAppServerBinding } = await import("./session-binding-DWiEGATW.js").then((n) => n.o);
54
+ const { clearCodexAppServerBinding } = await import("./session-binding-BgTv_YGm.js").then((n) => n.o);
51
55
  await clearCodexAppServerBinding(params.sessionFile);
52
56
  }
53
57
  },
54
58
  dispose: async () => {
55
- const { clearSharedCodexAppServerClientAndWait } = await import("./shared-client-DUWLidr5.js").then((n) => n.s);
59
+ const { clearSharedCodexAppServerClientAndWait } = await import("./shared-client-xytpSKD0.js").then((n) => n.c);
56
60
  await clearSharedCodexAppServerClientAndWait();
57
61
  }
58
62
  };
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { createCodexAppServerAgentHarness } from "./harness.js";
2
- import { d as resolveCodexAppServerRuntimeOptions, s as isCodexPluginsMarketplaceName, t as CODEX_PLUGINS_MARKETPLACE_NAME, u as readCodexPluginConfig } from "./config-AlzuNKCY.js";
2
+ import { c as readCodexPluginConfig, l as resolveCodexAppServerRuntimeOptions, t as CODEX_PLUGINS_MARKETPLACE_NAME } from "./config-BT6SLiE6.js";
3
3
  import { buildCodexProvider } from "./provider.js";
4
- import { v as ensureCodexPluginActivation, x as defaultCodexAppInventoryCache, y as pluginReadParams } from "./thread-lifecycle-6nrEQZMV.js";
4
+ import { v as ensureCodexPluginActivation, x as defaultCodexAppInventoryCache, y as pluginReadParams } from "./thread-lifecycle-BJsazZ8j.js";
5
5
  import { buildCodexMediaUnderstandingProvider } from "./media-understanding-provider.js";
6
- import { i as describeControlFailure, n as buildCodexPluginAppCacheKey, t as requestCodexAppServerJson } from "./request-CPtFWp-f.js";
7
- import { s as formatCodexDisplayText } from "./notification-correlation-BykOI_jh.js";
8
- import { a as releaseLeasedSharedCodexAppServerClient, f as resolveCodexAppServerAuthProfileIdForAgent, i as getLeasedSharedCodexAppServerClient, n as clearSharedCodexAppServerClientIfCurrentAndWait, p as resolveCodexAppServerFallbackApiKeyCacheKey, u as resolveCodexAppServerAuthAccountCacheKey } from "./shared-client-DUWLidr5.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-CqVPKJPp.js";
6
+ import { i as describeControlFailure, n as buildCodexPluginAppCacheKey, t as requestCodexAppServerJson } from "./request-D64BfplD.js";
7
+ import { s as formatCodexDisplayText } from "./notification-correlation-o8quHmTK.js";
8
+ import { a as getLeasedSharedCodexAppServerClient, d as resolveCodexAppServerAuthAccountCacheKey, m as resolveCodexAppServerFallbackApiKeyCacheKey, o as releaseLeasedSharedCodexAppServerClient, p as resolveCodexAppServerAuthProfileIdForAgent, r as clearSharedCodexAppServerClientIfCurrentAndWait } from "./shared-client-xytpSKD0.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-CzpvaBs1.js";
10
10
  import { mutateConfigFile } from "openclaw/plugin-sdk/config-mutation";
11
11
  import { resolveLivePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
12
12
  import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
@@ -22,6 +22,7 @@ import { archiveMigrationItem, copyMigrationFileItem, withCachedMigrationConfigR
22
22
  import { applyAuthProfileConfig, buildApiKeyCredential, buildOauthProviderAuthResult, buildOpenAICodexCredentialExtra, readCodexCliCredentialsCached, resolveOpenAICodexAuthIdentity, resolveOpenAICodexImportProfileName, updateAuthProfileStoreWithLock } from "openclaw/plugin-sdk/provider-auth";
23
23
  import { readJsonFileWithFallback } from "openclaw/plugin-sdk/json-store";
24
24
  //#region extensions/codex/src/commands.ts
25
+ /** Creates the reserved `/codex` command definition exposed by the plugin. */
25
26
  function createCodexCommand(options) {
26
27
  return {
27
28
  name: "codex",
@@ -39,6 +40,7 @@ function createCodexCommand(options) {
39
40
  handler: (ctx) => handleCodexCommand(ctx, options)
40
41
  };
41
42
  }
43
+ /** Dispatches a `/codex` command to the subcommand handler and formats failures for chat. */
42
44
  async function handleCodexCommand(ctx, options = {}) {
43
45
  const { loadSubcommandHandler, ...subcommandOptions } = options;
44
46
  try {
@@ -48,7 +50,7 @@ async function handleCodexCommand(ctx, options = {}) {
48
50
  }
49
51
  }
50
52
  async function loadDefaultCodexSubcommandHandler() {
51
- const { handleCodexSubcommand } = await import("./command-handlers-VhJdcXcI.js");
53
+ const { handleCodexSubcommand } = await import("./command-handlers-DMn2M7W7.js");
52
54
  return handleCodexSubcommand;
53
55
  }
54
56
  //#endregion
@@ -1341,10 +1343,7 @@ async function requestTargetCodexAppServerJson(params) {
1341
1343
  function hasOpenAiCuratedMarketplace(response) {
1342
1344
  if (!response || typeof response !== "object" || !("marketplaces" in response)) return false;
1343
1345
  const marketplaces = response.marketplaces;
1344
- return Array.isArray(marketplaces) && marketplaces.some((marketplace) => {
1345
- if (!marketplace || typeof marketplace !== "object") return false;
1346
- return marketplace.name === "openai-curated";
1347
- });
1346
+ return Array.isArray(marketplaces) && marketplaces.some((marketplace) => marketplace && typeof marketplace === "object" && marketplace.name === "openai-curated");
1348
1347
  }
1349
1348
  function targetCodexMarketplaceDiscoveryTimeoutMs(env = process.env) {
1350
1349
  const configured = parseStrictNonNegativeInteger(env[TARGET_CODEX_MARKETPLACE_DISCOVERY_TIMEOUT_ENV]);
@@ -1423,10 +1422,10 @@ function readCodexPluginPolicy(item) {
1423
1422
  const configKey = item.details?.configKey;
1424
1423
  const marketplaceName = item.details?.marketplaceName;
1425
1424
  const pluginName = item.details?.pluginName;
1426
- if (typeof configKey !== "string" || typeof marketplaceName !== "string" || !isCodexPluginsMarketplaceName(marketplaceName) || typeof pluginName !== "string") return;
1425
+ if (typeof configKey !== "string" || marketplaceName !== "openai-curated" || typeof pluginName !== "string") return;
1427
1426
  return {
1428
1427
  configKey,
1429
- marketplaceName,
1428
+ marketplaceName: CODEX_PLUGINS_MARKETPLACE_NAME,
1430
1429
  pluginName,
1431
1430
  enabled: true,
1432
1431
  allowDestructiveActions: true
@@ -1,14 +1,22 @@
1
1
  import { CODEX_PROVIDER_ID, FALLBACK_CODEX_MODELS } from "./provider-catalog.js";
2
- import { d as resolveCodexAppServerRuntimeOptions } from "./config-AlzuNKCY.js";
3
- import { i as assertCodexTurnStartResponse, l as readCodexTurnCompletedNotification, o as readCodexErrorNotification, r as assertCodexThreadStartResponse } from "./protocol-validators-DIt7cXIp.js";
4
- import { i as readModelListResult } from "./models-DAJvlyJu.js";
5
- import { l as isJsonObject } from "./client-BnOmn0y-.js";
6
- import { r as buildCodexRuntimeThreadConfig } from "./thread-lifecycle-6nrEQZMV.js";
2
+ import { l as resolveCodexAppServerRuntimeOptions } from "./config-BT6SLiE6.js";
3
+ import { i as assertCodexTurnStartResponse, l as readCodexTurnCompletedNotification, o as readCodexErrorNotification, r as assertCodexThreadStartResponse } from "./protocol-validators-CIpP8IJ2.js";
4
+ import { i as readModelListResult } from "./models-DXorTaja.js";
5
+ import { l as isJsonObject } from "./client-kMCtlApt.js";
6
+ import { r as buildCodexRuntimeThreadConfig } from "./thread-lifecycle-BJsazZ8j.js";
7
7
  import { validateJsonSchemaValue } from "openclaw/plugin-sdk/json-schema-runtime";
8
8
  import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
9
9
  //#region extensions/codex/media-understanding-provider.ts
10
+ /**
11
+ * Codex-backed media understanding provider for bounded image description and
12
+ * structured extraction turns.
13
+ */
10
14
  const DEFAULT_CODEX_IMAGE_MODEL = FALLBACK_CODEX_MODELS.find((model) => model.inputModalities.includes("image"))?.id ?? FALLBACK_CODEX_MODELS[0]?.id;
11
15
  const DEFAULT_CODEX_IMAGE_PROMPT = "Describe the image.";
16
+ /**
17
+ * Builds the media-understanding provider that delegates image tasks to an
18
+ * isolated Codex app-server session.
19
+ */
12
20
  function buildCodexMediaUnderstandingProvider(options = {}) {
13
21
  return {
14
22
  id: CODEX_PROVIDER_ID,
@@ -64,7 +72,7 @@ async function runBoundedCodexVisionTurn(params) {
64
72
  const appServer = resolveCodexAppServerRuntimeOptions({ pluginConfig: params.options.pluginConfig });
65
73
  const timeoutMs = resolveTimerTimeoutMs(params.timeoutMs, 100, 100);
66
74
  const ownsClient = !params.options.clientFactory;
67
- const client = params.options.clientFactory ? await params.options.clientFactory(appServer.start, params.profile) : await import("./shared-client-DUWLidr5.js").then((n) => n.s).then(({ createIsolatedCodexAppServerClient }) => createIsolatedCodexAppServerClient({
75
+ const client = params.options.clientFactory ? await params.options.clientFactory(appServer.start, params.profile) : await import("./shared-client-xytpSKD0.js").then((n) => n.c).then(({ createIsolatedCodexAppServerClient }) => createIsolatedCodexAppServerClient({
68
76
  startOptions: appServer.start,
69
77
  timeoutMs,
70
78
  authProfileId: params.profile
@@ -1,18 +1,24 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { s as readCodexModelListResponse } from "./protocol-validators-DIt7cXIp.js";
2
+ import { s as readCodexModelListResponse } from "./protocol-validators-CIpP8IJ2.js";
3
3
  import { uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
4
4
  //#region extensions/codex/src/app-server/models.ts
5
+ /**
6
+ * Lists and normalizes models exposed by the Codex app-server `model/list`
7
+ * endpoint, including pagination and shared-client lease handling.
8
+ */
5
9
  var models_exports = /* @__PURE__ */ __exportAll({
6
10
  listAllCodexAppServerModels: () => listAllCodexAppServerModels,
7
11
  listCodexAppServerModels: () => listCodexAppServerModels,
8
12
  readModelListResult: () => readModelListResult
9
13
  });
14
+ /** Lists one Codex app-server model page using the configured auth/client options. */
10
15
  async function listCodexAppServerModels(options = {}) {
11
16
  return await withCodexAppServerModelClient(options, async ({ client, timeoutMs }) => requestModelListPage(client, {
12
17
  ...options,
13
18
  timeoutMs
14
19
  }));
15
20
  }
21
+ /** Walks Codex app-server model pages until exhaustion or the max-page guard. */
16
22
  async function listAllCodexAppServerModels(options = {}) {
17
23
  const maxPages = normalizeMaxPages(options.maxPages);
18
24
  return await withCodexAppServerModelClient(options, async ({ client, timeoutMs }) => {
@@ -40,7 +46,7 @@ async function listAllCodexAppServerModels(options = {}) {
40
46
  async function withCodexAppServerModelClient(options, run) {
41
47
  const timeoutMs = options.timeoutMs ?? 2500;
42
48
  const useSharedClient = options.sharedClient !== false;
43
- const { createIsolatedCodexAppServerClient, getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("./shared-client-DUWLidr5.js").then((n) => n.s);
49
+ const { createIsolatedCodexAppServerClient, getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("./shared-client-xytpSKD0.js").then((n) => n.c);
44
50
  const client = useSharedClient ? await getLeasedSharedCodexAppServerClient({
45
51
  startOptions: options.startOptions,
46
52
  timeoutMs,
@@ -71,6 +77,7 @@ async function requestModelListPage(client, options) {
71
77
  includeHidden: options.includeHidden ?? null
72
78
  }, { timeoutMs: options.timeoutMs }));
73
79
  }
80
+ /** Parses a raw Codex app-server model/list response into OpenClaw's normalized shape. */
74
81
  function readModelListResult(value) {
75
82
  const response = readCodexModelListResponse(value);
76
83
  if (!response) return { models: [] };