@openclaw/codex 2026.6.9-beta.1 → 2026.6.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/{app-server-policy-KpyUye2D.js → app-server-policy-BPTiVNsW.js} +2 -2
  2. package/dist/{attempt-notifications-Meja3TX6.js → attempt-notifications-7oZeRa71.js} +1 -1
  3. package/dist/{client-m7XiCQpO.js → client-CLrtWgrD.js} +1 -1
  4. package/dist/{client-factory-CPuoOOx6.js → client-factory-Bm6HsGob.js} +1 -1
  5. package/dist/{command-handlers-CqS0Kv3Z.js → command-handlers-BaqM9s9b.js} +9 -9
  6. package/dist/{compact-CMVlldii.js → compact-aQJ0ZKhe.js} +4 -4
  7. package/dist/{computer-use-qLm7Gf35.js → computer-use-BmuwYrW6.js} +3 -3
  8. package/dist/{config-BksX0T33.js → config-CszD0vP3.js} +16 -5
  9. package/dist/{conversation-binding-DBof5w9J.js → conversation-binding-DbG2ZJQY.js} +6 -6
  10. package/dist/harness.js +6 -6
  11. package/dist/index.js +11 -11
  12. package/dist/{media-understanding-provider-CiwPkR58.js → media-understanding-provider-Dmfg4tH_.js} +5 -5
  13. package/dist/media-understanding-provider.js +1 -1
  14. package/dist/{models-BsyV1Psm.js → models-CAmfBWRl.js} +1 -1
  15. package/dist/{plugin-app-cache-key-CN9zBiCG.js → plugin-app-cache-key-vaZ_8Usz.js} +3 -3
  16. package/dist/prompt-overlay.js +2 -6
  17. package/dist/{provider-qJygHQx4.js → provider-B-OHpbD3.js} +3 -3
  18. package/dist/{provider-capabilities-BOvTfMhF.js → provider-capabilities-ByR82ytL.js} +4 -4
  19. package/dist/provider.js +1 -1
  20. package/dist/{request-DTIEyUrA.js → request-Dcd452Nk.js} +1 -1
  21. package/dist/{run-attempt-DRhB6bTc.js → run-attempt-DYt00Jxz.js} +126 -43
  22. package/dist/{session-binding-BRUi8y6E.js → session-binding-HOuPt-E0.js} +1 -1
  23. package/dist/{shared-client-Bg5d7VV9.js → shared-client-Dtx5i7Ez.js} +2 -2
  24. package/dist/{side-question-BdYL4kj1.js → side-question-h01W1aCe.js} +8 -8
  25. package/dist/{thread-lifecycle-CbJqqnEw.js → thread-lifecycle-DQyii5vp.js} +50 -14
  26. package/dist/{web-search-provider.runtime-DrpQ8Cyd.js → web-search-provider.runtime-BWG_oqLf.js} +2 -2
  27. package/npm-shrinkwrap.json +2 -2
  28. package/openclaw.plugin.json +11 -2
  29. package/package.json +4 -4
@@ -1,6 +1,6 @@
1
1
  import { n as isJsonObject } from "./protocol-dh-ETiNd.js";
2
- import { n as canUseCodexModelBackedApprovalsReviewerForModel } from "./config-BksX0T33.js";
3
- import { a as hasCodexRateLimitSnapshots, c as summarizeCodexAccountRateLimits, u as summarizeCodexRateLimits } from "./provider-qJygHQx4.js";
2
+ import { n as canUseCodexModelBackedApprovalsReviewerForModel } from "./config-CszD0vP3.js";
3
+ import { a as hasCodexRateLimitSnapshots, c as summarizeCodexAccountRateLimits, u as summarizeCodexRateLimits } from "./provider-B-OHpbD3.js";
4
4
  //#region extensions/codex/src/command-formatters.ts
5
5
  /** Formats the combined `/codex status` probe result. */
