@openclaw/codex 2026.8.1 → 2026.8.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.
Files changed (54) hide show
  1. package/dist/api.js +2 -2
  2. package/dist/{attempt-client-cleanup-CVPvp9dL.js → attempt-client-cleanup-CpVfwctT.js} +1 -1
  3. package/dist/{binding-connection-CCQFs8lf.js → binding-connection-CF7BmrDk.js} +2 -2
  4. package/dist/{bounded-turn-rq5tiSXk.js → bounded-turn-DRC3hcjm.js} +10 -9
  5. package/dist/{capabilities-CGm_94eL.js → capabilities-D6m_TdVy.js} +1 -1
  6. package/dist/cli-metadata.js +1 -1
  7. package/dist/{command-formatters-C54Yg3eA.js → command-formatters--UToCokS.js} +4 -3
  8. package/dist/{command-handlers-BvOAHTrA.js → command-handlers-CLFx2Ypa.js} +41 -33
  9. package/dist/{compact-Hd7SAc0N.js → compact-5xqW1oCh.js} +13 -11
  10. package/dist/{config-Cxw3Cl3k.js → config-CcYL77O6.js} +6 -4
  11. package/dist/{conversation-binding-data-CW2GuupV.js → conversation-binding-data-BiodpIzq.js} +2 -1
  12. package/dist/doctor-contract-api.js +8 -4
  13. package/dist/{dynamic-tools-BFoUcRdx.js → dynamic-tools-BmeXjwNZ.js} +103 -106
  14. package/dist/{effective-mcp-catalog-BTJHnDSx.js → effective-mcp-catalog-XXQKgK1U.js} +2 -2
  15. package/dist/{event-projector-usage-D3PHFFXh.js → event-projector-usage-B2r5vhWH.js} +7 -12
  16. package/dist/{harness-DVfUQBlQ.js → harness-BgeB7LnD.js} +13 -13
  17. package/dist/harness.js +1 -1
  18. package/dist/index.js +56 -37
  19. package/dist/{isolated-completion-Cbbx_5Ed.js → isolated-completion-CxTus3vZ.js} +3 -3
  20. package/dist/media-understanding-provider.js +1 -1
  21. package/dist/{model-catalog-o6Cgjoss.js → model-catalog-DULBcniB.js} +5 -5
  22. package/dist/{models-DgFWSuxA.js → models-DaWfETQk.js} +4 -3
  23. package/dist/{native-subagent-monitor-CwFyoylz.js → native-subagent-monitor-vXYUZH37.js} +24 -104
  24. package/dist/{node-exec-server.runtime-DXrqpw1c.js → node-exec-server.runtime-DirKVZ5h.js} +2 -2
  25. package/dist/{plugin-approval-roundtrip-D80UZiJ_.js → plugin-approval-roundtrip-CCWQGlAI.js} +2 -1
  26. package/dist/{plugin-marketplace-discovery-mdmScYOj.js → plugin-marketplace-discovery-BXjIFEiw.js} +14 -13
  27. package/dist/{plugin-metadata-cache-CulOABwu.js → plugin-metadata-cache-DQQm4gWT.js} +5 -5
  28. package/dist/{rate-limits-hFtzt2Up.js → rate-limits-BqHEHXQJ.js} +3 -2
  29. package/dist/{request-CCm4LaED.js → request-BWxweEdK.js} +2 -2
  30. package/dist/{run-attempt-BwNQDH2u.js → run-attempt-BVLE4Gbi.js} +133 -182
  31. package/dist/{runtime-artifact-DeBvleJw.js → runtime-artifact-D9pYp4zL.js} +3 -3
  32. package/dist/{session-binding-q2WSTVmC.js → session-binding-D0zinCP1.js} +1 -1
  33. package/dist/{session-catalog-C2Tae4rI.js → session-catalog-eMhVm0Ql.js} +232 -204
  34. package/dist/{session-catalog-home-id-DAKUrm3C.js → session-catalog-home-id-Dt2GiG5o.js} +3 -3
  35. package/dist/{session-cli-BuDjm5Ou.js → session-cli-B2lyjJA0.js} +1 -1
  36. package/dist/session-history-C5J1AKzG.js +87 -0
  37. package/dist/{session-permission-policy-gLm40Vtq.js → session-permission-policy-ScnAyG90.js} +1 -1
  38. package/dist/{session-retirement-CdkI0bvb.js → session-retirement-CtUtUTr9.js} +4 -4
  39. package/dist/{session-upstream-marker-Bcy33kam.js → session-upstream-marker-gqrYIRHk.js} +1 -1
  40. package/dist/settled-turn-context-Bk3IUwod.js +290 -0
  41. package/dist/settled-turn-finalizer-BXLN9PfJ.js +104 -0
  42. package/dist/{shared-client-kNkljY-R.js → shared-client-B1tT5U6r.js} +33 -35
  43. package/dist/{side-question-GwD73tX6.js → side-question-CZ-mCw-t.js} +18 -15
  44. package/dist/{thread-lifecycle-Ss-uwnC4.js → thread-lifecycle-CGGKP720.js} +206 -163
  45. package/dist/{thread-ownership-CeYBqg_4.js → thread-ownership-RkaoZCmQ.js} +2 -2
  46. package/dist/{thread-resume-DF54hagX.js → thread-resume-BFt1-ZDa.js} +7 -6
  47. package/dist/{transcript-mirror-CkEQIna-.js → transcript-mirror-1ep4XjzF.js} +14 -7
  48. package/dist/{transport-stdio-C7-s9TLG.js → transport-stdio-NT_Dpd9V.js} +40 -24
  49. package/dist/{upstream-prompt-provenance-CFmsKwr9.js → upstream-prompt-provenance-LphB8slG.js} +8 -4
  50. package/dist/{upstream-session-fork-BACGlOFa.js → upstream-session-fork-Dc8BFExw.js} +13 -19
  51. package/dist/{usage-C2l8Mils.js → usage-DUhd58gI.js} +3 -3
  52. package/dist/{web-search-provider.runtime-B2XgRdFv.js → web-search-provider.runtime-BEmlE7ov.js} +3 -3
  53. package/package.json +5 -5
  54. package/dist/settled-turn-finalizer-B8JJcxCi.js +0 -329
package/dist/index.js CHANGED
@@ -1,27 +1,27 @@
1
1
  import { registerCodexCliMetadata } from "./cli-metadata.js";
