@openclaw/codex 2026.5.22 → 2026.5.24-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.
@@ -340,7 +340,7 @@ var CodexAppServerClient = class CodexAppServerClient {
340
340
  return;
341
341
  }
342
342
  try {
343
- this.writeMessage(message);
343
+ this.writeMessage(message, (error) => rejectPending(error));
344
344
  } catch (error) {
345
345
  rejectPending(error instanceof Error ? error : new Error(String(error)));
346
346
  }
@@ -372,16 +372,19 @@ var CodexAppServerClient = class CodexAppServerClient {
372
372
  this.markClosed(/* @__PURE__ */ new Error("codex app-server client is closed"));
373
373
  await closeCodexAppServerTransportAndWait(this.child, options);
374
374
  }
375
- writeMessage(message) {
375
+ writeMessage(message, onError) {
376
376
  if (this.closed) return;
377
377
  const id = "id" in message ? message.id : void 0;
378
378
  const method = "method" in message ? message.method : void 0;
379
379
  this.child.stdin.write(`${stringifyCodexAppServerMessage(message)}\n`, (error) => {
380
- if (error) embeddedAgentLog.warn("codex app-server write failed", {
381
- error,
382
- id,
383
- method
384
- });
380
+ if (error) {
381
+ embeddedAgentLog.warn("codex app-server write failed", {
382
+ error,
383
+ id,
384
+ method
385
+ });
386
+ onError?.(error);
387
+ }
385
388
  });
386
389
  }
387
390
  handleLine(line) {
@@ -418,7 +421,7 @@ var CodexAppServerClient = class CodexAppServerClient {
418
421
  parsed = JSON.parse(candidate);
419
422
  } catch (error) {
420
423
  const lineCount = pending.lineCount + 1;
421
- if (candidate.length <= CODEX_APP_SERVER_PARSE_BUFFER_MAX && lineCount <= CODEX_APP_SERVER_PARSE_BUFFER_MAX_LINES) {
424
+ if (shouldBufferCodexAppServerParseFailure(candidate.trim(), error) && candidate.length <= CODEX_APP_SERVER_PARSE_BUFFER_MAX && lineCount <= CODEX_APP_SERVER_PARSE_BUFFER_MAX_LINES) {
422
425
  this.pendingParse = {
423
426
  text: candidate,
424
427
  lineCount,
@@ -1,5 +1,5 @@
1
1
  //#region extensions/codex/src/app-server/client-factory.ts
2
- const defaultCodexAppServerClientFactory = (startOptions, authProfileId, agentDir, config) => import("./shared-client-C_RbGxW8.js").then((n) => n.a).then(({ getSharedCodexAppServerClient }) => getSharedCodexAppServerClient({
2
+ const defaultCodexAppServerClientFactory = (startOptions, authProfileId, agentDir, config) => import("./shared-client-CFCUGEVs.js").then((n) => n.a).then(({ getSharedCodexAppServerClient }) => getSharedCodexAppServerClient({
3
3
  startOptions,
4
4
  authProfileId,
5
5
  agentDir,
@@ -1,12 +1,12 @@
1
1
  import { a as isCodexFastServiceTier, l as resolveCodexAppServerRuntimeOptions } from "./config-DDMrwfJl.js";
2
- import { n as listCodexAppServerModels, t as listAllCodexAppServerModels } from "./models-B_uo1pf5.js";
2
+ import { n as listCodexAppServerModels, t as listAllCodexAppServerModels } from "./models-DtGLkqMP.js";
3
3
  import { t as isJsonObject } from "./protocol-oeJQu4rs.js";
4
4
  import { i as readCodexAppServerBinding, o as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-Bw_mfIW2.js";
5
- import { i as describeControlFailure, r as CODEX_CONTROL_METHODS, t as requestCodexAppServerJson } from "./request-NklFaHM4.js";
5
+ import { i as describeControlFailure, r as CODEX_CONTROL_METHODS, t as requestCodexAppServerJson } from "./request-D93E78SA.js";
6
6
  import { _ as summarizeCodexAccountUsage, a as buildHelp, c as formatCodexStatus, d as formatModels, f as formatThreads, l as formatComputerUseStatus, o as formatAccount, p as readString$1, s as formatCodexDisplayText, u as formatList } from "./notification-correlation-qKY_sgga.js";
7
7
  import { n as resolveCodexNativeExecutionBlock, r as resolveCodexNativeSandboxBlock } from "./sandbox-guard-CTnEWuor.js";
8
- import { _ as steerCodexConversationTurn, b as readCodexConversationBindingData, d as parseCodexFastModeArg, f as parseCodexPermissionsModeArg, g as setCodexConversationPermissions, h as setCodexConversationModel, l as startCodexConversationThread, m as setCodexConversationFastMode, p as readCodexConversationActiveTurn, r as formatCodexCliSessions, u as formatPermissionsMode, v as stopCodexConversationTurn, x as resolveCodexDefaultWorkspaceDir, y as createCodexCliNodeConversationBindingData } from "./node-cli-sessions-yVCifOyG.js";
9
- import { n as installCodexComputerUse, r as readCodexComputerUseStatus } from "./computer-use-BMMwWwno.js";
8
+ import { _ as steerCodexConversationTurn, b as readCodexConversationBindingData, d as parseCodexFastModeArg, f as parseCodexPermissionsModeArg, g as setCodexConversationPermissions, h as setCodexConversationModel, l as startCodexConversationThread, m as setCodexConversationFastMode, p as readCodexConversationActiveTurn, r as formatCodexCliSessions, u as formatPermissionsMode, v as stopCodexConversationTurn, x as resolveCodexDefaultWorkspaceDir, y as createCodexCliNodeConversationBindingData } from "./node-cli-sessions-9CAqnIaA.js";
9
+ import { n as installCodexComputerUse, r as readCodexComputerUseStatus } from "./computer-use-Hdq1WgTA.js";
10
10
  import { n as rememberCodexRateLimits } from "./rate-limit-cache-N66I-Rd7.js";
11
11
  import crypto from "node:crypto";
12
12
  import { ensureAuthProfileStore, findNormalizedProviderValue, resolveAgentDir, resolveAuthProfileEligibility, resolveAuthProfileOrder, resolveDefaultAgentDir, resolveProfileUnusableUntilForDisplay, resolveSessionAgentIds } from "openclaw/plugin-sdk/agent-runtime";
@@ -2,7 +2,7 @@ import { l as resolveCodexAppServerRuntimeOptions } from "./config-DDMrwfJl.js";
2
2
  import { t as isJsonObject } from "./protocol-oeJQu4rs.js";
3
3
  import { i as readCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-Bw_mfIW2.js";
4
4
  import { n as resolveCodexNativeExecutionBlock } from "./sandbox-guard-CTnEWuor.js";
5
- import { t as defaultCodexAppServerClientFactory } from "./client-factory-DdrIY1lw.js";
5
+ import { t as defaultCodexAppServerClientFactory } from "./client-factory-Bk6i4FnW.js";
6
6
  import { compactContextEngineWithSafetyTimeout, embeddedAgentLog, formatErrorMessage, isActiveHarnessContextEngine, resolveCompactionTimeoutMs, resolveContextEngineOwnerPluginId, runHarnessContextEngineMaintenance } from "openclaw/plugin-sdk/agent-harness-runtime";
7
7
  //#region extensions/codex/src/app-server/compact.ts
8
8
  const DEFAULT_CODEX_COMPACTION_WAIT_TIMEOUT_MS = 300 * 1e3;
@@ -1,5 +1,5 @@
1
1
  import { l as resolveCodexAppServerRuntimeOptions, u as resolveCodexComputerUseConfig } from "./config-DDMrwfJl.js";
2
- import { i as describeControlFailure, t as requestCodexAppServerJson } from "./request-NklFaHM4.js";
2
+ import { i as describeControlFailure, t as requestCodexAppServerJson } from "./request-D93E78SA.js";
3
3
  import { existsSync } from "node:fs";
4
4
  //#region extensions/codex/src/app-server/computer-use.ts
5
5
  var CodexComputerUseSetupError = class extends Error {
@@ -1,4 +1,4 @@
1
- import { C as sanitizeInlineImageDataUrl, x as invalidInlineImageText } from "./thread-lifecycle-4Ul7RoW4.js";
1
+ import { S as invalidInlineImageText, w as sanitizeInlineImageDataUrl } from "./thread-lifecycle-DGoaguJh.js";
2
2
  import { HEARTBEAT_RESPONSE_TOOL_NAME, createAgentToolResultMiddlewareRunner, createCodexAppServerToolResultExtensionRunner, extractToolResultMediaArtifact, filterToolResultMediaUrls, isMessagingTool, isMessagingToolSendAction, isToolWrappedWithBeforeToolCallHook, normalizeHeartbeatToolResponse, runAgentHarnessAfterToolCallHook, setBeforeToolCallDiagnosticsEnabled, wrapToolWithBeforeToolCallHook } from "openclaw/plugin-sdk/agent-harness-runtime";
3
3
  import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
4
4
  //#region extensions/codex/src/app-server/dynamic-tool-profile.ts
package/dist/harness.js CHANGED
@@ -28,21 +28,21 @@ function createCodexAppServerAgentHarness(options) {
28
28
  };
29
29
  },
30
30
  runAttempt: async (params) => {
31
- const { runCodexAppServerAttempt } = await import("./run-attempt-DzlLXP5Y.js");
31
+ const { runCodexAppServerAttempt } = await import("./run-attempt-CT1N__qp.js");
32
32
  return runCodexAppServerAttempt(params, {
33
33
  pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
34
34
  nativeHookRelay: { enabled: true }
35
35
  });
36
36
  },
37
37
  runSideQuestion: async (params) => {
38
- const { runCodexAppServerSideQuestion } = await import("./side-question-DzP1wClA.js");
38
+ const { runCodexAppServerSideQuestion } = await import("./side-question-CYFMTA1O.js");
39
39
  return runCodexAppServerSideQuestion(params, {
40
40
  pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
41
41
  nativeHookRelay: { enabled: true }
42
42
  });
43
43
  },
44
44
  compact: async (params) => {
45
- const { maybeCompactCodexAppServerSession } = await import("./compact-BwQn7jKq.js");
45
+ const { maybeCompactCodexAppServerSession } = await import("./compact-DnTgL6UT.js");
46
46
  return maybeCompactCodexAppServerSession(params, { pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig });
47
47
  },
48
48
  reset: async (params) => {
@@ -52,7 +52,7 @@ function createCodexAppServerAgentHarness(options) {
52
52
  }
53
53
  },
54
54
  dispose: async () => {
55
- const { clearSharedCodexAppServerClientAndWait } = await import("./shared-client-C_RbGxW8.js").then((n) => n.a);
55
+ const { clearSharedCodexAppServerClientAndWait } = await import("./shared-client-CFCUGEVs.js").then((n) => n.a);
56
56
  await clearSharedCodexAppServerClientAndWait();
57
57
  }
58
58
  };
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { createCodexAppServerAgentHarness } from "./harness.js";
2
2
  import { c as readCodexPluginConfig, l as resolveCodexAppServerRuntimeOptions, t as CODEX_PLUGINS_MARKETPLACE_NAME } from "./config-DDMrwfJl.js";
3
3
  import { buildCodexProvider } from "./provider.js";
4
- import { _ as ensureCodexPluginActivation, b as defaultCodexAppInventoryCache, v as pluginReadParams } from "./thread-lifecycle-4Ul7RoW4.js";
4
+ import { v as ensureCodexPluginActivation, x as defaultCodexAppInventoryCache, y as pluginReadParams } from "./thread-lifecycle-DGoaguJh.js";
5
5
  import { buildCodexMediaUnderstandingProvider } from "./media-understanding-provider.js";
6
- import { i as describeControlFailure, n as buildCodexPluginAppCacheKey, t as requestCodexAppServerJson } from "./request-NklFaHM4.js";
6
+ import { i as describeControlFailure, n as buildCodexPluginAppCacheKey, t as requestCodexAppServerJson } from "./request-D93E78SA.js";
7
7
  import { s as formatCodexDisplayText } from "./notification-correlation-qKY_sgga.js";
8
- import { c as resolveCodexAppServerAuthAccountCacheKey, d as resolveCodexAppServerEnvApiKeyCacheKey, i as getSharedCodexAppServerClient, n as clearSharedCodexAppServerClientIfCurrentAndWait, u as resolveCodexAppServerAuthProfileIdForAgent } from "./shared-client-C_RbGxW8.js";
9
- import { a as resolveCodexCliSessionForBindingOnNode, c as handleCodexConversationInboundClaim, i as listCodexCliSessionsOnNode, n as createCodexCliSessionNodeInvokePolicies, o as resumeCodexCliSessionOnNode, s as handleCodexConversationBindingResolved, t as createCodexCliSessionNodeHostCommands } from "./node-cli-sessions-yVCifOyG.js";
8
+ import { c as resolveCodexAppServerAuthAccountCacheKey, d as resolveCodexAppServerEnvApiKeyCacheKey, i as getSharedCodexAppServerClient, n as clearSharedCodexAppServerClientIfCurrentAndWait, u as resolveCodexAppServerAuthProfileIdForAgent } from "./shared-client-CFCUGEVs.js";
9
+ import { a as resolveCodexCliSessionForBindingOnNode, c as handleCodexConversationInboundClaim, i as listCodexCliSessionsOnNode, n as createCodexCliSessionNodeInvokePolicies, o as resumeCodexCliSessionOnNode, s as handleCodexConversationBindingResolved, t as createCodexCliSessionNodeHostCommands } from "./node-cli-sessions-9CAqnIaA.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";
@@ -45,7 +45,7 @@ async function handleCodexCommand(ctx, options = {}) {
45
45
  }
46
46
  }
47
47
  async function loadDefaultCodexSubcommandHandler() {
48
- const { handleCodexSubcommand } = await import("./command-handlers-DsB0GYd2.js");
48
+ const { handleCodexSubcommand } = await import("./command-handlers-CcTABuem.js");
49
49
  return handleCodexSubcommand;
50
50
  }
51
51
  //#endregion
@@ -1,9 +1,9 @@
1
1
  import { CODEX_PROVIDER_ID, FALLBACK_CODEX_MODELS } from "./provider-catalog.js";
2
2
  import { l as resolveCodexAppServerRuntimeOptions } from "./config-DDMrwfJl.js";
3
3
  import { i as assertCodexTurnStartResponse, l as readCodexTurnCompletedNotification, o as readCodexErrorNotification, r as assertCodexThreadStartResponse } from "./protocol-validators-_gKDcd0x.js";
4
- import { i as readModelListResult } from "./models-B_uo1pf5.js";
4
+ import { i as readModelListResult } from "./models-DtGLkqMP.js";
5
5
  import { t as isJsonObject } from "./protocol-oeJQu4rs.js";
6
- import { n as buildCodexRuntimeThreadConfig } from "./thread-lifecycle-4Ul7RoW4.js";
6
+ import { n as buildCodexRuntimeThreadConfig } from "./thread-lifecycle-DGoaguJh.js";
7
7
  import { validateJsonSchemaValue } from "openclaw/plugin-sdk/json-schema-runtime";
8
8
  //#region extensions/codex/media-understanding-provider.ts
9
9
  const DEFAULT_CODEX_IMAGE_MODEL = FALLBACK_CODEX_MODELS.find((model) => model.inputModalities.includes("image"))?.id ?? FALLBACK_CODEX_MODELS[0]?.id;
@@ -63,7 +63,7 @@ async function runBoundedCodexVisionTurn(params) {
63
63
  const appServer = resolveCodexAppServerRuntimeOptions({ pluginConfig: params.options.pluginConfig });
64
64
  const timeoutMs = Math.max(100, params.timeoutMs);
65
65
  const ownsClient = !params.options.clientFactory;
66
- const client = params.options.clientFactory ? await params.options.clientFactory(appServer.start, params.profile) : await import("./shared-client-C_RbGxW8.js").then((n) => n.a).then(({ createIsolatedCodexAppServerClient }) => createIsolatedCodexAppServerClient({
66
+ const client = params.options.clientFactory ? await params.options.clientFactory(appServer.start, params.profile) : await import("./shared-client-CFCUGEVs.js").then((n) => n.a).then(({ createIsolatedCodexAppServerClient }) => createIsolatedCodexAppServerClient({
67
67
  startOptions: appServer.start,
68
68
  timeoutMs,
69
69
  authProfileId: params.profile
@@ -39,7 +39,7 @@ async function listAllCodexAppServerModels(options = {}) {
39
39
  async function withCodexAppServerModelClient(options, run) {
40
40
  const timeoutMs = options.timeoutMs ?? 2500;
41
41
  const useSharedClient = options.sharedClient !== false;
42
- const { createIsolatedCodexAppServerClient, getSharedCodexAppServerClient } = await import("./shared-client-C_RbGxW8.js").then((n) => n.a);
42
+ const { createIsolatedCodexAppServerClient, getSharedCodexAppServerClient } = await import("./shared-client-CFCUGEVs.js").then((n) => n.a);
43
43
  const client = useSharedClient ? await getSharedCodexAppServerClient({
44
44
  startOptions: options.startOptions,
45
45
  timeoutMs,
@@ -1,9 +1,9 @@
1
1
  import { a as isCodexFastServiceTier, l as resolveCodexAppServerRuntimeOptions, r as codexSandboxPolicyForTurn } from "./config-DDMrwfJl.js";
2
2
  import { t as isJsonObject } from "./protocol-oeJQu4rs.js";
3
3
  import { i as readCodexAppServerBinding, n as isCodexAppServerNativeAuthProfile, o as writeCodexAppServerBinding, r as normalizeCodexAppServerBindingModelProvider, t as clearCodexAppServerBinding } from "./session-binding-Bw_mfIW2.js";
4
- import { r as CODEX_CONTROL_METHODS } from "./request-NklFaHM4.js";
4
+ import { r as CODEX_CONTROL_METHODS } from "./request-D93E78SA.js";
5
5
  import { i as readCodexNotificationTurnId, r as readCodexNotificationThreadId, s as formatCodexDisplayText } from "./notification-correlation-qKY_sgga.js";
6
- import { i as getSharedCodexAppServerClient, u as resolveCodexAppServerAuthProfileIdForAgent } from "./shared-client-C_RbGxW8.js";
6
+ import { i as getSharedCodexAppServerClient, u as resolveCodexAppServerAuthProfileIdForAgent } from "./shared-client-CFCUGEVs.js";
7
7
  import { n as resolveCodexNativeExecutionBlock, r as resolveCodexNativeSandboxBlock } from "./sandbox-guard-CTnEWuor.js";
8
8
  import os from "node:os";
9
9
  import { materializeWindowsSpawnProgram, resolveWindowsSpawnProgram } from "openclaw/plugin-sdk/windows-spawn";
@@ -4,47 +4,32 @@ const CODEX_BASE_URL = "https://chatgpt.com/backend-api";
4
4
  const CODEX_APP_SERVER_AUTH_MARKER = "codex-app-server";
5
5
  const DEFAULT_CONTEXT_WINDOW = 272e3;
6
6
  const DEFAULT_MAX_TOKENS = 128e3;
7
- const FALLBACK_CODEX_MODELS = [
8
- {
9
- id: "gpt-5.5",
10
- model: "gpt-5.5",
11
- displayName: "gpt-5.5",
12
- description: "Latest frontier agentic coding model.",
13
- isDefault: true,
14
- inputModalities: ["text", "image"],
15
- supportedReasoningEfforts: [
16
- "low",
17
- "medium",
18
- "high",
19
- "xhigh"
20
- ]
21
- },
22
- {
23
- id: "gpt-5.4-mini",
24
- model: "gpt-5.4-mini",
25
- displayName: "GPT-5.4-Mini",
26
- description: "Smaller frontier agentic coding model.",
27
- inputModalities: ["text", "image"],
28
- supportedReasoningEfforts: [
29
- "low",
30
- "medium",
31
- "high",
32
- "xhigh"
33
- ]
34
- },
35
- {
36
- id: "gpt-5.2",
37
- model: "gpt-5.2",
38
- displayName: "gpt-5.2",
39
- inputModalities: ["text", "image"],
40
- supportedReasoningEfforts: [
41
- "low",
42
- "medium",
43
- "high",
44
- "xhigh"
45
- ]
46
- }
47
- ];
7
+ const FALLBACK_CODEX_MODELS = [{
8
+ id: "gpt-5.5",
9
+ model: "gpt-5.5",
10
+ displayName: "gpt-5.5",
11
+ description: "Latest frontier agentic coding model.",
12
+ isDefault: true,
13
+ inputModalities: ["text", "image"],
14
+ supportedReasoningEfforts: [
15
+ "low",
16
+ "medium",
17
+ "high",
18
+ "xhigh"
19
+ ]
20
+ }, {
21
+ id: "gpt-5.4-mini",
22
+ model: "gpt-5.4-mini",
23
+ displayName: "GPT-5.4-Mini",
24
+ description: "Smaller frontier agentic coding model.",
25
+ inputModalities: ["text", "image"],
26
+ supportedReasoningEfforts: [
27
+ "low",
28
+ "medium",
29
+ "high",
30
+ "xhigh"
31
+ ]
32
+ }];
48
33
  function buildCodexModelDefinition(model) {
49
34
  const id = model.id.trim() || model.model.trim();
50
35
  return {
package/dist/provider.js CHANGED
@@ -123,7 +123,7 @@ async function listModelsBestEffort(params) {
123
123
  }
124
124
  }
125
125
  async function listCodexAppServerModelsLazy(options) {
126
- const { listCodexAppServerModels } = await import("./models-B_uo1pf5.js").then((n) => n.r);
126
+ const { listCodexAppServerModels } = await import("./models-DtGLkqMP.js").then((n) => n.r);
127
127
  return listCodexAppServerModels(options);
128
128
  }
129
129
  function normalizeTimeoutMs(value) {
@@ -144,7 +144,7 @@ function isKnownXHighCodexModel(modelId) {
144
144
  }
145
145
  function isModernCodexModel(modelId) {
146
146
  const lower = modelId.trim().toLowerCase();
147
- return lower === "gpt-5.5" || lower === "gpt-5.4" || lower === "gpt-5.4-mini" || lower === "gpt-5.2";
147
+ return lower === "gpt-5.5" || lower === "gpt-5.4" || lower === "gpt-5.4-mini";
148
148
  }
149
149
  //#endregion
150
150
  export { buildCodexProvider, buildCodexProviderCatalog, isModernCodexModel };
@@ -1,6 +1,6 @@
1
- import { n as CodexAppServerRpcError } from "./client-D3SUwPFl.js";
2
- import { y as buildCodexAppInventoryCacheKey } from "./thread-lifecycle-4Ul7RoW4.js";
3
- import { f as resolveCodexAppServerHomeDir, i as getSharedCodexAppServerClient, o as withTimeout, r as createIsolatedCodexAppServerClient } from "./shared-client-C_RbGxW8.js";
1
+ import { n as CodexAppServerRpcError } from "./client-1sSy4p3z.js";
2
+ import { b as buildCodexAppInventoryCacheKey } from "./thread-lifecycle-DGoaguJh.js";
3
+ import { f as resolveCodexAppServerHomeDir, i as getSharedCodexAppServerClient, o as withTimeout, r as createIsolatedCodexAppServerClient } from "./shared-client-CFCUGEVs.js";
4
4
  import { t as resolveCodexAppServerDirectSandboxBypassBlock } from "./sandbox-guard-CTnEWuor.js";
5
5
  import { createHash } from "node:crypto";
6
6
  //#region extensions/codex/src/app-server/capabilities.ts
@@ -1,17 +1,17 @@
1
1
  import { c as readCodexPluginConfig, d as resolveCodexPluginsPolicy, f as withMcpElicitationsApprovalPolicy, i as isCodexAppServerApprovalPolicyAllowedByRequirements, l as resolveCodexAppServerRuntimeOptions, o as isCodexSandboxExecServerEnabled, u as resolveCodexComputerUseConfig } from "./config-DDMrwfJl.js";
2
2
  import { a as readCodexDynamicToolCallParams, c as readCodexTurn, i as assertCodexTurnStartResponse } from "./protocol-validators-_gKDcd0x.js";
3
3
  import { t as isJsonObject } from "./protocol-oeJQu4rs.js";
4
- import { a as isCodexAppServerConnectionClosedError, i as isCodexAppServerApprovalRequest, r as compareCodexAppServerVersions, s as MIN_CODEX_SANDBOX_EXEC_SERVER_APP_SERVER_VERSION } from "./client-D3SUwPFl.js";
5
- import { D as resolveCodexContextEngineProjectionReserveTokens, E as resolveCodexContextEngineProjectionMaxChars, S as sanitizeCodexHistoryImagePayloads, T as projectContextEngineAssemblyForCodex, b as defaultCodexAppInventoryCache, 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 } from "./thread-lifecycle-4Ul7RoW4.js";
4
+ import { a as isCodexAppServerConnectionClosedError, i as isCodexAppServerApprovalRequest, r as compareCodexAppServerVersions, s as MIN_CODEX_SANDBOX_EXEC_SERVER_APP_SERVER_VERSION } from "./client-1sSy4p3z.js";
5
+ import { C as sanitizeCodexHistoryImagePayloads, D as resolveCodexContextEngineProjectionMaxChars, E as projectContextEngineAssemblyForCodex, O as resolveCodexContextEngineProjectionReserveTokens, _ as shouldBuildCodexPluginThreadConfig, c as buildTurnStartParams, g as mergeCodexThreadConfigs, h as buildCodexPluginThreadConfigInputFingerprint, i as buildDeveloperInstructions, l as codexDynamicToolsFingerprint, m as buildCodexPluginThreadConfig, p as startOrResumeThread, r as buildContextEngineBinding, s as buildTurnCollaborationMode, t as areCodexDynamicToolFingerprintsCompatible, u as isContextEngineBindingCompatible, x as defaultCodexAppInventoryCache } from "./thread-lifecycle-DGoaguJh.js";
6
6
  import { i as readCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-Bw_mfIW2.js";
7
- import { n as buildCodexPluginAppCacheKey, r as CODEX_CONTROL_METHODS } from "./request-NklFaHM4.js";
7
+ import { n as buildCodexPluginAppCacheKey, r as CODEX_CONTROL_METHODS } from "./request-D93E78SA.js";
8
8
  import { g as shouldRefreshCodexRateLimitsForUsageLimitMessage, h as resolveCodexUsageLimitResetAtMs, i as readCodexNotificationTurnId, m as formatCodexUsageLimitErrorMessage, n as isCodexNotificationForTurn, r as readCodexNotificationThreadId, s as formatCodexDisplayText, t as describeCodexNotificationCorrelation } from "./notification-correlation-qKY_sgga.js";
9
- 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-C_RbGxW8.js";
9
+ 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-CFCUGEVs.js";
10
10
  import { i as resolveCodexNativeExecutionPolicy } from "./sandbox-guard-CTnEWuor.js";
11
- import { a as resolveCodexDynamicToolsLoading, i as normalizeCodexDynamicToolName, n as filterCodexDynamicTools, r as isForcedPrivateQaCodexRuntime, t as createCodexDynamicToolBridge } from "./dynamic-tools-DA42no4X.js";
12
- import { t as defaultCodexAppServerClientFactory } from "./client-factory-DdrIY1lw.js";
11
+ import { a as resolveCodexDynamicToolsLoading, i as normalizeCodexDynamicToolName, n as filterCodexDynamicTools, r as isForcedPrivateQaCodexRuntime, t as createCodexDynamicToolBridge } from "./dynamic-tools-Bq717oJR.js";
12
+ import { t as defaultCodexAppServerClientFactory } from "./client-factory-Bk6i4FnW.js";
13
13
  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";
14
- import { t as ensureCodexComputerUse } from "./computer-use-BMMwWwno.js";
14
+ import { t as ensureCodexComputerUse } from "./computer-use-Hdq1WgTA.js";
15
15
  import { n as rememberCodexRateLimits, t as readRecentCodexRateLimits } from "./rate-limit-cache-N66I-Rd7.js";
16
16
  import { createHash, randomUUID } from "node:crypto";
17
17
  import nodeFs from "node:fs";
@@ -324,6 +324,9 @@ var CodexAppServerEventProjector = class {
324
324
  this.guardianReviewCount = 0;
325
325
  this.completedCompactionCount = 0;
326
326
  }
327
+ getCompletedTurnStatus() {
328
+ return this.completedTurn?.status;
329
+ }
327
330
  async handleNotification(notification) {
328
331
  const params = isJsonObject(notification.params) ? notification.params : void 0;
329
332
  if (!params) return;
@@ -1338,6 +1341,23 @@ function readString$5(record, key) {
1338
1341
  const value = record[key];
1339
1342
  return typeof value === "string" ? value : void 0;
1340
1343
  }
1344
+ function normalizeNonEmptyString(value) {
1345
+ if (typeof value !== "string") return;
1346
+ return value.trim() || void 0;
1347
+ }
1348
+ function readNonEmptyString$1(record, key) {
1349
+ return normalizeNonEmptyString(record[key]);
1350
+ }
1351
+ function readNonEmptyStringArray(record, key) {
1352
+ const value = record[key];
1353
+ if (!Array.isArray(value)) return [];
1354
+ const entries = [];
1355
+ for (const entry of value) {
1356
+ const normalized = normalizeNonEmptyString(entry);
1357
+ if (normalized) entries.push(normalized);
1358
+ }
1359
+ return entries;
1360
+ }
1341
1361
  function readNullableString$1(record, key) {
1342
1362
  const value = record[key];
1343
1363
  if (value === null) return null;
@@ -1524,9 +1544,25 @@ function itemToolArgs(item) {
1524
1544
  ...typeof item.cwd === "string" ? { cwd: item.cwd } : {}
1525
1545
  });
1526
1546
  if (item.type === "fileChange") return sanitizeCodexAgentEventRecord({ changes: itemFileChanges(item) });
1527
- if (item.type === "webSearch" && typeof item.query === "string") return sanitizeCodexAgentEventRecord({ query: item.query });
1547
+ if (item.type === "webSearch") return webSearchToolArgs(item);
1528
1548
  if (item.type === "dynamicToolCall" || item.type === "mcpToolCall") return sanitizeCodexToolArguments(item.arguments);
1529
1549
  }
1550
+ function webSearchToolArgs(item) {
1551
+ const action = isJsonObject(item.action) ? item.action : void 0;
1552
+ const actionType = action ? readNonEmptyString$1(action, "type") : void 0;
1553
+ const queries = action && actionType === "search" ? readNonEmptyStringArray(action, "queries") : [];
1554
+ const query = normalizeNonEmptyString(item.query) ?? (action && actionType === "search" ? readNonEmptyString$1(action, "query") : void 0) ?? queries[0];
1555
+ const url = action ? readNonEmptyString$1(action, "url") : void 0;
1556
+ const pattern = action ? readNonEmptyString$1(action, "pattern") : void 0;
1557
+ const args = {};
1558
+ if (query) args.query = query;
1559
+ if (queries.length > 0) args.queries = queries;
1560
+ if (actionType && actionType !== "search") args.action = actionType;
1561
+ if (url) args.url = url;
1562
+ if (pattern) args.pattern = pattern;
1563
+ if (!query && !url && !pattern) args.queryUnavailable = true;
1564
+ return sanitizeCodexAgentEventRecord(args);
1565
+ }
1530
1566
  function itemToolResult(item) {
1531
1567
  if (item.type === "commandExecution") return { result: sanitizeCodexAgentEventRecord({
1532
1568
  status: item.status,
@@ -1543,9 +1579,16 @@ function itemToolResult(item) {
1543
1579
  ...item.error ? { error: item.error } : {},
1544
1580
  ...item.result ? { result: item.result } : {}
1545
1581
  }) };
1546
- if (item.type === "webSearch") return { result: sanitizeCodexAgentEventRecord({ status: "completed" }) };
1582
+ if (item.type === "webSearch") return { result: webSearchToolResult(item) };
1547
1583
  return {};
1548
1584
  }
1585
+ function webSearchToolResult(item) {
1586
+ return sanitizeCodexAgentEventRecord({
1587
+ status: itemStatus(item),
1588
+ ...typeof item.durationMs === "number" ? { durationMs: item.durationMs } : {},
1589
+ ...webSearchToolArgs(item)
1590
+ });
1591
+ }
1549
1592
  function itemFileChanges(item) {
1550
1593
  return Array.isArray(item.changes) ? item.changes.map((change) => ({
1551
1594
  path: change.path,
@@ -1562,7 +1605,7 @@ function itemMeta(item, detailMode = "explain") {
1562
1605
  command: item.command,
1563
1606
  cwd: typeof item.cwd === "string" ? item.cwd : void 0
1564
1607
  }, { detailMode });
1565
- if (item.type === "webSearch" && typeof item.query === "string") return item.query;
1608
+ if (item.type === "webSearch") return inferToolMetaFromArgs("web_search", webSearchToolArgs(item), { detailMode });
1566
1609
  const toolName = itemName(item);
1567
1610
  if ((item.type === "dynamicToolCall" || item.type === "mcpToolCall") && toolName) return inferToolMetaFromArgs(toolName, item.arguments, { detailMode });
1568
1611
  }
@@ -3217,6 +3260,10 @@ async function runStreamingSandboxHttpRequest(execServer, socket, requestId, par
3217
3260
  child.once("close", () => {
3218
3261
  socket.off("close", abortOnSocketClose);
3219
3262
  });
3263
+ child.stdin.on("error", (error) => {
3264
+ if (error.code === "EPIPE" || error.code === "ERR_STREAM_DESTROYED") return;
3265
+ embeddedAgentLog.warn("codex sandbox http/request stdin write failed", { error });
3266
+ });
3220
3267
  child.stdin.end(JSON.stringify(params));
3221
3268
  return await readStreamingSandboxHttpResponse({
3222
3269
  child,
@@ -3689,7 +3736,6 @@ function readStringList(value) {
3689
3736
  //#endregion
3690
3737
  //#region extensions/codex/src/app-server/sandbox-exec-server.ts
3691
3738
  const SANDBOX_EXEC_SERVERS = /* @__PURE__ */ new Map();
3692
- const EXEC_SERVER_CLOSE_GRACE_MS = 1e3;
3693
3739
  async function ensureCodexSandboxExecServerEnvironment(params) {
3694
3740
  if (!params.sandbox?.enabled || !params.sandbox.backend) return;
3695
3741
  if (!canExposeLocalExecServerToAppServer(params.appServerStartOptions)) throw new Error("OpenClaw Codex exec-server uses a local loopback URL and cannot be registered with a remote Codex app-server.");
@@ -3808,18 +3854,7 @@ async function closeOpenClawExecServer(execServer) {
3808
3854
  execServer.closed = true;
3809
3855
  for (const client of execServer.server.clients) client.close(1001, "shutdown");
3810
3856
  await new Promise((resolve) => {
3811
- let fallbackTimer;
3812
- const forceCloseTimer = setTimeout(() => {
3813
- for (const client of execServer.server.clients) client.terminate();
3814
- fallbackTimer = setTimeout(resolve, EXEC_SERVER_CLOSE_GRACE_MS);
3815
- fallbackTimer.unref?.();
3816
- }, EXEC_SERVER_CLOSE_GRACE_MS);
3817
- forceCloseTimer.unref?.();
3818
- execServer.server.close(() => {
3819
- clearTimeout(forceCloseTimer);
3820
- if (fallbackTimer) clearTimeout(fallbackTimer);
3821
- resolve();
3822
- });
3857
+ execServer.server.close(() => resolve());
3823
3858
  });
3824
3859
  }
3825
3860
  function buildEnvironmentId(sandbox) {
@@ -4273,10 +4308,13 @@ const CODEX_APP_SERVER_UNSUBSCRIBE_TIMEOUT_MS = 5e3;
4273
4308
  const CODEX_USAGE_LIMIT_RATE_LIMIT_REFRESH_TIMEOUT_MS = 5e3;
4274
4309
  const CODEX_TURN_COMPLETION_IDLE_TIMEOUT_MS = 6e4;
4275
4310
  const CODEX_TURN_ASSISTANT_COMPLETION_IDLE_TIMEOUT_MS = 1e4;
4311
+ const CODEX_POST_REASONING_SOURCE_REPLY_IDLE_TIMEOUT_MS = 5 * 6e4;
4276
4312
  const CODEX_TURN_TERMINAL_IDLE_TIMEOUT_MS = 30 * 6e4;
4277
4313
  const CODEX_NATIVE_HOOK_RELAY_MIN_TTL_MS = 30 * 6e4;
4278
4314
  const CODEX_NATIVE_HOOK_RELAY_TTL_GRACE_MS = 5 * 6e4;
4279
4315
  const CODEX_NATIVE_HOOK_RELAY_RENEW_INTERVAL_MS = 6e4;
4316
+ const CODEX_NATIVE_HOOK_RELAY_UNREGISTER_GRACE_MS = 1e4;
4317
+ const CODEX_NATIVE_HOOK_RELAY_UNREGISTER_EXTRA_GRACE_MS = 5e3;
4280
4318
  const CODEX_STEER_ALL_DEBOUNCE_MS = 500;
4281
4319
  const LOG_FIELD_MAX_LENGTH = 160;
4282
4320
  const CODEX_NATIVE_SANDBOX_TOOL_REQUIREMENTS = [
@@ -4289,12 +4327,13 @@ const CODEX_NATIVE_SANDBOX_TOOL_REQUIREMENTS = [
4289
4327
  ];
4290
4328
  const CODEX_MEMORY_FLUSH_DYNAMIC_TOOL_ALLOW = new Set(["read", "write"]);
4291
4329
  const CODEX_NATIVE_PROJECT_DOC_BASENAMES = new Set(["agents.md"]);
4292
- const CODEX_WORKSPACE_DEVELOPER_CONTEXT_BASENAMES = new Set([
4330
+ const CODEX_INHERITED_WORKSPACE_DEVELOPER_CONTEXT_BASENAMES = new Set(["tools.md"]);
4331
+ const CODEX_TURN_SCOPED_WORKSPACE_DEVELOPER_CONTEXT_BASENAMES = new Set([
4293
4332
  "identity.md",
4294
4333
  "soul.md",
4295
- "tools.md",
4296
4334
  "user.md"
4297
4335
  ]);
4336
+ const CODEX_WORKSPACE_DEVELOPER_CONTEXT_BASENAMES = new Set([...CODEX_INHERITED_WORKSPACE_DEVELOPER_CONTEXT_BASENAMES, ...CODEX_TURN_SCOPED_WORKSPACE_DEVELOPER_CONTEXT_BASENAMES]);
4298
4337
  const CODEX_HEARTBEAT_CONTEXT_BASENAME = "heartbeat.md";
4299
4338
  const CODEX_NATIVE_HOOK_RELAY_EVENTS_WITH_APP_SERVER_APPROVALS = CODEX_NATIVE_HOOK_RELAY_EVENTS.filter((event) => event !== "permission_request");
4300
4339
  const CODEX_BOOTSTRAP_CONTEXT_ORDER = new Map([
@@ -4306,6 +4345,28 @@ const CODEX_BOOTSTRAP_CONTEXT_ORDER = new Map([
4306
4345
  ["memory.md", 60],
4307
4346
  ["heartbeat.md", 70]
4308
4347
  ]);
4348
+ const pendingCodexNativeHookRelayUnregisters = /* @__PURE__ */ new Set();
4349
+ function scheduleCodexNativeHookRelayUnregister(params) {
4350
+ let pending;
4351
+ const unregister = () => {
4352
+ if (!pending) return;
4353
+ const current = pending;
4354
+ pending = void 0;
4355
+ if (!pendingCodexNativeHookRelayUnregisters.delete(current)) return;
4356
+ params.relay.unregister();
4357
+ };
4358
+ const timeout = setTimeout(unregister, resolveCodexNativeHookRelayUnregisterGraceMs(params.hookTimeoutSec));
4359
+ pending = {
4360
+ timeout,
4361
+ unregister
4362
+ };
4363
+ pendingCodexNativeHookRelayUnregisters.add(pending);
4364
+ timeout.unref();
4365
+ }
4366
+ function resolveCodexNativeHookRelayUnregisterGraceMs(hookTimeoutSec) {
4367
+ const hookTimeoutMs = typeof hookTimeoutSec === "number" && Number.isFinite(hookTimeoutSec) && hookTimeoutSec > 0 ? Math.ceil(hookTimeoutSec) * 1e3 : 0;
4368
+ return Math.max(CODEX_NATIVE_HOOK_RELAY_UNREGISTER_GRACE_MS, hookTimeoutMs + CODEX_NATIVE_HOOK_RELAY_UNREGISTER_EXTRA_GRACE_MS);
4369
+ }
4309
4370
  function emitCodexAppServerEvent(params, event) {
4310
4371
  try {
4311
4372
  emitAgentEvent({
@@ -5024,6 +5085,11 @@ async function runCodexAppServerAttempt(params, options = {}) {
5024
5085
  const refreshCodexTurnPromptText = () => {
5025
5086
  codexTurnPromptText = decorateCodexTurnPromptText(promptBuild.prompt);
5026
5087
  };
5088
+ const buildCodexTurnCollaborationDeveloperInstructions = () => buildTurnCollaborationMode(params, {
5089
+ turnScopedDeveloperInstructions: workspaceBootstrapContext.turnScopedDeveloperInstructions,
5090
+ heartbeatCollaborationInstructions: workspaceBootstrapContext.heartbeatCollaborationInstructions
5091
+ }).settings.developer_instructions ?? void 0;
5092
+ const buildRenderedCodexDeveloperInstructions = () => joinPresentSections(promptBuild.developerInstructions, buildCodexTurnCollaborationDeveloperInstructions());
5027
5093
  const rebuildPromptAfterContextEngineCompaction = async () => {
5028
5094
  historyMessages = await readMirroredSessionHistoryMessages(activeSessionFile) ?? historyMessages;
5029
5095
  resetCodexPromptInputs();
@@ -5039,16 +5105,17 @@ async function runCodexAppServerAttempt(params, options = {}) {
5039
5105
  const contextTokenBudget = typeof params.contextTokenBudget === "number" && Number.isFinite(params.contextTokenBudget) ? Math.floor(params.contextTokenBudget) : typeof params.contextWindowInfo?.tokens === "number" && Number.isFinite(params.contextWindowInfo.tokens) ? Math.floor(params.contextWindowInfo.tokens) : void 0;
5040
5106
  if (!contextTokenBudget || contextTokenBudget <= 0) return;
5041
5107
  const reserveTokens = resolveCodexContextEngineProjectionReserveTokens({ config: params.config }) ?? 2e4;
5042
- const renderedChars = codexTurnPromptText.length + (promptBuild.developerInstructions?.length ?? 0);
5108
+ const renderedDeveloperInstructions = buildRenderedCodexDeveloperInstructions();
5109
+ const renderedChars = codexTurnPromptText.length + renderedDeveloperInstructions.length;
5043
5110
  return shouldPreemptivelyCompactBeforePrompt({
5044
5111
  messages: historyMessages,
5045
- systemPrompt: promptBuild.developerInstructions,
5112
+ systemPrompt: renderedDeveloperInstructions,
5046
5113
  prompt: codexTurnPromptText,
5047
5114
  contextTokenBudget,
5048
5115
  reserveTokens,
5049
5116
  llmBoundaryTokenPressure: {
5050
5117
  estimatedPromptTokens: estimateRenderedLlmBoundaryTokenPressure({
5051
- systemPrompt: promptBuild.developerInstructions,
5118
+ systemPrompt: renderedDeveloperInstructions,
5052
5119
  prompt: codexTurnPromptText
5053
5120
  }),
5054
5121
  source: "codex_app_server_rendered_prompt",
@@ -5091,7 +5158,7 @@ async function runCodexAppServerAttempt(params, options = {}) {
5091
5158
  attempt: params,
5092
5159
  sessionKey: contextSessionKey,
5093
5160
  workspaceDir: effectiveWorkspace,
5094
- developerInstructions: promptBuild.developerInstructions,
5161
+ developerInstructions: buildRenderedCodexDeveloperInstructions(),
5095
5162
  workspaceBootstrapContext,
5096
5163
  skillsPrompt: openClawPromptContext ? params.skillsSnapshot?.prompt ?? "" : "",
5097
5164
  tools: toolBridge.availableSpecs
@@ -5099,7 +5166,7 @@ async function runCodexAppServerAttempt(params, options = {}) {
5099
5166
  const trajectoryRecorder = createCodexTrajectoryRecorder({
5100
5167
  attempt: params,
5101
5168
  cwd: effectiveWorkspace,
5102
- developerInstructions: promptBuild.developerInstructions,
5169
+ developerInstructions: buildRenderedCodexDeveloperInstructions(),
5103
5170
  prompt: codexTurnPromptText,
5104
5171
  tools: toolBridge.availableSpecs
5105
5172
  });
@@ -5367,6 +5434,7 @@ async function runCodexAppServerAttempt(params, options = {}) {
5367
5434
  let turnCompletionIdleTimeoutMessage;
5368
5435
  let clientClosedPromptError;
5369
5436
  let clientClosedAbort = false;
5437
+ let shouldDelayNativeHookRelayUnregister = false;
5370
5438
  let lifecycleStarted = false;
5371
5439
  let lifecycleTerminalEmitted = false;
5372
5440
  let resolveCompletion;
@@ -5797,7 +5865,8 @@ async function runCodexAppServerAttempt(params, options = {}) {
5797
5865
  if (isCurrentTurnNotification && (rawToolOutputCompletion || isNativeToolProgressNotification(notification))) turnCrossedToolHandoff = true;
5798
5866
  const assistantCompletionCanRelease = isAssistantCompletionReleaseNotification(notification, turnCrossedToolHandoff);
5799
5867
  const postToolRawAssistantCompletionNeedsTerminalGuard = isCurrentTurnNotification && turnCrossedToolHandoff && isRawAssistantCompletionNotification(notification) && activeTurnItemIds.size === 0;
5800
- const shouldRearmCompletionIdleWatchAfterLastCurrentTurnItem = isCurrentTurnNotification && notification.method === "item/completed" && activeTurnItemIds.size === 0 && !trackedDynamicToolCompletion && !assistantCompletionCanRelease;
5868
+ const shouldArmPostReasoningSourceReplyWatch = isCurrentTurnNotification && isReasoningItemCompletionNotification(notification) && activeTurnItemIds.size === 0 && params.sourceReplyDeliveryMode === "message_tool_only";
5869
+ const shouldRearmCompletionIdleWatchAfterLastCurrentTurnItem = isCurrentTurnNotification && notification.method === "item/completed" && activeTurnItemIds.size === 0 && !trackedDynamicToolCompletion && !assistantCompletionCanRelease && !shouldArmPostReasoningSourceReplyWatch;
5801
5870
  if (isCurrentTurnNotification && notification.method === "error") {
5802
5871
  if (isRetryableErrorNotification(notification.params)) disarmTurnCompletionIdleWatch();
5803
5872
  else armTurnCompletionIdleWatch({ pinnedByTerminalError: true });
@@ -5805,11 +5874,12 @@ async function runCodexAppServerAttempt(params, options = {}) {
5805
5874
  } else if (isTurnCompletion) disarmTurnAssistantCompletionIdleWatch();
5806
5875
  else if (isCurrentTurnNotification && assistantCompletionCanRelease) armTurnAssistantCompletionIdleWatch(describeNotificationActivity(notification));
5807
5876
  else if (postToolRawAssistantCompletionNeedsTerminalGuard) armTurnCompletionIdleWatch({ timeoutMs: postToolRawAssistantCompletionIdleTimeoutMs });
5877
+ else if (shouldArmPostReasoningSourceReplyWatch) armTurnCompletionIdleWatch({ timeoutMs: CODEX_POST_REASONING_SOURCE_REPLY_IDLE_TIMEOUT_MS });
5808
5878
  else if (unblockedAssistantCompletionRelease) armTurnAssistantCompletionIdleWatch(describeNotificationActivity(notification));
5809
5879
  else if (shouldRearmCompletionIdleWatchAfterLastCurrentTurnItem) armTurnCompletionIdleWatch();
5810
5880
  else if (isCurrentTurnNotification && rawToolOutputCompletion) armTurnCompletionIdleWatch();
5811
5881
  else if (isCurrentTurnNotification && shouldDisarmAssistantCompletionIdleWatch(notification)) disarmTurnAssistantCompletionIdleWatch();
5812
- if (turnCompletionIdleWatchArmed && !turnCompletionIdleWatchPinnedByTerminalError && notification.method !== "turn/completed" && isCurrentTurnNotification && !trackedDynamicToolCompletion && !rawToolOutputCompletion && !postToolRawAssistantCompletionNeedsTerminalGuard && !shouldRearmCompletionIdleWatchAfterLastCurrentTurnItem) disarmTurnCompletionIdleWatch();
5882
+ if (turnCompletionIdleWatchArmed && !turnCompletionIdleWatchPinnedByTerminalError && notification.method !== "turn/completed" && isCurrentTurnNotification && !trackedDynamicToolCompletion && !rawToolOutputCompletion && !postToolRawAssistantCompletionNeedsTerminalGuard && !shouldArmPostReasoningSourceReplyWatch && !shouldRearmCompletionIdleWatchAfterLastCurrentTurnItem) disarmTurnCompletionIdleWatch();
5813
5883
  if (trackedDynamicToolCompletion) {
5814
5884
  const itemId = readNotificationItemId(notification);
5815
5885
  if (itemId) {
@@ -6088,7 +6158,7 @@ async function runCodexAppServerAttempt(params, options = {}) {
6088
6158
  sessionId: params.sessionId,
6089
6159
  provider: params.provider,
6090
6160
  model: params.modelId,
6091
- systemPrompt: promptBuild.developerInstructions,
6161
+ systemPrompt: buildRenderedCodexDeveloperInstructions(),
6092
6162
  prompt: codexTurnPromptText,
6093
6163
  historyMessages,
6094
6164
  imagesCount: params.images?.length ?? 0
@@ -6105,6 +6175,7 @@ async function runCodexAppServerAttempt(params, options = {}) {
6105
6175
  promptText: codexTurnPromptText,
6106
6176
  sandboxPolicy: codexSandboxPolicy,
6107
6177
  environmentSelection: codexEnvironmentSelection,
6178
+ turnScopedDeveloperInstructions: workspaceBootstrapContext.turnScopedDeveloperInstructions,
6108
6179
  heartbeatCollaborationInstructions: workspaceBootstrapContext.heartbeatCollaborationInstructions
6109
6180
  }), {
6110
6181
  timeoutMs: params.timeoutMs,
@@ -6452,6 +6523,7 @@ async function runCodexAppServerAttempt(params, options = {}) {
6452
6523
  },
6453
6524
  ctx: hookContext
6454
6525
  });
6526
+ shouldDelayNativeHookRelayUnregister = activeProjector.getCompletedTurnStatus() === "completed" && !timedOut && !runAbortController.signal.aborted && !finalAborted && !finalPromptError;
6455
6527
  return {
6456
6528
  ...result,
6457
6529
  timedOut,
@@ -6503,7 +6575,11 @@ async function runCodexAppServerAttempt(params, options = {}) {
6503
6575
  notificationCleanup();
6504
6576
  requestCleanup();
6505
6577
  closeCleanup?.();
6506
- nativeHookRelay?.unregister();
6578
+ if (nativeHookRelay) if (shouldDelayNativeHookRelayUnregister) scheduleCodexNativeHookRelayUnregister({
6579
+ relay: nativeHookRelay,
6580
+ hookTimeoutSec: options.nativeHookRelay?.hookTimeoutSec
6581
+ });
6582
+ else nativeHookRelay.unregister();
6507
6583
  await releaseSandboxExecEnvironment();
6508
6584
  runAbortController.signal.removeEventListener("abort", abortListener);
6509
6585
  params.abortSignal?.removeEventListener("abort", abortFromUpstream);
@@ -6887,15 +6963,6 @@ async function buildDynamicTools(input) {
6887
6963
  message
6888
6964
  }
6889
6965
  });
6890
- },
6891
- onAsyncTaskStarted: (message) => {
6892
- emitCodexAppServerEvent(params, {
6893
- stream: "codex_app_server.tool",
6894
- data: {
6895
- name: "media_async_task_started",
6896
- message
6897
- }
6898
- });
6899
6966
  }
6900
6967
  });
6901
6968
  const filteredTools = filterCodexDynamicToolsForAllowlist(filterToolsForVisionInputs(addNodeShellDynamicToolsIfNeeded(addSandboxShellDynamicToolsIfAvailable(isCodexMemoryFlushRun(params) ? filterCodexMemoryFlushDynamicTools(allTools) : filterCodexDynamicTools(allTools, input.pluginConfig), allTools, input), allTools, input), {
@@ -7341,6 +7408,11 @@ function isCompletedAssistantNotification(notification) {
7341
7408
  const item = isJsonObject(notification.params.item) ? notification.params.item : void 0;
7342
7409
  return Boolean(item && readString(item, "type") === "agentMessage" && readString(item, "phase") !== "commentary");
7343
7410
  }
7411
+ function isReasoningItemCompletionNotification(notification) {
7412
+ if (!isJsonObject(notification.params) || notification.method !== "item/completed") return false;
7413
+ const item = isJsonObject(notification.params.item) ? notification.params.item : void 0;
7414
+ return item ? readString(item, "type") === "reasoning" : false;
7415
+ }
7344
7416
  function isAssistantCompletionReleaseNotification(notification, turnCrossedToolHandoff) {
7345
7417
  if (isCompletedAssistantNotification(notification)) return true;
7346
7418
  return !turnCrossedToolHandoff && isRawAssistantCompletionNotification(notification);
@@ -7482,16 +7554,19 @@ async function buildCodexWorkspaceBootstrapContext(params) {
7482
7554
  targetWorkspaceDir: params.effectiveWorkspace
7483
7555
  }));
7484
7556
  const promptContextFiles = selectCodexWorkspacePromptContextFiles(contextFiles);
7485
- const developerInstructionFiles = shouldInjectCodexOpenClawPromptContext(params.params) ? selectCodexWorkspaceDeveloperInstructionFiles(contextFiles) : [];
7557
+ const developerInstructionFiles = shouldInjectCodexOpenClawPromptContext(params.params) ? selectCodexWorkspaceInheritedDeveloperInstructionFiles(contextFiles) : [];
7558
+ const turnScopedDeveloperInstructionFiles = shouldInjectCodexOpenClawPromptContext(params.params) ? selectCodexWorkspaceTurnScopedDeveloperInstructionFiles(contextFiles) : [];
7486
7559
  const heartbeatReferenceFiles = selectCodexWorkspaceHeartbeatReferenceFiles(contextFiles);
7487
7560
  return {
7488
7561
  ...bootstrapContext,
7489
7562
  contextFiles,
7490
7563
  promptContextFiles,
7491
7564
  developerInstructionFiles,
7565
+ turnScopedDeveloperInstructionFiles,
7492
7566
  heartbeatReferenceFiles,
7493
7567
  promptContext: renderCodexWorkspaceBootstrapPromptContext(promptContextFiles),
7494
- developerInstructions: renderCodexWorkspaceDeveloperInstructions(developerInstructionFiles),
7568
+ developerInstructions: renderCodexWorkspaceThreadDeveloperInstructions(developerInstructionFiles),
7569
+ turnScopedDeveloperInstructions: renderCodexWorkspaceCollaborationDeveloperInstructions(turnScopedDeveloperInstructionFiles),
7495
7570
  heartbeatCollaborationInstructions: renderCodexWorkspaceHeartbeatReference(heartbeatReferenceFiles)
7496
7571
  };
7497
7572
  } catch (error) {
@@ -7526,7 +7601,7 @@ function buildCodexSystemPromptReport(params) {
7526
7601
  injectedWorkspaceFiles: buildCodexBootstrapInjectionStats({
7527
7602
  bootstrapFiles: params.workspaceBootstrapContext.bootstrapFiles,
7528
7603
  injectedFiles: params.workspaceBootstrapContext.promptContextFiles ?? [],
7529
- developerInstructionFiles: params.workspaceBootstrapContext.developerInstructionFiles ?? []
7604
+ developerInstructionFiles: [...params.workspaceBootstrapContext.developerInstructionFiles ?? [], ...params.workspaceBootstrapContext.turnScopedDeveloperInstructionFiles ?? []]
7530
7605
  }),
7531
7606
  skills: {
7532
7607
  promptChars: skillsPrompt.length,
@@ -7671,7 +7746,7 @@ function renderCodexWorkspaceBootstrapPromptContext(contextFiles) {
7671
7746
  const files = selectCodexWorkspacePromptContextFiles(contextFiles);
7672
7747
  if (files.length === 0) return;
7673
7748
  const lines = [
7674
- "OpenClaw loaded these user-editable workspace files for the current turn. Codex loads AGENTS.md natively. SOUL.md, IDENTITY.md, TOOLS.md, and USER.md are provided separately as Codex developer instructions. HEARTBEAT.md is handled by heartbeat collaboration-mode guidance. Those files are not repeated here.",
7749
+ "OpenClaw loaded these user-editable workspace files for the current turn. Codex loads AGENTS.md natively. TOOLS.md is provided as inherited Codex developer instructions. SOUL.md, IDENTITY.md, and USER.md are provided as turn-scoped collaboration instructions so native Codex subagents do not inherit them. HEARTBEAT.md is handled by heartbeat collaboration-mode guidance. Those files are not repeated here.",
7675
7750
  "",
7676
7751
  "# Project Context",
7677
7752
  "",
@@ -7687,18 +7762,39 @@ function selectCodexWorkspacePromptContextFiles(contextFiles) {
7687
7762
  return baseName && !CODEX_NATIVE_PROJECT_DOC_BASENAMES.has(baseName) && !CODEX_WORKSPACE_DEVELOPER_CONTEXT_BASENAMES.has(baseName) && baseName !== CODEX_HEARTBEAT_CONTEXT_BASENAME && !isMissingCodexBootstrapContextFile(file);
7688
7763
  }).toSorted(compareCodexContextFiles);
7689
7764
  }
7690
- function selectCodexWorkspaceDeveloperInstructionFiles(contextFiles) {
7765
+ function selectCodexWorkspaceInheritedDeveloperInstructionFiles(contextFiles) {
7766
+ return selectCodexWorkspaceDeveloperInstructionFiles(contextFiles, CODEX_INHERITED_WORKSPACE_DEVELOPER_CONTEXT_BASENAMES);
7767
+ }
7768
+ function selectCodexWorkspaceTurnScopedDeveloperInstructionFiles(contextFiles) {
7769
+ return selectCodexWorkspaceDeveloperInstructionFiles(contextFiles, CODEX_TURN_SCOPED_WORKSPACE_DEVELOPER_CONTEXT_BASENAMES);
7770
+ }
7771
+ function selectCodexWorkspaceDeveloperInstructionFiles(contextFiles, basenames) {
7691
7772
  return contextFiles.filter((file) => {
7692
7773
  const baseName = getCodexContextFileBasename(file.path);
7693
- return baseName && CODEX_WORKSPACE_DEVELOPER_CONTEXT_BASENAMES.has(baseName) && !isMissingCodexBootstrapContextFile(file) && file.content.trim().length > 0;
7774
+ return baseName && basenames.has(baseName) && !isMissingCodexBootstrapContextFile(file) && file.content.trim().length > 0;
7694
7775
  }).toSorted(compareCodexContextFiles);
7695
7776
  }
7696
- function renderCodexWorkspaceDeveloperInstructions(files) {
7777
+ function renderCodexWorkspaceThreadDeveloperInstructions(files) {
7778
+ return renderCodexWorkspaceDeveloperInstructions({
7779
+ files,
7780
+ header: "## OpenClaw Workspace Instructions",
7781
+ preamble: "OpenClaw loaded these workspace instruction files from the active agent workspace. Internalize and follow them accordingly."
7782
+ });
7783
+ }
7784
+ function renderCodexWorkspaceCollaborationDeveloperInstructions(files) {
7785
+ return renderCodexWorkspaceDeveloperInstructions({
7786
+ files,
7787
+ header: "## OpenClaw Agent Soul",
7788
+ preamble: "OpenClaw loaded these workspace instruction files from the active agent workspace. They are the canonical definitions of who you are, how you think and work, and the human you work alongside. Internalize and follow them accordingly."
7789
+ });
7790
+ }
7791
+ function renderCodexWorkspaceDeveloperInstructions(params) {
7792
+ const { files, header, preamble } = params;
7697
7793
  if (files.length === 0) return;
7698
7794
  const lines = [
7699
- "## OpenClaw Agent Soul",
7795
+ header,
7700
7796
  "",
7701
- "OpenClaw loaded these workspace instruction files from the active agent workspace. They define who you are, how you work, what tools are available, and the human you work alongside. Internalize and follow them accordingly.",
7797
+ preamble,
7702
7798
  ""
7703
7799
  ];
7704
7800
  for (const file of files) lines.push(`### ${file.path}`, "", file.content, "");
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
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-D3SUwPFl.js";
3
+ import { c as resolveCodexAppServerSpawnEnv, o as MANAGED_CODEX_APP_SERVER_PACKAGE, t as CodexAppServerClient } from "./client-1sSy4p3z.js";
4
4
  import { createRequire } from "node:module";
5
5
  import { createHash } from "node:crypto";
6
6
  import { constants, readFileSync } from "node:fs";
@@ -1,13 +1,13 @@
1
1
  import { c as readCodexPluginConfig, l as resolveCodexAppServerRuntimeOptions } from "./config-DDMrwfJl.js";
2
2
  import { a as readCodexDynamicToolCallParams, c as readCodexTurn, i as assertCodexTurnStartResponse, t as assertCodexThreadForkResponse } from "./protocol-validators-_gKDcd0x.js";
3
3
  import { t as isJsonObject } from "./protocol-oeJQu4rs.js";
4
- import { i as isCodexAppServerApprovalRequest } from "./client-D3SUwPFl.js";
5
- import { d as resolveReasoningEffort, h as mergeCodexThreadConfigs, n as buildCodexRuntimeThreadConfig, u as resolveCodexAppServerModelProvider } from "./thread-lifecycle-4Ul7RoW4.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
6
  import { i as readCodexAppServerBinding } from "./session-binding-Bw_mfIW2.js";
7
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-C_RbGxW8.js";
8
+ import { i as getSharedCodexAppServerClient, s as refreshCodexAppServerAuthTokens } from "./shared-client-CFCUGEVs.js";
9
9
  import { n as resolveCodexNativeExecutionBlock } from "./sandbox-guard-CTnEWuor.js";
10
- import { a as resolveCodexDynamicToolsLoading, n as filterCodexDynamicTools, t as createCodexDynamicToolBridge } from "./dynamic-tools-DA42no4X.js";
10
+ import { a as resolveCodexDynamicToolsLoading, n as filterCodexDynamicTools, t as createCodexDynamicToolBridge } from "./dynamic-tools-Bq717oJR.js";
11
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";
12
12
  import { n as rememberCodexRateLimits, t as readRecentCodexRateLimits } from "./rate-limit-cache-N66I-Rd7.js";
13
13
  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,6 +1,6 @@
1
1
  import { l as resolveCodexAppServerRuntimeOptions } from "./config-DDMrwfJl.js";
2
- import { a as buildThreadResumeParams, i as buildDeveloperInstructions, o as buildThreadStartParams, s as buildTurnStartParams } from "./thread-lifecycle-4Ul7RoW4.js";
3
- import { n as filterCodexDynamicTools, t as createCodexDynamicToolBridge } from "./dynamic-tools-DA42no4X.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";
4
4
  //#region extensions/codex/test-api.ts
5
5
  function resolveCodexPromptSnapshotAppServerOptions(pluginConfig) {
6
6
  return resolveCodexAppServerRuntimeOptions({
@@ -31,6 +31,7 @@ function buildCodexHarnessPromptSnapshot(params) {
31
31
  cwd: params.cwd,
32
32
  appServer: params.appServer,
33
33
  promptText: params.promptText,
34
+ turnScopedDeveloperInstructions: params.turnScopedDeveloperInstructions,
34
35
  heartbeatCollaborationInstructions: params.heartbeatCollaborationInstructions
35
36
  })
36
37
  };
@@ -3,7 +3,7 @@ import { n as assertCodexThreadResumeResponse, r as assertCodexThreadStartRespon
3
3
  import { t as isJsonObject } from "./protocol-oeJQu4rs.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-D3SUwPFl.js";
6
+ import { a as isCodexAppServerConnectionClosedError } from "./client-1sSy4p3z.js";
7
7
  import { i as readCodexAppServerBinding, n as isCodexAppServerNativeAuthProfile, o as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-Bw_mfIW2.js";
8
8
  import crypto from "node:crypto";
9
9
  import { embeddedAgentLog, isActiveHarnessContextEngine } from "openclaw/plugin-sdk/agent-harness-runtime";
@@ -1469,7 +1469,10 @@ function buildTurnStartParams(params, options) {
1469
1469
  ...options.appServer.serviceTier ? { serviceTier: options.appServer.serviceTier } : {},
1470
1470
  effort: resolveReasoningEffort(params.thinkLevel, params.modelId),
1471
1471
  ...options.environmentSelection ? { environments: options.environmentSelection } : {},
1472
- collaborationMode: buildTurnCollaborationMode(params, { heartbeatCollaborationInstructions: options.heartbeatCollaborationInstructions })
1472
+ collaborationMode: buildTurnCollaborationMode(params, {
1473
+ turnScopedDeveloperInstructions: options.turnScopedDeveloperInstructions,
1474
+ heartbeatCollaborationInstructions: options.heartbeatCollaborationInstructions
1475
+ })
1473
1476
  };
1474
1477
  }
1475
1478
  function resolveCodexThreadEnvironmentSelection(options) {
@@ -1488,10 +1491,26 @@ function buildTurnCollaborationMode(params, options = {}) {
1488
1491
  };
1489
1492
  }
1490
1493
  function buildTurnScopedCollaborationInstructions(params, options = {}) {
1491
- if (params.trigger === "cron") return buildCronCollaborationInstructions();
1492
- if (params.trigger === "heartbeat") return joinPresentSections(buildHeartbeatCollaborationInstructions(), options.heartbeatCollaborationInstructions);
1494
+ if (params.trigger === "cron") return joinPresentSections(buildCronCollaborationInstructions(), options.turnScopedDeveloperInstructions);
1495
+ if (params.trigger === "heartbeat") return joinPresentSections(buildHeartbeatCollaborationInstructions(), options.turnScopedDeveloperInstructions, options.heartbeatCollaborationInstructions);
1496
+ if (options.turnScopedDeveloperInstructions?.trim()) return joinPresentSections(buildDefaultCollaborationInstructions(), options.turnScopedDeveloperInstructions);
1493
1497
  return null;
1494
1498
  }
1499
+ function buildDefaultCollaborationInstructions() {
1500
+ return [
1501
+ "# Collaboration Mode: Default",
1502
+ "",
1503
+ "You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.",
1504
+ "",
1505
+ "Your active mode changes only when new developer instructions with a different `<collaboration_mode>...</collaboration_mode>` change it; user requests or tool descriptions do not change mode by themselves. Known mode names are Default and Plan.",
1506
+ "",
1507
+ "## request_user_input availability",
1508
+ "",
1509
+ "Use the `request_user_input` tool only when it is listed in the available tools for this turn.",
1510
+ "",
1511
+ "In Default mode, strongly prefer making reasonable assumptions and executing the user's request rather than stopping to ask questions. If you absolutely must ask a question because the answer cannot be discovered from local context and a reasonable assumption would be risky, ask the user directly with a concise plain-text question. Never write a multiple choice question as a textual assistant message."
1512
+ ].join("\n");
1513
+ }
1495
1514
  function buildCronCollaborationInstructions() {
1496
1515
  return [
1497
1516
  "This is an OpenClaw cron automation turn. Apply these instructions only to this scheduled job; ordinary chat turns should stay in Codex Default mode.",
@@ -1606,4 +1625,4 @@ function resolveReasoningEffort(thinkLevel, modelId) {
1606
1625
  return null;
1607
1626
  }
1608
1627
  //#endregion
1609
- export { sanitizeInlineImageDataUrl as C, resolveCodexContextEngineProjectionReserveTokens as D, resolveCodexContextEngineProjectionMaxChars as E, sanitizeCodexHistoryImagePayloads as S, projectContextEngineAssemblyForCodex as T, ensureCodexPluginActivation as _, buildThreadResumeParams as a, defaultCodexAppInventoryCache as b, codexDynamicToolsFingerprint as c, resolveReasoningEffort as d, startOrResumeThread as f, shouldBuildCodexPluginThreadConfig as g, mergeCodexThreadConfigs as h, buildDeveloperInstructions as i, isContextEngineBindingCompatible as l, buildCodexPluginThreadConfigInputFingerprint as m, buildCodexRuntimeThreadConfig as n, buildThreadStartParams as o, buildCodexPluginThreadConfig as p, buildContextEngineBinding as r, buildTurnStartParams as s, areCodexDynamicToolFingerprintsCompatible as t, resolveCodexAppServerModelProvider as u, pluginReadParams as v, DEFAULT_CODEX_PROJECTION_RESERVE_TOKENS as w, invalidInlineImageText as x, buildCodexAppInventoryCacheKey as y };
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 };
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@openclaw/codex",
3
- "version": "2026.5.22",
3
+ "version": "2026.5.24-beta.2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@openclaw/codex",
9
- "version": "2026.5.22",
9
+ "version": "2026.5.24-beta.2",
10
10
  "dependencies": {
11
11
  "@earendil-works/pi-coding-agent": "0.75.4",
12
12
  "@openai/codex": "0.132.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/codex",
3
- "version": "2026.5.22",
3
+ "version": "2026.5.24-beta.2",
4
4
  "description": "OpenClaw Codex harness and model provider plugin",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,10 +27,10 @@
27
27
  "minHostVersion": ">=2026.5.1-beta.1"
28
28
  },
29
29
  "compat": {
30
- "pluginApi": ">=2026.5.22"
30
+ "pluginApi": ">=2026.5.24-beta.2"
31
31
  },
32
32
  "build": {
33
- "openclawVersion": "2026.5.22"
33
+ "openclawVersion": "2026.5.24-beta.2"
34
34
  },
35
35
  "release": {
36
36
  "publishToClawHub": true,
@@ -47,7 +47,7 @@
47
47
  "npm-shrinkwrap.json"
48
48
  ],
49
49
  "peerDependencies": {
50
- "openclaw": ">=2026.5.22"
50
+ "openclaw": ">=2026.5.24-beta.2"
51
51
  },
52
52
  "peerDependenciesMeta": {
53
53
  "openclaw": {