6
6
  function formatCodexStatus(probes) {
@@ -1,5 +1,5 @@
1
1
  import { n as isJsonObject } from "./protocol-dh-ETiNd.js";
2
- import { z as isCodexNotificationForTurn } from "./thread-lifecycle-CbJqqnEw.js";
2
+ import { B as isCodexNotificationForTurn } from "./thread-lifecycle-DQyii5vp.js";
3
3
  import { asBoolean } from "openclaw/plugin-sdk/string-coerce-runtime";
4
4
  //#region extensions/codex/src/app-server/attempt-notifications.ts
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { r as isRpcResponse } from "./protocol-dh-ETiNd.js";
2
- import { d as resolveCodexAppServerRuntimeOptions } from "./config-BksX0T33.js";
2
+ import { d as resolveCodexAppServerRuntimeOptions } from "./config-CszD0vP3.js";
3
3
  import { materializeWindowsSpawnProgram, resolveWindowsSpawnProgram } from "openclaw/plugin-sdk/windows-spawn";
4
4
  import { OPENCLAW_VERSION, embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
5
5
  import { createInterface } from "node:readline";
@@ -1,7 +1,7 @@
1
1
  //#region extensions/codex/src/app-server/client-factory.ts
2
2
  let sharedClientModulePromise = null;
3
3
  const loadSharedClientModule = async () => {
4
- sharedClientModulePromise ??= import("./shared-client-Bg5d7VV9.js").then((n) => n.c);
4
+ sharedClientModulePromise ??= import("./shared-client-Dtx5i7Ez.js").then((n) => n.c);
5
5
  return await sharedClientModulePromise;
6
6
  };
7
7
  /** Returns a leased shared client so startup can release ownership explicitly. */
@@ -1,14 +1,14 @@
1
1
  import { n as isJsonObject } from "./protocol-dh-ETiNd.js";
2
- import { d as resolveCodexAppServerRuntimeOptions, o as isCodexFastServiceTier } from "./config-BksX0T33.js";
3
- import { n as listCodexAppServerModels, t as listAllCodexAppServerModels } from "./models-BsyV1Psm.js";
4
- import { l as summarizeCodexAccountUsage } from "./provider-qJygHQx4.js";
5
- import { l as writeCodexAppServerBinding, n as clearCodexAppServerBinding, o as readCodexAppServerBinding } from "./session-binding-BRUi8y6E.js";
6
- import { i as describeControlFailure, r as CODEX_CONTROL_METHODS } from "./plugin-app-cache-key-CN9zBiCG.js";
7
- import { a as formatCodexDisplayText, c as formatList, d as formatThreads, f as readString$1, i as formatAccount, l as formatModels, o as formatCodexStatus, r as buildHelp, s as formatComputerUseStatus, u as formatSkills } from "./app-server-policy-KpyUye2D.js";
2
+ import { d as resolveCodexAppServerRuntimeOptions, o as isCodexFastServiceTier } from "./config-CszD0vP3.js";
3
+ import { n as listCodexAppServerModels, t as listAllCodexAppServerModels } from "./models-CAmfBWRl.js";
4
+ import { l as summarizeCodexAccountUsage } from "./provider-B-OHpbD3.js";
5
+ import { l as writeCodexAppServerBinding, n as clearCodexAppServerBinding, o as readCodexAppServerBinding } from "./session-binding-HOuPt-E0.js";
6
+ import { i as describeControlFailure, r as CODEX_CONTROL_METHODS } from "./plugin-app-cache-key-vaZ_8Usz.js";
7
+ import { a as formatCodexDisplayText, c as formatList, d as formatThreads, f as readString$1, i as formatAccount, l as formatModels, o as formatCodexStatus, r as buildHelp, s as formatComputerUseStatus, u as formatSkills } from "./app-server-policy-BPTiVNsW.js";
8
8
  import { n as resolveCodexNativeExecutionBlock, r as resolveCodexNativeSandboxBlock } from "./sandbox-guard-3tnjhjFb.js";
9
- import { _ as steerCodexConversationTurn, b as readCodexConversationBindingData, d as parseCodexFastModeArg, f as parseCodexPermissionsModeArg, g as setCodexConversationPermissions, h as setCodexConversationModel, m as setCodexConversationFastMode, o as formatCodexCliSessions, p as readCodexConversationActiveTurn, r as startCodexConversationThread, u as formatPermissionsMode, v as stopCodexConversationTurn, x as resolveCodexDefaultWorkspaceDir, y as createCodexCliNodeConversationBindingData } from "./conversation-binding-DBof5w9J.js";
10
- import { t as requestCodexAppServerJson } from "./request-DTIEyUrA.js";
11
- import { n as installCodexComputerUse, r as readCodexComputerUseStatus } from "./computer-use-qLm7Gf35.js";
9
+ import { _ as steerCodexConversationTurn, b as readCodexConversationBindingData, d as parseCodexFastModeArg, f as parseCodexPermissionsModeArg, g as setCodexConversationPermissions, h as setCodexConversationModel, m as setCodexConversationFastMode, o as formatCodexCliSessions, p as readCodexConversationActiveTurn, r as startCodexConversationThread, u as formatPermissionsMode, v as stopCodexConversationTurn, x as resolveCodexDefaultWorkspaceDir, y as createCodexCliNodeConversationBindingData } from "./conversation-binding-DbG2ZJQY.js";
10
+ import { t as requestCodexAppServerJson } from "./request-Dcd452Nk.js";
11
+ import { n as installCodexComputerUse, r as readCodexComputerUseStatus } from "./computer-use-BmuwYrW6.js";
12
12
  import { n as rememberCodexRateLimits } from "./rate-limit-cache-C7qmZ0Jh.js";
13
13
  import { parseStrictPositiveInteger } from "openclaw/plugin-sdk/number-runtime";
14
14
  import { normalizeOptionalString, normalizeUniqueStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -1,8 +1,8 @@
1
- import { d as resolveCodexAppServerRuntimeOptions } from "./config-BksX0T33.js";
2
- import { c as withCodexAppServerBindingLock, l as writeCodexAppServerBinding, o as readCodexAppServerBinding, t as CODEX_APP_SERVER_BINDING_GUARDED_REQUEST_TIMEOUT_MS } from "./session-binding-BRUi8y6E.js";
3
- import { o as releaseLeasedSharedCodexAppServerClient } from "./shared-client-Bg5d7VV9.js";
1
+ import { d as resolveCodexAppServerRuntimeOptions } from "./config-CszD0vP3.js";
2
+ import { c as withCodexAppServerBindingLock, l as writeCodexAppServerBinding, o as readCodexAppServerBinding, t as CODEX_APP_SERVER_BINDING_GUARDED_REQUEST_TIMEOUT_MS } from "./session-binding-HOuPt-E0.js";
3
+ import { o as releaseLeasedSharedCodexAppServerClient } from "./shared-client-Dtx5i7Ez.js";
4
4
  import { n as resolveCodexNativeExecutionBlock } from "./sandbox-guard-3tnjhjFb.js";
5
- import { t as defaultLeasedCodexAppServerClientFactory } from "./client-factory-CPuoOOx6.js";
5
+ import { t as defaultLeasedCodexAppServerClientFactory } from "./client-factory-Bm6HsGob.js";
6
6
  import { embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
7
7
  //#region extensions/codex/src/app-server/compact.ts
8
8
  /**
@@ -1,6 +1,6 @@
1
- import { d as resolveCodexAppServerRuntimeOptions, f as resolveCodexComputerUseConfig } from "./config-BksX0T33.js";
2
- import { i as describeControlFailure } from "./plugin-app-cache-key-CN9zBiCG.js";
3
- import { t as requestCodexAppServerJson } from "./request-DTIEyUrA.js";
1
+ import { d as resolveCodexAppServerRuntimeOptions, f as resolveCodexComputerUseConfig } from "./config-CszD0vP3.js";
2
+ import { i as describeControlFailure } from "./plugin-app-cache-key-vaZ_8Usz.js";
3
+ import { t as requestCodexAppServerJson } from "./request-Dcd452Nk.js";
4
4
  import { existsSync } from "node:fs";
5
5
  //#region extensions/codex/src/app-server/computer-use.ts
6
6
  /**
@@ -7,6 +7,7 @@ import { hostname } from "node:os";
7
7
  import { resolveProviderIdForAuth } from "openclaw/plugin-sdk/agent-runtime";
8
8
  import { resolveExecApprovalsFromFile } from "openclaw/plugin-sdk/exec-approvals-runtime";
9
9
  import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
10
+ import { buildSecretInputSchema, normalizeResolvedSecretInputString } from "openclaw/plugin-sdk/secret-input";
10
11
  import { detectWindowsSpawnCommandInlineArgs } from "openclaw/plugin-sdk/windows-spawn";
11
12
  import { z } from "zod";
12
13
  //#region extensions/codex/src/app-server/config.ts
@@ -26,6 +27,7 @@ const DEFAULT_CODEX_COMPUTER_USE_MCP_SERVER_NAME = "computer-use";
26
27
  const DEFAULT_CODEX_COMPUTER_USE_MARKETPLACE_DISCOVERY_TIMEOUT_MS = 6e4;
27
28
  const DEFAULT_CODEX_APP_SERVER_NETWORK_PROXY_PROFILE_PREFIX = "openclaw-network";
28
29
  const codexAppServerTransportSchema = z.enum(["stdio", "websocket"]);
30
+ const SecretInputSchema = buildSecretInputSchema();
29
31
  const codexAppServerPolicyModeSchema = z.enum(["yolo", "guardian"]);
30
32
  const codexAppServerApprovalPolicySchema = z.enum([
31
33
  "never",
@@ -101,8 +103,8 @@ const codexPluginConfigSchema = z.object({
101
103
  command: z.string().optional(),
102
104
  args: z.union([z.array(z.string()), z.string()]).optional(),
103
105
  url: z.string().optional(),
104
- authToken: z.string().optional(),
105
- headers: z.record(z.string(), z.string()).optional(),
106
+ authToken: SecretInputSchema.optional(),
107
+ headers: z.record(z.string(), SecretInputSchema).optional(),
106
108
  clearEnv: z.array(z.string()).optional(),
107
109
  remoteWorkspaceRoot: codexAppServerRemoteWorkspaceRootSchema.optional(),
108
110
  codeModeOnly: z.boolean().optional(),
@@ -189,7 +191,10 @@ function resolveCodexAppServerRuntimeOptions(params = {}) {
189
191
  const args = resolveArgs(config.args, env.OPENCLAW_CODEX_APP_SERVER_ARGS);
190
192
  const headers = normalizeHeaders(config.headers);
191
193
  const clearEnv = normalizeStringList(config.clearEnv);
192
- const authToken = readNonEmptyString(config.authToken);
194
+ const authToken = normalizeCodexAppServerSecretInput({
195
+ value: config.authToken,
196
+ path: "plugins.entries.codex.config.appServer.authToken"
197
+ });
193
198
  const url = readNonEmptyString(config.url);
194
199
  const connectionClass = inferCodexAppServerConnectionClass({
195
200
  transport,
@@ -364,7 +369,7 @@ function codexAppServerStartOptionsKey(options, params = {}) {
364
369
  args: options.args,
365
370
  url: options.url ?? null,
366
371
  authToken: hashSecretForKey(options.authToken, "authToken"),
367
- headers: Object.entries(options.headers).toSorted(([left], [right]) => left.localeCompare(right)),
372
+ headers: Object.entries(options.headers).toSorted(([left], [right]) => left.localeCompare(right)).map(([key, value]) => [key, hashSecretForKey(value, `header:${key}`)]),
368
373
  env: Object.entries(options.env ?? {}).toSorted(([left], [right]) => left.localeCompare(right)).map(([key, value]) => [key, hashSecretForKey(value, `env:${key}`)]),
369
374
  clearEnv: [...options.clearEnv ?? []].toSorted(),
370
375
  authProfileId: params.authProfileId ?? null,
@@ -1020,7 +1025,13 @@ function normalizePositiveNumber(value, fallback) {
1020
1025
  }
1021
1026
  function normalizeHeaders(value) {
1022
1027
  if (!value || typeof value !== "object" || Array.isArray(value)) return {};
1023
- return Object.fromEntries(Object.entries(value).map(([key, child]) => [key.trim(), readNonEmptyString(child)]).filter((entry) => Boolean(entry[0] && entry[1])));
1028
+ return Object.fromEntries(Object.entries(value).map(([key, child]) => [key.trim(), normalizeCodexAppServerSecretInput({
1029
+ value: child,
1030
+ path: `plugins.entries.codex.config.appServer.headers.${key}`
1031
+ })]).filter((entry) => Boolean(entry[0] && entry[1])));
1032
+ }
1033
+ function normalizeCodexAppServerSecretInput(params) {
1034
+ return normalizeResolvedSecretInputString(params);
1024
1035
  }
1025
1036
  function normalizeStringList(value) {
1026
1037
  return normalizeTrimmedStringList(value);
@@ -1,11 +1,11 @@
1
1
  import { n as isJsonObject } from "./protocol-dh-ETiNd.js";
2
- import { B as readCodexNotificationThreadId, V as readCodexNotificationTurnId, d as resolveCodexAppServerRequestModelSelection, p as resolveCodexBindingModelProviderFallback, t as CODEX_NATIVE_PERSONALITY_NONE } from "./thread-lifecycle-CbJqqnEw.js";
3
- import { d as resolveCodexAppServerRuntimeOptions, h as resolveOpenClawExecPolicyForCodexAppServer, i as codexSandboxPolicyForTurn, n as canUseCodexModelBackedApprovalsReviewerForModel, o as isCodexFastServiceTier, p as resolveCodexModelBackedReviewerPolicyContext } from "./config-BksX0T33.js";
2
+ import { H as readCodexNotificationTurnId, V as readCodexNotificationThreadId, d as resolveCodexAppServerRequestModelSelection, p as resolveCodexBindingModelProviderFallback, t as CODEX_NATIVE_PERSONALITY_NONE } from "./thread-lifecycle-DQyii5vp.js";
3
+ import { d as resolveCodexAppServerRuntimeOptions, h as resolveOpenClawExecPolicyForCodexAppServer, i as codexSandboxPolicyForTurn, n as canUseCodexModelBackedApprovalsReviewerForModel, o as isCodexFastServiceTier, p as resolveCodexModelBackedReviewerPolicyContext } from "./config-CszD0vP3.js";
4
4
  import { r as assertCodexThreadStartResponse } from "./protocol-validators-B19q5BIX.js";
5
- import { a as normalizeCodexAppServerBindingModelProvider, i as isCodexAppServerNativeAuthProfile, l as writeCodexAppServerBinding, n as clearCodexAppServerBinding, o as readCodexAppServerBinding } from "./session-binding-BRUi8y6E.js";
6
- import { r as CODEX_CONTROL_METHODS } from "./plugin-app-cache-key-CN9zBiCG.js";
7
- import { a as formatCodexDisplayText, t as resolveCodexAppServerForModelProvider } from "./app-server-policy-KpyUye2D.js";
8
- import { a as getLeasedSharedCodexAppServerClient, o as releaseLeasedSharedCodexAppServerClient, p as resolveCodexAppServerAuthProfileIdForAgent } from "./shared-client-Bg5d7VV9.js";
5
+ import { a as normalizeCodexAppServerBindingModelProvider, i as isCodexAppServerNativeAuthProfile, l as writeCodexAppServerBinding, n as clearCodexAppServerBinding, o as readCodexAppServerBinding } from "./session-binding-HOuPt-E0.js";
6
+ import { r as CODEX_CONTROL_METHODS } from "./plugin-app-cache-key-vaZ_8Usz.js";
7
+ import { a as formatCodexDisplayText, t as resolveCodexAppServerForModelProvider } from "./app-server-policy-BPTiVNsW.js";
8
+ import { a as getLeasedSharedCodexAppServerClient, o as releaseLeasedSharedCodexAppServerClient, p as resolveCodexAppServerAuthProfileIdForAgent } from "./shared-client-Dtx5i7Ez.js";
9
9
  import { n as resolveCodexNativeExecutionBlock, r as resolveCodexNativeSandboxBlock } from "./sandbox-guard-3tnjhjFb.js";
10
10
  import fs from "node:fs/promises";
11
11
  import path from "node:path";
package/dist/harness.js CHANGED
@@ -32,25 +32,25 @@ function createCodexAppServerAgentHarness(options) {
32
32
  };
33
33
  },
34
34
  runAttempt: async (params) => {
35
- const { runCodexAppServerAttempt } = await import("./run-attempt-DRhB6bTc.js");
35
+ const { runCodexAppServerAttempt } = await import("./run-attempt-DYt00Jxz.js");
36
36
  return runCodexAppServerAttempt(params, {
37
37
  pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
38
38
  nativeHookRelay: { enabled: true }
39
39
  });
40
40
  },
41
41
  runSideQuestion: async (params) => {
42
- const { runCodexAppServerSideQuestion } = await import("./side-question-BdYL4kj1.js");
42
+ const { runCodexAppServerSideQuestion } = await import("./side-question-h01W1aCe.js");
43
43
  return runCodexAppServerSideQuestion(params, {
44
44
  pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
45
45
  nativeHookRelay: { enabled: true }
46
46
  });
47
47
  },
48
48
  compact: async (params) => {
49
- const { maybeCompactCodexAppServerSession } = await import("./compact-CMVlldii.js");
49
+ const { maybeCompactCodexAppServerSession } = await import("./compact-aQJ0ZKhe.js");
50
50
  return maybeCompactCodexAppServerSession(params, { pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig });
51
51
  },
52
52
  compactAfterContextEngine: async (params) => {
53
- const { maybeCompactCodexAppServerSession } = await import("./compact-CMVlldii.js");
53
+ const { maybeCompactCodexAppServerSession } = await import("./compact-aQJ0ZKhe.js");
54
54
  return maybeCompactCodexAppServerSession(params, {
55
55
  pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
56
56
  allowNonManualNativeRequest: true
@@ -58,12 +58,12 @@ function createCodexAppServerAgentHarness(options) {
58
58
  },
59
59
  reset: async (params) => {
60
60
  if (params.sessionFile) {
61
- const { clearCodexAppServerBinding } = await import("./session-binding-BRUi8y6E.js").then((n) => n.s);
61
+ const { clearCodexAppServerBinding } = await import("./session-binding-HOuPt-E0.js").then((n) => n.s);
62
62
  await clearCodexAppServerBinding(params.sessionFile);
63
63
  }
64
64
  },
65
65
  dispose: async () => {
66
- const { clearSharedCodexAppServerClientAndWait } = await import("./shared-client-Bg5d7VV9.js").then((n) => n.c);
66
+ const { clearSharedCodexAppServerClientAndWait } = await import("./shared-client-Dtx5i7Ez.js").then((n) => n.c);
67
67
  await clearSharedCodexAppServerClientAndWait();
68
68
  }
69
69
  };
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { createCodexAppServerAgentHarness } from "./harness.js";
2
- import { F as pluginReadParams, L as defaultCodexAppInventoryCache, P as ensureCodexPluginActivation } from "./thread-lifecycle-CbJqqnEw.js";
3
- import { d as resolveCodexAppServerRuntimeOptions, t as CODEX_PLUGINS_MARKETPLACE_NAME, u as readCodexPluginConfig } from "./config-BksX0T33.js";
4
- import { t as buildCodexProvider } from "./provider-qJygHQx4.js";
5
- import { t as buildCodexMediaUnderstandingProvider } from "./media-understanding-provider-CiwPkR58.js";
6
- import { i as describeControlFailure, n as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-CN9zBiCG.js";
7
- import { a as formatCodexDisplayText } from "./app-server-policy-KpyUye2D.js";
8
- import { a as getLeasedSharedCodexAppServerClient, d as resolveCodexAppServerAuthAccountCacheKey, m as resolveCodexAppServerFallbackApiKeyCacheKey, o as releaseLeasedSharedCodexAppServerClient, p as resolveCodexAppServerAuthProfileIdForAgent, r as clearSharedCodexAppServerClientIfCurrentAndWait } from "./shared-client-Bg5d7VV9.js";
9
- import { a as createCodexCliSessionNodeInvokePolicies, c as resolveCodexCliSessionForBindingOnNode, i as createCodexCliSessionNodeHostCommands, l as resumeCodexCliSessionOnNode, n as handleCodexConversationInboundClaim, s as listCodexCliSessionsOnNode, t as handleCodexConversationBindingResolved } from "./conversation-binding-DBof5w9J.js";
10
- import { t as requestCodexAppServerJson } from "./request-DTIEyUrA.js";
2
+ import { F as ensureCodexPluginActivation, I as pluginReadParams, R as defaultCodexAppInventoryCache } from "./thread-lifecycle-DQyii5vp.js";
3
+ import { d as resolveCodexAppServerRuntimeOptions, t as CODEX_PLUGINS_MARKETPLACE_NAME, u as readCodexPluginConfig } from "./config-CszD0vP3.js";
4
+ import { t as buildCodexProvider } from "./provider-B-OHpbD3.js";
5
+ import { t as buildCodexMediaUnderstandingProvider } from "./media-understanding-provider-Dmfg4tH_.js";
6
+ import { i as describeControlFailure, n as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-vaZ_8Usz.js";
7
+ import { a as formatCodexDisplayText } from "./app-server-policy-BPTiVNsW.js";
8
+ import { a as getLeasedSharedCodexAppServerClient, d as resolveCodexAppServerAuthAccountCacheKey, m as resolveCodexAppServerFallbackApiKeyCacheKey, o as releaseLeasedSharedCodexAppServerClient, p as resolveCodexAppServerAuthProfileIdForAgent, r as clearSharedCodexAppServerClientIfCurrentAndWait } from "./shared-client-Dtx5i7Ez.js";
9
+ import { a as createCodexCliSessionNodeInvokePolicies, c as resolveCodexCliSessionForBindingOnNode, i as createCodexCliSessionNodeHostCommands, l as resumeCodexCliSessionOnNode, n as handleCodexConversationInboundClaim, s as listCodexCliSessionsOnNode, t as handleCodexConversationBindingResolved } from "./conversation-binding-DbG2ZJQY.js";
10
+ import { t as requestCodexAppServerJson } from "./request-Dcd452Nk.js";
11
11
  import { t as createCodexWebSearchProviderBase } from "./web-search-provider.shared-BrZmlqyR.js";
12
12
  import { mutateConfigFile } from "openclaw/plugin-sdk/config-mutation";
13
13
  import { resolveLivePluginConfigObject, resolvePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
@@ -52,7 +52,7 @@ async function handleCodexCommand(ctx, options = {}) {
52
52
  }
53
53
  }
54
54
  async function loadDefaultCodexSubcommandHandler() {
55
- const { handleCodexSubcommand } = await import("./command-handlers-CqS0Kv3Z.js");
55
+ const { handleCodexSubcommand } = await import("./command-handlers-BaqM9s9b.js");
56
56
  return handleCodexSubcommand;
57
57
  }
58
58
  //#endregion
@@ -1542,7 +1542,7 @@ function buildCodexMigrationProvider(params = {}) {
1542
1542
  //#region extensions/codex/src/web-search-provider.ts
1543
1543
  let codexWebSearchRuntimePromise;
1544
1544
  function loadCodexWebSearchRuntime() {
1545
- codexWebSearchRuntimePromise ??= import("./web-search-provider.runtime-DrpQ8Cyd.js");
1545
+ codexWebSearchRuntimePromise ??= import("./web-search-provider.runtime-BWG_oqLf.js");
1546
1546
  return codexWebSearchRuntimePromise;
1547
1547
  }
1548
1548
  const CodexWebSearchSchema = {
@@ -1,10 +1,10 @@
1
1
  import { CODEX_PROVIDER_ID, FALLBACK_CODEX_MODELS } from "./provider-catalog.js";
2
2
  import { n as isJsonObject } from "./protocol-dh-ETiNd.js";
3
- import { M as mergeCodexThreadConfigs, r as buildCodexRuntimeThreadConfig } from "./thread-lifecycle-CbJqqnEw.js";
4
- import { S as readCodexNotificationItem } from "./attempt-notifications-Meja3TX6.js";
5
- import { d as resolveCodexAppServerRuntimeOptions } from "./config-BksX0T33.js";
3
+ import { N as mergeCodexThreadConfigs, r as buildCodexRuntimeThreadConfig } from "./thread-lifecycle-DQyii5vp.js";
4
+ import { S as readCodexNotificationItem } from "./attempt-notifications-7oZeRa71.js";
5
+ import { d as resolveCodexAppServerRuntimeOptions } from "./config-CszD0vP3.js";
6
6
  import { i as assertCodexTurnStartResponse, l as readCodexTurnCompletedNotification, o as readCodexErrorNotification, r as assertCodexThreadStartResponse } from "./protocol-validators-B19q5BIX.js";
7
- import { i as readModelListResult } from "./models-BsyV1Psm.js";
7
+ import { i as readModelListResult } from "./models-CAmfBWRl.js";
8
8
  import { validateJsonSchemaValue } from "openclaw/plugin-sdk/json-schema-runtime";
9
9
  import fs from "node:fs/promises";
10
10
  import path from "node:path";
@@ -51,7 +51,7 @@ async function runBoundedCodexAppServerTurnInWorkspace(params, appServer, worksp
51
51
  const agentDir = params.agentDir?.trim() || void 0;
52
52
  const startOptions = workspace.codexHome ? buildPrivateCodexAppServerStartOptions(appServer.start, workspace.codexHome) : appServer.start;
53
53
  const ownsClient = !params.options.clientFactory;
54
- const client = params.options.clientFactory ? await params.options.clientFactory(startOptions, params.profile, agentDir, params.config, { timeoutMs }) : await import("./shared-client-Bg5d7VV9.js").then((n) => n.c).then(({ createIsolatedCodexAppServerClient }) => createIsolatedCodexAppServerClient({
54
+ const client = params.options.clientFactory ? await params.options.clientFactory(startOptions, params.profile, agentDir, params.config, { timeoutMs }) : await import("./shared-client-Dtx5i7Ez.js").then((n) => n.c).then(({ createIsolatedCodexAppServerClient }) => createIsolatedCodexAppServerClient({
55
55
  startOptions,
56
56
  timeoutMs,
57
57
  authProfileId: params.profile,
@@ -1,2 +1,2 @@
1
- import { t as buildCodexMediaUnderstandingProvider } from "./media-understanding-provider-CiwPkR58.js";
1
+ import { t as buildCodexMediaUnderstandingProvider } from "./media-understanding-provider-Dmfg4tH_.js";
2
2
  export { buildCodexMediaUnderstandingProvider };
@@ -46,7 +46,7 @@ async function listAllCodexAppServerModels(options = {}) {
46
46
  async function withCodexAppServerModelClient(options, run) {
47
47
  const timeoutMs = options.timeoutMs ?? 2500;
48
48
  const useSharedClient = options.sharedClient !== false;
49
- const { createIsolatedCodexAppServerClient, getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("./shared-client-Bg5d7VV9.js").then((n) => n.c);
49
+ const { createIsolatedCodexAppServerClient, getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("./shared-client-Dtx5i7Ez.js").then((n) => n.c);
50
50
  const client = useSharedClient ? await getLeasedSharedCodexAppServerClient({
51
51
  startOptions: options.startOptions,
52
52
  timeoutMs,
@@ -1,6 +1,6 @@
1
- import { I as buildCodexAppInventoryCacheKey } from "./thread-lifecycle-CbJqqnEw.js";
2
- import { n as CodexAppServerRpcError } from "./client-m7XiCQpO.js";
3
- import { h as resolveCodexAppServerHomeDir } from "./shared-client-Bg5d7VV9.js";
1
+ import { L as buildCodexAppInventoryCacheKey } from "./thread-lifecycle-DQyii5vp.js";
2
+ import { n as CodexAppServerRpcError } from "./client-CLrtWgrD.js";
3
+ import { h as resolveCodexAppServerHomeDir } from "./shared-client-Dtx5i7Ez.js";
4
4
  import { createHash } from "node:crypto";
5
5
  //#region extensions/codex/src/app-server/capabilities.ts
6
6
  /**
@@ -1,4 +1,4 @@
1
- import { GPT5_BEHAVIOR_CONTRACT, GPT5_HEARTBEAT_PROMPT_OVERLAY, renderGpt5PromptOverlay, resolveGpt5SystemPromptContribution } from "openclaw/plugin-sdk/provider-model-shared";
1
+ import { GPT5_BEHAVIOR_CONTRACT, GPT5_HEARTBEAT_PROMPT_OVERLAY, resolveGpt5SystemPromptContribution } from "openclaw/plugin-sdk/provider-model-shared";
2
2
  //#region extensions/codex/prompt-overlay.ts
3
3
  /**
4
4
  * Codex prompt-overlay facade for GPT-5 behavior and heartbeat guidance.
@@ -11,9 +11,5 @@ const CODEX_GPT5_HEARTBEAT_PROMPT_OVERLAY = GPT5_HEARTBEAT_PROMPT_OVERLAY;
11
11
  function resolveCodexSystemPromptContribution(params) {
12
12
  return resolveGpt5SystemPromptContribution(params);
13
13
  }
14
- /** Renders the Codex prompt overlay text for supported GPT-5-family models. */
15
- function renderCodexPromptOverlay(params) {
16
- return renderGpt5PromptOverlay(params);
17
- }
18
14
  //#endregion
19
- export { CODEX_GPT5_BEHAVIOR_CONTRACT, CODEX_GPT5_HEARTBEAT_PROMPT_OVERLAY, renderCodexPromptOverlay, resolveCodexSystemPromptContribution };
15
+ export { CODEX_GPT5_BEHAVIOR_CONTRACT, CODEX_GPT5_HEARTBEAT_PROMPT_OVERLAY, resolveCodexSystemPromptContribution };
@@ -1,6 +1,6 @@
1
1
  import { CODEX_APP_SERVER_AUTH_MARKER, CODEX_BASE_URL, CODEX_PROVIDER_ID, FALLBACK_CODEX_MODELS, buildCodexModelDefinition, buildCodexProviderConfig } from "./provider-catalog.js";
2
2
  import { n as isJsonObject } from "./protocol-dh-ETiNd.js";
3
- import { d as resolveCodexAppServerRuntimeOptions, u as readCodexPluginConfig } from "./config-BksX0T33.js";
3
+ import { d as resolveCodexAppServerRuntimeOptions, u as readCodexPluginConfig } from "./config-CszD0vP3.js";
4
4
  import { resolveCodexSystemPromptContribution } from "./prompt-overlay.js";
5
5
  import { resolvePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
6
6
  import { MAX_DATE_TIMESTAMP_MS, resolveExpiresAtMsFromEpochSeconds } from "openclaw/plugin-sdk/number-runtime";
@@ -541,11 +541,11 @@ async function listModelsBestEffort(params) {
541
541
  }
542
542
  }
543
543
  async function listCodexAppServerModelsLazy(options) {
544
- const { listCodexAppServerModels } = await import("./models-BsyV1Psm.js").then((n) => n.r);
544
+ const { listCodexAppServerModels } = await import("./models-CAmfBWRl.js").then((n) => n.r);
545
545
  return listCodexAppServerModels(options);
546
546
  }
547
547
  async function requestCodexAppServerRateLimitsLazy(options) {
548
- const { requestCodexAppServerJson } = await import("./request-DTIEyUrA.js").then((n) => n.n);
548
+ const { requestCodexAppServerJson } = await import("./request-Dcd452Nk.js").then((n) => n.n);
549
549
  return await requestCodexAppServerJson({
550
550
  method: "account/rateLimits/read",
551
551
  timeoutMs: options.timeoutMs,
@@ -1,8 +1,8 @@
1
1
  import { n as isJsonObject } from "./protocol-dh-ETiNd.js";
2
- import { C as isForcedPrivateQaCodexRuntime, S as filterCodexDynamicTools, _ as resolveCodexWebSearchPlan, w as normalizeCodexDynamicToolName, x as sanitizeInlineImageDataUrl, y as invalidInlineImageText } from "./thread-lifecycle-CbJqqnEw.js";
3
- import { c as isTrustedCodexModelBackedOpenAIProvider, u as readCodexPluginConfig } from "./config-BksX0T33.js";
4
- import { a as formatCodexDisplayText } from "./app-server-policy-KpyUye2D.js";
5
- import { o as releaseLeasedSharedCodexAppServerClient } from "./shared-client-Bg5d7VV9.js";
2
+ import { C as isForcedPrivateQaCodexRuntime, S as filterCodexDynamicTools, _ as resolveCodexWebSearchPlan, w as normalizeCodexDynamicToolName, x as sanitizeInlineImageDataUrl, y as invalidInlineImageText } from "./thread-lifecycle-DQyii5vp.js";
3
+ import { c as isTrustedCodexModelBackedOpenAIProvider, u as readCodexPluginConfig } from "./config-CszD0vP3.js";
4
+ import { a as formatCodexDisplayText } from "./app-server-policy-BPTiVNsW.js";
5
+ import { o as releaseLeasedSharedCodexAppServerClient } from "./shared-client-Dtx5i7Ez.js";
6
6
  import { i as resolveCodexNativeExecutionPolicy } from "./sandbox-guard-3tnjhjFb.js";
7
7
  import { addTimerTimeoutGraceMs, finiteSecondsToTimerSafeMilliseconds, resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
8
8
  import { asOptionalRecord, isRecord, normalizeTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
package/dist/provider.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as buildCodexProviderCatalog, r as isModernCodexModel, t as buildCodexProvider } from "./provider-qJygHQx4.js";
1
+ import { n as buildCodexProviderCatalog, r as isModernCodexModel, t as buildCodexProvider } from "./provider-B-OHpbD3.js";
2
2
  export { buildCodexProvider, buildCodexProviderCatalog, isModernCodexModel };
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { a as getLeasedSharedCodexAppServerClient, i as createIsolatedCodexAppServerClient, l as withTimeout, o as releaseLeasedSharedCodexAppServerClient } from "./shared-client-Bg5d7VV9.js";
2
+ import { a as getLeasedSharedCodexAppServerClient, i as createIsolatedCodexAppServerClient, l as withTimeout, o as releaseLeasedSharedCodexAppServerClient } from "./shared-client-Dtx5i7Ez.js";
3
3
  import { t as resolveCodexAppServerDirectSandboxBypassBlock } from "./sandbox-guard-3tnjhjFb.js";
4
4
  //#region extensions/codex/src/app-server/request.ts
5
5
  var request_exports = /* @__PURE__ */ __exportAll({ requestCodexAppServerJson: () => requestCodexAppServerJson });
@@ -1,17 +1,17 @@
1
1
  import { n as isJsonObject, t as flattenCodexDynamicToolFunctions } from "./protocol-dh-ETiNd.js";
2
- import { A as buildCodexPluginThreadConfig, B as readCodexNotificationThreadId, D as projectContextEngineAssemblyForCodex, E as resolveCodexDynamicToolsLoadingForRuntime, L as defaultCodexAppInventoryCache, M as mergeCodexThreadConfigs, N as shouldBuildCodexPluginThreadConfig, O as resolveCodexContextEngineProjectionMaxChars, R as describeCodexNotificationCorrelation, V as readCodexNotificationTurnId, _ as resolveCodexWebSearchPlan, a as buildDeveloperInstructions, b as sanitizeCodexHistoryImagePayloads, c as codexDynamicToolsFingerprint, f as resolveCodexAppServerThreadModelSelection, h as startOrResumeThread, i as buildContextEngineBinding, j as buildCodexPluginThreadConfigInputFingerprint, k as resolveCodexContextEngineProjectionReserveTokens, l as isContextEngineBindingCompatible, n as areCodexDynamicToolFingerprintsCompatible, o as buildTurnCollaborationMode, s as buildTurnStartParams, v as isCodexAppServerProfilerEnabled } from "./thread-lifecycle-CbJqqnEw.js";
3
- import { C as readNotificationItemId, E as updateActiveTurnItemIds, S as readCodexNotificationItem, T as shouldDisarmAssistantCompletionIdleWatch, _ as isReasoningItemCompletionNotification, a as isCodexNotificationOutsideActiveRun, b as isTerminalTurnStatus, c as isCurrentThreadOptionalTurnRequestParams, d as isNativeResponseStreamDeltaNotification, f as isNativeToolProgressNotification, g as isRawToolOutputCompletionNotification, h as isRawReasoningCompletionNotification, i as isAssistantCompletionReleaseNotification, l as isCurrentThreadTurnRequestParams, m as isRawAssistantProgressNotification, n as describeNotificationActivity, o as isCodexTurnAbortMarkerNotification, p as isPendingOpenClawDynamicToolCompletionNotification, r as isAssistantCommentaryCompletionNotification, s as isCurrentApprovalTurnRequestParams, t as codexExecutionToolName, u as isFileChangePatchUpdatedNotification, v as isReasoningProgressNotification, w as readRawResponseToolCallId, x as isTurnNotification, y as isRetryableErrorNotification } from "./attempt-notifications-Meja3TX6.js";
4
- import { _ as withMcpElicitationsApprovalPolicy, a as isCodexAppServerApprovalPolicyAllowedByRequirements, d as resolveCodexAppServerRuntimeOptions, f as resolveCodexComputerUseConfig, g as shouldAutoApproveCodexAppServerApprovals, h as resolveOpenClawExecPolicyForCodexAppServer, m as resolveCodexPluginsPolicy, p as resolveCodexModelBackedReviewerPolicyContext, s as isCodexSandboxExecServerEnabled, u as readCodexPluginConfig } from "./config-BksX0T33.js";
2
+ import { A as resolveCodexContextEngineProjectionReserveTokens, D as fitCodexProjectedContextForTurnStart, E as resolveCodexDynamicToolsLoadingForRuntime, H as readCodexNotificationTurnId, M as buildCodexPluginThreadConfigInputFingerprint, N as mergeCodexThreadConfigs, O as projectContextEngineAssemblyForCodex, P as shouldBuildCodexPluginThreadConfig, R as defaultCodexAppInventoryCache, V as readCodexNotificationThreadId, _ as resolveCodexWebSearchPlan, a as buildDeveloperInstructions, b as sanitizeCodexHistoryImagePayloads, c as codexDynamicToolsFingerprint, f as resolveCodexAppServerThreadModelSelection, h as startOrResumeThread, i as buildContextEngineBinding, j as buildCodexPluginThreadConfig, k as resolveCodexContextEngineProjectionMaxChars, l as isContextEngineBindingCompatible, n as areCodexDynamicToolFingerprintsCompatible, o as buildTurnCollaborationMode, s as buildTurnStartParams, v as isCodexAppServerProfilerEnabled, z as describeCodexNotificationCorrelation } from "./thread-lifecycle-DQyii5vp.js";
3
+ import { C as readNotificationItemId, E as updateActiveTurnItemIds, S as readCodexNotificationItem, T as shouldDisarmAssistantCompletionIdleWatch, _ as isReasoningItemCompletionNotification, a as isCodexNotificationOutsideActiveRun, b as isTerminalTurnStatus, c as isCurrentThreadOptionalTurnRequestParams, d as isNativeResponseStreamDeltaNotification, f as isNativeToolProgressNotification, g as isRawToolOutputCompletionNotification, h as isRawReasoningCompletionNotification, i as isAssistantCompletionReleaseNotification, l as isCurrentThreadTurnRequestParams, m as isRawAssistantProgressNotification, n as describeNotificationActivity, o as isCodexTurnAbortMarkerNotification, p as isPendingOpenClawDynamicToolCompletionNotification, r as isAssistantCommentaryCompletionNotification, s as isCurrentApprovalTurnRequestParams, t as codexExecutionToolName, u as isFileChangePatchUpdatedNotification, v as isReasoningProgressNotification, w as readRawResponseToolCallId, x as isTurnNotification, y as isRetryableErrorNotification } from "./attempt-notifications-7oZeRa71.js";
4
+ import { _ as withMcpElicitationsApprovalPolicy, a as isCodexAppServerApprovalPolicyAllowedByRequirements, d as resolveCodexAppServerRuntimeOptions, f as resolveCodexComputerUseConfig, g as shouldAutoApproveCodexAppServerApprovals, h as resolveOpenClawExecPolicyForCodexAppServer, m as resolveCodexPluginsPolicy, p as resolveCodexModelBackedReviewerPolicyContext, s as isCodexSandboxExecServerEnabled, u as readCodexPluginConfig } from "./config-CszD0vP3.js";
5
5
  import { a as readCodexDynamicToolCallParams, c as readCodexTurn, i as assertCodexTurnStartResponse } from "./protocol-validators-B19q5BIX.js";
6
- import { i as formatCodexUsageLimitErrorMessage, o as resolveCodexUsageLimitResetAtMs, s as shouldRefreshCodexRateLimitsForUsageLimitMessage } from "./provider-qJygHQx4.js";
7
- import { a as isCodexAppServerConnectionClosedError, i as isCodexAppServerApprovalRequest, n as CodexAppServerRpcError, r as compareCodexAppServerVersions, s as MIN_CODEX_SANDBOX_EXEC_SERVER_APP_SERVER_VERSION } from "./client-m7XiCQpO.js";
8
- import { i as isCodexAppServerNativeAuthProfile, l as writeCodexAppServerBinding, n as clearCodexAppServerBinding, o as readCodexAppServerBinding, r as clearCodexAppServerBindingForThread } from "./session-binding-BRUi8y6E.js";
9
- import { n as buildCodexPluginAppCacheKey, r as CODEX_CONTROL_METHODS, t as buildCodexAppServerRuntimeFingerprint } from "./plugin-app-cache-key-CN9zBiCG.js";
10
- import { a as formatCodexDisplayText, n as resolveCodexAppServerForOpenClawToolPolicy, t as resolveCodexAppServerForModelProvider } from "./app-server-policy-KpyUye2D.js";
11
- import { d as resolveCodexAppServerAuthAccountCacheKey, f as resolveCodexAppServerAuthProfileId, h as resolveCodexAppServerHomeDir, m as resolveCodexAppServerFallbackApiKeyCacheKey, n as clearSharedCodexAppServerClientIfCurrentAndUnclaimed, o as releaseLeasedSharedCodexAppServerClient, p as resolveCodexAppServerAuthProfileIdForAgent, s as retireSharedCodexAppServerClientIfCurrent, t as clearSharedCodexAppServerClientIfCurrent, u as refreshCodexAppServerAuthTokens } from "./shared-client-Bg5d7VV9.js";
12
- import { t as defaultLeasedCodexAppServerClientFactory } from "./client-factory-CPuoOOx6.js";
13
- import { A as CODEX_POST_REASONING_REPLY_IDLE_TIMEOUT_MS, C as resolveCodexMessageToolProvider, D as shouldWarnCodexDynamicToolBuildStageSummary, E as shouldRequireCodexSandboxExecServerEnvironment, F as resolveCodexTurnTerminalIdleTimeoutMs, I as withCodexStartupTimeout, M as resolveCodexStartupTimeoutMs, N as resolveCodexTurnAssistantCompletionIdleTimeoutMs, P as resolveCodexTurnCompletionIdleTimeoutMs, S as resolveCodexExternalSandboxPolicyForOpenClawSandbox, T as shouldEnableCodexAppServerNativeToolSurface, _ as createCodexDynamicToolBuildStageTracker, a as buildCodexNativeHookRelayConfig, b as resolveCodexAppServerExecutionCwd, c as resolveCodexNativeHookRelayEvents, d as handleCodexAppServerElicitationRequest, f as createCodexDynamicToolBridge, g as buildDynamicTools, h as emitDynamicToolTerminalDiagnostic, i as CODEX_NATIVE_HOOK_RELAY_TTL_GRACE_MS, j as resolveCodexPostToolRawAssistantCompletionIdleTimeoutMs, k as handleCodexAppServerApprovalRequest, l as resolveCodexNativeHookRelayTtlMs, m as emitDynamicToolStartedDiagnostic, o as buildCodexNativeHookRelayDisabledConfig, p as emitDynamicToolErrorDiagnostic, s as createCodexNativeHookRelay, t as resolveCodexProviderWebSearchSupport, u as scheduleCodexNativeHookRelayUnregister, v as disableCodexPluginThreadConfig, w as resolveCodexSandboxEnvironmentSelection, x as resolveCodexAppServerHookChannelId, y as formatCodexDynamicToolBuildStageSummary } from "./provider-capabilities-BOvTfMhF.js";
14
- import { t as ensureCodexComputerUse } from "./computer-use-qLm7Gf35.js";
6
+ import { i as formatCodexUsageLimitErrorMessage, o as resolveCodexUsageLimitResetAtMs, s as shouldRefreshCodexRateLimitsForUsageLimitMessage } from "./provider-B-OHpbD3.js";
7
+ import { a as isCodexAppServerConnectionClosedError, i as isCodexAppServerApprovalRequest, n as CodexAppServerRpcError, r as compareCodexAppServerVersions, s as MIN_CODEX_SANDBOX_EXEC_SERVER_APP_SERVER_VERSION } from "./client-CLrtWgrD.js";
8
+ import { i as isCodexAppServerNativeAuthProfile, l as writeCodexAppServerBinding, n as clearCodexAppServerBinding, o as readCodexAppServerBinding, r as clearCodexAppServerBindingForThread } from "./session-binding-HOuPt-E0.js";
9
+ import { n as buildCodexPluginAppCacheKey, r as CODEX_CONTROL_METHODS, t as buildCodexAppServerRuntimeFingerprint } from "./plugin-app-cache-key-vaZ_8Usz.js";
10
+ import { a as formatCodexDisplayText, n as resolveCodexAppServerForOpenClawToolPolicy, t as resolveCodexAppServerForModelProvider } from "./app-server-policy-BPTiVNsW.js";
11
+ import { d as resolveCodexAppServerAuthAccountCacheKey, f as resolveCodexAppServerAuthProfileId, h as resolveCodexAppServerHomeDir, m as resolveCodexAppServerFallbackApiKeyCacheKey, n as clearSharedCodexAppServerClientIfCurrentAndUnclaimed, o as releaseLeasedSharedCodexAppServerClient, p as resolveCodexAppServerAuthProfileIdForAgent, s as retireSharedCodexAppServerClientIfCurrent, t as clearSharedCodexAppServerClientIfCurrent, u as refreshCodexAppServerAuthTokens } from "./shared-client-Dtx5i7Ez.js";
12
+ import { t as defaultLeasedCodexAppServerClientFactory } from "./client-factory-Bm6HsGob.js";
13
+ import { A as CODEX_POST_REASONING_REPLY_IDLE_TIMEOUT_MS, C as resolveCodexMessageToolProvider, D as shouldWarnCodexDynamicToolBuildStageSummary, E as shouldRequireCodexSandboxExecServerEnvironment, F as resolveCodexTurnTerminalIdleTimeoutMs, I as withCodexStartupTimeout, M as resolveCodexStartupTimeoutMs, N as resolveCodexTurnAssistantCompletionIdleTimeoutMs, P as resolveCodexTurnCompletionIdleTimeoutMs, S as resolveCodexExternalSandboxPolicyForOpenClawSandbox, T as shouldEnableCodexAppServerNativeToolSurface, _ as createCodexDynamicToolBuildStageTracker, a as buildCodexNativeHookRelayConfig, b as resolveCodexAppServerExecutionCwd, c as resolveCodexNativeHookRelayEvents, d as handleCodexAppServerElicitationRequest, f as createCodexDynamicToolBridge, g as buildDynamicTools, h as emitDynamicToolTerminalDiagnostic, i as CODEX_NATIVE_HOOK_RELAY_TTL_GRACE_MS, j as resolveCodexPostToolRawAssistantCompletionIdleTimeoutMs, k as handleCodexAppServerApprovalRequest, l as resolveCodexNativeHookRelayTtlMs, m as emitDynamicToolStartedDiagnostic, o as buildCodexNativeHookRelayDisabledConfig, p as emitDynamicToolErrorDiagnostic, s as createCodexNativeHookRelay, t as resolveCodexProviderWebSearchSupport, u as scheduleCodexNativeHookRelayUnregister, v as disableCodexPluginThreadConfig, w as resolveCodexSandboxEnvironmentSelection, x as resolveCodexAppServerHookChannelId, y as formatCodexDynamicToolBuildStageSummary } from "./provider-capabilities-ByR82ytL.js";
14
+ import { t as ensureCodexComputerUse } from "./computer-use-BmuwYrW6.js";
15
15
  import { n as rememberCodexRateLimits, t as readRecentCodexRateLimits } from "./rate-limit-cache-C7qmZ0Jh.js";
16
16
  import fs from "node:fs/promises";
17
17
  import path, { posix } from "node:path";
@@ -6137,25 +6137,58 @@ var CodexNativeSubagentMonitor = class {
6137
6137
  continue;
6138
6138
  }
6139
6139
  const completion = toThreadCompletion(nativeCompletion, childState.childThreadId);
6140
- if (shouldWaitForTranscriptCompletion(completion, this.codexHome)) {
6141
- const eventAt = Date.now();
6142
- if (!await this.reconcileChildTranscript(childState.childThreadId)) {
6143
- this.scheduleTranscriptPoll(childState);
6144
- this.scheduleNoFinalCompletionFallback(state, childState, completion, eventAt);
6145
- }
6146
- continue;
6147
- }
6148
- await this.processCompletion(state, completion);
6140
+ await this.processChildCompletion(state, childState, completion);
6149
6141
  }
6150
6142
  }
6151
6143
  captureChildAssistantMessage(notification) {
6152
- if (notification.method !== "item/completed") return;
6153
6144
  const params = isJsonObject(notification.params) ? notification.params : void 0;
6154
6145
  const childThreadId = readString$2(params, "threadId")?.trim();
6155
6146
  const childState = childThreadId ? this.childStates.get(childThreadId) : void 0;
6147
+ if (!childState || childState.transcriptTerminal) return;
6148
+ if (notification.method === "item/agentMessage/delta") {
6149
+ const turnId = readString$2(params, "turnId");
6150
+ const itemId = readString$2(params, "itemId");
6151
+ const delta = readString$2(params, "delta");
6152
+ if (turnId && itemId && delta) this.recordChildAssistantMessage(childState, turnId, itemId, delta);
6153
+ return;
6154
+ }
6155
+ if (notification.method !== "item/started" && notification.method !== "item/completed") return;
6156
+ const turnId = readString$2(params, "turnId");
6156
6157
  const item = isJsonObject(params?.item) ? params.item : void 0;
6157
- const text = readString$2(item, "type") === "agentMessage" ? normalizeOptionalString(readString$2(item, "text")) : void 0;
6158
- if (childState && text) childState.lastAssistantMessage = text;
6158
+ this.captureChildAssistantMessageItem(childState, turnId, item);
6159
+ }
6160
+ captureChildAssistantMessageItem(childState, turnId, item) {
6161
+ if (readString$2(item, "type") !== "agentMessage") return;
6162
+ const itemId = readString$2(item, "id");
6163
+ if (!turnId || !itemId) return;
6164
+ const assistantMessages = this.getChildAssistantMessages(childState, turnId);
6165
+ if (readString$2(item, "phase") === "commentary") assistantMessages.commentaryIds.add(itemId);
6166
+ else assistantMessages.finalMessageIds.add(itemId);
6167
+ const text = readString$2(item, "text");
6168
+ if (text) this.recordChildAssistantMessage(childState, turnId, itemId, text, { replace: true });
6169
+ }
6170
+ captureChildTurnAssistantMessages(childState, turn) {
6171
+ const turnId = readString$2(turn, "id");
6172
+ if (!turnId || !Array.isArray(turn.items)) return;
6173
+ for (const item of turn.items) this.captureChildAssistantMessageItem(childState, turnId, isJsonObject(item) ? item : void 0);
6174
+ }
6175
+ recordChildAssistantMessage(childState, turnId, itemId, text, options = {}) {
6176
+ const assistantMessages = this.getChildAssistantMessages(childState, turnId);
6177
+ if (!assistantMessages.texts.has(itemId)) assistantMessages.order.push(itemId);
6178
+ const existing = assistantMessages.texts.get(itemId) ?? "";
6179
+ assistantMessages.texts.set(itemId, options.replace ? text : `${existing}${text}`);
6180
+ }
6181
+ getChildAssistantMessages(childState, turnId) {
6182
+ const existing = childState.assistantMessagesByTurn.get(turnId);
6183
+ if (existing) return existing;
6184
+ const assistantMessages = {
6185
+ texts: /* @__PURE__ */ new Map(),
6186
+ order: [],
6187
+ commentaryIds: /* @__PURE__ */ new Set(),
6188
+ finalMessageIds: /* @__PURE__ */ new Set()
6189
+ };
6190
+ childState.assistantMessagesByTurn.set(turnId, assistantMessages);
6191
+ return assistantMessages;
6159
6192
  }
6160
6193
  async handleChildTurnCompletion(notification) {
6161
6194
  if (notification.method !== "turn/completed") return;
@@ -6164,8 +6197,25 @@ var CodexNativeSubagentMonitor = class {
6164
6197
  const childState = childThreadId ? this.childStates.get(childThreadId) : void 0;
6165
6198
  const state = childState ? this.parentStates.get(childState.parentThreadId) : void 0;
6166
6199
  const turn = isJsonObject(params?.turn) ? params.turn : void 0;
6200
+ if (childState && turn && readString$2(turn, "status") === "interrupted") {
6201
+ const turnId = readString$2(turn, "id");
6202
+ if (turnId) childState.assistantMessagesByTurn.delete(turnId);
6203
+ return;
6204
+ }
6205
+ if (childState && turn) this.captureChildTurnAssistantMessages(childState, turn);
6167
6206
  const completion = childState && turn ? toChildTurnCompletion(childState, turn) : void 0;
6168
6207
  if (!state || !childState || childState.transcriptTerminal || !completion) return;
6208
+ await this.processChildCompletion(state, childState, completion);
6209
+ }
6210
+ async processChildCompletion(state, childState, completion) {
6211
+ if (shouldWaitForTranscriptCompletion(completion, this.codexHome)) {
6212
+ const eventAt = Date.now();
6213
+ if (!await this.reconcileChildTranscript(childState.childThreadId)) {
6214
+ this.scheduleTranscriptPoll(childState);
6215
+ this.scheduleNoFinalCompletionFallback(state, childState, completion, eventAt);
6216
+ }
6217
+ return;
6218
+ }
6169
6219
  await this.processCompletion(state, completion);
6170
6220
  }
6171
6221
  async reconcileChildTranscript(childThreadId, options = {}) {
@@ -6325,6 +6375,7 @@ var CodexNativeSubagentMonitor = class {
6325
6375
  childState = {
6326
6376
  childThreadId: normalizedChildThreadId,
6327
6377
  parentThreadId: normalizedParentThreadId,
6378
+ assistantMessagesByTurn: /* @__PURE__ */ new Map(),
6328
6379
  transcriptPollAttempt: 0,
6329
6380
  transcriptTerminal: false,
6330
6381
  completionDeliveryAttempt: 0
@@ -6522,18 +6573,16 @@ function buildCompletionDedupeKey(parentThreadId, completion) {
6522
6573
  }
6523
6574
  function toChildTurnCompletion(childState, turn) {
6524
6575
  const status = readString$2(turn, "status");
6525
- if (status === "completed") return {
6526
- childThreadId: childState.childThreadId,
6527
- status: "succeeded",
6528
- statusLabel: "turn_completed",
6529
- result: childState.lastAssistantMessage ?? "Codex native subagent completed without a final assistant message."
6530
- };
6531
- if (status === "interrupted") return {
6532
- childThreadId: childState.childThreadId,
6533
- status: "cancelled",
6534
- statusLabel: "turn_interrupted",
6535
- result: "Codex native subagent was interrupted."
6536
- };
6576
+ if (status === "completed") {
6577
+ const turnId = readString$2(turn, "id");
6578
+ const result = turnId ? lastChildAssistantMessage(childState, turnId) : void 0;
6579
+ return {
6580
+ childThreadId: childState.childThreadId,
6581
+ status: "succeeded",
6582
+ statusLabel: result ? "turn_completed" : "completed_without_final_message",
6583
+ result: result ?? "Codex native subagent completed without a final assistant message."
6584
+ };
6585
+ }
6537
6586
  if (status === "failed") return {
6538
6587
  childThreadId: childState.childThreadId,
6539
6588
  status: "failed",
@@ -6541,6 +6590,17 @@ function toChildTurnCompletion(childState, turn) {
6541
6590
  result: readTurnErrorMessage(turn) ?? "Codex native subagent failed."
6542
6591
  };
6543
6592
  }
6593
+ function lastChildAssistantMessage(childState, turnId) {
6594
+ const assistantMessages = childState.assistantMessagesByTurn.get(turnId);
6595
+ if (!assistantMessages) return;
6596
+ for (let index = assistantMessages.order.length - 1; index >= 0; index -= 1) {
6597
+ const itemId = assistantMessages.order[index];
6598
+ if (assistantMessages.finalMessageIds.has(itemId) && !assistantMessages.commentaryIds.has(itemId)) {
6599
+ const text = normalizeOptionalString(assistantMessages.texts.get(itemId));
6600
+ if (text) return text;
6601
+ }
6602
+ }
6603
+ }
6544
6604
  function readTurnErrorMessage(turn) {
6545
6605
  const error = isJsonObject(turn.error) ? turn.error : void 0;
6546
6606
  return normalizeOptionalString(readString$2(error, "message")) ?? normalizeOptionalString(isJsonObject(error?.codexErrorInfo) ? readString$2(error.codexErrorInfo, "message") : void 0);
@@ -7996,8 +8056,13 @@ async function runCodexAppServerAttempt(params, options = {}) {
7996
8056
  skillsPrompt: params.skillsSnapshot?.prompt
7997
8057
  });
7998
8058
  let promptText = params.prompt;
8059
+ let promptContextRange;
7999
8060
  let developerInstructions = baseDeveloperInstructions;
8000
8061
  let prePromptMessageCount = historyMessages.length;
8062
+ const codexContextProjectionMaxChars = resolveCodexContextEngineProjectionMaxChars({
8063
+ contextTokenBudget: params.contextTokenBudget,
8064
+ reserveTokens: resolveCodexContextEngineProjectionReserveTokens({ config: params.config })
8065
+ });
8001
8066
  let contextEngineProjection;
8002
8067
  let precomputedStaleBindingContinuityProjectionApplied = false;
8003
8068
  let staleBindingContinuityForcedFreshStart = false;
@@ -8006,9 +8071,11 @@ async function runCodexAppServerAttempt(params, options = {}) {
8006
8071
  const projection = projectContextEngineAssemblyForCodex({
8007
8072
  assembledMessages: historyMessages,
8008
8073
  originalHistoryMessages: historyMessages,
8009
- prompt: params.prompt
8074
+ prompt: params.prompt,
8075
+ maxRenderedContextChars: codexContextProjectionMaxChars
8010
8076
  });
8011
8077
  promptText = projection.promptText;
8078
+ promptContextRange = projection.promptContextRange;
8012
8079
  prePromptMessageCount = projection.prePromptMessageCount;
8013
8080
  };
8014
8081
  const applyActiveContextEngineProjection = async (decisionStartupBinding) => {
@@ -8036,10 +8103,7 @@ async function runCodexAppServerAttempt(params, options = {}) {
8036
8103
  originalHistoryMessages: historyMessages,
8037
8104
  prompt: params.prompt,
8038
8105
  systemPromptAddition: assembled.systemPromptAddition,
8039
- maxRenderedContextChars: resolveCodexContextEngineProjectionMaxChars({
8040
- contextTokenBudget: params.contextTokenBudget,
8041
- reserveTokens: resolveCodexContextEngineProjectionReserveTokens({ config: params.config })
8042
- }),
8106
+ maxRenderedContextChars: codexContextProjectionMaxChars,
8043
8107
  toolPayloadMode: contextEngineProjection ? "preserve" : "elide"
8044
8108
  });
8045
8109
  const projectionDecision = contextEngineProjection ? resolveContextEngineBootstrapProjectionDecision({
@@ -8069,6 +8133,7 @@ async function runCodexAppServerAttempt(params, options = {}) {
8069
8133
  developerInstructionAdditionChars: projection.developerInstructionAddition?.length ?? 0
8070
8134
  });
8071
8135
  promptText = projectionDecision.project ? projection.promptText : params.prompt;
8136
+ promptContextRange = projectionDecision.project ? projection.promptContextRange : void 0;
8072
8137
  developerInstructions = joinPresentSections(baseDeveloperInstructions, projection.developerInstructionAddition);
8073
8138
  prePromptMessageCount = projection.prePromptMessageCount;
8074
8139
  };
@@ -8084,8 +8149,23 @@ async function runCodexAppServerAttempt(params, options = {}) {
8084
8149
  messages: codexModelInputHistoryMessages,
8085
8150
  ctx: hookContext
8086
8151
  });
8152
+ const resolveShiftedPromptContextRange = (prompt, turnPromptText) => {
8153
+ if (!promptContextRange || !prompt.endsWith(promptText) || !turnPromptText.endsWith(prompt)) return;
8154
+ const promptTextOffset = prompt.length - promptText.length;
8155
+ const turnPromptOffset = turnPromptText.length - prompt.length + promptTextOffset;
8156
+ return {
8157
+ start: turnPromptOffset + promptContextRange.start,
8158
+ end: turnPromptOffset + promptContextRange.end
8159
+ };
8160
+ };
8087
8161
  let promptBuild = await buildPromptFromCurrentInputs();
8088
- const decorateCodexTurnPromptText = (prompt) => prependCodexOpenClawPromptContext(prompt, openClawPromptContext, { preservePromptWithoutContext: params.bootstrapContextMode === "lightweight" && params.bootstrapContextRunKind === "cron" });
8162
+ const decorateCodexTurnPromptText = (prompt) => {
8163
+ const turnPromptText = prependCodexOpenClawPromptContext(prompt, openClawPromptContext, { preservePromptWithoutContext: params.bootstrapContextMode === "lightweight" && params.bootstrapContextRunKind === "cron" });
8164
+ return fitCodexProjectedContextForTurnStart({
8165
+ promptText: turnPromptText,
8166
+ contextRange: resolveShiftedPromptContextRange(prompt, turnPromptText)
8167
+ });
8168
+ };
8089
8169
  let codexTurnPromptText = decorateCodexTurnPromptText(promptBuild.prompt);
8090
8170
  const buildCodexTurnCollaborationDeveloperInstructions = () => buildTurnCollaborationMode(params, {
8091
8171
  turnScopedDeveloperInstructions: workspaceBootstrapContext.turnScopedDeveloperInstructions,
@@ -8127,9 +8207,11 @@ async function runCodexAppServerAttempt(params, options = {}) {
8127
8207
  const projection = projectContextEngineAssemblyForCodex({
8128
8208
  assembledMessages: newerVisibleMessages,
8129
8209
  originalHistoryMessages: historyMessages,
8130
- prompt: params.prompt
8210
+ prompt: params.prompt,
8211
+ maxRenderedContextChars: codexContextProjectionMaxChars
8131
8212
  });
8132
8213
  promptText = projection.promptText;
8214
+ promptContextRange = projection.promptContextRange;
8133
8215
  prePromptMessageCount = projection.prePromptMessageCount;
8134
8216
  return true;
8135
8217
  };
@@ -8178,6 +8260,7 @@ async function runCodexAppServerAttempt(params, options = {}) {
8178
8260
  if (startupBinding?.threadId) return;
8179
8261
  inactiveThreadBootstrapBindingForcedFreshStart = hadInactiveThreadBootstrapBinding;
8180
8262
  staleBindingContinuityForcedFreshStart = precomputedStaleBindingContinuityProjectionApplied && !inactiveThreadBootstrapBindingForcedFreshStart;
8263
+ if (staleBindingContinuityForcedFreshStart) applyFreshThreadContinuityProjection();
8181
8264
  if (activeContextEngine) {
8182
8265
  contextEngineProjection = void 0;
8183
8266
  try {
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { l as normalizeCodexServiceTier } from "./config-BksX0T33.js";
2
+ import { l as normalizeCodexServiceTier } from "./config-CszD0vP3.js";
3
3
  import fs from "node:fs/promises";
4
4
  import { ensureAuthProfileStore, resolveDefaultAgentDir, resolveProviderIdForAuth } from "openclaw/plugin-sdk/agent-runtime";
5
5
  import { embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { d as resolveCodexAppServerRuntimeOptions, r as codexAppServerStartOptionsKey } from "./config-BksX0T33.js";
3
- import { c as resolveCodexAppServerSpawnEnv, o as MANAGED_CODEX_APP_SERVER_PACKAGE, t as CodexAppServerClient } from "./client-m7XiCQpO.js";
2
+ import { d as resolveCodexAppServerRuntimeOptions, r as codexAppServerStartOptionsKey } from "./config-CszD0vP3.js";
3
+ import { c as resolveCodexAppServerSpawnEnv, o as MANAGED_CODEX_APP_SERVER_PACKAGE, t as CodexAppServerClient } from "./client-CLrtWgrD.js";
4
4
  import { createRequire } from "node:module";
5
5
  import fs, { access } from "node:fs/promises";
6
6
  import path from "node:path";
@@ -1,14 +1,14 @@
1
1
  import { n as isJsonObject } from "./protocol-dh-ETiNd.js";
2
- import { B as readCodexNotificationThreadId, M as mergeCodexThreadConfigs, S as filterCodexDynamicTools, T as resolveCodexDynamicToolsLoading, V as readCodexNotificationTurnId, _ as resolveCodexWebSearchPlan, d as resolveCodexAppServerRequestModelSelection, m as resolveReasoningEffort, p as resolveCodexBindingModelProviderFallback, r as buildCodexRuntimeThreadConfig, t as CODEX_NATIVE_PERSONALITY_NONE, u as resolveCodexAppServerModelProvider } from "./thread-lifecycle-CbJqqnEw.js";
3
- import { d as resolveCodexAppServerRuntimeOptions, g as shouldAutoApproveCodexAppServerApprovals, h as resolveOpenClawExecPolicyForCodexAppServer, n as canUseCodexModelBackedApprovalsReviewerForModel, p as resolveCodexModelBackedReviewerPolicyContext, u as readCodexPluginConfig } from "./config-BksX0T33.js";
2
+ import { H as readCodexNotificationTurnId, N as mergeCodexThreadConfigs, S as filterCodexDynamicTools, T as resolveCodexDynamicToolsLoading, V as readCodexNotificationThreadId, _ as resolveCodexWebSearchPlan, d as resolveCodexAppServerRequestModelSelection, m as resolveReasoningEffort, p as resolveCodexBindingModelProviderFallback, r as buildCodexRuntimeThreadConfig, t as CODEX_NATIVE_PERSONALITY_NONE, u as resolveCodexAppServerModelProvider } from "./thread-lifecycle-DQyii5vp.js";
3
+ import { d as resolveCodexAppServerRuntimeOptions, g as shouldAutoApproveCodexAppServerApprovals, h as resolveOpenClawExecPolicyForCodexAppServer, n as canUseCodexModelBackedApprovalsReviewerForModel, p as resolveCodexModelBackedReviewerPolicyContext, u as readCodexPluginConfig } from "./config-CszD0vP3.js";
4
4
  import { a as readCodexDynamicToolCallParams, c as readCodexTurn, i as assertCodexTurnStartResponse, t as assertCodexThreadForkResponse } from "./protocol-validators-B19q5BIX.js";
5
- import { i as formatCodexUsageLimitErrorMessage } from "./provider-qJygHQx4.js";
6
- import { i as isCodexAppServerApprovalRequest } from "./client-m7XiCQpO.js";
7
- import { i as isCodexAppServerNativeAuthProfile, o as readCodexAppServerBinding } from "./session-binding-BRUi8y6E.js";
8
- import { t as resolveCodexAppServerForModelProvider } from "./app-server-policy-KpyUye2D.js";
9
- import { a as getLeasedSharedCodexAppServerClient, o as releaseLeasedSharedCodexAppServerClient, u as refreshCodexAppServerAuthTokens } from "./shared-client-Bg5d7VV9.js";
5
+ import { i as formatCodexUsageLimitErrorMessage } from "./provider-B-OHpbD3.js";
6
+ import { i as isCodexAppServerApprovalRequest } from "./client-CLrtWgrD.js";
7
+ import { i as isCodexAppServerNativeAuthProfile, o as readCodexAppServerBinding } from "./session-binding-HOuPt-E0.js";
8
+ import { t as resolveCodexAppServerForModelProvider } from "./app-server-policy-BPTiVNsW.js";
9
+ import { a as getLeasedSharedCodexAppServerClient, o as releaseLeasedSharedCodexAppServerClient, u as refreshCodexAppServerAuthTokens } from "./shared-client-Dtx5i7Ez.js";
10
10
  import { n as resolveCodexNativeExecutionBlock } from "./sandbox-guard-3tnjhjFb.js";
11
- import { C as resolveCodexMessageToolProvider, O as filterToolsForVisionInputs, T as shouldEnableCodexAppServerNativeToolSurface, a as buildCodexNativeHookRelayConfig, d as handleCodexAppServerElicitationRequest, f as createCodexDynamicToolBridge, h as emitDynamicToolTerminalDiagnostic, k as handleCodexAppServerApprovalRequest, m as emitDynamicToolStartedDiagnostic, n as resolveCodexProviderWebSearchSupportForClient, o as buildCodexNativeHookRelayDisabledConfig, p as emitDynamicToolErrorDiagnostic, r as CODEX_NATIVE_HOOK_RELAY_EVENTS } from "./provider-capabilities-BOvTfMhF.js";
11
+ import { C as resolveCodexMessageToolProvider, O as filterToolsForVisionInputs, T as shouldEnableCodexAppServerNativeToolSurface, a as buildCodexNativeHookRelayConfig, d as handleCodexAppServerElicitationRequest, f as createCodexDynamicToolBridge, h as emitDynamicToolTerminalDiagnostic, k as handleCodexAppServerApprovalRequest, m as emitDynamicToolStartedDiagnostic, n as resolveCodexProviderWebSearchSupportForClient, o as buildCodexNativeHookRelayDisabledConfig, p as emitDynamicToolErrorDiagnostic, r as CODEX_NATIVE_HOOK_RELAY_EVENTS } from "./provider-capabilities-ByR82ytL.js";
12
12
  import { n as rememberCodexRateLimits, t as readRecentCodexRateLimits } from "./rate-limit-cache-C7qmZ0Jh.js";
13
13
  import { loadExecApprovals } from "openclaw/plugin-sdk/exec-approvals-runtime";
14
14
  import { buildAgentHookContextChannelFields, embeddedAgentLog, formatErrorMessage, registerNativeHookRelay, resolveAgentDir, resolveAttemptSpawnWorkspaceDir, resolveModelAuthMode, resolveSandboxContext, resolveSessionAgentIds, supportsModelTools } from "openclaw/plugin-sdk/agent-harness-runtime";
@@ -1,10 +1,10 @@
1
1
  import { n as isJsonObject, t as flattenCodexDynamicToolFunctions } from "./protocol-dh-ETiNd.js";
2
- import { i as codexSandboxPolicyForTurn, m as resolveCodexPluginsPolicy, t as CODEX_PLUGINS_MARKETPLACE_NAME } from "./config-BksX0T33.js";
2
+ import { i as codexSandboxPolicyForTurn, m as resolveCodexPluginsPolicy, t as CODEX_PLUGINS_MARKETPLACE_NAME } from "./config-CszD0vP3.js";
3
3
  import { n as assertCodexThreadResumeResponse, r as assertCodexThreadStartResponse } from "./protocol-validators-B19q5BIX.js";
4
4
  import { CODEX_GPT5_HEARTBEAT_PROMPT_OVERLAY } from "./prompt-overlay.js";
5
- import { r as isModernCodexModel } from "./provider-qJygHQx4.js";
6
- import { a as isCodexAppServerConnectionClosedError, n as CodexAppServerRpcError } from "./client-m7XiCQpO.js";
7
- import { i as isCodexAppServerNativeAuthProfile, l as writeCodexAppServerBinding, n as clearCodexAppServerBinding, o as readCodexAppServerBinding } from "./session-binding-BRUi8y6E.js";
5
+ import { r as isModernCodexModel } from "./provider-B-OHpbD3.js";
6
+ import { a as isCodexAppServerConnectionClosedError, n as CodexAppServerRpcError } from "./client-CLrtWgrD.js";
7
+ import { i as isCodexAppServerNativeAuthProfile, l as writeCodexAppServerBinding, n as clearCodexAppServerBinding, o as readCodexAppServerBinding } from "./session-binding-HOuPt-E0.js";
8
8
  import "node:fs/promises";
9
9
  import "node:path";
10
10
  import { isFutureDateTimestampMs, resolveDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
@@ -860,6 +860,7 @@ const MAX_RENDERED_CONTEXT_CHARS = 1e6;
860
860
  const DEFAULT_TEXT_PART_CHARS = 6e3;
861
861
  const MAX_TEXT_PART_CHARS = 128e3;
862
862
  const APPROX_RENDERED_CHARS_PER_TOKEN = 4;
863
+ const CODEX_TURN_START_TEXT_INPUT_MAX_CHARS = 1 << 20;
863
864
  /** Default token reserve kept out of rendered context-engine prompt text. */
864
865
  const DEFAULT_CODEX_PROJECTION_RESERVE_TOKENS = 2e4;
865
866
  const MIN_PROMPT_BUDGET_RATIO = .5;
@@ -873,20 +874,23 @@ function projectContextEngineAssemblyForCodex(params) {
873
874
  maxTextPartChars: resolveTextPartMaxChars(maxRenderedContextChars),
874
875
  toolPayloadMode: params.toolPayloadMode ?? "elide"
875
876
  });
876
- const promptText = renderedContext ? [
877
+ const boundedContext = renderedContext ? truncateOlderContext(renderedContext, maxRenderedContextChars) : void 0;
878
+ const promptPrefix = boundedContext ? [
877
879
  CONTEXT_HEADER,
878
880
  CONTEXT_SAFETY_NOTE,
879
881
  "",
880
- CONTEXT_OPEN,
881
- truncateOlderContext(renderedContext, maxRenderedContextChars),
882
- CONTEXT_CLOSE,
883
- "",
884
- REQUEST_HEADER,
885
- prompt
886
- ].join("\n") : prompt;
882
+ CONTEXT_OPEN
883
+ ].join("\n") + "\n" : void 0;
884
+ const promptSuffix = boundedContext ? `\n${CONTEXT_CLOSE}\n\n${REQUEST_HEADER}\n${prompt}` : "";
885
+ const promptText = boundedContext ? `${promptPrefix}${boundedContext}${promptSuffix}` : prompt;
886
+ const promptContextRange = promptPrefix && boundedContext ? {
887
+ start: promptPrefix.length,
888
+ end: promptPrefix.length + boundedContext.length
889
+ } : void 0;
887
890
  return {
888
891
  ...params.systemPromptAddition?.trim() ? { developerInstructionAddition: params.systemPromptAddition.trim() } : {},
889
892
  promptText,
893
+ ...promptContextRange ? { promptContextRange } : {},
890
894
  assembledMessages: params.assembledMessages,
891
895
  prePromptMessageCount: params.originalHistoryMessages.length
892
896
  };
@@ -908,6 +912,30 @@ function resolveCodexContextEngineProjectionReserveTokens(params) {
908
912
  if (configuredReserveTokens !== void 0) return Math.max(configuredReserveTokens, configuredReserveTokensFloor ?? 2e4);
909
913
  if (configuredReserveTokensFloor !== void 0) return configuredReserveTokensFloor;
910
914
  }
915
+ /** Fits projected context prompts under Codex app-server turn/start text limits. */
916
+ function fitCodexProjectedContextForTurnStart(params) {
917
+ const maxChars = typeof params.maxChars === "number" && Number.isFinite(params.maxChars) ? Math.max(0, Math.floor(params.maxChars)) : CODEX_TURN_START_TEXT_INPUT_MAX_CHARS;
918
+ if (params.promptText.length <= maxChars) return params.promptText;
919
+ const range = normalizeProjectedContextRange(params.contextRange, params.promptText.length);
920
+ if (!range) return params.promptText;
921
+ const beforeContext = params.promptText.slice(0, range.start);
922
+ const context = params.promptText.slice(range.start, range.end);
923
+ const afterContext = params.promptText.slice(range.end);
924
+ const contextBudget = maxChars - beforeContext.length - afterContext.length;
925
+ if (contextBudget > 0) return `${beforeContext}${truncateOlderContext(context, contextBudget)}${afterContext}`;
926
+ return truncateOlderContext(`${beforeContext}${afterContext}`, maxChars);
927
+ }
928
+ function normalizeProjectedContextRange(range, textLength) {
929
+ if (!range) return;
930
+ const start = Math.floor(range.start);
931
+ const end = Math.floor(range.end);
932
+ if (!Number.isFinite(start) || !Number.isFinite(end) || start < 0 || end < start) return;
933
+ if (end > textLength) return;
934
+ return {
935
+ start,
936
+ end
937
+ };
938
+ }
911
939
  function resolveProjectionPromptBudgetTokens(params) {
912
940
  const requestedReserveTokens = typeof params.reserveTokens === "number" && Number.isFinite(params.reserveTokens) && params.reserveTokens >= 0 ? Math.floor(params.reserveTokens) : DEFAULT_CODEX_PROJECTION_RESERVE_TOKENS;
913
941
  const minPromptBudget = Math.min(MIN_PROMPT_BUDGET_TOKENS, Math.max(1, Math.floor(params.contextTokenBudget * MIN_PROMPT_BUDGET_RATIO)));
@@ -1059,7 +1087,15 @@ function truncateOlderContext(text, maxChars) {
1059
1087
  marker = buildMarker(text.length - tailChars);
1060
1088
  if (marker.length >= maxChars) return marker.slice(0, maxChars);
1061
1089
  tailChars = maxChars - marker.length;
1062
- return `${marker}${text.slice(text.length - tailChars).trimStart()}`;
1090
+ return `${marker}${sliceTailFromCodePointBoundary(text, tailChars).trimStart()}`;
1091
+ }
1092
+ function sliceTailFromCodePointBoundary(text, tailChars) {
1093
+ let start = text.length - tailChars;
1094
+ if (start > 0 && start < text.length) {
1095
+ const code = text.charCodeAt(start);
1096
+ if (code >= 56320 && code <= 57343) start += 1;
1097
+ }
1098
+ return text.slice(start);
1063
1099
  }
1064
1100
  //#endregion
1065
1101
  //#region extensions/codex/src/app-server/dynamic-tool-profile.ts
@@ -2213,4 +2249,4 @@ function resolveReasoningEffort(thinkLevel, modelId) {
2213
2249
  return null;
2214
2250
  }
2215
2251
  //#endregion
2216
- export { buildCodexPluginThreadConfig as A, readCodexNotificationThreadId as B, isForcedPrivateQaCodexRuntime as C, projectContextEngineAssemblyForCodex as D, resolveCodexDynamicToolsLoadingForRuntime as E, pluginReadParams as F, buildCodexAppInventoryCacheKey as I, defaultCodexAppInventoryCache as L, mergeCodexThreadConfigs as M, shouldBuildCodexPluginThreadConfig as N, resolveCodexContextEngineProjectionMaxChars as O, ensureCodexPluginActivation as P, describeCodexNotificationCorrelation as R, filterCodexDynamicTools as S, resolveCodexDynamicToolsLoading as T, readCodexNotificationTurnId as V, resolveCodexWebSearchPlan as _, buildDeveloperInstructions as a, sanitizeCodexHistoryImagePayloads as b, codexDynamicToolsFingerprint as c, resolveCodexAppServerRequestModelSelection as d, resolveCodexAppServerThreadModelSelection as f, buildCodexNativeWebSearchThreadConfig as g, startOrResumeThread as h, buildContextEngineBinding as i, buildCodexPluginThreadConfigInputFingerprint as j, resolveCodexContextEngineProjectionReserveTokens as k, isContextEngineBindingCompatible as l, resolveReasoningEffort as m, areCodexDynamicToolFingerprintsCompatible as n, buildTurnCollaborationMode as o, resolveCodexBindingModelProviderFallback as p, buildCodexRuntimeThreadConfig as r, buildTurnStartParams as s, CODEX_NATIVE_PERSONALITY_NONE as t, resolveCodexAppServerModelProvider as u, isCodexAppServerProfilerEnabled as v, normalizeCodexDynamicToolName as w, sanitizeInlineImageDataUrl$1 as x, invalidInlineImageText as y, isCodexNotificationForTurn as z };
2252
+ export { resolveCodexContextEngineProjectionReserveTokens as A, isCodexNotificationForTurn as B, isForcedPrivateQaCodexRuntime as C, fitCodexProjectedContextForTurnStart as D, resolveCodexDynamicToolsLoadingForRuntime as E, ensureCodexPluginActivation as F, readCodexNotificationTurnId as H, pluginReadParams as I, buildCodexAppInventoryCacheKey as L, buildCodexPluginThreadConfigInputFingerprint as M, mergeCodexThreadConfigs as N, projectContextEngineAssemblyForCodex as O, shouldBuildCodexPluginThreadConfig as P, defaultCodexAppInventoryCache as R, filterCodexDynamicTools as S, resolveCodexDynamicToolsLoading as T, readCodexNotificationThreadId as V, resolveCodexWebSearchPlan as _, buildDeveloperInstructions as a, sanitizeCodexHistoryImagePayloads as b, codexDynamicToolsFingerprint as c, resolveCodexAppServerRequestModelSelection as d, resolveCodexAppServerThreadModelSelection as f, buildCodexNativeWebSearchThreadConfig as g, startOrResumeThread as h, buildContextEngineBinding as i, buildCodexPluginThreadConfig as j, resolveCodexContextEngineProjectionMaxChars as k, isContextEngineBindingCompatible as l, resolveReasoningEffort as m, areCodexDynamicToolFingerprintsCompatible as n, buildTurnCollaborationMode as o, resolveCodexBindingModelProviderFallback as p, buildCodexRuntimeThreadConfig as r, buildTurnStartParams as s, CODEX_NATIVE_PERSONALITY_NONE as t, resolveCodexAppServerModelProvider as u, isCodexAppServerProfilerEnabled as v, normalizeCodexDynamicToolName as w, sanitizeInlineImageDataUrl$1 as x, invalidInlineImageText as y, describeCodexNotificationCorrelation as z };
@@ -1,6 +1,6 @@
1
1
  import { n as isJsonObject } from "./protocol-dh-ETiNd.js";
2
- import { g as buildCodexNativeWebSearchThreadConfig } from "./thread-lifecycle-CbJqqnEw.js";
3
- import { n as runBoundedCodexAppServerTurn } from "./media-understanding-provider-CiwPkR58.js";
2
+ import { g as buildCodexNativeWebSearchThreadConfig } from "./thread-lifecycle-DQyii5vp.js";
3
+ import { n as runBoundedCodexAppServerTurn } from "./media-understanding-provider-Dmfg4tH_.js";
4
4
  import { readStringParam, resolveSearchTimeoutSeconds, wrapWebContent } from "openclaw/plugin-sdk/provider-web-search";
5
5
  //#region extensions/codex/src/web-search-provider.runtime.ts
6
6
  async function executeCodexWebSearchProviderTool(ctx, args, executionContext, options) {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@openclaw/codex",
3
- "version": "2026.6.9-beta.1",
3
+ "version": "2026.6.9",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@openclaw/codex",
9
- "version": "2026.6.9-beta.1",
9
+ "version": "2026.6.9",
10
10
  "dependencies": {
11
11
  "@openai/codex": "0.139.0",
12
12
  "typebox": "1.1.39",
@@ -152,10 +152,10 @@
152
152
  ]
153
153
  },
154
154
  "url": { "type": "string" },
155
- "authToken": { "type": "string" },
155
+ "authToken": { "type": ["string", "object"] },
156
156
  "headers": {
157
157
  "type": "object",
158
- "additionalProperties": { "type": "string" }
158
+ "additionalProperties": { "type": ["string", "object"] }
159
159
  },
160
160
  "clearEnv": {
161
161
  "type": "array",
@@ -254,6 +254,14 @@
254
254
  }
255
255
  }
256
256
  },
257
+ "configContracts": {
258
+ "secretInputs": {
259
+ "paths": [
260
+ { "path": "appServer.authToken", "expected": "string" },
261
+ { "path": "appServer.headers.*", "expected": "string" }
262
+ ]
263
+ }
264
+ },
257
265
  "uiHints": {
258
266
  "codexDynamicToolsLoading": {
259
267
  "label": "Dynamic Tools Loading",
@@ -382,6 +390,7 @@
382
390
  "appServer.headers": {
383
391
  "label": "Headers",
384
392
  "help": "Additional headers sent to the WebSocket app-server.",
393
+ "sensitive": true,
385
394
  "advanced": true
386
395
  },
387
396
  "appServer.clearEnv": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/codex",
3
- "version": "2026.6.9-beta.1",
3
+ "version": "2026.6.9",
4
4
  "description": "OpenClaw Codex app-server harness and model provider plugin with a Codex-managed GPT catalog.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,10 +34,10 @@
34
34
  ]
35
35
  },
36
36
  "compat": {
37
- "pluginApi": ">=2026.6.9-beta.1"
37
+ "pluginApi": ">=2026.6.9"
38
38
  },
39
39
  "build": {
40
- "openclawVersion": "2026.6.9-beta.1"
40
+ "openclawVersion": "2026.6.9"
41
41
  },
42
42
  "release": {
43
43
  "publishToClawHub": true,
@@ -55,7 +55,7 @@
55
55
  "README.md"
56
56
  ],
57
57
  "peerDependencies": {
58
- "openclaw": ">=2026.6.9-beta.1"
58
+ "openclaw": ">=2026.6.9"
59
59
  },
60
60
  "peerDependenciesMeta": {
61
61
  "openclaw": {