@openclaw/codex 2026.5.24-beta.2 → 2026.5.25-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 (26) hide show
  1. package/dist/{client-1sSy4p3z.js → client-SrtuTTVa.js} +10 -3
  2. package/dist/{client-factory-Bk6i4FnW.js → client-factory-A7DQkSLq.js} +1 -1
  3. package/dist/{command-handlers-CcTABuem.js → command-handlers-CLtPT37L.js} +10 -23
  4. package/dist/compact-acCua7zr.js +155 -0
  5. package/dist/{computer-use-Hdq1WgTA.js → computer-use-CVfE2Vfb.js} +2 -2
  6. package/dist/{config-DDMrwfJl.js → config-D6TUuyo2.js} +6 -3
  7. package/dist/{node-cli-sessions-9CAqnIaA.js → conversation-binding-B-GevkEb.js} +426 -434
  8. package/dist/{dynamic-tools-Bq717oJR.js → dynamic-tools-BXAE1U1-.js} +20 -11
  9. package/dist/harness.js +5 -5
  10. package/dist/index.js +451 -17
  11. package/dist/media-understanding-provider.js +7 -5
  12. package/dist/{models-DtGLkqMP.js → models-CC2IusQs.js} +3 -3
  13. package/dist/{notification-correlation-qKY_sgga.js → notification-correlation-D7tJW3FW.js} +26 -11
  14. package/dist/provider.js +3 -3
  15. package/dist/{request-D93E78SA.js → request-BO0z3vA8.js} +3 -3
  16. package/dist/{run-attempt-CT1N__qp.js → run-attempt-BjoI3hUJ.js} +279 -230
  17. package/dist/{session-binding-Bw_mfIW2.js → session-binding-CwNOIDP2.js} +1 -1
  18. package/dist/{shared-client-CFCUGEVs.js → shared-client-CZP1DjaN.js} +3 -4
  19. package/dist/{side-question-CYFMTA1O.js → side-question-Cb4COOQ9.js} +16 -11
  20. package/dist/test-api.js +3 -3
  21. package/dist/{thread-lifecycle-DGoaguJh.js → thread-lifecycle-CXMd9UgJ.js} +10 -12
  22. package/dist/{vision-tools-DOnxzH2y.js → vision-tools-CETeQgze.js} +16 -4
  23. package/npm-shrinkwrap.json +225 -238
  24. package/package.json +7 -7
  25. package/dist/compact-DnTgL6UT.js +0 -475
  26. package/dist/protocol-oeJQu4rs.js +0 -9
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { s as normalizeCodexServiceTier } from "./config-DDMrwfJl.js";
2
+ import { s as normalizeCodexServiceTier } from "./config-D6TUuyo2.js";
3
3
  import { embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
4
4
  import fs from "node:fs/promises";
5
5
  import { ensureAuthProfileStore, resolveDefaultAgentDir, resolveProviderIdForAuth } from "openclaw/plugin-sdk/agent-runtime";
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { l as resolveCodexAppServerRuntimeOptions, n as codexAppServerStartOptionsKey } from "./config-DDMrwfJl.js";
3
- import { c as resolveCodexAppServerSpawnEnv, o as MANAGED_CODEX_APP_SERVER_PACKAGE, t as CodexAppServerClient } from "./client-1sSy4p3z.js";
2
+ import { l as resolveCodexAppServerRuntimeOptions, n as codexAppServerStartOptionsKey } from "./config-D6TUuyo2.js";
3
+ import { c as resolveCodexAppServerSpawnEnv, o as MANAGED_CODEX_APP_SERVER_PACKAGE, t as CodexAppServerClient } from "./client-SrtuTTVa.js";
4
4
  import { createRequire } from "node:module";
5
5
  import { createHash } from "node:crypto";
6
6
  import { constants, readFileSync } from "node:fs";
@@ -233,8 +233,7 @@ async function resolveCodexAppServerAuthProfileLoginParamsInternal(params) {
233
233
  async function resolveCodexAppServerEnvApiKeyLoginParams(params) {
234
234
  const apiKey = readFirstNonEmptyEnv(params.env, CODEX_APP_SERVER_API_KEY_ENV_VARS);
235
235
  if (!apiKey) return;
236
- const response = await params.client.request("account/read", { refreshToken: false });
237
- if (response.account || !response.requiresOpenaiAuth) return;
236
+ if ((await params.client.request("account/read", { refreshToken: false })).account) return;
238
237
  return {
239
238
  type: "apiKey",
240
239
  apiKey
@@ -1,14 +1,13 @@
1
- import { c as readCodexPluginConfig, l as resolveCodexAppServerRuntimeOptions } from "./config-DDMrwfJl.js";
1
+ import { c as readCodexPluginConfig, f as shouldAutoApproveCodexAppServerApprovals, l as resolveCodexAppServerRuntimeOptions } from "./config-D6TUuyo2.js";
2
2
  import { a as readCodexDynamicToolCallParams, c as readCodexTurn, i as assertCodexTurnStartResponse, t as assertCodexThreadForkResponse } from "./protocol-validators-_gKDcd0x.js";
3
- import { t as isJsonObject } from "./protocol-oeJQu4rs.js";
4
- import { i as isCodexAppServerApprovalRequest } from "./client-1sSy4p3z.js";
5
- import { d as resolveCodexAppServerModelProvider, f as resolveReasoningEffort, g as mergeCodexThreadConfigs, n as buildCodexRuntimeThreadConfig } from "./thread-lifecycle-DGoaguJh.js";
6
- import { i as readCodexAppServerBinding } from "./session-binding-Bw_mfIW2.js";
7
- import { i as readCodexNotificationTurnId, m as formatCodexUsageLimitErrorMessage, r as readCodexNotificationThreadId } from "./notification-correlation-qKY_sgga.js";
8
- import { i as getSharedCodexAppServerClient, s as refreshCodexAppServerAuthTokens } from "./shared-client-CFCUGEVs.js";
3
+ import { i as isCodexAppServerApprovalRequest, l as isJsonObject } from "./client-SrtuTTVa.js";
4
+ import { _ as mergeCodexThreadConfigs, f as resolveCodexAppServerModelProvider, p as resolveReasoningEffort, r as buildCodexRuntimeThreadConfig, t as CODEX_NATIVE_PERSONALITY_NONE } from "./thread-lifecycle-CXMd9UgJ.js";
5
+ import { i as readCodexAppServerBinding } from "./session-binding-CwNOIDP2.js";
6
+ import { i as readCodexNotificationTurnId, m as formatCodexUsageLimitErrorMessage, r as readCodexNotificationThreadId } from "./notification-correlation-D7tJW3FW.js";
7
+ import { i as getSharedCodexAppServerClient, s as refreshCodexAppServerAuthTokens } from "./shared-client-CZP1DjaN.js";
9
8
  import { n as resolveCodexNativeExecutionBlock } from "./sandbox-guard-CTnEWuor.js";
10
- import { a as resolveCodexDynamicToolsLoading, n as filterCodexDynamicTools, t as createCodexDynamicToolBridge } from "./dynamic-tools-Bq717oJR.js";
11
- import { a as handleCodexAppServerElicitationRequest, c as emitDynamicToolTerminalDiagnostic, i as buildCodexNativeHookRelayDisabledConfig, l as handleCodexAppServerApprovalRequest, n as CODEX_NATIVE_HOOK_RELAY_EVENTS, o as emitDynamicToolErrorDiagnostic, r as buildCodexNativeHookRelayConfig, s as emitDynamicToolStartedDiagnostic, t as filterToolsForVisionInputs } from "./vision-tools-DOnxzH2y.js";
9
+ import { a as resolveCodexDynamicToolsLoading, n as filterCodexDynamicTools, t as createCodexDynamicToolBridge } from "./dynamic-tools-BXAE1U1-.js";
10
+ import { a as handleCodexAppServerElicitationRequest, c as emitDynamicToolTerminalDiagnostic, i as buildCodexNativeHookRelayDisabledConfig, l as handleCodexAppServerApprovalRequest, n as CODEX_NATIVE_HOOK_RELAY_EVENTS, o as emitDynamicToolErrorDiagnostic, r as buildCodexNativeHookRelayConfig, s as emitDynamicToolStartedDiagnostic, t as filterToolsForVisionInputs } from "./vision-tools-CETeQgze.js";
12
11
  import { n as rememberCodexRateLimits, t as readRecentCodexRateLimits } from "./rate-limit-cache-N66I-Rd7.js";
13
12
  import { buildAgentHookContextChannelFields, embeddedAgentLog, formatErrorMessage, registerNativeHookRelay, resolveAgentDir, resolveAttemptSpawnWorkspaceDir, resolveModelAuthMode, resolveSandboxContext, resolveSessionAgentIds, supportsModelTools } from "openclaw/plugin-sdk/agent-harness-runtime";
14
13
  //#region extensions/codex/src/app-server/side-question.ts
@@ -84,6 +83,8 @@ async function runCodexAppServerSideQuestion(params, options = {}) {
84
83
  cwd,
85
84
  authProfileId
86
85
  });
86
+ const approvalPolicy = binding.approvalPolicy ?? appServer.approvalPolicy;
87
+ const sandbox = binding.sandbox ?? appServer.sandbox;
87
88
  const { sessionAgentId } = resolveSessionAgentIds({
88
89
  sessionKey: params.sessionKey,
89
90
  config: params.cfg,
@@ -119,6 +120,10 @@ async function runCodexAppServerSideQuestion(params, options = {}) {
119
120
  threadId: childThreadId,
120
121
  turnId,
121
122
  nativeHookRelay,
123
+ autoApprove: shouldAutoApproveCodexAppServerApprovals({
124
+ approvalPolicy,
125
+ sandbox
126
+ }),
122
127
  signal: runAbortController.signal
123
128
  });
124
129
  if (request.method !== "item/tool/call") return;
@@ -160,8 +165,6 @@ async function runCodexAppServerSideQuestion(params, options = {}) {
160
165
  throw error;
161
166
  }
162
167
  });
163
- const approvalPolicy = binding.approvalPolicy ?? appServer.approvalPolicy;
164
- const sandbox = binding.sandbox ?? appServer.sandbox;
165
168
  const serviceTier = binding.serviceTier ?? appServer.serviceTier;
166
169
  const nativeHookRelayEvents = resolveCodexSideNativeHookRelayEvents({
167
170
  configuredEvents: options.nativeHookRelay?.events,
@@ -203,6 +206,7 @@ async function runCodexAppServerSideQuestion(params, options = {}) {
203
206
  threadId: binding.threadId,
204
207
  model: params.model,
205
208
  ...modelProvider ? { modelProvider } : {},
209
+ personality: CODEX_NATIVE_PERSONALITY_NONE,
206
210
  cwd,
207
211
  approvalPolicy,
208
212
  approvalsReviewer: appServer.approvalsReviewer,
@@ -233,6 +237,7 @@ async function runCodexAppServerSideQuestion(params, options = {}) {
233
237
  }],
234
238
  cwd,
235
239
  model: params.model,
240
+ personality: CODEX_NATIVE_PERSONALITY_NONE,
236
241
  ...serviceTier ? { serviceTier } : {},
237
242
  effort,
238
243
  collaborationMode: {
package/dist/test-api.js CHANGED
@@ -1,6 +1,6 @@
1
- import { l as resolveCodexAppServerRuntimeOptions } from "./config-DDMrwfJl.js";
2
- import { a as buildThreadResumeParams, c as buildTurnStartParams, i as buildDeveloperInstructions, o as buildThreadStartParams } from "./thread-lifecycle-DGoaguJh.js";
3
- import { n as filterCodexDynamicTools, t as createCodexDynamicToolBridge } from "./dynamic-tools-Bq717oJR.js";
1
+ import { l as resolveCodexAppServerRuntimeOptions } from "./config-D6TUuyo2.js";
2
+ import { a as buildDeveloperInstructions, l as buildTurnStartParams, o as buildThreadResumeParams, s as buildThreadStartParams } from "./thread-lifecycle-CXMd9UgJ.js";
3
+ import { n as filterCodexDynamicTools, t as createCodexDynamicToolBridge } from "./dynamic-tools-BXAE1U1-.js";
4
4
  //#region extensions/codex/test-api.ts
5
5
  function resolveCodexPromptSnapshotAppServerOptions(pluginConfig) {
6
6
  return resolveCodexAppServerRuntimeOptions({
@@ -1,11 +1,11 @@
1
- import { d as resolveCodexPluginsPolicy, r as codexSandboxPolicyForTurn, t as CODEX_PLUGINS_MARKETPLACE_NAME } from "./config-DDMrwfJl.js";
1
+ import { d as resolveCodexPluginsPolicy, r as codexSandboxPolicyForTurn, t as CODEX_PLUGINS_MARKETPLACE_NAME } from "./config-D6TUuyo2.js";
2
2
  import { n as assertCodexThreadResumeResponse, r as assertCodexThreadStartResponse } from "./protocol-validators-_gKDcd0x.js";
3
- import { t as isJsonObject } from "./protocol-oeJQu4rs.js";
3
+ import { a as isCodexAppServerConnectionClosedError, l as isJsonObject } from "./client-SrtuTTVa.js";
4
4
  import { CODEX_GPT5_HEARTBEAT_PROMPT_OVERLAY } from "./prompt-overlay.js";
5
5
  import { isModernCodexModel } from "./provider.js";
6
- import { a as isCodexAppServerConnectionClosedError } from "./client-1sSy4p3z.js";
7
- import { i as readCodexAppServerBinding, n as isCodexAppServerNativeAuthProfile, o as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-Bw_mfIW2.js";
6
+ import { i as readCodexAppServerBinding, n as isCodexAppServerNativeAuthProfile, o as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-CwNOIDP2.js";
8
7
  import crypto from "node:crypto";
8
+ import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
9
9
  import { embeddedAgentLog, isActiveHarnessContextEngine } from "openclaw/plugin-sdk/agent-harness-runtime";
10
10
  import { buildCodexUserMcpServersThreadConfigPatch } from "openclaw/plugin-sdk/codex-mcp-projection";
11
11
  import { listRegisteredPluginAgentPromptGuidance } from "openclaw/plugin-sdk/plugin-runtime";
@@ -301,9 +301,6 @@ function sanitizeInlineImageDataUrl(imageUrl) {
301
301
  function invalidInlineImageText(label) {
302
302
  return `[${label}] ${IMAGE_OMITTED_TEXT}`;
303
303
  }
304
- function isRecord$1(value) {
305
- return Boolean(value && typeof value === "object" && !Array.isArray(value));
306
- }
307
304
  function sanitizeImageContentRecord(record, label) {
308
305
  if (record.type === "image" && typeof record.data === "string") {
309
306
  const mimeType = typeof record.mimeType === "string" ? record.mimeType : "image/png";
@@ -343,7 +340,7 @@ function sanitizeImageContentRecord(record, label) {
343
340
  }
344
341
  function sanitizeCodexHistoryImagePayloads(value, label) {
345
342
  if (Array.isArray(value)) return value.map((entry) => sanitizeCodexHistoryImagePayloads(entry, label));
346
- if (!isRecord$1(value)) return value;
343
+ if (!isRecord(value)) return value;
347
344
  const imageRecord = sanitizeImageContentRecord(value, label);
348
345
  if (imageRecord) return imageRecord;
349
346
  const next = {};
@@ -512,9 +509,6 @@ function fingerprintInventoryCacheKey(key) {
512
509
  for (let index = 0; index < key.length; index += 1) hash = hash * 31 + key.charCodeAt(index) >>> 0;
513
510
  return hash.toString(16).padStart(8, "0");
514
511
  }
515
- function isRecord(value) {
516
- return Boolean(value && typeof value === "object" && !Array.isArray(value));
517
- }
518
512
  function redactErrorData(value, depth = 0) {
519
513
  if (value === void 0) return;
520
514
  if (value === null || typeof value === "boolean" || typeof value === "number") return value;
@@ -1074,6 +1068,7 @@ function stableStringify(value) {
1074
1068
  }
1075
1069
  //#endregion
1076
1070
  //#region extensions/codex/src/app-server/thread-lifecycle.ts
1071
+ const CODEX_NATIVE_PERSONALITY_NONE = "none";
1077
1072
  const CODEX_CODE_MODE_THREAD_CONFIG = {
1078
1073
  "features.code_mode": true,
1079
1074
  "features.code_mode_only": false
@@ -1401,6 +1396,7 @@ function buildThreadStartParams(params, options) {
1401
1396
  approvalsReviewer: options.appServer.approvalsReviewer,
1402
1397
  sandbox: options.appServer.sandbox,
1403
1398
  ...options.appServer.serviceTier ? { serviceTier: options.appServer.serviceTier } : {},
1399
+ personality: CODEX_NATIVE_PERSONALITY_NONE,
1404
1400
  serviceName: "OpenClaw",
1405
1401
  config: buildCodexRuntimeThreadConfigForRun(params, options.config, {
1406
1402
  nativeCodeModeEnabled: options.nativeCodeModeEnabled,
@@ -1429,6 +1425,7 @@ function buildThreadResumeParams(params, options) {
1429
1425
  approvalsReviewer: options.appServer.approvalsReviewer,
1430
1426
  sandbox: options.appServer.sandbox,
1431
1427
  ...options.appServer.serviceTier ? { serviceTier: options.appServer.serviceTier } : {},
1428
+ personality: CODEX_NATIVE_PERSONALITY_NONE,
1432
1429
  config: buildCodexRuntimeThreadConfigForRun(params, options.config, {
1433
1430
  nativeCodeModeEnabled: options.nativeCodeModeEnabled,
1434
1431
  nativeCodeModeOnlyEnabled: options.nativeCodeModeOnlyEnabled
@@ -1466,6 +1463,7 @@ function buildTurnStartParams(params, options) {
1466
1463
  approvalsReviewer: options.appServer.approvalsReviewer,
1467
1464
  sandboxPolicy: options.sandboxPolicy ?? codexSandboxPolicyForTurn(options.appServer.sandbox, options.cwd),
1468
1465
  model: params.modelId,
1466
+ personality: CODEX_NATIVE_PERSONALITY_NONE,
1469
1467
  ...options.appServer.serviceTier ? { serviceTier: options.appServer.serviceTier } : {},
1470
1468
  effort: resolveReasoningEffort(params.thinkLevel, params.modelId),
1471
1469
  ...options.environmentSelection ? { environments: options.environmentSelection } : {},
@@ -1625,4 +1623,4 @@ function resolveReasoningEffort(thinkLevel, modelId) {
1625
1623
  return null;
1626
1624
  }
1627
1625
  //#endregion
1628
- export { sanitizeCodexHistoryImagePayloads as C, resolveCodexContextEngineProjectionMaxChars as D, projectContextEngineAssemblyForCodex as E, resolveCodexContextEngineProjectionReserveTokens as O, invalidInlineImageText as S, DEFAULT_CODEX_PROJECTION_RESERVE_TOKENS as T, shouldBuildCodexPluginThreadConfig as _, buildThreadResumeParams as a, buildCodexAppInventoryCacheKey as b, buildTurnStartParams as c, resolveCodexAppServerModelProvider as d, resolveReasoningEffort as f, mergeCodexThreadConfigs as g, buildCodexPluginThreadConfigInputFingerprint as h, buildDeveloperInstructions as i, codexDynamicToolsFingerprint as l, buildCodexPluginThreadConfig as m, buildCodexRuntimeThreadConfig as n, buildThreadStartParams as o, startOrResumeThread as p, buildContextEngineBinding as r, buildTurnCollaborationMode as s, areCodexDynamicToolFingerprintsCompatible as t, isContextEngineBindingCompatible as u, ensureCodexPluginActivation as v, sanitizeInlineImageDataUrl as w, defaultCodexAppInventoryCache as x, pluginReadParams as y };
1626
+ export { invalidInlineImageText as C, resolveCodexContextEngineProjectionMaxChars as D, projectContextEngineAssemblyForCodex as E, resolveCodexContextEngineProjectionReserveTokens as O, defaultCodexAppInventoryCache as S, sanitizeInlineImageDataUrl as T, mergeCodexThreadConfigs as _, buildDeveloperInstructions as a, pluginReadParams as b, buildTurnCollaborationMode as c, isContextEngineBindingCompatible as d, resolveCodexAppServerModelProvider as f, buildCodexPluginThreadConfigInputFingerprint as g, buildCodexPluginThreadConfig as h, buildContextEngineBinding as i, buildTurnStartParams as l, startOrResumeThread as m, areCodexDynamicToolFingerprintsCompatible as n, buildThreadResumeParams as o, resolveReasoningEffort as p, buildCodexRuntimeThreadConfig as r, buildThreadStartParams as s, CODEX_NATIVE_PERSONALITY_NONE as t, codexDynamicToolsFingerprint as u, shouldBuildCodexPluginThreadConfig as v, sanitizeCodexHistoryImagePayloads as w, buildCodexAppInventoryCacheKey as x, ensureCodexPluginActivation as y };
@@ -1,6 +1,7 @@
1
- import { t as isJsonObject } from "./protocol-oeJQu4rs.js";
2
- import { s as formatCodexDisplayText } from "./notification-correlation-qKY_sgga.js";
1
+ import { l as isJsonObject } from "./client-SrtuTTVa.js";
2
+ import { s as formatCodexDisplayText } from "./notification-correlation-D7tJW3FW.js";
3
3
  import { createHash } from "node:crypto";
4
+ import { normalizeTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
4
5
  import { buildAgentHookContextChannelFields, callGatewayTool, embeddedAgentLog, formatApprovalDisplayPath, hasNativeHookRelayInvocation, invokeNativeHookRelay, runBeforeToolCallHook } from "openclaw/plugin-sdk/agent-harness-runtime";
5
6
  import { emitTrustedDiagnosticEvent } from "openclaw/plugin-sdk/diagnostic-runtime";
6
7
  //#region extensions/codex/src/app-server/plugin-approval-roundtrip.ts
@@ -106,6 +107,18 @@ async function handleCodexAppServerApprovalRequest(params) {
106
107
  });
107
108
  return buildApprovalResponse(params.method, context.requestParams, "denied");
108
109
  }
110
+ if (params.autoApprove === true) {
111
+ emitApprovalEvent(params.paramsForRun, {
112
+ phase: "resolved",
113
+ kind: context.kind,
114
+ status: "approved",
115
+ title: context.title,
116
+ ...context.eventDetails,
117
+ ...approvalEventScope(params.method, "approved-session"),
118
+ message: "Codex app-server approval auto-approved by runtime policy."
119
+ });
120
+ return buildApprovalResponse(params.method, context.requestParams, "approved-session");
121
+ }
109
122
  const requestResult = await requestPluginApproval({
110
123
  paramsForRun: params.paramsForRun,
111
124
  title: context.title,
@@ -567,8 +580,7 @@ function summarizeNetworkPolicyAmendments(value) {
567
580
  return `Proposed network policy: ${samples.join(", ")}${remainderSuffix}`;
568
581
  }
569
582
  function readStringArray(record, key) {
570
- const value = record[key];
571
- return Array.isArray(value) ? value.map((entry) => typeof entry === "string" ? entry.trim() : "").filter(Boolean) : [];
583
+ return normalizeTrimmedStringList(record[key]);
572
584
  }
573
585
  function sanitizePermissionHostValue(value) {
574
586
  const withoutScheme = sanitizePermissionScalar(value).toLowerCase().replace(/^[a-z][a-z0-9+.-]*:\/\//, "");