@openclaw/codex 2026.5.20-beta.1 → 2026.5.20-beta.2

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.
package/dist/harness.js CHANGED
@@ -18,14 +18,14 @@ function createCodexAppServerAgentHarness(options) {
18
18
  };
19
19
  },
20
20
  runAttempt: async (params) => {
21
- const { runCodexAppServerAttempt } = await import("./run-attempt-8r4wCbNk.js");
21
+ const { runCodexAppServerAttempt } = await import("./run-attempt-CRHVB240.js");
22
22
  return runCodexAppServerAttempt(params, {
23
23
  pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
24
24
  nativeHookRelay: { enabled: true }
25
25
  });
26
26
  },
27
27
  runSideQuestion: async (params) => {
28
- const { runCodexAppServerSideQuestion } = await import("./side-question-Ufu1Z7Ne.js");
28
+ const { runCodexAppServerSideQuestion } = await import("./side-question-DlJAUYst.js");
29
29
  return runCodexAppServerSideQuestion(params, {
30
30
  pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
31
31
  nativeHookRelay: { enabled: true }
@@ -7,7 +7,7 @@ import { d as resolveCodexUsageLimitResetAtMs, f as shouldRefreshCodexRateLimits
7
7
  import { c as resolveCodexAppServerAuthAccountCacheKey, d as resolveCodexAppServerEnvApiKeyCacheKey, f as resolveCodexAppServerHomeDir, l as resolveCodexAppServerAuthProfileId, s as refreshCodexAppServerAuthTokens, t as clearSharedCodexAppServerClientIfCurrent, u as resolveCodexAppServerAuthProfileIdForAgent } from "./shared-client-DCxJx5QU.js";
8
8
  import { i as readCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-DEiYHgJ_.js";
9
9
  import { a as defaultCodexAppInventoryCache } from "./plugin-activation-BkQkPLOY.js";
10
- import { C as isForcedPrivateQaCodexRuntime, S as filterCodexDynamicTools, T as resolveCodexDynamicToolsLoading, _ as projectContextEngineAssemblyForCodex, b as createCodexDynamicToolBridge, c as codexDynamicToolsFingerprint, f as startOrResumeThread, g as shouldBuildCodexPluginThreadConfig, h as mergeCodexThreadConfigs, i as buildDeveloperInstructions, l as isContextEngineBindingCompatible, m as buildCodexPluginThreadConfigInputFingerprint, p as buildCodexPluginThreadConfig, r as buildContextEngineBinding, s as buildTurnStartParams, t as areCodexDynamicToolFingerprintsCompatible, v as resolveCodexContextEngineProjectionMaxChars, w as normalizeCodexDynamicToolName, x as sanitizeCodexHistoryImagePayloads, y as resolveCodexContextEngineProjectionReserveTokens } from "./thread-lifecycle-CeH-cRV4.js";
10
+ import { C as isForcedPrivateQaCodexRuntime, S as filterCodexDynamicTools, T as resolveCodexDynamicToolsLoading, _ as projectContextEngineAssemblyForCodex, b as createCodexDynamicToolBridge, c as codexDynamicToolsFingerprint, f as startOrResumeThread, g as shouldBuildCodexPluginThreadConfig, h as mergeCodexThreadConfigs, i as buildDeveloperInstructions, l as isContextEngineBindingCompatible, m as buildCodexPluginThreadConfigInputFingerprint, p as buildCodexPluginThreadConfig, r as buildContextEngineBinding, s as buildTurnStartParams, t as areCodexDynamicToolFingerprintsCompatible, v as resolveCodexContextEngineProjectionMaxChars, w as normalizeCodexDynamicToolName, x as sanitizeCodexHistoryImagePayloads, y as resolveCodexContextEngineProjectionReserveTokens } from "./thread-lifecycle-Cgi62SSl.js";
11
11
  import { t as defaultCodexAppServerClientFactory } from "./client-factory-BbesECdh.js";
12
12
  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-B2wt6ecs.js";
13
13
  import { t as ensureCodexComputerUse } from "./computer-use-B4iTog6z.js";
@@ -4609,7 +4609,6 @@ async function buildDynamicTools(input) {
4609
4609
  senderName: params.senderName,
4610
4610
  senderUsername: params.senderUsername,
4611
4611
  senderE164: params.senderE164,
4612
- senderIsOwner: params.senderIsOwner,
4613
4612
  allowGatewaySubagentBinding: params.allowGatewaySubagentBinding || isForcedPrivateQaCodexRuntime(),
4614
4613
  ...sessionKeys,
4615
4614
  sessionId: params.sessionId,
@@ -5238,10 +5237,12 @@ function buildCodexBootstrapInjectionStats(params) {
5238
5237
  const injectedIndex = indexCodexContextFileContent(params.injectedFiles);
5239
5238
  const developerInstructionIndex = indexCodexContextFileContent(params.developerInstructionFiles ?? []);
5240
5239
  return params.bootstrapFiles.map((file) => {
5241
- const pathValue = readNonEmptyString(file.path) ?? file.name;
5242
- const baseName = getCodexContextFileBasename(pathValue || file.name);
5240
+ const fileName = readNonEmptyString(file.name);
5241
+ const pathValue = readNonEmptyString(file.path) ?? fileName ?? "";
5242
+ const displayName = (fileName ?? getCodexContextFileDisplayBasename(pathValue)) || pathValue;
5243
+ const baseName = getCodexContextFileBasename(pathValue || fileName || "");
5243
5244
  const rawChars = file.missing ? 0 : (file.content ?? "").trimEnd().length;
5244
- const injected = readCodexIndexedContextFileContent(injectedIndex, pathValue, file.name) ?? readCodexIndexedContextFileContent(developerInstructionIndex, pathValue, file.name);
5245
+ const injected = readCodexIndexedContextFileContent(injectedIndex, pathValue, fileName) ?? readCodexIndexedContextFileContent(developerInstructionIndex, pathValue, fileName);
5245
5246
  let injectedChars = injected?.length ?? 0;
5246
5247
  let truncated = !file.missing && injectedChars < rawChars;
5247
5248
  if (injected === void 0) {
@@ -5254,7 +5255,7 @@ function buildCodexBootstrapInjectionStats(params) {
5254
5255
  }
5255
5256
  }
5256
5257
  return {
5257
- name: file.name,
5258
+ name: displayName,
5258
5259
  path: pathValue,
5259
5260
  missing: file.missing,
5260
5261
  rawChars,
@@ -5279,7 +5280,14 @@ function indexCodexContextFileContent(files) {
5279
5280
  };
5280
5281
  }
5281
5282
  function readCodexIndexedContextFileContent(index, pathValue, fileName) {
5282
- return index.byPath.get(pathValue) ?? index.byPath.get(fileName) ?? index.byBaseName.get(getCodexContextFileBasename(fileName));
5283
+ const pathContent = index.byPath.get(pathValue);
5284
+ if (pathContent !== void 0) return pathContent;
5285
+ if (fileName) {
5286
+ const nameContent = index.byPath.get(fileName);
5287
+ if (nameContent !== void 0) return nameContent;
5288
+ }
5289
+ const baseName = getCodexContextFileBasename(fileName ?? pathValue);
5290
+ return baseName ? index.byBaseName.get(baseName) : void 0;
5283
5291
  }
5284
5292
  function readPositiveNumber(value) {
5285
5293
  return typeof value === "number" && Number.isFinite(value) && value > 0 ? Math.floor(value) : void 0;
@@ -5396,6 +5404,9 @@ function compareCodexContextFiles(left, right) {
5396
5404
  function normalizeCodexContextFilePath(filePath) {
5397
5405
  return filePath.trim().replaceAll("\\", "/").toLowerCase();
5398
5406
  }
5407
+ function getCodexContextFileDisplayBasename(filePath) {
5408
+ return filePath.trim().replaceAll("\\", "/").split("/").pop()?.trim() ?? "";
5409
+ }
5399
5410
  function getCodexContextFileBasename(filePath) {
5400
5411
  return normalizeCodexContextFilePath(filePath).split("/").pop() ?? "";
5401
5412
  }
@@ -5,7 +5,7 @@ import { r as isCodexAppServerApprovalRequest } from "./client-Ab4Fw77C.js";
5
5
  import { u as formatCodexUsageLimitErrorMessage } from "./command-formatters-BVBnEgyA.js";
6
6
  import { i as getSharedCodexAppServerClient, s as refreshCodexAppServerAuthTokens } from "./shared-client-DCxJx5QU.js";
7
7
  import { i as readCodexAppServerBinding } from "./session-binding-DEiYHgJ_.js";
8
- import { S as filterCodexDynamicTools, T as resolveCodexDynamicToolsLoading, b as createCodexDynamicToolBridge, d as resolveReasoningEffort, h as mergeCodexThreadConfigs, n as buildCodexRuntimeThreadConfig, u as resolveCodexAppServerModelProvider } from "./thread-lifecycle-CeH-cRV4.js";
8
+ import { S as filterCodexDynamicTools, T as resolveCodexDynamicToolsLoading, b as createCodexDynamicToolBridge, d as resolveReasoningEffort, h as mergeCodexThreadConfigs, n as buildCodexRuntimeThreadConfig, u as resolveCodexAppServerModelProvider } from "./thread-lifecycle-Cgi62SSl.js";
9
9
  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-B2wt6ecs.js";
10
10
  import { n as rememberCodexRateLimits, t as readRecentCodexRateLimits } from "./rate-limit-cache-N66I-Rd7.js";
11
11
  import { buildAgentHookContextChannelFields, embeddedAgentLog, formatErrorMessage, registerNativeHookRelay, resolveAgentDir, resolveAttemptSpawnWorkspaceDir, resolveModelAuthMode, resolveSandboxContext, resolveSessionAgentIds, supportsModelTools } from "openclaw/plugin-sdk/agent-harness-runtime";
package/dist/test-api.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { c as resolveCodexAppServerRuntimeOptions } from "./config-DqIp6oTk.js";
2
- import { S as filterCodexDynamicTools, a as buildThreadResumeParams, b as createCodexDynamicToolBridge, i as buildDeveloperInstructions, o as buildThreadStartParams, s as buildTurnStartParams } from "./thread-lifecycle-CeH-cRV4.js";
2
+ import { S as filterCodexDynamicTools, a as buildThreadResumeParams, b as createCodexDynamicToolBridge, i as buildDeveloperInstructions, o as buildThreadStartParams, s as buildTurnStartParams } from "./thread-lifecycle-Cgi62SSl.js";
3
3
  //#region extensions/codex/test-api.ts
4
4
  function resolveCodexPromptSnapshotAppServerOptions(pluginConfig) {
5
5
  return resolveCodexAppServerRuntimeOptions({
@@ -53,6 +53,24 @@ function filterCodexDynamicTools(tools, config, env = process.env) {
53
53
  //#region extensions/codex/src/app-server/image-payload-sanitizer.ts
54
54
  const DATA_URL_PREFIX = "data:";
55
55
  const IMAGE_OMITTED_TEXT = "omitted image payload: invalid inline image data";
56
+ const IMAGE_SIGNATURES = [
57
+ {
58
+ mime: "image/png",
59
+ matches: (buffer) => buffer.length >= 8 && buffer[0] === 137 && buffer[1] === 80 && buffer[2] === 78 && buffer[3] === 71 && buffer[4] === 13 && buffer[5] === 10 && buffer[6] === 26 && buffer[7] === 10
60
+ },
61
+ {
62
+ mime: "image/jpeg",
63
+ matches: (buffer) => buffer.length >= 3 && buffer[0] === 255 && buffer[1] === 216 && buffer[2] === 255
64
+ },
65
+ {
66
+ mime: "image/webp",
67
+ matches: (buffer) => buffer.length >= 12 && buffer.subarray(0, 4).toString("ascii") === "RIFF" && buffer.subarray(8, 12).toString("ascii") === "WEBP"
68
+ },
69
+ {
70
+ mime: "image/gif",
71
+ matches: (buffer) => buffer.length >= 6 && (buffer.subarray(0, 6).toString("ascii") === "GIF87a" || buffer.subarray(0, 6).toString("ascii") === "GIF89a")
72
+ }
73
+ ];
56
74
  function startsWithDataUrl(value) {
57
75
  return value.slice(0, 5).toLowerCase() === DATA_URL_PREFIX;
58
76
  }
@@ -77,21 +95,30 @@ function canonicalizeBase64(base64) {
77
95
  return cleaned;
78
96
  }
79
97
  function sniffImageMime(buffer) {
80
- if (buffer.length >= 8 && buffer[0] === 137 && buffer[1] === 80 && buffer[2] === 78 && buffer[3] === 71 && buffer[4] === 13 && buffer[5] === 10 && buffer[6] === 26 && buffer[7] === 10) return "image/png";
81
- if (buffer.length >= 3 && buffer[0] === 255 && buffer[1] === 216 && buffer[2] === 255) return "image/jpeg";
82
- if (buffer.length >= 12 && buffer.subarray(0, 4).toString("ascii") === "RIFF" && buffer.subarray(8, 12).toString("ascii") === "WEBP") return "image/webp";
83
- if (buffer.length >= 6 && (buffer.subarray(0, 6).toString("ascii") === "GIF87a" || buffer.subarray(0, 6).toString("ascii") === "GIF89a")) return "image/gif";
98
+ return IMAGE_SIGNATURES.find((signature) => signature.matches(buffer))?.mime;
84
99
  }
85
- function sanitizeInlineImageDataUrl(imageUrl) {
86
- if (!startsWithDataUrl(imageUrl)) return imageUrl;
87
- const commaIndex = imageUrl.indexOf(",");
100
+ function parseImageDataUrl(value) {
101
+ if (!startsWithDataUrl(value)) return {
102
+ metadata: [],
103
+ payload: value
104
+ };
105
+ const commaIndex = value.indexOf(",");
88
106
  if (commaIndex < 0) return;
89
- const metadata = imageUrl.slice(5, commaIndex);
90
- const payload = imageUrl.slice(commaIndex + 1);
91
- const metadataParts = metadata.split(";").map((part) => part.trim());
92
- if (!(metadataParts[0]?.toLowerCase())?.startsWith("image/")) return;
93
- if (!metadataParts.slice(1).some((part) => part.toLowerCase() === "base64")) return;
94
- const canonicalPayload = canonicalizeBase64(payload);
107
+ return {
108
+ metadata: value.slice(5, commaIndex).split(";").map((part) => part.trim()),
109
+ payload: value.slice(commaIndex + 1)
110
+ };
111
+ }
112
+ function metadataAllowsImageBase64(metadata) {
113
+ const [mimeType, ...options] = metadata;
114
+ return mimeType !== void 0 && mimeType.toLowerCase().startsWith("image/") && options.some((part) => part.toLowerCase() === "base64");
115
+ }
116
+ function sanitizeInlineImageDataUrl(imageUrl) {
117
+ const parsed = parseImageDataUrl(imageUrl);
118
+ if (!parsed) return;
119
+ if (parsed.metadata.length === 0) return imageUrl;
120
+ if (!metadataAllowsImageBase64(parsed.metadata)) return;
121
+ const canonicalPayload = canonicalizeBase64(parsed.payload);
95
122
  if (!canonicalPayload) return;
96
123
  const sniffedMimeType = sniffImageMime(Buffer.from(canonicalPayload, "base64"));
97
124
  if (!sniffedMimeType) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/codex",
3
- "version": "2026.5.20-beta.1",
3
+ "version": "2026.5.20-beta.2",
4
4
  "description": "OpenClaw Codex harness and model provider plugin",
5
5
  "repository": {
6
6
  "type": "git",
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "type": "module",
10
10
  "dependencies": {
11
- "@earendil-works/pi-coding-agent": "0.75.3",
11
+ "@earendil-works/pi-coding-agent": "0.75.4",
12
12
  "@openai/codex": "0.132.0",
13
13
  "ajv": "8.20.0",
14
14
  "ws": "8.20.1",
@@ -27,10 +27,10 @@
27
27
  "minHostVersion": ">=2026.5.1-beta.1"
28
28
  },
29
29
  "compat": {
30
- "pluginApi": ">=2026.5.20-beta.1"
30
+ "pluginApi": ">=2026.5.20-beta.2"
31
31
  },
32
32
  "build": {
33
- "openclawVersion": "2026.5.20-beta.1"
33
+ "openclawVersion": "2026.5.20-beta.2"
34
34
  },
35
35
  "release": {
36
36
  "publishToClawHub": true,
@@ -45,7 +45,7 @@
45
45
  "openclaw.plugin.json"
46
46
  ],
47
47
  "peerDependencies": {
48
- "openclaw": ">=2026.5.20-beta.1"
48
+ "openclaw": ">=2026.5.20-beta.2"
49
49
  },
50
50
  "peerDependenciesMeta": {
51
51
  "openclaw": {