2
- import { n as createCodexAppServerNativeCompaction, t as createCodexAppServerAgentHarness } from "./harness-DVfUQBlQ.js";
3
- import { D as resolveOpenClawExecPolicyForCodexAppServer, T as readCodexPluginConfig, c as assertCodexAppServerConnectionSecurity, i as resolveCodexAppServerRuntimeOptions, j as CODEX_PLUGINS_MARKETPLACE_NAME, n as codexSandboxPolicyForTurn, p as canUseCodexModelBackedApprovalsReviewerForModel, s as resolveCodexSupervisionAppServerRuntimeOptions, t as codexAppServerStartOptionsKey, v as readCodexRequirementsToml } from "./config-Cxw3Cl3k.js";
4
- import { C as withLeasedCodexAppServerClientStartSelectionRetry, Ft as resolveCodexAppServerFallbackApiKeyCacheKey, Ht as isJsonObject, J as isCodexAppServerOverloadError, K as isCodexAppServerIndeterminateRequestCancellationError, Nt as resolveCodexAppServerAuthProfileIdForAgent, St as releaseCodexAppServerLiveThread, Z as isUnsupportedCodexAppServerVersionError, _ as retainSharedCodexAppServerClientByInstanceId, b as retireSharedCodexAppServerClientsBeforeDesktopGeneration, bt as isCodexAppServerLiveThreadClaimed, c as getLeasedSharedCodexAppServerClient, gt as consumeCodexAppServerLiveThread, h as releaseLeasedSharedCodexAppServerClient, jt as resolveCodexAppServerAuthAccountCacheKey, k as createCodexDesktopGenerationService, m as releaseCodexAppServerClientLease, o as clearSharedCodexAppServerClientIfCurrentAndWait, vt as hasCodexAppServerLiveThread, yt as isCodexAppServerClientRuntimeLive, zt as CODEX_INTERACTIVE_THREAD_SOURCE_KINDS } from "./shared-client-kNkljY-R.js";
2
+ import { n as createCodexAppServerNativeCompaction, t as createCodexAppServerAgentHarness } from "./harness-BgeB7LnD.js";
3
+ import { D as resolveOpenClawExecPolicyForCodexAppServer, T as readCodexPluginConfig, c as assertCodexAppServerConnectionSecurity, i as resolveCodexAppServerRuntimeOptions, j as CODEX_PLUGINS_MARKETPLACE_NAME, n as codexSandboxPolicyForTurn, p as canUseCodexModelBackedApprovalsReviewerForModel, s as resolveCodexSupervisionAppServerRuntimeOptions, t as codexAppServerStartOptionsKey, v as readCodexRequirementsToml } from "./config-CcYL77O6.js";
4
+ import { C as withLeasedCodexAppServerClientStartSelectionRetry, Ft as resolveCodexAppServerFallbackApiKeyCacheKey, Ht as isJsonObject, J as isCodexAppServerOverloadError, K as isCodexAppServerIndeterminateRequestCancellationError, Nt as resolveCodexAppServerAuthProfileIdForAgent, St as releaseCodexAppServerLiveThread, Z as isUnsupportedCodexAppServerVersionError, _ as retainSharedCodexAppServerClientByInstanceId, b as retireSharedCodexAppServerClientsBeforeDesktopGeneration, bt as isCodexAppServerLiveThreadClaimed, c as getLeasedSharedCodexAppServerClient, gt as consumeCodexAppServerLiveThread, h as releaseLeasedSharedCodexAppServerClient, jt as resolveCodexAppServerAuthAccountCacheKey, k as createCodexDesktopGenerationService, m as releaseCodexAppServerClientLease, o as clearSharedCodexAppServerClientIfCurrentAndWait, vt as hasCodexAppServerLiveThread, yt as isCodexAppServerClientRuntimeLive, zt as CODEX_INTERACTIVE_THREAD_SOURCE_KINDS } from "./shared-client-B1tT5U6r.js";
5
5
  import { i as setManagedCodexPluginRoot } from "./managed-binary-ZkGodW19.js";
6
6
  import { n as CODEX_APP_SERVER_BINDING_NAMESPACE, t as CODEX_APP_SERVER_BINDING_MAX_ENTRIES } from "./session-binding-meta-B7aEMU7g.js";
7
- import { d as sessionBindingIdentity, n as assertCodexBindingMayBeReplaced, o as isCodexAppServerNativeAuthProfile, s as normalizeCodexAppServerBindingModelProvider } from "./session-binding-q2WSTVmC.js";
8
- import { o as createCodexAppServerProcessReaperService } from "./transport-stdio-C7-s9TLG.js";
7
+ import { d as sessionBindingIdentity, n as assertCodexBindingMayBeReplaced, o as isCodexAppServerNativeAuthProfile, s as normalizeCodexAppServerBindingModelProvider } from "./session-binding-D0zinCP1.js";
8
+ import { o as createCodexAppServerProcessReaperService } from "./transport-stdio-NT_Dpd9V.js";
9
9
  import { r as assertCodexThreadAcceptsDirectInput, s as assertCodexThreadStartResponse, t as CodexThreadDirectInputError } from "./protocol-validators-Bg5rpNxk.js";
10
- import { a as closeCodexStartupClientBestEffort, c as isCodexAppServerUnsafeSubscriptionError, f as unsubscribeCodexThreadBestEffort, g as isCodexNotificationForTurn, m as getCodexAppServerTurnRouter, o as interruptCodexTurnAndWaitBestEffort, u as retireUnsafeCodexTurnClientBestEffort } from "./attempt-client-cleanup-CVPvp9dL.js";
11
- import { s as isAssistantCommentaryCompletionNotification } from "./event-projector-usage-D3PHFFXh.js";
12
- import { i as buildCodexPluginAppCacheKey, s as defaultCodexAppInventoryCache, t as resumeCodexAppServerThread } from "./thread-resume-DF54hagX.js";
13
- import { C as buildCodexProjectDocThreadConfig, E as resolveCodexAppServerRequestModelSelection, M as CODEX_MANAGED_THREAD_NAMESPACE, N as createCodexManagedThreadStore, ct as ensureCodexPluginActivation, ft as pluginReadParams, it as buildDisabledAppsConfigPatch, j as CODEX_MANAGED_THREAD_MAX_ENTRIES, ot as mergeCodexThreadConfigs, ut as isOpenAiCuratedMarketplace, w as CODEX_NATIVE_PERSONALITY_NONE } from "./thread-lifecycle-Ss-uwnC4.js";
14
- import { a as rollbackCodexAppServerBindingSubscription, c as withExclusiveCodexAppServerThread, i as retireCodexConversationThreadBinding, l as isIncognitoSessionKey, n as releaseCodexAppServerBindingSubscription, r as retainCodexAppServerBindingSubscription, s as withCodexConversationThreadActivity, t as isSameCodexAppServerThreadOwner } from "./thread-ownership-CeYBqg_4.js";
15
- import { c as resolveCodexNativeSandboxBlock, i as requestCodexAppServerJson, o as withCodexAppServerJsonClient, s as resolveCodexNativeExecutionBlock } from "./request-CCm4LaED.js";
16
- import { f as projectBoundedCodexVisibleSessionHistory } from "./transcript-mirror-CkEQIna-.js";
10
+ import { a as closeCodexStartupClientBestEffort, c as isCodexAppServerUnsafeSubscriptionError, f as unsubscribeCodexThreadBestEffort, g as isCodexNotificationForTurn, m as getCodexAppServerTurnRouter, o as interruptCodexTurnAndWaitBestEffort, u as retireUnsafeCodexTurnClientBestEffort } from "./attempt-client-cleanup-CpVfwctT.js";
11
+ import { s as isAssistantCommentaryCompletionNotification } from "./event-projector-usage-B2r5vhWH.js";
12
+ import { i as buildCodexPluginAppCacheKey, s as defaultCodexAppInventoryCache, t as resumeCodexAppServerThread } from "./thread-resume-BFt1-ZDa.js";
13
+ import { C as buildCodexProjectDocThreadConfig, E as resolveCodexAppServerRequestModelSelection, M as CODEX_MANAGED_THREAD_NAMESPACE, N as createCodexManagedThreadStore, ct as ensureCodexPluginActivation, ft as pluginReadParams, it as buildDisabledAppsConfigPatch, j as CODEX_MANAGED_THREAD_MAX_ENTRIES, ot as mergeCodexThreadConfigs, ut as isOpenAiCuratedMarketplace, w as CODEX_NATIVE_PERSONALITY_NONE } from "./thread-lifecycle-CGGKP720.js";
14
+ import { a as rollbackCodexAppServerBindingSubscription, c as withExclusiveCodexAppServerThread, i as retireCodexConversationThreadBinding, l as isIncognitoSessionKey, n as releaseCodexAppServerBindingSubscription, r as retainCodexAppServerBindingSubscription, s as withCodexConversationThreadActivity, t as isSameCodexAppServerThreadOwner } from "./thread-ownership-RkaoZCmQ.js";
15
+ import { c as resolveCodexNativeSandboxBlock, i as requestCodexAppServerJson, o as withCodexAppServerJsonClient, s as resolveCodexNativeExecutionBlock } from "./request-BWxweEdK.js";
16
+ import { p as projectBoundedCodexVisibleSessionHistory } from "./transcript-mirror-1ep4XjzF.js";
17
17
  import { buildCodexMediaUnderstandingProvider } from "./media-understanding-provider.js";
