@openclaw/codex 2026.5.16-beta.6 → 2026.5.16-beta.7

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-D6sdcUE0.js");
21
+ const { runCodexAppServerAttempt } = await import("./run-attempt-Mn4zlbBO.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-BzVnOoBU.js");
28
+ const { runCodexAppServerSideQuestion } = await import("./side-question-D8VnF9iq.js");
29
29
  return runCodexAppServerSideQuestion(params, {
30
30
  pluginConfig: 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-DlvmoLBJ.js";
8
8
  import { i as readCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-DqApZIgD.js";
9
9
  import { a as defaultCodexAppInventoryCache } from "./plugin-activation-B49xb7pI.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-Cc_ljZLZ.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-Czx7CGwZ.js";
11
11
  import { t as defaultCodexAppServerClientFactory } from "./client-factory-9L6Ie1dC.js";
12
12
  import { a as handleCodexAppServerElicitationRequest, i as buildCodexNativeHookRelayDisabledConfig, n as CODEX_NATIVE_HOOK_RELAY_EVENTS, o as handleCodexAppServerApprovalRequest, r as buildCodexNativeHookRelayConfig, t as filterToolsForVisionInputs } from "./vision-tools-BX9YuTEK.js";
13
13
  import { t as ensureCodexComputerUse } from "./computer-use-UJ3dxrXF.js";
@@ -21,7 +21,7 @@ import { markAuthProfileBlockedUntil, resolveAgentDir as resolveAgentDir$1 } fro
21
21
  import { appendRegularFile, pathExists } from "openclaw/plugin-sdk/security-runtime";
22
22
  import { redactSensitiveFieldValue, redactToolPayloadText } from "openclaw/plugin-sdk/logging-core";
23
23
  import { emitTrustedDiagnosticEvent } from "openclaw/plugin-sdk/diagnostic-runtime";
24
- import { createRunningTaskRun, finalizeTaskRunByRunId, recordTaskRunProgressByRunId } from "openclaw/plugin-sdk/codex-native-task-runtime";
24
+ import { CODEX_NATIVE_SUBAGENT_RUNTIME, CODEX_NATIVE_SUBAGENT_RUN_ID_PREFIX, CODEX_NATIVE_SUBAGENT_TASK_KIND, createRunningTaskRun, finalizeTaskRunByRunId, recordTaskRunProgressByRunId } from "openclaw/plugin-sdk/codex-native-task-runtime";
25
25
  import { buildSessionContext, migrateSessionEntries, parseSessionEntries } from "@earendil-works/pi-coding-agent";
26
26
  //#region extensions/codex/src/app-server/local-runtime-attribution.ts
27
27
  const OPENAI_PROVIDER_ID = "openai";
@@ -44,8 +44,6 @@ function resolveCodexLocalRuntimeAttribution(params) {
44
44
  }
45
45
  //#endregion
46
46
  //#region extensions/codex/src/app-server/native-subagent-task-mirror.ts
47
- const CODEX_NATIVE_SUBAGENT_RUNTIME = "subagent";
48
- const CODEX_NATIVE_SUBAGENT_TASK_KIND = "codex-native";
49
47
  const defaultRuntime = {
50
48
  createRunningTaskRun,
51
49
  recordTaskRunProgressByRunId,
@@ -239,7 +237,7 @@ var CodexNativeSubagentTaskMirror = class {
239
237
  }
240
238
  };
241
239
  function codexNativeSubagentRunId(threadId) {
242
- return `codex-thread:${threadId.trim()}`;
240
+ return `${CODEX_NATIVE_SUBAGENT_RUN_ID_PREFIX}${threadId.trim()}`;
243
241
  }
244
242
  function readSubagentThreadSpawnSource(source, parentThreadId) {
245
243
  if (!source || typeof source !== "object" || !("subAgent" in source)) return;
@@ -700,6 +698,7 @@ var CodexAppServerEventProjector = class {
700
698
  assistantTexts,
701
699
  toolMetas: [...this.toolMetas.values()],
702
700
  lastAssistant,
701
+ ...this.lastNativeToolError ? { lastToolError: this.lastNativeToolError } : {},
703
702
  didSendViaMessagingTool: toolTelemetry.didSendViaMessagingTool,
704
703
  messagingToolSentTexts: toolTelemetry.messagingToolSentTexts,
705
704
  messagingToolSentMediaUrls: toolTelemetry.messagingToolSentMediaUrls,
@@ -1175,6 +1174,7 @@ var CodexAppServerEventProjector = class {
1175
1174
  if (!name) return;
1176
1175
  const status = params.phase === "result" ? itemStatus(item) : "running";
1177
1176
  const args = itemToolArgs(item);
1177
+ const meta = itemMeta(item, this.toolProgressDetailMode());
1178
1178
  this.recordToolTrajectoryEvent({
1179
1179
  phase: params.phase,
1180
1180
  item,
@@ -1188,11 +1188,16 @@ var CodexAppServerEventProjector = class {
1188
1188
  name,
1189
1189
  status
1190
1190
  });
1191
+ if (params.phase === "result") this.recordNativeToolError({
1192
+ item,
1193
+ name,
1194
+ meta,
1195
+ status
1196
+ });
1191
1197
  if (!shouldEmitTranscriptToolProgress(name, args)) {
1192
1198
  if (params.phase === "result") this.emitAfterToolCallObservation(item);
1193
1199
  return;
1194
1200
  }
1195
- const meta = itemMeta(item, this.toolProgressDetailMode());
1196
1201
  this.emitAgentEvent({
1197
1202
  stream: "tool",
1198
1203
  data: {
@@ -1211,6 +1216,27 @@ var CodexAppServerEventProjector = class {
1211
1216
  });
1212
1217
  if (params.phase === "result") this.emitAfterToolCallObservation(item);
1213
1218
  }
1219
+ recordNativeToolError(params) {
1220
+ if (!isNonSuccessItemStatus(params.status)) {
1221
+ if (!this.lastNativeToolError) return;
1222
+ if (!this.lastNativeToolError.mutatingAction) {
1223
+ this.lastNativeToolError = void 0;
1224
+ return;
1225
+ }
1226
+ const actionFingerprint = nativeToolActionFingerprint(params.item);
1227
+ if (this.lastNativeToolError.actionFingerprint && actionFingerprint && this.lastNativeToolError.actionFingerprint === actionFingerprint) this.lastNativeToolError = void 0;
1228
+ return;
1229
+ }
1230
+ const error = itemToolError(params.item, params.status, this.toolResultOutputTextByItem);
1231
+ const actionFingerprint = nativeToolActionFingerprint(params.item);
1232
+ this.lastNativeToolError = {
1233
+ toolName: params.name,
1234
+ ...params.meta ? { meta: params.meta } : {},
1235
+ ...error ? { error } : {},
1236
+ ...isMutatingNativeToolItem(params.item) ? { mutatingAction: true } : {},
1237
+ ...actionFingerprint ? { actionFingerprint } : {}
1238
+ };
1239
+ }
1214
1240
  recordToolTrajectoryEvent(params) {
1215
1241
  if (params.phase === "start") {
1216
1242
  this.options.trajectoryRecorder?.recordEvent("tool.call", {
@@ -1728,6 +1754,20 @@ function shouldSynthesizeToolProgressForItem(item) {
1728
1754
  default: return false;
1729
1755
  }
1730
1756
  }
1757
+ function isMutatingNativeToolItem(item) {
1758
+ return item.type === "commandExecution" || item.type === "fileChange";
1759
+ }
1760
+ function nativeToolActionFingerprint(item) {
1761
+ if (item.type === "commandExecution" && typeof item.command === "string") return JSON.stringify({
1762
+ type: item.type,
1763
+ command: item.command,
1764
+ cwd: typeof item.cwd === "string" ? item.cwd : ""
1765
+ });
1766
+ if (item.type === "fileChange") return JSON.stringify({
1767
+ type: item.type,
1768
+ changes: itemFileChanges(item)
1769
+ });
1770
+ }
1731
1771
  function isNativePostToolUseRelayItem(item) {
1732
1772
  switch (item.type) {
1733
1773
  case "commandExecution":
@@ -5,7 +5,7 @@ import { r as isCodexAppServerApprovalRequest } from "./client-6FkrXfaz.js";
5
5
  import { u as formatCodexUsageLimitErrorMessage } from "./command-formatters-BRW7_Nu7.js";
6
6
  import { i as getSharedCodexAppServerClient, s as refreshCodexAppServerAuthTokens } from "./shared-client-DlvmoLBJ.js";
7
7
  import { i as readCodexAppServerBinding } from "./session-binding-DqApZIgD.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-Cc_ljZLZ.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-Czx7CGwZ.js";
9
9
  import { a as handleCodexAppServerElicitationRequest, i as buildCodexNativeHookRelayDisabledConfig, n as CODEX_NATIVE_HOOK_RELAY_EVENTS, o as handleCodexAppServerApprovalRequest, r as buildCodexNativeHookRelayConfig, t as filterToolsForVisionInputs } from "./vision-tools-BX9YuTEK.js";
10
10
  import { n as rememberCodexRateLimits, t as readRecentCodexRateLimits } from "./rate-limit-cache-dvhq-4pi.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-B5pq6hEz.js";
2
- import { S as filterCodexDynamicTools, a as buildThreadResumeParams, b as createCodexDynamicToolBridge, i as buildDeveloperInstructions, o as buildThreadStartParams, s as buildTurnStartParams } from "./thread-lifecycle-Cc_ljZLZ.js";
2
+ import { S as filterCodexDynamicTools, a as buildThreadResumeParams, b as createCodexDynamicToolBridge, i as buildDeveloperInstructions, o as buildThreadStartParams, s as buildTurnStartParams } from "./thread-lifecycle-Czx7CGwZ.js";
3
3
  //#region extensions/codex/test-api.ts
4
4
  function resolveCodexPromptSnapshotAppServerOptions(pluginConfig) {
5
5
  return resolveCodexAppServerRuntimeOptions({
@@ -1424,6 +1424,7 @@ function compareJsonFingerprint(left, right) {
1424
1424
  function buildDeveloperInstructions(params) {
1425
1425
  return [
1426
1426
  "Running inside OpenClaw. Use dynamic tools for messaging, cron, sessions, media, gateway, and nodes when available.",
1427
+ "Use Codex native `spawn_agent` for Codex subagents. Use OpenClaw `sessions_spawn` only for OpenClaw or ACP delegation; if it is not already loaded, search for `sessions_spawn` in the `openclaw` dynamic tool namespace before calling it.",
1427
1428
  "Preserve channel/session context. Visible channel replies: use `message`, do not describe would-reply.",
1428
1429
  renderCodexRuntimePromptOverlay(params),
1429
1430
  params.extraSystemPrompt,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/codex",
3
- "version": "2026.5.16-beta.6",
3
+ "version": "2026.5.16-beta.7",
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.74.1",
11
+ "@earendil-works/pi-coding-agent": "0.75.1",
12
12
  "@openai/codex": "0.130.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.16-beta.6"
30
+ "pluginApi": ">=2026.5.16-beta.7"
31
31
  },
32
32
  "build": {
33
- "openclawVersion": "2026.5.16-beta.6"
33
+ "openclawVersion": "2026.5.16-beta.7"
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.16-beta.6"
48
+ "openclaw": ">=2026.5.16-beta.7"
49
49
  },
50
50
  "peerDependenciesMeta": {
51
51
  "openclaw": {