@openclaw/codex 2026.9.5 → 2026.9.6

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 (120) hide show
  1. package/dist/.setup/{account-usage-runtime-C2MOIvfq.mjs → account-usage-runtime-Eem_WGqY.mjs} +5 -5
  2. package/dist/.setup/{apply-CJ0ZfmBG.mjs → apply-DDOi8uNx.mjs} +22 -28
  3. package/dist/.setup/{attempt-client-cleanup-BpYKdTA0.mjs → attempt-client-cleanup-CEv1cKwF.mjs} +58 -43
  4. package/dist/.setup/attempt-workspace-context-DUVEn_CS.mjs +331 -0
  5. package/dist/.setup/{auth-cache-key-QirmgiCo.mjs → auth-cache-key-B2mpaI9D.mjs} +9 -81
  6. package/dist/.setup/auth-profile-health-oHizqgye.mjs +53 -0
  7. package/dist/.setup/auth-profile-recovery-BREezV0L.mjs +14 -0
  8. package/dist/.setup/{binding-connection-Bm38niE8.mjs → binding-connection-ThoatDcb.mjs} +1 -1
  9. package/dist/.setup/{binding-connection.runtime-CnRMC0ta.mjs → binding-connection.runtime-yoHrABt-.mjs} +4 -4
  10. package/dist/.setup/{bounded-turn-BtlZcivC.mjs → bounded-turn-B2HScEgT.mjs} +138 -32
  11. package/dist/.setup/{build-state-Xx9ybZqa.mjs → build-state-C7EnDVgr.mjs} +1 -1
  12. package/dist/.setup/{capabilities-_vXcZGSx.mjs → capabilities-CDXOOFdZ.mjs} +1 -1
  13. package/dist/.setup/{client-vXs2929Q.mjs → client-Cs08OXVQ.mjs} +583 -559
  14. package/dist/.setup/client-catalog-response-BMgt_4q4.mjs +285 -0
  15. package/dist/.setup/{command-dispatch-naHIZwwF.mjs → command-dispatch-B4JuOsOk.mjs} +8 -4
  16. package/dist/.setup/{command-formatters-CGEkdawF.mjs → command-formatters-Bmqvr9tO.mjs} +8 -4
  17. package/dist/.setup/{command-handlers-BtAJEW1X.mjs → command-handlers-DW7Lx9oH.mjs} +106 -172
  18. package/dist/.setup/{command-rpc-DHFpn4le.mjs → command-rpc-DixIj3HW.mjs} +36 -21
  19. package/dist/.setup/{compact-C3i3qlzj.mjs → compact-Du5UvtxA.mjs} +14 -21
  20. package/dist/.setup/{config-CedDWjM-.mjs → config-BoTP_mrL.mjs} +3 -3
  21. package/dist/.setup/{config-options-BsanJ8QG.mjs → config-options-BvaRs51b.mjs} +46 -30
  22. package/dist/.setup/{config-runtime-CeAhl_h4.mjs → config-runtime-C8Rw1m1m.mjs} +1 -1
  23. package/dist/.setup/{config-security-BRQ2mgW9.mjs → config-security-BEReZ6go.mjs} +35 -120
  24. package/dist/.setup/{conversation-binding-DhzrpTM6.mjs → conversation-binding-DP-gMrBP.mjs} +21 -32
  25. package/dist/.setup/{conversation-control-DN53ns41.mjs → conversation-control-uK9Jomlc.mjs} +28 -67
  26. package/dist/.setup/{dynamic-tools-D16lOp67.mjs → dynamic-tools-BDXl-8Cw.mjs} +848 -578
  27. package/dist/.setup/{effective-mcp-catalog-K6kLCN8X.mjs → effective-mcp-catalog-CvnvnGIe.mjs} +3 -3
  28. package/dist/.setup/{ephemeral-turn-R1gA8Sn6.mjs → ephemeral-turn-poidXgek.mjs} +9 -6
  29. package/dist/.setup/{event-projector-assistant-message-DNUR1s0A.mjs → event-projector-assistant-message-BsruvNrH.mjs} +2 -4
  30. package/dist/.setup/{event-projector-items-DyTQ_XqL.mjs → event-projector-items-C6L_5ZiT.mjs} +42 -8
  31. package/dist/.setup/{event-projector-usage-C7Ntzs-f.mjs → event-projector-usage-CnBS8Wa3.mjs} +1 -1
  32. package/dist/.setup/{harness-rxaaoN-o.mjs → harness-a_MsE4-_.mjs} +23 -17
  33. package/dist/.setup/{inference-context-fulhZuz8.mjs → inference-context-D96l9-ew.mjs} +1 -1
  34. package/dist/.setup/inference-proxy-b-aJMSxm.mjs +601 -0
  35. package/dist/.setup/{isolated-completion-B6srt48J.mjs → isolated-completion-BIZFhTNG.mjs} +17 -10
  36. package/dist/.setup/launch-args-DbFCehO7.mjs +196 -0
  37. package/dist/.setup/{managed-binary-DP6Rib3P.mjs → managed-binary-BnshlFag.mjs} +13 -2
  38. package/dist/.setup/{model-catalog-DkvUuBey.mjs → model-catalog-CfXJf9Ay.mjs} +9 -10
  39. package/dist/.setup/{models-BDFgm_G-.mjs → models-KnqBv0hE.mjs} +3 -3
  40. package/dist/.setup/{native-auth-BLZGqFjw.mjs → native-auth-rWbGbMn3.mjs} +4 -4
  41. package/dist/.setup/{native-subagent-history-YXaL6dMd.mjs → native-subagent-history-0nYYgo0k.mjs} +26 -13
  42. package/dist/.setup/{native-subagent-monitor-B1hxzIOy.mjs → native-subagent-monitor-D3filLY2.mjs} +145 -317
  43. package/dist/.setup/{native-subagent-task-ids-DsuOonKv.mjs → native-subagent-task-ids-wb8CKZGN.mjs} +69 -39
  44. package/dist/.setup/{node-cli-sessions-Cl8b2ZF3.mjs → node-cli-sessions-r3avj02l.mjs} +86 -68
  45. package/dist/.setup/node-exec-server.runtime-BDwWXVpK.mjs +247 -0
  46. package/dist/.setup/{plan-xD7WKYTM.mjs → plan-CN3VwfNU.mjs} +74 -76
  47. package/dist/.setup/{plugin-activation-r8nq5Jzp.mjs → plugin-activation-DT3MNtqj.mjs} +7 -16
  48. package/dist/.setup/{plugin-app-cache-key-BOxKP7db.mjs → plugin-app-cache-key-B2CsSdnV.mjs} +4 -20
  49. package/dist/.setup/{plugin-approval-roundtrip-CjfzafAZ.mjs → plugin-approval-roundtrip-C0MZzCuP.mjs} +1 -1
  50. package/dist/.setup/{plugin-inventory-DUle8DLz.mjs → plugin-inventory-BoRei8Z4.mjs} +16 -7
  51. package/dist/.setup/{plugin-marketplace-discovery-P-Vndfqq.mjs → plugin-marketplace-discovery-CDOi8IFs.mjs} +4 -1
  52. package/dist/.setup/{plugin-metadata-cache-DsS5buNa.mjs → plugin-metadata-cache-Ctmo83k_.mjs} +224 -154
  53. package/dist/.setup/protocol-CANUwXJ3.mjs +17 -0
  54. package/dist/.setup/{provider-fFh_-VR3.mjs → provider-BOsxQHOM.mjs} +9 -5
  55. package/dist/.setup/{provider-capabilities-B8J4Dy-O.mjs → provider-capabilities-BfE88FZ5.mjs} +31 -3
  56. package/dist/.setup/{rate-limits-DOEGYRNs.mjs → rate-limits-CMU3DUD0.mjs} +116 -137
  57. package/dist/.setup/{request-BioXJLYa.mjs → request-D2L0zMrq.mjs} +23 -15
  58. package/dist/.setup/{run-attempt-rlA07pUv.mjs → run-attempt-BHu11r7h.mjs} +1197 -617
  59. package/dist/.setup/{runtime-artifact-Dy38Z5iU.mjs → runtime-artifact-CLZ8udh-.mjs} +29 -45
  60. package/dist/.setup/{sandbox-guard-BBP-RbTf.mjs → sandbox-guard-C2sRMOEY.mjs} +1 -1
  61. package/dist/.setup/{session-binding-_0W_fHRr.mjs → session-binding-Cm0apEbd.mjs} +3 -32
  62. package/dist/.setup/{session-binding-record-TH3xA0zj.mjs → session-binding-record-BGoz8wOK.mjs} +22 -3
  63. package/dist/.setup/{session-binding-sidecars-CKYEcfNn.mjs → session-binding-sidecars-BlB5EvIS.mjs} +48 -45
  64. package/dist/.setup/{session-catalog-fUdWDx-U.mjs → session-catalog-Pno1xGcl.mjs} +482 -182
  65. package/dist/.setup/{session-catalog-adoption-CR_whkEW.mjs → session-catalog-adoption-BI6UTDZT.mjs} +57 -25
  66. package/dist/.setup/{session-catalog-archive-CwZaPacf.mjs → session-catalog-archive-lHBqzhaO.mjs} +6 -6
  67. package/dist/.setup/{session-catalog-events-jMcYfQyd.mjs → session-catalog-events-Bj6j94E_.mjs} +122 -25
  68. package/dist/.setup/{session-catalog-index-B141u15s.mjs → session-catalog-index-B9_VQIUz.mjs} +178 -78
  69. package/dist/.setup/{session-catalog-index-order-Cc5BzlQr.mjs → session-catalog-index-order-hcdz07yN.mjs} +2 -2
  70. package/dist/.setup/{session-catalog-index-state-BAuDztHN.mjs → session-catalog-index-state-Dgh8ORJm.mjs} +5 -2
  71. package/dist/.setup/{session-catalog-native-projection-ChV3cCtm.mjs → session-catalog-native-projection-DowriLid.mjs} +30 -13
  72. package/dist/.setup/{session-catalog-node-adoption-BVRsYOSh.mjs → session-catalog-node-adoption-ITddWx_X.mjs} +24 -12
  73. package/dist/.setup/{session-catalog-node-continue-Dowv8osw.mjs → session-catalog-node-continue-6g6qi4A9.mjs} +22 -13
  74. package/dist/.setup/{session-catalog-projection-C1Bj9Jl-.mjs → session-catalog-projection-zK_PUsiE.mjs} +13 -5
  75. package/dist/.setup/{session-cli-DIj-IE-E.mjs → session-cli-irrD-uo7.mjs} +4 -4
  76. package/dist/.setup/{session-history-C--SrLI8.mjs → session-history-BrqhSCf9.mjs} +17 -22
  77. package/dist/.setup/{session-history-import-JHXT5Xfi.mjs → session-history-import-D-3wAgOP.mjs} +4 -4
  78. package/dist/.setup/{session-history.worker-CpNj7H_P.mjs → session-history.worker-CaCh0xF_.mjs} +5 -18
  79. package/dist/.setup/{session-initialization-DH1z6fXn.mjs → session-initialization-rcgbZiid.mjs} +2 -2
  80. package/dist/.setup/{session-permission-policy-DhurXY0l.mjs → session-permission-policy-BI1QK_98.mjs} +2 -2
  81. package/dist/.setup/{session-retirement-CU87AOg9.mjs → session-retirement-BH-S6qkJ.mjs} +25 -6
  82. package/dist/.setup/{settled-turn-finalizer-CiY2bLFK.mjs → settled-turn-finalizer-DiAi6Kx6.mjs} +8 -8
  83. package/dist/.setup/{shared-client-BpTtuLQ5.mjs → shared-client-DA4VR4Eb.mjs} +59 -89
  84. package/dist/.setup/{side-question-DSCZyoBD.mjs → side-question-BJ1wSDcB.mjs} +147 -211
  85. package/dist/.setup/{source-Bjp4UQij.mjs → source-CUzJq5WN.mjs} +9 -9
  86. package/dist/.setup/spawn-error-CL3n6MAa.mjs +57 -0
  87. package/dist/.setup/{thread-archive-guard-jmecf6OJ.mjs → thread-archive-guard-C9frICzX.mjs} +10 -3
  88. package/dist/.setup/{thread-history-page-BTx-4xsg.mjs → thread-history-page-DoVpnHim.mjs} +1 -1
  89. package/dist/.setup/{thread-lifecycle-Cik28qWn.mjs → thread-lifecycle-B3mfz1TG.mjs} +172 -2271
  90. package/dist/.setup/{thread-ownership-skomxnIt.mjs → thread-ownership-DcTtAcXj.mjs} +4 -2
  91. package/dist/.setup/{thread-policy-Cjs4B8xf.mjs → thread-policy-DGuQsuFC.mjs} +19 -3
  92. package/dist/.setup/thread-requests-BLvGkP2R.mjs +2205 -0
  93. package/dist/.setup/{thread-resume-BkNpj9Pz.mjs → thread-resume-DIBXwOpE.mjs} +6 -6
  94. package/dist/.setup/{timeout-DZF05XrR.mjs → timeout-C910MdAB.mjs} +19 -2
  95. package/dist/.setup/{transcript-history-projection-DHNBDhCU.mjs → transcript-history-projection-ZZpkFkJ_.mjs} +94 -64
  96. package/dist/.setup/{transcript-mirror-D4qp_leP.mjs → transcript-mirror-BtHDBp1G.mjs} +218 -198
  97. package/dist/.setup/{transport-stdio-Cmx94Oiy.mjs → transport-stdio-h2VHOskC.mjs} +135 -55
  98. package/dist/.setup/{upstream-session-fork-D3UKxgVD.mjs → upstream-session-fork-BUr4OUbC.mjs} +44 -36
  99. package/dist/.setup/{usage-BOgBEKso.mjs → usage-BML0r-ua.mjs} +5 -4
  100. package/dist/.setup/{usage-limit-error-C0ow7DOc.mjs → usage-limit-error-DUMbefVY.mjs} +4 -4
  101. package/dist/.setup/{web-search-provider.runtime-CTGuJt6i.mjs → web-search-provider.runtime-CDKlN-Rv.mjs} +4 -3
  102. package/dist/api.js +23 -12
  103. package/dist/catalog-page-worker-entrypoint.js +12 -0
  104. package/dist/catalog-page.worker.js +9 -0
  105. package/dist/cli-metadata.js +1 -1
  106. package/dist/doctor-contract-api.js +2 -2
  107. package/dist/harness.js +1 -1
  108. package/dist/index.js +221 -170
  109. package/dist/media-understanding-provider.js +2 -2
  110. package/dist/migration-provider-api.js +1 -1
  111. package/dist/provider-discovery.js +1 -1
  112. package/dist/session-history-worker-runtime.js +15 -32
  113. package/dist/session-history.worker.js +1 -1
  114. package/package.json +9 -6
  115. package/dist/.setup/attempt-context-VXVwTCfS.mjs +0 -636
  116. package/dist/.setup/inference-proxy-CC15HuSi.mjs +0 -311
  117. package/dist/.setup/launch-args-DnMak49W.mjs +0 -111
  118. package/dist/.setup/node-exec-server.runtime-BaViBKNz.mjs +0 -226
  119. package/dist/.setup/version-CoqzXPgK.mjs +0 -12
  120. package/dist/.setup/{native-execution-policy-YBMHSzC4.mjs → native-execution-policy-umd0tgh4.mjs} +1 -1