18
- import { n as describeControlFailure, t as CODEX_CONTROL_METHODS } from "./capabilities-CGm_94eL.js";
19
- import { r as formatCodexDisplayText } from "./command-formatters-C54Yg3eA.js";
20
- import { a as resolveCodexAppServerForModelProvider, i as resolveCodexSessionPermissionCwd, n as applyCodexSessionPermissionPolicy, t as CODEX_SESSION_PERMISSION_EXEC_MODES } from "./session-permission-policy-gLm40Vtq.js";
21
- import { f as trackCodexConversationActiveTurn, g as canMutateCodexHost, h as CODEX_NATIVE_EXECUTION_AUTH_ERROR, t as discoverCodexMarketplacePlugins } from "./plugin-marketplace-discovery-mdmScYOj.js";
22
- import { a as readCodexConversationBindingDataRecord, i as readCodexConversationBindingData, o as resolveCodexDefaultWorkspaceDir, r as createCodexConversationBindingData } from "./conversation-binding-data-CW2GuupV.js";
23
- import { n as resolveCodexBindingAppServerConnection } from "./binding-connection-CCQFs8lf.js";
24
- import { d as createCodexCliSessionNodeHostCommands, f as createCodexCliSessionNodeInvokePolicies, g as resumeCodexCliSessionOnNode, h as resolveCodexCliSessionForBindingOnNode, i as createCodexSessionCatalogNodeHostCommands, m as listCodexCliSessionsOnNode, n as createCodexSessionCatalogNodeInvokePolicies, o as assertCodexArchiveDescendantsUnowned, r as createCodexSessionCatalogControl, s as codexControlRequest, t as codexSessionCatalogRuntime } from "./session-catalog-C2Tae4rI.js";
18
+ import { n as describeControlFailure, t as CODEX_CONTROL_METHODS } from "./capabilities-D6m_TdVy.js";
19
+ import { r as formatCodexDisplayText } from "./command-formatters--UToCokS.js";
20
+ import { a as resolveCodexAppServerForModelProvider, i as resolveCodexSessionPermissionCwd, n as applyCodexSessionPermissionPolicy, t as CODEX_SESSION_PERMISSION_EXEC_MODES } from "./session-permission-policy-ScnAyG90.js";
21
+ import { f as trackCodexConversationActiveTurn, g as canMutateCodexHost, h as CODEX_NATIVE_EXECUTION_AUTH_ERROR, t as discoverCodexMarketplacePlugins } from "./plugin-marketplace-discovery-BXjIFEiw.js";
22
+ import { a as readCodexConversationBindingDataRecord, i as readCodexConversationBindingData, o as resolveCodexDefaultWorkspaceDir, r as createCodexConversationBindingData } from "./conversation-binding-data-BiodpIzq.js";
23
+ import { n as resolveCodexBindingAppServerConnection } from "./binding-connection-CF7BmrDk.js";
24
+ import { d as createCodexCliSessionNodeHostCommands, f as createCodexCliSessionNodeInvokePolicies, g as resumeCodexCliSessionOnNode, h as resolveCodexCliSessionForBindingOnNode, i as createCodexSessionCatalogNodeHostCommands, m as listCodexCliSessionsOnNode, n as createCodexSessionCatalogNodeInvokePolicies, o as assertCodexArchiveDescendantsUnowned, r as createCodexSessionCatalogControl, s as codexControlRequest, t as codexSessionCatalogRuntime } from "./session-catalog-eMhVm0Ql.js";
25
25
  import { t as createCodexWebSearchProviderBase } from "./web-search-provider.shared-BrZmlqyR.js";
26
26
  import { mutateConfigFile } from "openclaw/plugin-sdk/config-mutation";