@@ -1,30 +1,71 @@
1
- import { p as sessionBindingIdentity } from "./session-binding-record-TH3xA0zj.mjs";
2
- import { E as readCodexRequirementsToml, l as shouldAutoApproveCodexAppServerApprovals, m as isJsonObject, n as hasCodexMcpToolApprovalOverrides, u as withMcpElicitationsApprovalPolicy } from "./config-security-BRQ2mgW9.mjs";
1
+ import { m as sessionBindingIdentity } from "./session-binding-record-BGoz8wOK.mjs";
2
+ import { l as shouldAutoApproveCodexAppServerApprovals, n as hasCodexMcpToolApprovalOverrides, u as withMcpElicitationsApprovalPolicy, y as readCodexRequirementsToml } from "./config-security-BEReZ6go.mjs";
3
3
  import { c as isCodexPairedNodeRemoteExecPlacementSandbox, d as readCodexPluginConfig, l as isCodexRemoteExecPlacementSandbox, u as isCodexSandboxExecServerEnabled } from "./config-parsing-CcB9iPoq.mjs";
4
- import { D as handleDynamicToolCallWithTimeout, E as createCodexElicitationResponse, L as resolveCodexToolAbortTerminalReason, S as readCodexDynamicToolCallParams, i as isCodexAppServerApprovalRequest, j as resolveDynamicToolCallTimeoutMs, s as isCodexAppServerIndeterminateRequestCancellationError, v as assertCodexThreadForkResponse, x as assertCodexTurnStartResponse } from "./client-vXs2929Q.mjs";
5
- import { i as resolveCodexAppServerHomeScope, l as resolveCodexModelBackedReviewerPolicyContext } from "./config-options-BsanJ8QG.mjs";
6
- import { n as formatCodexUsageLimitErrorMessage } from "./rate-limits-DOEGYRNs.mjs";
7
- import { i as resolveCodexBindingAppServerConnection, r as requireCodexSupervisionModelSelection } from "./binding-connection-Bm38niE8.mjs";
8
- import { n as resolveOpenClawExecPolicyForCodexAppServer, t as canUseCodexModelBackedApprovalsReviewerForModel } from "./config-CedDWjM-.mjs";
9
- import { P as ensureCodexAppServerClientRuntime, Z as resolveCodexAppServerPreparedAuthHandoff, c as getLeasedSharedCodexAppServerClient, m as releaseCodexAppServerClientLease, q as readRecentCodexRateLimits, x as withLeasedCodexAppServerClientStartSelectionRetry } from "./shared-client-BpTtuLQ5.mjs";
10
- import { f as unsubscribeCodexThreadBestEffort, l as retireUnsafeCodexTurnClientBestEffort, o as interruptCodexTurnAndWaitBestEffort } from "./attempt-client-cleanup-BpYKdTA0.mjs";
11
- import { t as CodexEphemeralTurn } from "./ephemeral-turn-R1gA8Sn6.mjs";
12
- import { A as resolveCodexBindingModelProviderFallback, D as resolveCodexAppServerModelProvider, E as CODEX_NATIVE_PERSONALITY_NONE, F as CODEX_NATIVE_HOOK_RELAY_EVENTS, H as emitCodexNativePreToolUseFailureDiagnostic, O as resolveCodexAppServerRequestModelSelection, Ot as mergeCodexThreadConfigs, R as buildCodexNativeHookRelayConfig, b as buildCodexRuntimeThreadConfig, c as resolveCodexAppServerReasoningEffort, it as filterCodexDynamicTools, kt as refreshCodexPluginAppApprovalPolicy, o as buildCodexUserInput, r as buildCodexTemporalAdditionalContext, s as readCodexSupportedReasoningEfforts, ut as resolveCodexDynamicToolsLoading, w as resolveCodexWebSearchPlan, z as buildCodexNativeHookRelayDisabledConfig } from "./thread-lifecycle-Cik28qWn.mjs";
13
- import { o as resolveCodexSessionBinding } from "./session-binding-_0W_fHRr.mjs";
14
- import { i as refreshCodexThreadPolicy, n as CodexThreadPolicyHandoffError, r as assertCodexSupervisionThreadLineage } from "./thread-policy-Cjs4B8xf.mjs";
15
- import { t as resolveCodexNativeExecutionBlock } from "./sandbox-guard-BBP-RbTf.mjs";
16
- import { C as shouldRequireCodexSandboxExecServerEnvironment, S as shouldEnableCodexAppServerNativeToolSurface, T as filterCodexVisionTools, a as emitDynamicToolStartedDiagnostic, b as resolveCodexNodePlacementToolConstructionPlan, c as ensureCodexSandboxExecServerEnvironment, d as CodexNativeToolLifecycleProjector, i as emitDynamicToolErrorDiagnostic, l as releaseCodexSandboxExecServerEnvironment, o as emitDynamicToolTerminalDiagnostic, r as routeCodexAppServerElicitationRequest, s as handleCodexAppServerApprovalRequest, t as createCodexDynamicToolBridge, v as resolveCodexExternalSandboxPolicyForOpenClawSandbox, x as resolveCodexSandboxEnvironmentSelection, y as resolveCodexMessageToolProvider } from "./dynamic-tools-D16lOp67.mjs";
17
- import { n as resolveCodexProviderWebSearchSupportForClient } from "./provider-capabilities-B8J4Dy-O.mjs";
18
- import { a as resolveCodexAppServerForModelProvider, i as resolveCodexSessionPermissionCwd, n as applyCodexSessionPermissionPolicy, r as resolveCodexEffectiveSessionPermissionPolicy, t as CODEX_SESSION_PERMISSION_EXEC_MODES } from "./session-permission-policy-DhurXY0l.mjs";
4
+ import { i as isJsonObject } from "./protocol-CANUwXJ3.mjs";
5
+ import { i as resolveCodexAppServerHomeScope, l as resolveCodexModelBackedReviewerPolicyContext } from "./config-options-BvaRs51b.mjs";
6
+ import { n as formatCodexUsageLimitErrorMessage } from "./rate-limits-CMU3DUD0.mjs";
7
+ import { i as resolveCodexBindingAppServerConnection, r as requireCodexSupervisionModelSelection } from "./binding-connection-ThoatDcb.mjs";
8
+ import { n as resolveOpenClawExecPolicyForCodexAppServer, t as canUseCodexModelBackedApprovalsReviewerForModel } from "./config-BoTP_mrL.mjs";
9
+ import { Z as resolveCodexAppServerPreparedAuthHandoff, c as getLeasedSharedCodexAppServerClient, m as releaseCodexAppServerClientLease, q as readRecentCodexRateLimits, x as withLeasedCodexAppServerClientStartSelectionRetry } from "./shared-client-DA4VR4Eb.mjs";
10
+ import { C as readCodexDynamicToolCallParams, D as handleDynamicToolCallWithTimeout, E as createCodexElicitationResponse, L as resolveCodexToolAbortTerminalReason, S as assertCodexTurnStartResponse, i as isCodexAppServerApprovalRequest, j as resolveDynamicToolCallTimeoutMs, s as isCodexAppServerIndeterminateRequestCancellationError, y as assertCodexThreadForkResponse } from "./client-Cs08OXVQ.mjs";
11
+ import { f as terminateCodexBackgroundTerminals, p as unsubscribeCodexThreadBestEffort, s as interruptCodexTurnAndWaitBestEffort, u as retireUnsafeCodexTurnClientBestEffort } from "./attempt-client-cleanup-CEv1cKwF.mjs";
12
+ import { t as CodexEphemeralTurn } from "./ephemeral-turn-poidXgek.mjs";
13
+ import { A as emitCodexNativePreToolUseFailureDiagnostic, D as buildCodexNativeHookRelayDisabledConfig, E as buildCodexNativeHookRelayConfig, S as CODEX_NATIVE_HOOK_RELAY_EVENTS, St as refreshCodexPluginAppApprovalPolicy, _ as resolveCodexAppServerRequestModelSelection, dt as resolveCodexDynamicToolsLoading, g as resolveCodexAppServerModelProvider, h as CODEX_NATIVE_PERSONALITY_NONE, p as resolveCodexWebSearchPlan, r as buildCodexRuntimeThreadConfig, xt as mergeCodexThreadConfigs, y as resolveCodexBindingModelProviderFallback } from "./thread-requests-BLvGkP2R.mjs";
14
+ import { M as resolveCodexAppServerReasoningEffort, j as readCodexSupportedReasoningEfforts, o as buildCodexUserInput, r as buildCodexTemporalAdditionalContext } from "./thread-lifecycle-B3mfz1TG.mjs";
15
+ import { o as resolveCodexSessionBinding } from "./session-binding-Cm0apEbd.mjs";
16
+ import { a as refreshCodexThreadPolicy, i as assertCodexSupervisionThreadLineage, n as CodexThreadPolicyHandoffError } from "./thread-policy-DGuQsuFC.mjs";
17
+ import { t as resolveCodexNativeExecutionBlock } from "./sandbox-guard-C2sRMOEY.mjs";
18
+ import { C as shouldEnableCodexAppServerNativeToolSurface, S as resolveCodexSandboxEnvironmentSelection, a as emitDynamicToolStartedDiagnostic, b as resolveCodexExternalSandboxPolicyForOpenClawSandbox, c as ensureCodexSandboxExecServerEnvironment, i as emitDynamicToolErrorDiagnostic, l as releaseCodexSandboxExecServerEnvironment, m as buildDynamicTools, o as emitDynamicToolTerminalDiagnostic, p as CodexNativeToolLifecycleProjector, r as routeCodexAppServerElicitationRequest, s as handleCodexAppServerApprovalRequest, t as createCodexDynamicToolBridge, w as shouldRequireCodexSandboxExecServerEnvironment, x as resolveCodexMessageToolProvider } from "./dynamic-tools-BDXl-8Cw.mjs";
19
+ import { n as resolveCodexProviderWebSearchSupportForClient } from "./provider-capabilities-BfE88FZ5.mjs";
20
+ import { a as resolveCodexAppServerForModelProvider, i as resolveCodexSessionPermissionCwd, n as applyCodexSessionPermissionPolicy, r as resolveCodexEffectiveSessionPermissionPolicy, t as CODEX_SESSION_PERMISSION_EXEC_MODES } from "./session-permission-policy-BI1QK_98.mjs";
19
21
  import { readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
20
22
  import { randomUUID } from "node:crypto";
21
23
  import { isDeepStrictEqual } from "node:util";
22
24
  import { resolveSessionAgentIdsStrict } from "openclaw/plugin-sdk/agent-scope-runtime";
25
+ import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
23
26
  import { resolveAgentWorkspaceDir } from "openclaw/plugin-sdk/agent-runtime";
24
- import { buildAgentHookContextChannelFields, embeddedAgentLog, formatErrorMessage, resolveAgentDir as resolveAgentDir$2, resolveAttemptSpawnWorkspaceDir, resolveModelAuthMode, resolveSandboxContext, runAgentCleanupStep, supportsModelTools } from "openclaw/plugin-sdk/agent-harness-runtime";
27
+ import { buildAgentHookContextChannelFields, embeddedAgentLog, formatErrorMessage as formatErrorMessage$1, resolveSandboxContext, runAgentCleanupStep } from "openclaw/plugin-sdk/agent-harness-runtime";
25
28
  import { loadExecApprovals } from "openclaw/plugin-sdk/exec-approvals-runtime";
26
29
  import { loadCodexBundleMcpApprovalConfig, resolveCodexMcpToolOverridesForAgent } from "openclaw/plugin-sdk/codex-mcp-projection";
27
30
  import { registerNativeHookRelayForBundledRuntime } from "openclaw/plugin-sdk/native-hook-relay-runtime";
31
+ //#region extensions/codex/src/app-server/side-question-cleanup.ts
32
+ async function cleanupCodexSideQuestion(client, params) {
33
+ const errors = [];
34
+ for (const cleanup of [() => cleanupCodexSideThread(client, params), ...params.afterThreadCleanup]) try {
35
+ const pending = cleanup();
36
+ if (pending) await pending;
37
+ } catch (error) {
38
+ errors.push(error);
39
+ }
40
+ if (errors.length === 0) return;
41
+ if (params.failure) errors.unshift(params.failure.error);
42
+ if (errors.length === 1) throw errors[0];
43
+ throw new AggregateError(errors, errors.map(formatErrorMessage).join("; "), { cause: errors[0] });
44
+ }
45
+ async function cleanupCodexSideThread(client, params) {
46
+ if (!params.threadId) return;
47
+ if (params.interrupt && params.turnId !== void 0) {
48
+ if (!await interruptCodexTurnAndWaitBestEffort(client, {
49
+ threadId: params.threadId,
50
+ turnId: params.turnId,
51
+ timeoutMs: params.timeoutMs
52
+ })) {
53
+ await retireUnsafeCodexTurnClientBestEffort(client, "side turn interrupt");
54
+ throw new Error("Codex /btw cleanup could not confirm the side turn stopped; background terminals may still be running.");
55
+ }
56
+ }
57
+ if (params.terminateBackgroundTerminals && params.turnId !== void 0) try {
58
+ await terminateCodexBackgroundTerminals(client, params.threadId);
59
+ } catch (error) {
60
+ await retireUnsafeCodexTurnClientBestEffort(client, "side background terminals");
61
+ throw error;
62
+ }
63
+ if (!await unsubscribeCodexThreadBestEffort(client, {
64
+ threadId: params.threadId,
65
+ timeoutMs: params.timeoutMs
66
+ })) await retireUnsafeCodexTurnClientBestEffort(client, "side thread unsubscribe");
67
+ }
68
+ //#endregion
28
69
  //#region extensions/codex/src/app-server/side-question-instructions.ts
29
70
  const SIDE_DEVELOPER_INSTRUCTIONS = `You are in a side conversation, not the main thread.
30
71
 
@@ -279,6 +320,7 @@ async function runCodexAppServerSideQuestion(params, options) {
279
320
  let sandboxEnvironmentClient;
280
321
  let nativeHookRelay;
281
322
  const activeDynamicToolCalls = /* @__PURE__ */ new Set();
323
+ let primaryFailure;
282
324
  const releaseSandboxEnvironment = async () => {
283
325
  if (!sandboxEnvironment) return;
284
326
  const environment = sandboxEnvironment;
@@ -320,33 +362,25 @@ async function runCodexAppServerSideQuestion(params, options) {
320
362
  });
321
363
  const approvalPolicy = hasCodexMcpToolApprovalOverrides(params.cfg?.mcp?.servers, Object.keys(projectedMcpServers), projectedMcpServers) ? withMcpElicitationsApprovalPolicy(appServer.approvalPolicy) : appServer.approvalPolicy;
322
364
  const sandbox = appServer.sandbox;
365
+ const nativeProviderWebSearchSupport = resolveCodexWebSearchPlan({
366
+ config: params.cfg,
367
+ nativeToolSurfaceEnabled
368
+ }).kind === "native-hosted" ? await resolveCodexProviderWebSearchSupportForClient({
369
+ client,
370
+ timeoutMs: appServer.requestTimeoutMs,
371
+ modelProviderOverride: modelSelection.modelProvider,
372
+ signal: runAbortController.signal
373
+ }) : "unsupported";
323
374
  const { toolBridge, webSearchPlan } = await createCodexSideToolBridge({
324
- params: effectiveParams,
375
+ params: sideRunParams,
325
376
  cwd,
377
+ resolvedWorkspace: effectiveParams.workspaceDir ?? cwd,
326
378
  pluginConfig,
327
379
  sessionAgentId,
328
380
  nativeToolSurfaceEnabled,
329
- nativeProviderWebSearchSupport: resolveCodexWebSearchPlan({
330
- config: params.cfg,
331
- nativeToolSurfaceEnabled
332
- }).kind === "native-hosted" ? await resolveCodexProviderWebSearchSupportForClient({
333
- client,
334
- timeoutMs: appServer.requestTimeoutMs,
335
- modelProviderOverride: modelSelection.modelProvider,
336
- signal: runAbortController.signal
337
- }) : "unsupported",
381
+ nativeProviderWebSearchSupport,
338
382
  sessionPermissionPolicy,
339
- runId,
340
- signal: runAbortController.signal
341
- });
342
- ensureCodexAppServerClientRuntime(client, {
343
- agentDir: params.agentDir,
344
- authProfileId: startupPreparedAuth?.kind === "api-key" ? void 0 : connection.requestAuthProfileId,
345
- ...!usesSupervisionConnection ? {
346
- authProfileStore: preparedRuntimeAuth.authProfileStore,
347
- authMode: startupPreparedAuth?.kind === "api-key" ? "prepared-api-key" : "profile"
348
- } : {},
349
- config: params.cfg
383
+ runAbortController
350
384
  });
351
385
  const handleServerRequest = async (request, _scope, requestSignal, setExecutionTimeoutMs) => {
352
386
  const signal = AbortSignal.any([requestSignal, runAbortController.signal]);
@@ -426,14 +460,6 @@ async function runCodexAppServerSideQuestion(params, options) {
426
460
  activeDynamicToolCalls.delete(toolCall);
427
461
  }
428
462
  };
429
- const selectClient = (nextClient) => {
430
- client = nextClient;
431
- ensureCodexAppServerClientRuntime(client, {
432
- agentDir: params.agentDir,
433
- authProfileId: connection.requestAuthProfileId,
434
- config: params.cfg
435
- });
436
- };
437
463
  const serviceTier = binding.serviceTier ?? appServer.serviceTier;
438
464
  const nativeHookRelayEvents = resolveCodexSideNativeHookRelayEvents({
439
465
  configuredEvents: options.nativeHookRelay?.events,
@@ -580,7 +606,9 @@ async function runCodexAppServerSideQuestion(params, options) {
580
606
  }
581
607
  return response.thread.id;
582
608
  }),
583
- onClientChange: selectClient
609
+ onClientChange: (nextClient) => {
610
+ client = nextClient;
611
+ }
584
612
  });
585
613
  const effort = usesSupervisionConnection ? void 0 : resolveCodexAppServerReasoningEffort({
586
614
  thinkLevel: params.resolvedThinkLevel ?? "off",
@@ -652,36 +680,33 @@ async function runCodexAppServerSideQuestion(params, options) {
652
680
  text: result.text,
653
681
  usage: result.usage
654
682
  };
683
+ } catch (error) {
684
+ primaryFailure = { error };
685
+ throw error;
655
686
  } finally {
656
- try {
657
- nativeToolRunWasAbortedBeforeCleanup = runAbortController.signal.aborted;
658
- params.opts?.abortSignal?.removeEventListener("abort", abortFromUpstream);
659
- if (!runAbortController.signal.aborted) runAbortController.abort("codex_side_question_finished");
660
- await Promise.allSettled(activeDynamicToolCalls);
661
- try {
662
- await cleanupCodexSideThread(childClient ?? client, {
663
- threadId: childThreadId,
664
- turnId,
665
- interrupt: !collector?.completed,
666
- timeoutMs: appServer.requestTimeoutMs
667
- });
668
- } finally {
669
- if (policyWriteUncertain && childClient) await retireUnsafeCodexTurnClientBestEffort(childClient, "side policy handoff");
670
- collector?.route.release();
671
- try {
672
- nativeToolLifecycleProjector?.finalizeActive(nativeToolRunWasAbortedBeforeCleanup);
673
- } finally {
674
- activateNativePreToolUseFailureFallback();
675
- }
676
- }
677
- } finally {
678
- flushPendingNativePreToolUseFailures();
679
- try {
680
- await releaseSandboxEnvironment();
681
- } finally {
682
- releaseCodexAppServerClientLease(clientLease);
683
- nativeHookRelay?.unregister();
684
- await runAgentCleanupStep({
687
+ nativeToolRunWasAbortedBeforeCleanup = runAbortController.signal.aborted;
688
+ params.opts?.abortSignal?.removeEventListener("abort", abortFromUpstream);
689
+ if (!runAbortController.signal.aborted) runAbortController.abort("codex_side_question_finished");
690
+ await Promise.allSettled(activeDynamicToolCalls);
691
+ await cleanupCodexSideQuestion(childClient ?? client, {
692
+ threadId: childThreadId,
693
+ turnId,
694
+ interrupt: !(collector?.completed || collector?.route.completed),
695
+ terminateBackgroundTerminals: nativeToolRunWasAbortedBeforeCleanup,
696
+ timeoutMs: appServer.requestTimeoutMs,
697
+ failure: primaryFailure,
698
+ afterThreadCleanup: [
699
+ async () => {
700
+ if (policyWriteUncertain && childClient) await retireUnsafeCodexTurnClientBestEffort(childClient, "side policy handoff");
701
+ },
702
+ () => collector?.route.release(),
703
+ () => nativeToolLifecycleProjector?.finalizeActive(nativeToolRunWasAbortedBeforeCleanup),
704
+ activateNativePreToolUseFailureFallback,
705
+ flushPendingNativePreToolUseFailures,
706
+ releaseSandboxEnvironment,
707
+ () => releaseCodexAppServerClientLease(clientLease),
708
+ () => nativeHookRelay?.unregister(),
709
+ () => runAgentCleanupStep({
685
710
  runId: sideRunParams.runId,
686
711
  sessionId: sideRunParams.sessionId,
687
712
  step: "codex-side-native-hook-relay-release",
@@ -689,9 +714,9 @@ async function runCodexAppServerSideQuestion(params, options) {
689
714
  cleanup: async () => {
690
715
  await nativeHookRelay?.drain();
691
716
  }
692
- });
693
- }
694
- }
717
+ })
718
+ ]
719
+ });
695
720
  }
696
721
  }
697
722
  function resolveCodexSideNativeHookRelayEvents(params) {
@@ -784,136 +809,64 @@ function buildSideRunAttemptParams(params, options) {
784
809
  },
785
810
  onBlockReply: params.opts?.onBlockReply,
786
811
  onPartialReply: params.opts?.onPartialReply,
812
+ onToolResult: params.opts?.onToolResult,
813
+ requireExplicitMessageTarget: true,
787
814
  hostCapabilities: params.hostCapabilities,
788
815
  sandbox: params.sandbox
789
816
  };
790
817
  }
791
818
  async function createCodexSideToolBridge(input) {
792
- const runtimeModel = input.params.runtimeModel ?? {
793
- id: input.params.model,
794
- provider: input.params.provider
795
- };
796
- const messageToolProvider = resolveCodexMessageToolProvider(input.params);
797
- let tools = [];
798
- const webFetchHostnameAllowlistRef = {};
799
- if (supportsModelTools(runtimeModel)) {
800
- const createOpenClawCodingTools = (await import("openclaw/plugin-sdk/agent-harness")).createOpenClawCodingTools;
801
- const sandboxSessionKey = input.params.sandboxSessionKey?.trim() || input.params.sessionKey?.trim() || input.params.sessionId || input.sessionAgentId;
802
- const sandbox = input.params.sandbox !== void 0 ? input.params.sandbox : await resolveSandboxContext({
803
- config: input.params.cfg,
804
- sessionKey: sandboxSessionKey,
805
- workspaceDir: input.cwd
806
- });
807
- const toolConstructionPlan = resolveCodexNodePlacementToolConstructionPlan(sandbox, input.nativeToolSurfaceEnabled);
808
- const publishSideToolResult = input.params.opts?.onToolResult;
809
- const questionPrompt = publishSideToolResult ? {
810
- send: async (payload) => {
811
- await publishSideToolResult(payload);
812
- },
813
- ...messageToolProvider ? { messageChannel: messageToolProvider } : {}
814
- } : void 0;
815
- const allTools = createOpenClawCodingTools({
816
- agentId: input.sessionAgentId,
817
- requesterThinkingLevel: input.params.resolvedThinkLevel ?? "off",
818
- requesterModel: input.params.runtimeModel ? {
819
- provider: input.params.runtimeModel.provider,
820
- model: input.params.runtimeModel.id
821
- } : void 0,
822
- sessionKey: sandboxSessionKey,
823
- runSessionKey: input.params.sessionKey && input.params.sessionKey !== sandboxSessionKey ? input.params.sessionKey : void 0,
824
- sessionId: input.params.sessionId,
825
- exec: input.sessionPermissionPolicy && { mode: input.sessionPermissionPolicy.execMode },
826
- sessionPermissionPolicy: input.sessionPermissionPolicy,
827
- runId: input.runId,
828
- agentDir: input.params.agentDir ?? resolveAgentDir$2(input.params.cfg ?? {}, input.sessionAgentId),
829
- workspaceDir: input.cwd,
830
- spawnWorkspaceDir: resolveAttemptSpawnWorkspaceDir({
831
- sandbox,
832
- resolvedWorkspace: input.params.workspaceDir ?? input.cwd
833
- }),
834
- config: input.params.cfg,
835
- preparedModelRuntime: input.params.preparedModelRuntime,
836
- abortSignal: input.signal,
837
- modelProvider: runtimeModel.provider,
838
- modelId: input.params.model,
839
- modelCompat: runtimeModel.compat && typeof runtimeModel.compat === "object" ? runtimeModel.compat : void 0,
840
- modelApi: runtimeModel.api,
841
- modelContextWindowTokens: runtimeModel.contextWindow,
842
- modelAuthMode: resolveModelAuthMode(runtimeModel.provider, input.params.cfg, void 0, { workspaceDir: input.cwd }),
843
- suppressManagedWebSearch: false,
844
- webFetchHostnameAllowlistRef,
845
- ...input.params.messageProvider || input.params.messageChannel ? {
846
- messageProvider: messageToolProvider,
847
- toolPolicyMessageProvider: input.params.messageProvider ?? input.params.messageChannel
848
- } : {},
849
- ...input.params.chatType ? { chatType: input.params.chatType } : {},
850
- ...input.params.agentAccountId ? { agentAccountId: input.params.agentAccountId } : {},
851
- ...input.params.messageTo ? { messageTo: input.params.messageTo } : {},
852
- ...input.params.messageThreadId !== void 0 ? { messageThreadId: input.params.messageThreadId } : {},
853
- ...input.params.chatId ? { nativeChannelId: input.params.chatId } : {},
854
- ...input.params.messageActionTurnCapability ? { messageActionTurnCapability: input.params.messageActionTurnCapability } : {},
855
- ...input.params.groupId !== void 0 ? { groupId: input.params.groupId } : {},
856
- ...input.params.groupChannel !== void 0 ? { groupChannel: input.params.groupChannel } : {},
857
- ...input.params.groupSpace !== void 0 ? { groupSpace: input.params.groupSpace } : {},
858
- ...input.params.memberRoleIds ? { memberRoleIds: input.params.memberRoleIds } : {},
859
- ...input.params.spawnedBy !== void 0 ? { spawnedBy: input.params.spawnedBy } : {},
860
- ...input.params.senderId !== void 0 ? { senderId: input.params.senderId } : {},
861
- ...input.params.senderName !== void 0 ? { senderName: input.params.senderName } : {},
862
- ...input.params.senderUsername !== void 0 ? { senderUsername: input.params.senderUsername } : {},
863
- ...input.params.senderE164 !== void 0 ? { senderE164: input.params.senderE164 } : {},
864
- ...input.params.senderIsOwner !== void 0 ? { senderIsOwner: input.params.senderIsOwner } : {},
865
- ...input.params.currentChannelId ? { currentChannelId: input.params.currentChannelId } : {},
866
- hookChannelId: buildAgentHookContextChannelFields({
867
- sessionKey: input.params.sessionKey,
868
- messageChannel: input.params.messageChannel,
869
- messageProvider: input.params.messageProvider,
870
- currentChannelId: input.params.currentChannelId
871
- }).channelId,
872
- sandbox,
873
- ...toolConstructionPlan ? { toolConstructionPlan } : {},
874
- ...questionPrompt ? { questionPrompt } : {},
875
- emitBeforeToolCallDiagnostics: false,
876
- modelHasVision: runtimeModel.input?.includes("image") ?? false,
877
- requireExplicitMessageTarget: true
878
- });
879
- const codexFilteredTools = filterCodexDynamicTools(allTools, input.pluginConfig);
880
- tools = filterCodexVisionTools(codexFilteredTools, {
881
- modelHasVision: runtimeModel.input?.includes("image") ?? false,
882
- nativeImageInspectionEnabled: input.nativeToolSurfaceEnabled
883
- });
884
- }
819
+ const { params } = input;
820
+ const sandboxSessionKey = params.sandboxSessionKey?.trim() || params.sessionKey?.trim() || params.sessionId || input.sessionAgentId;
821
+ const sandbox = params.sandbox !== void 0 ? params.sandbox : await resolveSandboxContext({
822
+ config: params.config,
823
+ sessionKey: sandboxSessionKey,
824
+ workspaceDir: input.cwd
825
+ });
826
+ let webSearchAllowed = false;
827
+ const tools = await buildDynamicTools({
828
+ params,
829
+ resolvedWorkspace: input.resolvedWorkspace,
830
+ effectiveWorkspace: input.cwd,
831
+ sandboxSessionKey,
832
+ sandbox,
833
+ nativeToolSurfaceEnabled: input.nativeToolSurfaceEnabled,
834
+ nativeProviderWebSearchSupport: input.nativeProviderWebSearchSupport,
835
+ sessionPermissionPolicy: input.sessionPermissionPolicy,
836
+ runAbortController: input.runAbortController,
837
+ sessionAgentId: input.sessionAgentId,
838
+ policyAgentId: input.sessionAgentId,
839
+ pluginConfig: input.pluginConfig,
840
+ onYieldDetected: () => {},
841
+ onWebSearchPolicyResolved: (allowed) => {
842
+ webSearchAllowed = allowed;
843
+ }
844
+ });
885
845
  const requestedWebSearchPlan = resolveCodexWebSearchPlan({
886
- config: input.params.cfg,
846
+ config: params.config,
887
847
  nativeToolSurfaceEnabled: input.nativeToolSurfaceEnabled,
888
848
  nativeProviderWebSearchSupport: input.nativeProviderWebSearchSupport,
889
- webSearchAllowed: tools.some((tool) => tool.name === "web_search")
849
+ webSearchAllowed
890
850
  });
891
- webFetchHostnameAllowlistRef.value = requestedWebSearchPlan.webFetchHostnameAllowlist;
892
851
  const webSearchPlan = requestedWebSearchPlan.kind === "managed" ? resolveCodexWebSearchPlan({
893
- config: input.params.cfg,
852
+ config: params.config,
894
853
  webSearchAllowed: false
895
854
  }) : requestedWebSearchPlan;
896
- const exposedTools = input.params.hostCapabilities.bindToolSurface(tools.filter((tool) => tool.name !== "web_search" && tool.name !== "computer"), { cwd: input.cwd });
897
- const hookChannelFields = buildAgentHookContextChannelFields({
898
- sessionKey: input.params.sessionKey,
899
- messageChannel: input.params.messageChannel,
900
- messageProvider: input.params.messageProvider,
901
- currentChannelId: input.params.currentChannelId
902
- });
855
+ const exposedTools = tools.filter((tool) => tool.name !== "web_search" && tool.name !== "computer");
903
856
  return {
904
857
  toolBridge: createCodexDynamicToolBridge({
905
858
  tools: exposedTools,
906
- signal: input.signal,
859
+ signal: input.runAbortController.signal,
907
860
  loading: resolveCodexDynamicToolsLoading(input.pluginConfig),
908
861
  hookContext: {
909
862
  agentId: input.sessionAgentId,
910
- config: input.params.cfg,
911
- contextWindowTokens: runtimeModel.contextWindow,
912
- sessionId: input.params.sessionId,
913
- sessionKey: input.params.sessionKey,
914
- runId: input.runId,
915
- currentChannelProvider: messageToolProvider,
916
- ...hookChannelFields
863
+ config: params.config,
864
+ contextWindowTokens: params.model.contextWindow,
865
+ sessionId: params.sessionId,
866
+ sessionKey: params.sessionKey,
867
+ runId: params.runId,
868
+ currentChannelProvider: resolveCodexMessageToolProvider(params),
869
+ ...buildAgentHookContextChannelFields(params)
917
870
  }
918
871
  }),
919
872
  webSearchPlan
@@ -934,26 +887,9 @@ async function forkCodexSideThread(client, params, options) {
934
887
  }
935
888
  }
936
889
  function isMissingCodexParentThreadError(error) {
937
- const message = formatErrorMessage(error);
890
+ const message = formatErrorMessage$1(error);
938
891
  return message.includes("no rollout found for thread id") || message.includes("includeTurns is unavailable before first user message");
939
892
  }
940
- async function cleanupCodexSideThread(client, params) {
941
- if (!params.threadId) return;
942
- if (params.interrupt && params.turnId !== void 0) {
943
- if (!await interruptCodexTurnAndWaitBestEffort(client, {
944
- threadId: params.threadId,
945
- turnId: params.turnId,
946
- timeoutMs: params.timeoutMs
947
- })) {
948
- await retireUnsafeCodexTurnClientBestEffort(client, "side turn interrupt");
949
- return;
950
- }
951
- }
952
- if (!await unsubscribeCodexThreadBestEffort(client, {
953
- threadId: params.threadId,
954
- timeoutMs: params.timeoutMs
955
- })) await retireUnsafeCodexTurnClientBestEffort(client, "side thread unsubscribe");
956
- }
957
893
  function formatCodexErrorMessage(params, rateLimits) {
958
894
  const error = isJsonObject(params.error) ? params.error : void 0;
959
895
  const message = formatCodexUsageLimitErrorMessage({
@@ -961,7 +897,7 @@ function formatCodexErrorMessage(params, rateLimits) {
961
897
  codexErrorInfo: error?.codexErrorInfo,
962
898
  rateLimits
963
899
  }) ?? (error ? readStringField(error, "message") ?? readStringField(error, "error") : void 0) ?? readStringField(params, "message") ?? "Codex /btw side thread failed.";
964
- return new Error(formatErrorMessage(message));
900
+ return new Error(formatErrorMessage$1(message));
965
901
  }
966
902
  //#endregion
967
903
  export { runCodexAppServerSideQuestion };
@@ -1,13 +1,13 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
2
- import { c as CODEX_PLUGINS_MARKETPLACE_NAME, i as pluginReadParams, n as isOpenAiCuratedMarketplace } from "./plugin-inventory-DUle8DLz.mjs";
3
- import { a as defaultCodexAppInventoryCache, r as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-BOxKP7db.mjs";
4
- import { o as withCodexAppServerJsonClient } from "./request-BioXJLYa.mjs";
5
- import "./config-CedDWjM-.mjs";
2
+ import { c as CODEX_PLUGINS_MARKETPLACE_NAME, i as pluginReadParams, n as isOpenAiCuratedMarketplace } from "./plugin-inventory-BoRei8Z4.mjs";
3
+ import { a as defaultCodexAppInventoryCache, r as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-B2CsSdnV.mjs";
4
+ import { o as withCodexAppServerJsonClient } from "./request-D2L0zMrq.mjs";
5
+ import "./config-BoTP_mrL.mjs";
6
6
  import path from "node:path";
7
7
  import os from "node:os";
8
8
  import fs from "node:fs/promises";
9
- import { coerceErrorMessage } from "openclaw/plugin-sdk/error-runtime";
10
9
  import { isPathInside } from "openclaw/plugin-sdk/file-access-runtime";
10
+ import { coerceErrorMessage } from "openclaw/plugin-sdk/error-runtime";
11
11
  import { pathExists } from "openclaw/plugin-sdk/security-runtime";
12
12
  import { readJsonFileWithFallback } from "openclaw/plugin-sdk/json-store";
13
13
  //#region extensions/codex/src/migration/helpers.ts
@@ -410,13 +410,13 @@ function sourcePluginAppFactWithInventory(app, info, installedApp) {
410
410
  };
411
411
  if (!installedApp.enabled) return {
412
412
  ...app,
413
- isAccessible: info.isAccessible,
413
+ isAccessible: true,
414
414
  isEnabled: false
415
415
  };
416
416
  return {
417
417
  ...app,
418
- isAccessible: info.isAccessible && installedApp.callable,
419
- isEnabled: info.isEnabled,
418
+ isAccessible: installedApp.callable,
419
+ isEnabled: installedApp.enabled,
420
420
  ...!installedApp.callable ? { isCallable: false } : {}
421
421
  };
422
422
  }
@@ -516,4 +516,4 @@ function sanitizePluginName(value) {
516
516
  return value.trim().toLowerCase().replaceAll(/\s+/gu, "-");
517
517
  }
518
518
  //#endregion
519
- export { source_exports as a, resolveHomePath as c, hasCodexSource as i, sanitizeName as l, defaultCodexHome as n, exists as o, discoverCodexSource as r, readJsonObject as s, codexPluginMigrationSubscriptionWarning as t };
519
+ export { source_exports as a, sanitizeName as c, hasCodexSource as i, defaultCodexHome as n, exists as o, discoverCodexSource as r, readJsonObject as s, codexPluginMigrationSubscriptionWarning as t };
@@ -0,0 +1,57 @@
1
+ import { embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-registration";
2
+ import { resolveGlobalSingleton } from "openclaw/plugin-sdk/global-singleton";
3
+ //#region extensions/codex/src/app-server/spawn-error.ts
4
+ const failures = resolveGlobalSingleton(Symbol.for("openclaw.codexSpawnFailures"), () => ({
5
+ commands: /* @__PURE__ */ new Map(),
6
+ errors: /* @__PURE__ */ new WeakMap(),
7
+ reported: /* @__PURE__ */ new Set()
8
+ }));
9
+ /** Also accepts the command runner's sanitized launch code (without syscall/errno). */
10
+ function codexSpawnFailureReason(error) {
11
+ if (!(error instanceof Error)) return;
12
+ const failure = error;
13
+ if (failure.syscall === void 0 || failure.syscall.startsWith("spawn")) {
14
+ if (failure.code === "EBADARCH" || failure.errno === -86 || failure.code === "Unknown system error -86") return "is not runnable on this CPU";
15
+ if (failure.code === "ENOENT") return "or its working directory was not found";
16
+ if (failure.code === "EACCES") return "is not executable or its working directory is inaccessible";
17
+ }
18
+ }
19
+ var CodexAppServerSpawnError = class extends Error {
20
+ constructor(command, reason, cause) {
21
+ super(`Codex catalog updater cannot run: ${command} ${reason}. Repair the executable or working directory and restart the Gateway.`, { cause });
22
+ this.command = command;
23
+ this.name = "CodexAppServerSpawnError";
24
+ failures.errors.set(this, this);
25
+ }
26
+ };
27
+ function findCodexAppServerSpawnError(error) {
28
+ let current = error;
29
+ const seen = /* @__PURE__ */ new Set();
30
+ while (current instanceof Error && !seen.has(current)) {
31
+ const failure = failures.errors.get(current);
32
+ if (failure) return failure;
33
+ seen.add(current);
34
+ current = current.cause;
35
+ }
36
+ }
37
+ function describeCodexSpawnError(error, command) {
38
+ const reason = codexSpawnFailureReason(error);
39
+ return reason ? new CodexAppServerSpawnError(command, reason, error) : error;
40
+ }
41
+ function getCodexAppServerSpawnFailure(command) {
42
+ return failures.commands.get(command);
43
+ }
44
+ function recordCodexAppServerSpawnFailure(error, command, launchKey) {
45
+ const described = describeCodexSpawnError(error, command);
46
+ const failure = findCodexAppServerSpawnError(described);
47
+ if (failure) failures.commands.set(launchKey, failure);
48
+ return described;
49
+ }
50
+ function reportCodexCatalogSpawnFailure(failure) {
51
+ if (!failures.reported.has(failure.command)) {
52
+ failures.reported.add(failure.command);
53
+ embeddedAgentLog.warn(failure.message);
54
+ }
55
+ }
56
+ //#endregion
57
+ export { reportCodexCatalogSpawnFailure as a, recordCodexAppServerSpawnFailure as i, findCodexAppServerSpawnError as n, getCodexAppServerSpawnFailure as r, describeCodexSpawnError as t };
@@ -1,4 +1,4 @@
1
- import { m as isJsonObject } from "./config-security-BRQ2mgW9.mjs";
1
+ import { i as isJsonObject } from "./protocol-CANUwXJ3.mjs";
2
2
  import { normalizeBoundedOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
3
3
  //#region extensions/codex/src/app-server/thread-archive-guard.ts
4
4
  const DESCENDANT_PAGE_LIMIT = 100;
@@ -19,11 +19,12 @@ async function assertCodexArchiveDescendantsUnowned(params) {
19
19
  if (!ancestorThreadId) throw new Error("cannot verify Codex archive descendants for an invalid thread id");
20
20
  const seenCursors = /* @__PURE__ */ new Set();
21
21
  const seenThreadIds = /* @__PURE__ */ new Set([ancestorThreadId]);
22
+ let archived = false;
22
23
  let cursor;
23
24
  for (let pageIndex = 0; pageIndex < MAX_DESCENDANT_PAGES; pageIndex += 1) {
24
25
  const response = await params.listPage({
25
26
  ancestorThreadId,
26
- archived: false,
27
+ archived,
27
28
  limit: DESCENDANT_PAGE_LIMIT,
28
29
  sortKey: "created_at",
29
30
  sortDirection: "desc",
@@ -42,7 +43,13 @@ async function assertCodexArchiveDescendantsUnowned(params) {
42
43
  if (await params.bindingStore.hasOtherThreadOwner(descendantThreadId)) throw new Error("cannot archive a Codex thread while a spawned descendant is owned by an OpenClaw session");
43
44
  }
44
45
  const nextCursor = readNextCursor(response.nextCursor);
45
- if (!nextCursor) return;
46
+ if (!nextCursor) {
47
+ if (archived) return;
48
+ archived = true;
49
+ cursor = void 0;
50
+ seenCursors.clear();
51
+ continue;
52
+ }
46
53
  if (seenCursors.has(nextCursor)) throw new Error("Codex app-server returned a repeated descendant-list cursor");
47
54
  seenCursors.add(nextCursor);
48
55
  cursor = nextCursor;
@@ -1,4 +1,4 @@
1
- import { A as parseTranscriptPage, M as readControlCursor, g as CatalogParamsError } from "./session-catalog-native-projection-ChV3cCtm.mjs";
1
+ import { M as parseTranscriptPage, P as readControlCursor, v as CatalogParamsError } from "./session-catalog-native-projection-DowriLid.mjs";
2
2
  //#region extensions/codex/src/app-server/thread-history-page.ts
3
3
  const TURN_ITEM_CURSOR_PREFIX = "turn-item:";
4
4
  function encodeTurnItemCursor(turnCursor, itemId) {