27
27
  import { normalizePluginsConfig, resolveEffectiveEnableState, resolveLivePluginConfigObject, resolvePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
@@ -181,7 +181,7 @@ function waitForReconnect(delayMs, signal) {
181
181
  /** Defers schema compilation and auth loading until the first binding operation. */
182
182
  function createLazyCodexAppServerBindingStore(state, managedThreadState) {
183
183
  let resolved;
184
- const store = () => resolved ??= import("./session-binding-q2WSTVmC.js").then((n) => n.f).then(({ createCodexAppServerBindingStore }) => createCodexAppServerBindingStore(state));
184
+ const store = () => resolved ??= import("./session-binding-D0zinCP1.js").then((n) => n.f).then(({ createCodexAppServerBindingStore }) => createCodexAppServerBindingStore(state));
185
185
  const managedThreads = managedThreadState ? createCodexManagedThreadStore(managedThreadState) : void 0;
186
186
  return {
187
187
  ...managedThreads ? { managedThreads } : {},
@@ -212,7 +212,7 @@ async function handleCodexCommand(ctx, options) {
212
212
  }
213
213
  }
214
214
  async function loadDefaultCodexSubcommandHandler() {
215
- const { handleCodexSubcommand } = await import("./command-handlers-BvOAHTrA.js");
215
+ const { handleCodexSubcommand } = await import("./command-handlers-CLFx2Ypa.js");
216
216
  return handleCodexSubcommand;
217
217
  }
218
218
  //#endregion
@@ -410,7 +410,7 @@ function readLocalMediaPath(value) {
410
410
  }
411
411
  //#endregion
412
412
  //#region extensions/codex/src/conversation-binding.ts
413
- const DEFAULT_BOUND_TURN_TIMEOUT_MS = 20 * 6e4;
413
+ const DEFAULT_BOUND_TURN_TIMEOUT_MS = 12e5;
414
414
  const NATIVE_CONVERSATION_INTERACTIVE_APPROVALS_UNAVAILABLE = "OpenClaw native Codex conversation binding cannot route interactive approvals yet; use the Codex harness or explicit /acp spawn codex for that workflow.";
415
415
  async function resolveConversationAppServerRuntime(params) {
416
416
  const source = params.source;
@@ -779,7 +779,8 @@ async function attachExistingThread(params) {
779
779
  });
780
780
  }
781
781
  async function bindThread(params, threadId) {
782
- assertCodexBindingMayBeReplaced(await params.bindingStore.read(params.identity), "binding a conversation-bound Codex thread");
782
+ const current = await params.bindingStore.read(params.identity);
783
+ assertCodexBindingMayBeReplaced(current, "binding a conversation-bound Codex thread");
783
784
  const resolved = await resolveThreadBindingRuntime(params);
784
785
  const clientLease = { client: await getLeasedSharedCodexAppServerClient(resolved.clientOptions) };
785
786
  try {
@@ -1195,12 +1196,13 @@ async function projectConversationSourceHistory(source, target, config) {
1195
1196
  storePath
1196
1197
  });
1197
1198
  if (!sessionKey) return;
1198
- const history = projectBoundedCodexVisibleSessionHistory(await readVisibleSessionTranscriptMessageEntries({
1199
+ const entries = await readVisibleSessionTranscriptMessageEntries({
1199
1200
  agentId: source.agentId,
1200
1201
  sessionId: source.sessionId,
1201
1202
  sessionKey,
1202
1203
  storePath
1203
- }));
1204
+ });
1205
+ const history = projectBoundedCodexVisibleSessionHistory(entries);
1204
1206
  if (history.length === 0) return;
1205
1207
  const clientLease = retainSharedCodexAppServerClientByInstanceId(target.clientId);
1206
1208
  if (!clientLease) throw new Error("Codex conversation source history lost its bound client owner.");
@@ -1385,7 +1387,8 @@ async function buildCodexOAuthCredential(source) {
1385
1387
  } : null;
1386
1388
  }
1387
1389
  async function buildCodexApiKeyCredential(source) {
1388
- const key = normalizeOptionalString((await readJsonObject(source.authPath)).OPENAI_API_KEY);
1390
+ const raw = await readJsonObject(source.authPath);
1391
+ const key = normalizeOptionalString(raw.OPENAI_API_KEY);
1389
1392
  if (!key) return null;
1390
1393
  return {
1391
1394
  kind: "api_key",
@@ -2693,7 +2696,8 @@ async function requestTargetCodexAppServerJson(params) {
2693
2696
  });
2694
2697
  if (hasOpenAiCuratedMarketplace(lastResponse)) return lastResponse;
2695
2698
  if (Date.now() >= discoveryDeadline) return lastResponse;
2696
- await sleep(Math.min(TARGET_CODEX_MARKETPLACE_DISCOVERY_POLL_MS, discoveryDeadline - Date.now()));
2699
+ const waitMs = Math.min(TARGET_CODEX_MARKETPLACE_DISCOVERY_POLL_MS, discoveryDeadline - Date.now());
2700
+ await sleep(waitMs);
2697
2701
  } while (Date.now() < discoveryDeadline);
2698
2702
  return lastResponse;
2699
2703
  }
@@ -3263,7 +3267,7 @@ function createCodexNodeExecServerCommand() {
3263
3267
  try {
3264
3268
  if (!context.prepareExecAuthorization) throw new Error("Codex node execution requires node-local exec policy support; update the node.");
3265
3269
  const assertExecAuthorized = context.prepareExecAuthorization(request.authorization);
3266
- const { runCodexNodeExecServer } = await import("./node-exec-server.runtime-DXrqpw1c.js");
3270
+ const { runCodexNodeExecServer } = await import("./node-exec-server.runtime-DirKVZ5h.js");
3267
3271
  return await runCodexNodeExecServer({
3268
3272
  workspaceDir: workspace.workspaceDir,
3269
3273
  io,
@@ -3329,16 +3333,29 @@ function createCodexNodeExecServerInvokePolicy() {
3329
3333
  message: "Codex node execution requires an available approval reviewer."
3330
3334
  };
3331
3335
  const nodeName = context.node?.displayName ?? context.nodeId;
3332
- if ((await context.approvals.request({
3336
+ const approval = await context.approvals.request({
3333
3337
  title: "Run Codex execution on node",
3334
3338
  description: `Allows arbitrary processes and filesystem access across the node account, not only this workspace. ${nodeName}: ${placement.cwd}`,
3335
3339
  severity: "critical",
3336
3340
  allowedDecisions: ["allow-once"]
3337
- })).decision !== "allow-once") return {
3338
- ok: false,
3339
- code: "CODEX_NODE_EXEC_APPROVAL_DENIED",
3340
- message: "Codex node execution requires one-time approval."
3341
- };
3341
+ });
3342
+ if (approval.decision !== "allow-once") {
3343
+ if (approval.decision === "deny") return {
3344
+ ok: false,
3345
+ code: "CODEX_NODE_EXEC_APPROVAL_DENIED",
3346
+ message: "Codex node execution was denied. Retry the action and choose Allow once to continue."
3347
+ };
3348
+ if (approval.decision === "allow-always") return {
3349
+ ok: false,
3350
+ code: "CODEX_NODE_EXEC_APPROVAL_INVALID",
3351
+ message: "Codex node execution cannot use permanent approval. Retry the action and choose Allow once."
3352
+ };
3353
+ return {
3354
+ ok: false,
3355
+ code: "CODEX_NODE_EXEC_APPROVAL_EXPIRED",
3356
+ message: "Codex node execution approval expired before a decision. Retry the action and approve the new request."
3357
+ };
3358
+ }
3342
3359
  return await context.invokeNode({
3343
3360
  workspace,
3344
3361
  params: {
@@ -4131,7 +4148,7 @@ function createCodexSupervisionTools(options) {
4131
4148
  }
4132
4149
  //#endregion
4133
4150
  //#region extensions/codex/src/web-search-provider.ts
4134
- const loadCodexWebSearchRuntime = createLazyRuntimeModule(() => import("./web-search-provider.runtime-B2XgRdFv.js"));
4151
+ const loadCodexWebSearchRuntime = createLazyRuntimeModule(() => import("./web-search-provider.runtime-BEmlE7ov.js"));
4135
4152
  const CodexWebSearchSchema = {
4136
4153
  type: "object",
4137
4154
  properties: { query: {
@@ -4221,10 +4238,12 @@ var codex_default = definePluginEntry({
4221
4238
  });
4222
4239
  const bindingStore = createLazyCodexAppServerBindingStore(lazyBindingStateStore, {
4223
4240
  entries: () => openManagedThreadStateStore().entries(),
4241
+ lookup: (key) => openManagedThreadStateStore().lookup(key),
4224
4242
  registerIfAbsent: (key, value) => openManagedThreadStateStore().registerIfAbsent(key, value)
4225
4243
  });
4226
4244
  registerCodexCliMetadata(api);
4227
4245
  const sessionCatalogControlFactory = createCodexSessionCatalogControl({
4246
+ managedThreads: bindingStore.managedThreads,
4228
4247
  config: api.config,
4229
4248
  getPluginConfig: resolveCurrentPluginConfig,
4230
4249
  getRuntimeConfig: resolveCurrentConfig
@@ -4364,7 +4383,7 @@ var codex_default = definePluginEntry({
4364
4383
  if (!previousSessionId || !sessionId || previousSessionId === sessionId) return;
4365
4384
  const config = resolveCurrentConfig();
4366
4385
  const sessionKey = ctx.sessionKey?.trim();
4367
- const { sessionBindingIdentity } = await import("./session-binding-q2WSTVmC.js").then((n) => n.f);
4386
+ const { sessionBindingIdentity } = await import("./session-binding-D0zinCP1.js").then((n) => n.f);
4368
4387
  const identity = sessionBindingIdentity({
4369
4388
  sessionId,
4370
4389
  ...sessionKey ? { sessionKey } : {},
@@ -4382,7 +4401,7 @@ var codex_default = definePluginEntry({
4382
4401
  if (endedSessionKey && nextSessionKey && nextSessionKey !== endedSessionKey) return;
4383
4402
  if (event.nextSessionId?.trim() === event.sessionId.trim()) return;
4384
4403
  const config = resolveCurrentConfig();
4385
- const [{ sessionBindingIdentity }, { retireCodexAppServerSessionGeneration }] = await Promise.all([import("./session-binding-q2WSTVmC.js").then((n) => n.f), import("./session-retirement-CdkI0bvb.js")]);
4404
+ const [{ sessionBindingIdentity }, { retireCodexAppServerSessionGeneration }] = await Promise.all([import("./session-binding-D0zinCP1.js").then((n) => n.f), import("./session-retirement-CtUtUTr9.js")]);
4386
4405
  await retireCodexAppServerSessionGeneration({
4387
4406
  bindingStore,
4388
4407
  identity: sessionBindingIdentity({
@@ -1,6 +1,6 @@
1
- import { T as readCodexPluginConfig, r as resolveCodexAppServerHomeScope } from "./config-Cxw3Cl3k.js";
2
- import { Ht as isJsonObject, Lt as resolveCodexAppServerPreparedAuthHandoff } from "./shared-client-kNkljY-R.js";
3
- import { t as runBoundedCodexAppServerTurn } from "./bounded-turn-rq5tiSXk.js";
1
+ import { T as readCodexPluginConfig, r as resolveCodexAppServerHomeScope } from "./config-CcYL77O6.js";
2
+ import { Ht as isJsonObject, Lt as resolveCodexAppServerPreparedAuthHandoff } from "./shared-client-B1tT5U6r.js";
3
+ import { t as runBoundedCodexAppServerTurn } from "./bounded-turn-DRC3hcjm.js";
4
4
  import { a as createAttributedCodexAssistantMessage } from "./event-projector-assistant-message-C5-Ds8mA.js";
5
5
  //#region extensions/codex/src/app-server/isolated-completion.ts
6
6
  const ISOLATED_PASSIVE_ITEM_TYPES = /* @__PURE__ */ new Set(["agentMessage", "reasoning"]);
@@ -1,4 +1,4 @@
1
- import { t as runBoundedCodexAppServerTurn } from "./bounded-turn-rq5tiSXk.js";
1
+ import { t as runBoundedCodexAppServerTurn } from "./bounded-turn-DRC3hcjm.js";
2
2
  import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
3
3
  import { validateJsonSchemaValue } from "openclaw/plugin-sdk/json-schema-runtime";
4
4
  //#region extensions/codex/media-understanding-provider.ts
@@ -1,8 +1,8 @@
1
- import { r as buildCodexRuntimeModelParams } from "./harness-DVfUQBlQ.js";
2
- import { T as readCodexPluginConfig, i as resolveCodexAppServerRuntimeOptions } from "./config-Cxw3Cl3k.js";
3
- import { Ht as isJsonObject, r as captureSharedCodexAppServerCatalogLifetime } from "./shared-client-kNkljY-R.js";
4
- import { t as listAllCodexAppServerModels } from "./models-DgFWSuxA.js";
5
- import { o as withCodexAppServerJsonClient } from "./request-CCm4LaED.js";
1
+ import { r as buildCodexRuntimeModelParams } from "./harness-BgeB7LnD.js";
2
+ import { T as readCodexPluginConfig, i as resolveCodexAppServerRuntimeOptions } from "./config-CcYL77O6.js";
3
+ import { Ht as isJsonObject, r as captureSharedCodexAppServerCatalogLifetime } from "./shared-client-B1tT5U6r.js";
4
+ import { t as listAllCodexAppServerModels } from "./models-DaWfETQk.js";
5
+ import { o as withCodexAppServerJsonClient } from "./request-BWxweEdK.js";
6
6
  //#region extensions/codex/src/app-server/model-catalog.ts
7
7
  const DEFAULT_MODEL_DISCOVERY_TIMEOUT_MS = 2500;
8
8
  const INPUT_TYPES = /* @__PURE__ */ new Set([
@@ -37,8 +37,8 @@ async function withCodexAppServerModelRequest(options, run) {
37
37
  if (options.request) return await run(options.request);
38
38
  const timeoutMs = options.timeoutMs ?? 2500;
39
39
  const useSharedClient = options.sharedClient !== false;
40
- const { createIsolatedCodexAppServerClient, getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("./shared-client-kNkljY-R.js").then((n) => n.x);
41
- const { requestCodexAppServerClientJson } = await import("./request-CCm4LaED.js").then((n) => n.a);
40
+ const { createIsolatedCodexAppServerClient, getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("./shared-client-B1tT5U6r.js").then((n) => n.x);
41
+ const { requestCodexAppServerClientJson } = await import("./request-BWxweEdK.js").then((n) => n.a);
42
42
  const client = await (useSharedClient ? getLeasedSharedCodexAppServerClient : createIsolatedCodexAppServerClient)({
43
43
  startOptions: options.startOptions,
44
44
  timeoutMs,
@@ -97,7 +97,8 @@ function readCodexModel(value) {
97
97
  };
98
98
  }
99
99
  function readReasoningEfforts(value) {
100
- return uniqueStrings(value.map((entry) => normalizeOptionalString(entry.reasoningEffort)).filter((entry) => entry !== void 0));
100
+ const efforts = value.map((entry) => normalizeOptionalString(entry.reasoningEffort)).filter((entry) => entry !== void 0);
101
+ return uniqueStrings(efforts);
101
102
  }
102
103
  function normalizeMaxPages(value) {
103
104
  return typeof value === "number" && Number.isFinite(value) && value > 0 ? Math.floor(value) : 20;
@@ -1,21 +1,16 @@
1
- import { Ct as retainCodexAppServerLiveThread, Ht as isJsonObject, St as releaseCodexAppServerLiveThread, ht as claimCodexAppServerLiveThread } from "./shared-client-kNkljY-R.js";
2
- import { A as shouldRecordNativeToolTranscript, C as isNonSuccessItemStatus, D as itemStatus, E as itemName, F as readHookOutputEntries, I as readItem, N as normalizeOptionalString$1, O as itemTitle, R as readNonEmptyString, S as isMutatingNativeToolItem, T as itemKind, V as readNullableString$1, b as auditNativeToolTerminalStatus, j as shouldSynthesizeToolProgressForItem, w as isSideEffectingNativeToolItem, z as readNonEmptyStringArray } from "./attempt-client-cleanup-CVPvp9dL.js";
3
- import { t as attachCodexMirrorIdentity } from "./upstream-prompt-provenance-CFmsKwr9.js";
4
- import { n as sanitizeCodexHistoryImagePayloads } from "./image-payload-sanitizer-CnfoUPCE.js";
1
+ import { Ct as retainCodexAppServerLiveThread, Ht as isJsonObject, St as releaseCodexAppServerLiveThread, ht as claimCodexAppServerLiveThread } from "./shared-client-B1tT5U6r.js";
2
+ import { A as shouldRecordNativeToolTranscript, C as isNonSuccessItemStatus, D as itemStatus, E as itemName, F as readHookOutputEntries, I as readItem, N as normalizeOptionalString$1, O as itemTitle, R as readNonEmptyString, S as isMutatingNativeToolItem, T as itemKind, V as readNullableString$1, b as auditNativeToolTerminalStatus, j as shouldSynthesizeToolProgressForItem, w as isSideEffectingNativeToolItem, z as readNonEmptyStringArray } from "./attempt-client-cleanup-CpVfwctT.js";
3
+ import { t as attachCodexMirrorIdentity } from "./upstream-prompt-provenance-LphB8slG.js";
5
4
  import { t as resolveCodexLocalRuntimeAttribution } from "./local-runtime-attribution-B_2mnqhb.js";
6
- import { n as codexApprovalTimeoutText } from "./plugin-approval-roundtrip-D80UZiJ_.js";
5
+ import { n as codexApprovalTimeoutText } from "./plugin-approval-roundtrip-CCWQGlAI.js";
6
+ import { n as readCodexMirroredSessionHistoryMessages } from "./session-history-C5J1AKzG.js";
7
7
  import { asFiniteNumber, asNonArrayRecord, normalizeOptionalString, readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
8
- import fs from "node:fs/promises";
9
8
  import path from "node:path";
10
9
  import { asDateTimestampMs } from "openclaw/plugin-sdk/number-runtime";
11
10
  import { TOOL_PROGRESS_OUTPUT_MAX_CHARS, embeddedAgentLog, emitAgentEvent, formatErrorMessage, formatToolAggregate, formatToolProgressOutput, inferToolMetaFromArgs, runAgentHarnessAfterToolCallHook } from "openclaw/plugin-sdk/agent-harness-runtime";
12
- import { getSessionEntry, parseSqliteSessionFileMarker, resolveTranscriptSessionKeyBySessionId } from "openclaw/plugin-sdk/session-store-runtime";
13
11
  import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
14
12
  import { redactSensitiveFieldValue, redactToolPayloadText } from "openclaw/plugin-sdk/logging-core";
15
13
  import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
16
- import { readCodexSessionTranscriptEventsBeforeAdmission } from "openclaw/plugin-sdk/codex-session-transcript-runtime";
17
- import { readSessionTranscriptEvents } from "openclaw/plugin-sdk/session-transcript-runtime";
18
- import { buildSessionContext, migrateSessionEntries, parseSessionEntries } from "openclaw/plugin-sdk/agent-sessions";
19
14
  import { createAgentHarnessTaskRuntime, deliverAgentHarnessTaskCompletion, isDurableAgentHarnessCompletionDelivery } from "openclaw/plugin-sdk/agent-harness-task-runtime";
20
15
  //#region extensions/codex/src/app-server/event-projector-tool-output.ts
21
16
  const TOOL_TRANSCRIPT_OUTPUT_MAX_CHARS = 1e4;
@@ -114,7 +109,8 @@ function appendBoundedToolTranscriptText(currentPrefix, delta, originalLength) {
114
109
  };
115
110
  const textBudget = TOOL_TRANSCRIPT_OUTPUT_MAX_CHARS - notice.length;
116
111
  const remaining = Math.max(0, textBudget - currentPrefix.length);
117
- const rawPrefix = truncateUtf16Safe(remaining > 0 ? `${currentPrefix}${truncateUtf16Safe(delta, remaining)}` : currentPrefix, textBudget);
112
+ const prefix = remaining > 0 ? `${currentPrefix}${truncateUtf16Safe(delta, remaining)}` : currentPrefix;
113
+ const rawPrefix = truncateUtf16Safe(prefix, textBudget);
118
114
  return {
119
115
  text: `${rawPrefix}${notice}`,
120
116
  rawPrefix
@@ -127,7 +123,8 @@ function truncateToolTranscriptText(text, originalLength = text.length) {
127
123
  if (originalLength <= 1e4 && text.length <= 1e4) return text;
128
124
  const notice = toolTranscriptTruncationNotice(originalLength);
129
125
  if (notice.length >= 1e4) return notice.slice(1, 10001);
130
- return `${truncateUtf16Safe(text, TOOL_TRANSCRIPT_OUTPUT_MAX_CHARS - notice.length)}${notice}`;
126
+ const textBudget = TOOL_TRANSCRIPT_OUTPUT_MAX_CHARS - notice.length;
127
+ return `${truncateUtf16Safe(text, textBudget)}${notice}`;
131
128
  }
132
129
  function formatToolSummary(toolName, meta) {
133
130
  const trimmedMeta = meta?.trim();
@@ -723,85 +720,6 @@ var CodexToolProgressProjection = class {
723
720
  }
724
721
  };
725
722
  //#endregion
726
- //#region extensions/codex/src/app-server/session-history.ts
727
- /**
728
- * Reads OpenClaw session history for Codex transcript mirroring and sanitizes
729
- * image payloads before replaying messages into the app-server projector.
730
- */
731
- function isMissingFileError(error) {
732
- return Boolean(error && typeof error === "object" && "code" in error && error.code === "ENOENT");
733
- }
734
- /** Returns sanitized session-context messages for a Codex mirrored session file. */
735
- async function readCodexMirroredSessionHistoryMessages(target, admission) {
736
- try {
737
- const entries = await readCodexMirroredSessionEntries(target, admission);
738
- if (entries.length === 0) return [];
739
- const firstEntry = entries[0];
740
- if (firstEntry?.type !== "session") return [];
741
- if (typeof firstEntry.id !== "string") return;
742
- if (firstEntry.id !== target.sessionId) return [];
743
- migrateSessionEntries(entries);
744
- return sanitizeCodexHistoryImagePayloads(buildSessionContext(entries.filter((entry) => {
745
- return entry !== null && typeof entry === "object" && !Array.isArray(entry) && entry.type !== "session";
746
- })).messages, "codex mirrored history");
747
- } catch (error) {
748
- if (isMissingFileError(error)) return [];
749
- return;
750
- }
751
- }
752
- async function readCodexMirroredSessionEntries(target, admission) {
753
- if (target.sessionTarget) {
754
- const { agentId, sessionId, sessionKey, storePath } = target.sessionTarget;
755
- if (!agentId || !sessionId || !sessionKey || !storePath || sessionId !== target.sessionId || target.agentId !== void 0 && agentId !== target.agentId || target.sessionKey !== void 0 && sessionKey !== target.sessionKey) return [];
756
- const transcriptTarget = {
757
- agentId,
758
- sessionId,
759
- sessionKey,
760
- storePath
761
- };
762
- return await (admission ? readCodexSessionTranscriptEventsBeforeAdmission(transcriptTarget, admission) : readSessionTranscriptEvents(transcriptTarget));
763
- }
764
- const sqliteMarker = parseSqliteSessionFileMarker(target.sessionFile);
765
- if (sqliteMarker) {
766
- if (sqliteMarker.sessionId !== target.sessionId || target.agentId !== void 0 && sqliteMarker.agentId !== target.agentId) return [];
767
- const sessionKey = resolveSqliteMarkerSessionKey(target, sqliteMarker);
768
- if (!sessionKey) return [];
769
- const transcriptTarget = {
770
- agentId: sqliteMarker.agentId,
771
- sessionId: sqliteMarker.sessionId,
772
- sessionKey,
773
- storePath: sqliteMarker.storePath
774
- };
775
- return await (admission ? readCodexSessionTranscriptEventsBeforeAdmission(transcriptTarget, admission) : readSessionTranscriptEvents(transcriptTarget));
776
- }
777
- if (admission) {
778
- if (admission.sessionId !== target.sessionId || target.agentId !== void 0 && admission.agentId !== target.agentId || target.sessionKey !== void 0 && admission.sessionKey !== target.sessionKey) return [];
779
- return await readCodexSessionTranscriptEventsBeforeAdmission({
780
- agentId: admission.agentId,
781
- sessionId: admission.sessionId,
782
- sessionKey: admission.sessionKey,
783
- storePath: admission.storePath
784
- }, admission);
785
- }
786
- return parseSessionEntries(await fs.readFile(target.sessionFile, "utf-8"));
787
- }
788
- function resolveSqliteMarkerSessionKey(target, marker) {
789
- const explicitSessionKey = target.sessionKey?.trim();
790
- if (explicitSessionKey) {
791
- const explicitEntry = getSessionEntry({
792
- agentId: marker.agentId,
793
- sessionKey: explicitSessionKey,
794
- storePath: marker.storePath
795
- });
796
- if (explicitEntry) return explicitEntry.sessionId === marker.sessionId ? explicitSessionKey : void 0;
797
- }
798
- return resolveTranscriptSessionKeyBySessionId({
799
- agentId: marker.agentId,
800
- sessionId: marker.sessionId,
801
- storePath: marker.storePath
802
- });
803
- }
804
- //#endregion
805
723
  //#region extensions/codex/src/app-server/event-projector-tool-transcript.ts
806
724
  const ZERO_USAGE = {
807
725
  input: 0,
@@ -2367,19 +2285,21 @@ var Monitor = class {
2367
2285
  if (childState && !childState.terminal) this.emitChildTaskActivity(notification, childState);
2368
2286
  this.captureChildAssistantMessage(notification);
2369
2287
  await this.handleChildTurnCompletion(notification);
2370
- if (notification.method === "thread/status/changed" && threadId && threadStatus) if (threadStatus !== "systemerror") {
2371
- if (childState) this.clearSystemErrorFallback(childState);
2372
- } else {
2373
- if (childState) {
2374
- this.resumeChild(childState, { scheduleRecovery: false });
2375
- this.setRecoveryFallback(childState, systemErrorFallbackCompletion(childState.childThreadId), this.now());
2288
+ if (notification.method === "thread/status/changed" && threadId && threadStatus) {
2289
+ if (threadStatus !== "systemerror") {
2290
+ if (childState) this.clearSystemErrorFallback(childState);
2291
+ } else {
2292
+ if (childState) {
2293
+ this.resumeChild(childState, { scheduleRecovery: false });
2294
+ this.setRecoveryFallback(childState, systemErrorFallbackCompletion(childState.childThreadId), this.now());
2295
+ }
2296
+ this.reconcileChildThread(threadId).catch((error) => {
2297
+ this.logRecoveryFailure(threadId, error);
2298
+ return false;
2299
+ }).then((reconciled) => {
2300
+ if (!reconciled && childState && this.childStates.get(threadId) === childState) this.scheduleRecoveryPoll(childState);
2301
+ });
2376
2302
  }
2377
- this.reconcileChildThread(threadId).catch((error) => {
2378
- this.logRecoveryFailure(threadId, error);
2379
- return false;
2380
- }).then((reconciled) => {
2381
- if (!reconciled && childState && this.childStates.get(threadId) === childState) this.scheduleRecoveryPoll(childState);
2382
- });
2383
2303
  }
2384
2304
  await this.handleCompletionNotification(notification);
2385
2305
  }
@@ -3399,4 +3319,4 @@ function unrefTimer(timer) {
3399
3319
  if (typeof timer === "object" && timer && "unref" in timer) timer.unref();
3400
3320
  }
3401
3321
  //#endregion
3402
- export { readCodexMirroredSessionHistoryMessages as a, inferCodexDynamicToolMeta as c, sanitizeCodexToolArguments as d, sanitizeCodexToolResponse as f, CodexToolTranscriptProjection as i, isCodexCommandBearingToolCall as l, CodexEventProjection as n, CodexToolProgressProjection as o, emitCodexAgentEvent as r, shouldEmitTranscriptToolProgress as s, codexNativeSubagentMonitorRuntime as t, resolveCodexToolProgressDetailMode as u };
3322
+ export { CodexToolProgressProjection as a, isCodexCommandBearingToolCall as c, sanitizeCodexToolResponse as d, CodexToolTranscriptProjection as i, resolveCodexToolProgressDetailMode as l, CodexEventProjection as n, shouldEmitTranscriptToolProgress as o, emitCodexAgentEvent as r, inferCodexDynamicToolMeta as s, codexNativeSubagentMonitorRuntime as t, sanitizeCodexToolArguments as u };
@@ -1,5 +1,5 @@
1
1
  import { n as resolveManagedCodexAppServerStartOptions, r as resolveManagedCodexNativeCommand, t as isManagedCodexDesktopCommand } from "./managed-binary-ZkGodW19.js";
2
- import { i as closeCodexAppServerTransportAndWait, t as createStdioTransport } from "./transport-stdio-C7-s9TLG.js";
2
+ import { i as closeCodexAppServerTransportAndWait, t as createStdioTransport } from "./transport-stdio-NT_Dpd9V.js";
3
3
  import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
4
4
  import { mkdir } from "node:fs/promises";
5
5
  import path from "node:path";
@@ -8,7 +8,7 @@ import { killProcessTree } from "openclaw/plugin-sdk/process-runtime";
8
8
  import { once } from "node:events";
9
9
  import { sanitizeEnvVars } from "openclaw/plugin-sdk/sandbox";
10
10
  //#region extensions/codex/src/node-exec-server.runtime.ts
11
- const MAX_CODEX_EXEC_SERVER_MESSAGE_BYTES = 64 * 1024 * 1024;
11
+ const MAX_CODEX_EXEC_SERVER_MESSAGE_BYTES = 67108864;
12
12
  const CODEX_EXEC_SERVER_TERMINATION_GRACE_MS = 1e3;
13
13
  const CODEX_EXEC_SERVER_REAP_TIMEOUT_MS = 5e3;
14
14
  const NODE_EXEC_SERVER_PLATFORM_ENVIRONMENT = /^(?:SYSTEMROOT|WINDIR|COMSPEC|PATHEXT|TEMP|TMP|TMPDIR)$/iu;
@@ -1,4 +1,4 @@
1
- import { F as resolveCodexGatewayTimeoutWithGraceMs } from "./shared-client-kNkljY-R.js";
1
+ import { F as resolveCodexGatewayTimeoutWithGraceMs } from "./shared-client-B1tT5U6r.js";
2
2
  import { isApprovalNotFoundError, toErrorObject } from "openclaw/plugin-sdk/error-runtime";
3
3
  import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
4
4
  //#region extensions/codex/src/app-server/plugin-approval-roundtrip.ts
@@ -23,6 +23,7 @@ function codexApprovalTimeoutText(kind) {
23
23
  async function requestPluginApproval(params) {
24
24
  const timeoutMs = DEFAULT_CODEX_APPROVAL_TIMEOUT_MS;
25
25
  return params.hostCapabilities.requestApproval({
26
+ signal: params.signal,
26
27
  title: truncateCodexApprovalDisplayText(params.title, MAX_PLUGIN_APPROVAL_TITLE_LENGTH),
27
28
  description: truncateCodexApprovalDisplayText(params.description, MAX_PLUGIN_APPROVAL_DESCRIPTION_LENGTH),
28
29
  severity: params.severity,
@@ -1,9 +1,9 @@
1
- import { k as isCodexFastServiceTier } from "./config-Cxw3Cl3k.js";
2
- import { c as getLeasedSharedCodexAppServerClient, h as releaseLeasedSharedCodexAppServerClient } from "./shared-client-kNkljY-R.js";
3
- import { o as isCodexAppServerNativeAuthProfile, r as bindingStoreKey, s as normalizeCodexAppServerBindingModelProvider } from "./session-binding-q2WSTVmC.js";
4
- import { E as resolveCodexAppServerRequestModelSelection, O as resolveCodexBindingModelProviderFallback } from "./thread-lifecycle-Ss-uwnC4.js";
5
- import { r as formatCodexDisplayText } from "./command-formatters-C54Yg3eA.js";
6
- import { n as resolveCodexBindingAppServerConnection } from "./binding-connection-CCQFs8lf.js";
1
+ import { k as isCodexFastServiceTier } from "./config-CcYL77O6.js";
2
+ import { c as getLeasedSharedCodexAppServerClient, h as releaseLeasedSharedCodexAppServerClient } from "./shared-client-B1tT5U6r.js";
3
+ import { o as isCodexAppServerNativeAuthProfile, r as bindingStoreKey, s as normalizeCodexAppServerBindingModelProvider } from "./session-binding-D0zinCP1.js";
4
+ import { E as resolveCodexAppServerRequestModelSelection, O as resolveCodexBindingModelProviderFallback } from "./thread-lifecycle-CGGKP720.js";
5
+ import { r as formatCodexDisplayText } from "./command-formatters--UToCokS.js";
6
+ import { n as resolveCodexBindingAppServerConnection } from "./binding-connection-CF7BmrDk.js";
7
7
  import { asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
8
8
  import { resolveAgentDir } from "openclaw/plugin-sdk/agent-runtime";
9
9
  import { getSessionEntry, patchSessionEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
@@ -127,15 +127,16 @@ async function setCodexConversationModel(params) {
127
127
  const lookup = buildBindingLookup(params);
128
128
  const binding = await requireThreadBinding(params.bindingStore, params.identity);
129
129
  if (binding.connectionScope === "supervision") throw new ModelSelectionLockedError();
130
+ const modelProvider = resolveConversationControlModelProvider({
131
+ authProfileId: binding.authProfileId,
132
+ bindingModel: binding.model,
133
+ bindingModelProvider: binding.modelProvider,
134
+ currentModel: model,
135
+ ...lookup
136
+ });
130
137
  const modelSelection = resolveCodexAppServerRequestModelSelection({
131
138
  model,
132
- modelProvider: resolveConversationControlModelProvider({
133
- authProfileId: binding.authProfileId,
134
- bindingModel: binding.model,
135
- bindingModelProvider: binding.modelProvider,
136
- currentModel: model,
137
- ...lookup
138
- }),
139
+ modelProvider,
139
140
  authProfileId: binding.authProfileId,
140
141
  ...lookup
141
142
  });
@@ -1,8 +1,8 @@
1
- import { P as resolveCodexAppServerHomeDir, i as resolveCodexAppServerRuntimeOptions, o as resolveCodexComputerUseConfig } from "./config-Cxw3Cl3k.js";
2
- import { At as reconcileCodexComputerUseStartArtifacts, G as isCodexAppServerConnectionClosedError, K as isCodexAppServerIndeterminateRequestCancellationError, O as acquireCodexNativeConfigFence, S as waitForCodexAppServerClientDesktopGenerationDrain, Ut as resolveCodexManagedBundledMarketplacePath, Wt as assertNotSymlink, c as getLeasedSharedCodexAppServerClient, d as readCodexAppServerClientDesktopGeneration, g as resolveCodexNativeConfigFenceKey, h as releaseLeasedSharedCodexAppServerClient, p as readCodexAppServerClientProcessIdentity, q as isCodexAppServerIndeterminateTransportError, t as assertCodexAppServerClientStartSelectionCurrent, u as isCodexAppServerStartSelectionChangedError } from "./shared-client-kNkljY-R.js";
1
+ import { P as resolveCodexAppServerHomeDir, i as resolveCodexAppServerRuntimeOptions, o as resolveCodexComputerUseConfig } from "./config-CcYL77O6.js";
2
+ import { At as reconcileCodexComputerUseStartArtifacts, G as isCodexAppServerConnectionClosedError, K as isCodexAppServerIndeterminateRequestCancellationError, O as acquireCodexNativeConfigFence, S as waitForCodexAppServerClientDesktopGenerationDrain, Ut as resolveCodexManagedBundledMarketplacePath, Wt as assertNotSymlink, c as getLeasedSharedCodexAppServerClient, d as readCodexAppServerClientDesktopGeneration, g as resolveCodexNativeConfigFenceKey, h as releaseLeasedSharedCodexAppServerClient, p as readCodexAppServerClientProcessIdentity, q as isCodexAppServerIndeterminateTransportError, t as assertCodexAppServerClientStartSelectionCurrent, u as isCodexAppServerStartSelectionChangedError } from "./shared-client-B1tT5U6r.js";
3
3
  import { l as resolveMacOSDesktopCodexBundledMarketplaceCandidates, s as resolveFirstExistingMacOSDesktopCodexBundledMarketplacePath, t as isManagedCodexDesktopCommand } from "./managed-binary-ZkGodW19.js";
4
- import { i as requestCodexAppServerJson } from "./request-CCm4LaED.js";
5
- import { n as describeControlFailure } from "./capabilities-CGm_94eL.js";
4
+ import { i as requestCodexAppServerJson } from "./request-BWxweEdK.js";
5
+ import { n as describeControlFailure } from "./capabilities-D6m_TdVy.js";
6
6
  import fs from "node:fs/promises";
7
7
  import path from "node:path";
8
8
  import { existsSync } from "node:fs";
@@ -721,7 +721,7 @@ function resolveComputerUseConfig(params) {
721
721
  }
722
722
  //#endregion
723
723
  //#region extensions/codex/src/app-server/plugin-metadata-cache.ts
724
- const CODEX_PLUGIN_METADATA_CACHE_TTL_MS = 3600 * 1e3;
724
+ const CODEX_PLUGIN_METADATA_CACHE_TTL_MS = 36e5;
725
725
  /** Process-local plugin metadata cache with coalesced loads per query. */
726
726
  var CodexPluginMetadataCache = class {
727
727
  constructor(nowMs = Date.now) {
@@ -1,4 +1,4 @@
1
- import { Ht as isJsonObject } from "./shared-client-kNkljY-R.js";
1
+ import { Ht as isJsonObject } from "./shared-client-B1tT5U6r.js";
2
2
  import { asBoolean, asFiniteNumber, normalizeOptionalString, parseStrictFiniteNumber } from "openclaw/plugin-sdk/string-coerce-runtime";
3
3
  import { MAX_DATE_TIMESTAMP_MS, resolveExpiresAtMsFromEpochSeconds } from "openclaw/plugin-sdk/number-runtime";
4
4
  import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
@@ -186,8 +186,9 @@ function isRateLimitSnapshot(value) {
186
186
  function readRateLimitWindow(snapshot, key) {
187
187
  const window = snapshot[key];
188
188
  if (!isJsonObject(window)) return;
189
+ const resetsAt = asFiniteNumber(window.resetsAt) ?? asFiniteNumber(window.resets_at);
189
190
  return {
190
- resetsAtMs: resolveExpiresAtMsFromEpochSeconds(asFiniteNumber(window.resetsAt) ?? asFiniteNumber(window.resets_at), { maxMs: MAX_DATE_TIMESTAMP_MS }) ?? 0,
191
+ resetsAtMs: resolveExpiresAtMsFromEpochSeconds(resetsAt, { maxMs: MAX_DATE_TIMESTAMP_MS }) ?? 0,
191
192
  ...readOptionalNumberField(window, "usedPercent", "used_percent"),
192
193
  ...readOptionalNumberField(window, "windowDurationMins", "window_duration_mins", "windowMinutes", "window_minutes")
193
194
  };
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { C as isCodexRemoteExecPlacementSandbox } from "./config-Cxw3Cl3k.js";
3
- import { Et as withTimeout, c as getLeasedSharedCodexAppServerClient, h as releaseLeasedSharedCodexAppServerClient, s as createIsolatedCodexAppServerClient, u as isCodexAppServerStartSelectionChangedError, y as retireSharedCodexAppServerClientIfCurrent } from "./shared-client-kNkljY-R.js";
2
+ import { C as isCodexRemoteExecPlacementSandbox } from "./config-CcYL77O6.js";
3
+ import { Et as withTimeout, c as getLeasedSharedCodexAppServerClient, h as releaseLeasedSharedCodexAppServerClient, s as createIsolatedCodexAppServerClient, u as isCodexAppServerStartSelectionChangedError, y as retireSharedCodexAppServerClientIfCurrent } from "./shared-client-B1tT5U6r.js";
4
4
  import { resolveAgentConfig, tryResolveDefaultAgentId } from "openclaw/plugin-sdk/agent-scope-runtime";
5
5
  import { getSessionEntry } from "openclaw/plugin-sdk/session-store-runtime";
6
6
  import { normalizeAgentId, parseAgentSessionKey } from "openclaw/plugin-sdk/routing";