@openclaw/codex 2026.10.5-beta.4 → 2026.10.10-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -3
- package/dist/.setup/{account-usage-runtime-CoVpNIlD.mjs → account-usage-runtime-DDCDkvtl.mjs} +15 -9
- package/dist/.setup/{app-server-policy-D_zv8J7V.mjs → app-server-policy-Cog6mm2i.mjs} +1 -1
- package/dist/.setup/{apply-BXDMd05l.mjs → apply-BVSXYkTV.mjs} +11 -11
- package/dist/.setup/{attempt-client-cleanup-zNuNTKVr.mjs → attempt-client-cleanup-6OcbMH46.mjs} +14 -8
- package/dist/.setup/attempt-terminal-sZutF0WY.mjs +1 -0
- package/dist/.setup/{attempt-workspace-context-CcwP3DA3.mjs → attempt-workspace-context-GYPLawX6.mjs} +2 -2
- package/dist/.setup/{auth-binding-BaxlhaNx.mjs → auth-binding-830RLAJW.mjs} +2 -2
- package/dist/.setup/{auth-cache-key-f8ODJ_OX.mjs → auth-cache-key-CVcYw8HD.mjs} +92 -80
- package/dist/.setup/{auth-profile-CgHQ8Vot.mjs → auth-profile-auwzSwwy.mjs} +14 -8
- package/dist/.setup/{auth-profile-health-oHizqgye.mjs → auth-profile-health-BVPZU9I8.mjs} +15 -8
- package/dist/.setup/{auth-profile-selection-hr8ocLtz.mjs → auth-profile-selection-Bp5PDk3W.mjs} +24 -7
- package/dist/.setup/{binding-connection-B7HAAZSI.mjs → binding-connection-GTgUj9pi.mjs} +2 -2
- package/dist/.setup/{binding-connection.runtime-DAXn7iFl.mjs → binding-connection.runtime-RcWR3vQu.mjs} +4 -3
- package/dist/.setup/{bounded-turn-isolation-BfDAo-qZ.mjs → bounded-turn-isolation-D8CDrAVX.mjs} +3 -3
- package/dist/.setup/{bounded-turn-DfIJtRlv.mjs → bounded-turn-mN_ekXYW.mjs} +18 -22
- package/dist/.setup/{build-state-Ds14X10-.mjs → build-state-VcujMRqP.mjs} +1 -1
- package/dist/.setup/{capabilities-DbOzOglY.mjs → capabilities-DAS-JX1z.mjs} +1 -1
- package/dist/.setup/{client-D93nbdB8.mjs → client-BS8X7HmG.mjs} +47 -317
- package/dist/.setup/{client-catalog-response-CuVLp4I0.mjs → client-catalog-response-jM38o5w1.mjs} +2 -2
- package/dist/.setup/client-initialize-CjgZcX61.mjs +165 -0
- package/dist/.setup/{command-dispatch-DxdH5a9-.mjs → command-dispatch-DzXbHqCn.mjs} +3 -3
- package/dist/.setup/{command-formatters-xW9KpoSZ.mjs → command-formatters-B_7-QZ1c.mjs} +2 -2
- package/dist/.setup/{command-handlers-fiYvYYq0.mjs → command-handlers-tfb5Uq-O.mjs} +539 -406
- package/dist/.setup/command-rpc-SXqLQukR.mjs +296 -0
- package/dist/.setup/compact-M-JxLcbZ.mjs +823 -0
- package/dist/.setup/{computer-use-DL2v3Kxq.mjs → computer-use-FqQ-Flbl.mjs} +21 -68
- package/dist/.setup/{config-C1YVVLEA.mjs → config-BfrAlTMT.mjs} +3 -3
- package/dist/.setup/{config-options-DDzeNQ8m.mjs → config-options-DMFZkd3X.mjs} +1 -1
- package/dist/.setup/{config-runtime-DWzK-k0n.mjs → config-runtime-BZRizyuG.mjs} +2 -2
- package/dist/.setup/{context-engine-projection-ps-yn_ci.mjs → context-engine-projection-PIeLSnR-.mjs} +16 -30
- package/dist/.setup/{conversation-binding-BieJZRRV.mjs → conversation-binding-C7MZy-Cx.mjs} +228 -116
- package/dist/.setup/{conversation-binding-data-UgLuTSQT.mjs → conversation-binding-data-khgW0n-o.mjs} +4 -2
- package/dist/.setup/{conversation-control-GXM3unE4.mjs → conversation-control-B2EpVZEb.mjs} +53 -23
- package/dist/.setup/{cyber-failover-D4dgNfFf.mjs → cyber-failover-CqEZoQsj.mjs} +1 -1
- package/dist/.setup/{cyber-failover-notice-ljgGGL0s.mjs → cyber-failover-notice-poL3Advd.mjs} +1 -1
- package/dist/.setup/{doctor-start-options-JjTAl-q_.mjs → doctor-start-options-8uIBXIzR.mjs} +8 -5
- package/dist/.setup/{dynamic-tool-build-DcaPmBlE.mjs → dynamic-tool-build-BjFAIG-f.mjs} +208 -218
- package/dist/.setup/{dynamic-tools-CnQFnNKH.mjs → dynamic-tools-XqWsVjcC.mjs} +344 -118
- package/dist/.setup/{effective-mcp-catalog-B5HKFZNK.mjs → effective-mcp-catalog-C3ta5hHc.mjs} +11 -9
- package/dist/.setup/{ephemeral-turn-De3qb8EQ.mjs → ephemeral-turn-1ZF17fUR.mjs} +5 -4
- package/dist/.setup/{event-projector-assistant-message-CLMKN4x-.mjs → event-projector-assistant-message-ChOAY7rW.mjs} +16 -11
- package/dist/.setup/{event-projector-usage-BpKfdoTm.mjs → event-projector-usage-CBY0Hkga.mjs} +2 -2
- package/dist/.setup/{event-projector-values-CLvG1Hil.mjs → event-projector-values-yf4us9Pf.mjs} +1 -1
- package/dist/.setup/experimental-features-uGnVDtp-.mjs +19 -0
- package/dist/.setup/inference-context-mv_dBpAL.mjs +209 -0
- package/dist/.setup/{inference-dispatch-CO6tTs4q.mjs → inference-dispatch-C2zVSnrr.mjs} +2 -2
- package/dist/.setup/{inference-metadata-DCvcG_N_.mjs → inference-metadata-CYFWLHVk.mjs} +3 -1
- package/dist/.setup/{inference-proxy-BDWV0djM.mjs → inference-proxy-yd3hr2dr.mjs} +8 -8
- package/dist/.setup/installed-probe-lVC1X5ve.mjs +185 -0
- package/dist/.setup/{isolated-completion-BPJdvk5F.mjs → isolated-completion-P-r8NRE4.mjs} +7 -7
- package/dist/.setup/managed-binary-DbKvGXKl.mjs +395 -0
- package/dist/.setup/{mcp-app-session-preparation-Dz2GOwyE.mjs → mcp-app-session-preparation-fnsnCovu.mjs} +18 -14
- package/dist/.setup/{model-catalog-ZNwltCKl.mjs → model-catalog-Y_esgRPY.mjs} +28 -17
- package/dist/.setup/{models-BHpbAuz8.mjs → models-BWLEUo2E.mjs} +3 -3
- package/dist/.setup/{native-auth-esN5MdIv.mjs → native-auth-DpZIaY8N.mjs} +7 -4
- package/dist/.setup/native-execution-policy-D09tLP-u.mjs +152 -0
- package/dist/.setup/{native-hook-relay-wq7jrNLk.mjs → native-hook-relay-C7aaLJaP.mjs} +45 -10
- package/dist/.setup/{native-mcp-app-DX3nyTtc.mjs → native-mcp-app-CsWj-v_x.mjs} +5 -5
- package/dist/.setup/{native-skill-isolation-DSBeF-Yy.mjs → native-skill-isolation-CMimsKYy.mjs} +7 -7
- package/dist/.setup/{native-subagent-monitor-DOLEIf9r.mjs → native-subagent-monitor-CFE7b4oC.mjs} +485 -239
- package/dist/.setup/{native-subagent-pending-assignments-DmVhedNs.mjs → native-subagent-pending-assignments-CTinVtjo.mjs} +1 -1
- package/dist/.setup/{native-task-assignments-DimsQ9Qa.mjs → native-task-assignments-YJopbaVO.mjs} +9 -5
- package/dist/.setup/{node-cli-sessions-CzKg2nGq.mjs → node-cli-sessions-BuJnBnEq.mjs} +7 -4
- package/dist/.setup/{node-exec-server.runtime-BWkULhBM.mjs → node-exec-server.runtime-CP7RC1Nd.mjs} +3 -3
- package/dist/.setup/{plan-41-YOBMq.mjs → plan-B4cHgqNv.mjs} +7 -20
- package/dist/.setup/{plugin-activation-D7WkJMvU.mjs → plugin-activation-CXPWe-hl.mjs} +4 -4
- package/dist/.setup/{plugin-app-cache-key-Bg9DbDI6.mjs → plugin-app-cache-key-DRb-niJc.mjs} +17 -55
- package/dist/.setup/{plugin-approval-roundtrip-CD88q3yx.mjs → plugin-approval-roundtrip-DIZHLbAM.mjs} +1 -1
- package/dist/.setup/{plugin-inventory-CYgdo14P.mjs → plugin-inventory-DE9wcaeH.mjs} +2 -2
- package/dist/.setup/{plugin-metadata-cache-Bi8TAPwX.mjs → plugin-metadata-cache-BqC-a6Fb.mjs} +2 -15
- package/dist/.setup/{project-doc-thread-config-BVcvnps8.mjs → project-doc-thread-config-B0UI3f1D.mjs} +6 -6
- package/dist/.setup/protocol-CaPAVwe9.mjs +12 -0
- package/dist/.setup/{provider-capabilities-Dn2WwH4P.mjs → provider-capabilities-DjcKunHS.mjs} +1 -1
- package/dist/.setup/{provider-LWKll6dV.mjs → provider-wj_LFJH3.mjs} +4 -4
- package/dist/.setup/{rate-limits-CI8pTPqL.mjs → rate-limits-BpfURnuy.mjs} +1 -1
- package/dist/.setup/{request-Bo0kKABI.mjs → request-ePeNJrOd.mjs} +132 -136
- package/dist/.setup/{responses-oauth-twnuTaAa.mjs → responses-oauth-CCV7aVYF.mjs} +6 -6
- package/dist/.setup/{rpc-error-C98SHchT.mjs → rpc-error-DemqqaxE.mjs} +7 -3
- package/dist/.setup/{run-attempt-ClU8MxhZ.mjs → run-attempt-BcWArowv.mjs} +595 -426
- package/dist/.setup/{run-attempt-lifecycle-KN4oh-7O.mjs → run-attempt-lifecycle-DN-ATDp9.mjs} +1 -1
- package/dist/.setup/{runtime-artifact-C13pR7tD.mjs → runtime-artifact-CmLWeyJB.mjs} +3 -3
- package/dist/.setup/{runtime-artifact-connection-jS5DeCok.mjs → runtime-artifact-connection-DpWlZ02e.mjs} +3 -3
- package/dist/.setup/{sandbox-guard-DIImwCy1.mjs → sandbox-guard-DneAfNye.mjs} +70 -30
- package/dist/.setup/{session-binding-JEHNMPsr.mjs → session-binding-BgsWcbdY.mjs} +25 -23
- package/dist/.setup/{session-binding-record-DU_0biMD.mjs → session-binding-record-C_THntMe.mjs} +27 -12
- package/dist/.setup/{session-binding-record-codec-BpH8u_G9.mjs → session-binding-record-codec-DvmOI7g_.mjs} +1 -0
- package/dist/.setup/{session-binding-sidecars-DD-enC8w.mjs → session-binding-sidecars-BNSS6WL4.mjs} +55 -63
- package/dist/.setup/session-cancellation-DLBSJO5n.mjs +43 -0
- package/dist/.setup/{session-catalog-adoption-Ca3OYGYM.mjs → session-catalog-adoption-ppsLlVLB.mjs} +24 -38
- package/dist/.setup/{session-catalog-archive-Bv6gV7x9.mjs → session-catalog-archive-CqLRHJ6z.mjs} +11 -13
- package/dist/.setup/{session-catalog-events-kR2Ot6nX.mjs → session-catalog-events-DK0opVp3.mjs} +5 -5
- package/dist/.setup/{session-catalog-index-CrnfVEnT.mjs → session-catalog-index-BfzfdtH7.mjs} +96 -271
- package/dist/.setup/{session-catalog-index-order-CTfoefow.mjs → session-catalog-index-order-0Zqng2u8.mjs} +1 -1
- package/dist/.setup/{session-catalog-limits-BynIoOYm.mjs → session-catalog-limits-Dc6E0BZz.mjs} +1 -1
- package/dist/.setup/{session-catalog-list-request-D4MYNgDB.mjs → session-catalog-list-request-CAjoWjaH.mjs} +3 -4
- package/dist/.setup/{session-catalog-native-projection-CWqCU1I_.mjs → session-catalog-native-projection-G3lSDYYG.mjs} +5 -5
- package/dist/.setup/{session-catalog-node-adoption-BdP9Zjqo.mjs → session-catalog-node-adoption-e9v8mGgx.mjs} +5 -5
- package/dist/.setup/{session-catalog-node-continue-CNJibO4_.mjs → session-catalog-node-continue-H7nrzcUD.mjs} +5 -5
- package/dist/.setup/{session-catalog-node-lookup-BH_DBGa9.mjs → session-catalog-node-lookup-BrZfDkA8.mjs} +2 -2
- package/dist/.setup/{session-catalog-parsing-DkeoVn60.mjs → session-catalog-parsing-V6jyFg9g.mjs} +2 -2
- package/dist/.setup/{session-catalog-projection-BzHiV818.mjs → session-catalog-projection-BjWE414G.mjs} +8 -7
- package/dist/.setup/{session-catalog-provenance-CmsOE5mh.mjs → session-catalog-provenance-Dg9s12z-.mjs} +50 -30
- package/dist/.setup/{session-catalog-source-DGuRdGvM.mjs → session-catalog-source-DqyuNxCe.mjs} +2 -6
- package/dist/.setup/{session-cli-GwU0izn-.mjs → session-cli-CBGKiqdv.mjs} +1 -1
- package/dist/.setup/{session-history-BO6i_pfk.mjs → session-history-7W0cgTXF.mjs} +11 -9
- package/dist/.setup/{session-history-import-CaO8s6ta.mjs → session-history-import-BwPKwcNi.mjs} +4 -4
- package/dist/.setup/{session-initialization-Bi_2DKhc.mjs → session-initialization-Dn3vveGv.mjs} +2 -2
- package/dist/.setup/{session-retirement-B3U5hpGJ.mjs → session-retirement-Ci_JvOfH.mjs} +8 -8
- package/dist/.setup/{session-history.worker-DJQfek5p.mjs → settled-turn-evidence--tRW6fSm.mjs} +2 -18
- package/dist/.setup/{settled-turn-finalizer-CYCVpTv2.mjs → settled-turn-finalizer-D3-KXsbP.mjs} +8 -8
- package/dist/.setup/{shared-client-BCx1wbyA.mjs → shared-client-CE_uY0A1.mjs} +380 -557
- package/dist/.setup/side-question-OM18H9WJ.mjs +998 -0
- package/dist/.setup/{source-DipMO9hL.mjs → source-uGKgKWm8.mjs} +5 -5
- package/dist/.setup/{thread-archive-guard-LKdwQKyr.mjs → thread-archive-guard-BWjSsA92.mjs} +1 -1
- package/dist/.setup/{thread-lifecycle-run-C_aYiYqk.mjs → thread-lifecycle-run-mLueY6pH.mjs} +172 -75
- package/dist/.setup/{thread-model-selection-DcVebr8N.mjs → thread-model-selection-DxposL4X.mjs} +9 -9
- package/dist/.setup/{thread-ownership-BoUd0i6L.mjs → thread-ownership-t6Y9fLQS.mjs} +7 -7
- package/dist/.setup/{thread-policy-B3wBRNph.mjs → thread-policy-Cy301Or8.mjs} +6 -6
- package/dist/.setup/{thread-requests-BgzJwJtS.mjs → thread-requests-BjawdIVV.mjs} +14 -14
- package/dist/.setup/{thread-resume-D-3bsr1j.mjs → thread-resume-BUbsUfgF.mjs} +6 -6
- package/dist/.setup/{transcript-history-projection-DfKcoZCB.mjs → transcript-history-projection-i-FVpyha.mjs} +1 -1
- package/dist/.setup/{transcript-mirror-Bee2o6jj.mjs → transcript-mirror-CEQJZlF3.mjs} +6 -9
- package/dist/.setup/{transport-stdio-CRWTkKOn.mjs → transport-stdio-Bq160Dhv.mjs} +63 -64
- package/dist/.setup/{transport-websocket-DIyPfkHo.mjs → transport-websocket-0YqiI_MH.mjs} +1 -1
- package/dist/.setup/{turn-router-DBVMToGo.mjs → turn-router-Dbw17k3K.mjs} +2 -2
- package/dist/.setup/{upstream-session-fork-p5fwKi7w.mjs → upstream-session-fork-_LYkh0nZ.mjs} +46 -219
- package/dist/.setup/{usage-limit-error-BQX8RHAd.mjs → usage-limit-error-DcOSH3J4.mjs} +4 -4
- package/dist/.setup/{usage-C2Kq7oej.mjs → usage-w_93wnnR.mjs} +4 -4
- package/dist/.setup/{web-search-item-CvokaZOo.mjs → web-search-item-DHVuNSqk.mjs} +1 -1
- package/dist/.setup/{web-search-provider.runtime-D89djc7e.mjs → web-search-provider.runtime-DMHxve5v.mjs} +3 -3
- package/dist/.setup/{workspace-write-sandbox-probe-BDWO2Qkh.mjs → workspace-write-sandbox-probe-DJxOXcF3.mjs} +2 -2
- package/dist/api.js +7 -28
- package/dist/catalog-page.worker.js +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/client-version-api.js +25 -0
- package/dist/doctor-contract-api.js +5 -5
- package/dist/harness.js +59 -36
- package/dist/index.js +259 -295
- package/dist/media-understanding-provider.js +2 -2
- package/dist/migration-provider-api.js +1 -2
- package/dist/native-session-binding-api.js +1 -2
- package/dist/provider-discovery.js +1 -1
- package/dist/session-history-worker-entrypoint.js +12 -0
- package/dist/session-history-worker-runtime.js +7 -18
- package/dist/session-history.worker.js +18 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +6 -6
- package/dist/.setup/attempt-terminal-jO5IMj9K.mjs +0 -2
- package/dist/.setup/command-rpc-HIvsy3wS.mjs +0 -247
- package/dist/.setup/compact-ClZ7Ar7L.mjs +0 -808
- package/dist/.setup/inference-context-DNlGwzwy.mjs +0 -91
- package/dist/.setup/managed-binary-BtIjV7yN.mjs +0 -175
- package/dist/.setup/native-execution-policy-MXEe7PB3.mjs +0 -75
- package/dist/.setup/protocol-CANUwXJ3.mjs +0 -17
- package/dist/.setup/side-question-Bz2UQW0l.mjs +0 -826
package/dist/.setup/{upstream-session-fork-p5fwKi7w.mjs → upstream-session-fork-_LYkh0nZ.mjs}
RENAMED
|
@@ -1,171 +1,49 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { n as flattenCodexDynamicToolFunctions, r as isJsonObject } from "./protocol-CaPAVwe9.mjs";
|
|
2
|
+
import { g as sessionBindingIdentity } from "./session-binding-record-C_THntMe.mjs";
|
|
3
3
|
import { d as readCodexPluginConfig } from "./config-parsing-DsWSCPHO.mjs";
|
|
4
|
-
import { s as assertCodexModelBackedReviewerEffectiveConfig } from "./config-options-
|
|
4
|
+
import { s as assertCodexModelBackedReviewerEffectiveConfig } from "./config-options-DMFZkd3X.mjs";
|
|
5
5
|
import { t as withCodexAppServerThreadMutation } from "./thread-ownership-queue-CeyYScUC.mjs";
|
|
6
|
-
import { i as CodexAppServerScopedRequestRejectedError, o as isCodexAppServerOverloadError } from "./rpc-error-
|
|
6
|
+
import { i as CodexAppServerScopedRequestRejectedError, o as isCodexAppServerOverloadError } from "./rpc-error-DemqqaxE.mjs";
|
|
7
7
|
import { a as readUpstreamUserText, i as readMirrorIdentity } from "./upstream-prompt-provenance-Ccd9MFRJ.mjs";
|
|
8
|
-
import { r as projectCodexUserItemText } from "./transcript-history-projection-
|
|
8
|
+
import { r as projectCodexUserItemText } from "./transcript-history-projection-i-FVpyha.mjs";
|
|
9
9
|
import { n as codexUpstreamBaseline, t as codexLastTerminalTurnId } from "./session-upstream-marker-D15C9NHp.mjs";
|
|
10
|
-
import { r as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-
|
|
11
|
-
import { n as readCodexSessionMeta } from "./session-catalog-provenance-
|
|
12
|
-
import "./request-
|
|
13
|
-
import { r as resolveOpenClawExecPolicyForCodexAppServer } from "./config-
|
|
14
|
-
import { r as resolveCodexSupervisionAppServerRuntimeOptions } from "./config-runtime-
|
|
10
|
+
import { r as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-DRb-niJc.mjs";
|
|
11
|
+
import { n as readCodexSessionMeta } from "./session-catalog-provenance-Dg9s12z-.mjs";
|
|
12
|
+
import "./request-ePeNJrOd.mjs";
|
|
13
|
+
import { r as resolveOpenClawExecPolicyForCodexAppServer } from "./config-BfrAlTMT.mjs";
|
|
14
|
+
import { r as resolveCodexSupervisionAppServerRuntimeOptions } from "./config-runtime-BZRizyuG.mjs";
|
|
15
15
|
import { l as readCodexMirrorSourceFingerprint, o as fingerprintCodexMirrorSourceMessage } from "./transcript-mirror-attestation-BzUXnrvv.mjs";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { d as mergeCodexThreadConfigs, i as buildCodexPluginThreadConfig, p as shouldBuildCodexPluginThreadConfig } from "./project-doc-thread-config-
|
|
19
|
-
import { T as fingerprintUserMcpServersConfigPatch, _ as buildDeveloperInstructions, a as buildCodexThreadConfiguration, b as codexDynamicToolsFingerprint, h as resolveCodexWebSearchPlan, w as fingerprintJsonObject } from "./thread-requests-
|
|
20
|
-
import "./session-binding-
|
|
21
|
-
import "./thread-ownership-
|
|
22
|
-
import {
|
|
23
|
-
import { n as CodexThreadPolicyHandoffError, o as refreshCodexThreadPolicy } from "./thread-policy-
|
|
24
|
-
import { b as isCodexDynamicToolExcluded, f as codexNativeHookRemoteCredentialPath, i as buildCodexNativeHookRelayConfig, l as resolveCodexNativeHookRelayEvents, o as buildCodexNativeHookRelayId, r as assertCodexNativeHookRelayAllowed } from "./native-hook-relay-
|
|
25
|
-
import { c as parseCodexNativeToolCatalog, i as checkCodexThreadAppAvailability, n as resolveCodexNativeSkillIsolation, t as applyCodexNativeSkillIsolation } from "./native-skill-isolation-
|
|
26
|
-
import { c as prepareCodexWorkspaceDeveloperInstructions } from "./attempt-workspace-context-
|
|
27
|
-
import { n as resolveCodexProviderWebSearchSupportForClient } from "./provider-capabilities-
|
|
28
|
-
import { n as prepareCodexSessionInitialization } from "./session-initialization-
|
|
29
|
-
import { createImportedCodexSession } from "./session-history-import-
|
|
16
|
+
import { A as hasCodexAppServerLiveThread, E as claimCodexAppServerLiveThread, l as readCodexAppServerClientDesktopGenerationFingerprint } from "./shared-client-CE_uY0A1.mjs";
|
|
17
|
+
import { f as assertCodexThreadAcceptsDirectInput, o as isCodexAppServerPrewriteRequestCancellationError, p as assertCodexThreadForkResponse } from "./client-BS8X7HmG.mjs";
|
|
18
|
+
import { d as mergeCodexThreadConfigs, i as buildCodexPluginThreadConfig, p as shouldBuildCodexPluginThreadConfig } from "./project-doc-thread-config-B0UI3f1D.mjs";
|
|
19
|
+
import { T as fingerprintUserMcpServersConfigPatch, _ as buildDeveloperInstructions, a as buildCodexThreadConfiguration, b as codexDynamicToolsFingerprint, h as resolveCodexWebSearchPlan, w as fingerprintJsonObject } from "./thread-requests-BjawdIVV.mjs";
|
|
20
|
+
import "./session-binding-BgsWcbdY.mjs";
|
|
21
|
+
import "./thread-ownership-t6Y9fLQS.mjs";
|
|
22
|
+
import { i as resolveCodexNativeExecutionPolicy } from "./native-execution-policy-D09tLP-u.mjs";
|
|
23
|
+
import { n as CodexThreadPolicyHandoffError, o as refreshCodexThreadPolicy } from "./thread-policy-Cy301Or8.mjs";
|
|
24
|
+
import { b as isCodexDynamicToolExcluded, f as codexNativeHookRemoteCredentialPath, i as buildCodexNativeHookRelayConfig, l as resolveCodexNativeHookRelayEvents, o as buildCodexNativeHookRelayId, r as assertCodexNativeHookRelayAllowed } from "./native-hook-relay-C7aaLJaP.mjs";
|
|
25
|
+
import { c as parseCodexNativeToolCatalog, i as checkCodexThreadAppAvailability, n as resolveCodexNativeSkillIsolation, t as applyCodexNativeSkillIsolation } from "./native-skill-isolation-CMimsKYy.mjs";
|
|
26
|
+
import { c as prepareCodexWorkspaceDeveloperInstructions } from "./attempt-workspace-context-GYPLawX6.mjs";
|
|
27
|
+
import { n as resolveCodexProviderWebSearchSupportForClient } from "./provider-capabilities-DjcKunHS.mjs";
|
|
28
|
+
import { n as prepareCodexSessionInitialization } from "./session-initialization-Dn3vveGv.mjs";
|
|
29
|
+
import { createImportedCodexSession } from "./session-history-import-BwPKwcNi.mjs";
|
|
30
30
|
import { isRecord, normalizeOptionalString, readNonBlankString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
31
31
|
import { randomUUID } from "node:crypto";
|
|
32
32
|
import { isDeepStrictEqual } from "node:util";
|
|
33
|
-
import path from "node:path";
|
|
34
|
-
import { lstat } from "node:fs/promises";
|
|
35
|
-
import { root } from "openclaw/plugin-sdk/file-access-runtime";
|
|
36
|
-
import { constants, createZstdDecompress } from "node:zlib";
|
|
37
33
|
import { resolveAgentWorkspaceDir } from "openclaw/plugin-sdk/agent-runtime";
|
|
38
34
|
import { loadCodexBundleMcpThreadConfig } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
39
|
-
import {
|
|
35
|
+
import { loadExecApprovalsReadOnlyAsync } from "openclaw/plugin-sdk/exec-approvals-runtime";
|
|
40
36
|
import { resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
|
|
41
37
|
import { appendSessionTranscriptMessagesByIdentity, readVisibleSessionTranscriptMessageEntries } from "openclaw/plugin-sdk/session-transcript-runtime";
|
|
42
38
|
import { buildCodexUserMcpServersThreadConfigPatchForRuntime, resolveCodexMcpToolOverridesForAgent } from "openclaw/plugin-sdk/codex-mcp-projection";
|
|
43
39
|
import { buildNativeHookRelayCommandPlan } from "openclaw/plugin-sdk/native-hook-relay-runtime";
|
|
44
|
-
//#region extensions/codex/src/session-rollout-snapshot.ts
|
|
45
|
-
const CHUNK_BYTES = 65536;
|
|
46
|
-
const META_BYTES = 1048576;
|
|
47
|
-
const COMPRESSED_BYTES = 8388608;
|
|
48
|
-
const DEADLINE_MS = 5e3;
|
|
49
|
-
const utf8Decoder = new TextDecoder("utf-8", { fatal: true });
|
|
50
|
-
function parseMetadata(line, threadId) {
|
|
51
|
-
const parsed = JSON.parse(utf8Decoder.decode(line));
|
|
52
|
-
if (!isRecord(parsed) || parsed.type !== "session_meta" || !isRecord(parsed.payload) || parsed.payload.id !== threadId) throw new Error("Codex rollout does not belong to the bound thread");
|
|
53
|
-
return parsed.payload;
|
|
54
|
-
}
|
|
55
|
-
/** Read immutable metadata while pinning the entire rollout against concurrent writers. */
|
|
56
|
-
async function readCodexRolloutSnapshot(params) {
|
|
57
|
-
const deadline = Date.now() + DEADLINE_MS;
|
|
58
|
-
const check = () => {
|
|
59
|
-
params.assertCurrent();
|
|
60
|
-
if (Date.now() >= deadline) throw new Error("Codex rollout metadata observation timed out");
|
|
61
|
-
};
|
|
62
|
-
check();
|
|
63
|
-
const rootStat = await lstat(params.sessionsRoot);
|
|
64
|
-
if (!rootStat.isDirectory() || rootStat.isSymbolicLink()) throw new Error("Codex rollout root is not a verified local directory");
|
|
65
|
-
const safeRoot = await root(params.sessionsRoot, {
|
|
66
|
-
hardlinks: "reject",
|
|
67
|
-
symlinks: "reject",
|
|
68
|
-
maxBytes: Number.MAX_SAFE_INTEGER
|
|
69
|
-
});
|
|
70
|
-
const plain = params.rolloutPath.endsWith(".zst") ? params.rolloutPath.slice(0, -4) : params.rolloutPath;
|
|
71
|
-
let selected = plain;
|
|
72
|
-
let opened;
|
|
73
|
-
try {
|
|
74
|
-
opened = await safeRoot.open(path.relative(params.sessionsRoot, selected));
|
|
75
|
-
} catch (error) {
|
|
76
|
-
if (!isRecord(error) || error.code !== "not-found" && error.code !== "ENOENT") throw error;
|
|
77
|
-
selected = `${plain}.zst`;
|
|
78
|
-
opened = await safeRoot.open(path.relative(params.sessionsRoot, selected));
|
|
79
|
-
}
|
|
80
|
-
try {
|
|
81
|
-
check();
|
|
82
|
-
const snapshot = opened.stat;
|
|
83
|
-
const unchanged = (stat) => stat.dev === snapshot.dev && stat.ino === snapshot.ino && stat.size === snapshot.size && stat.mtimeMs === snapshot.mtimeMs && stat.ctimeMs === snapshot.ctimeMs && stat.nlink === 1;
|
|
84
|
-
if (!snapshot.size) throw new Error("Codex rollout metadata is incomplete");
|
|
85
|
-
const compressed = selected.endsWith(".zst");
|
|
86
|
-
if (compressed && snapshot.size > COMPRESSED_BYTES) throw new Error("Compressed Codex rollout exceeds the observation limit");
|
|
87
|
-
const input = opened.handle.createReadStream({
|
|
88
|
-
autoClose: false,
|
|
89
|
-
highWaterMark: CHUNK_BYTES,
|
|
90
|
-
end: snapshot.size - 1
|
|
91
|
-
});
|
|
92
|
-
const decoder = compressed ? createZstdDecompress({
|
|
93
|
-
chunkSize: CHUNK_BYTES,
|
|
94
|
-
params: { [constants.ZSTD_d_windowLogMax]: 25 }
|
|
95
|
-
}) : void 0;
|
|
96
|
-
if (decoder) {
|
|
97
|
-
input.on("error", (error) => decoder.destroy(error));
|
|
98
|
-
input.pipe(decoder);
|
|
99
|
-
}
|
|
100
|
-
const reader = decoder ?? input;
|
|
101
|
-
const timer = setTimeout(() => reader.destroy(/* @__PURE__ */ new Error("Codex rollout metadata observation timed out")), Math.max(1, deadline - Date.now()));
|
|
102
|
-
let metadata;
|
|
103
|
-
const chunks = [];
|
|
104
|
-
let total = 0;
|
|
105
|
-
try {
|
|
106
|
-
for await (const chunk of reader) {
|
|
107
|
-
check();
|
|
108
|
-
const bytes = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
109
|
-
const newline = bytes.indexOf(10);
|
|
110
|
-
const prefix = newline < 0 ? bytes : bytes.subarray(0, newline);
|
|
111
|
-
total += prefix.length;
|
|
112
|
-
if (total > META_BYTES) throw new Error("Codex rollout metadata exceeds the observation limit");
|
|
113
|
-
chunks.push(prefix);
|
|
114
|
-
if (newline >= 0) {
|
|
115
|
-
metadata = parseMetadata(Buffer.concat(chunks), params.threadId);
|
|
116
|
-
if (!unchanged(await opened.handle.stat())) throw new Error("Codex rollout changed during metadata observation");
|
|
117
|
-
break;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
} finally {
|
|
121
|
-
clearTimeout(timer);
|
|
122
|
-
reader.destroy();
|
|
123
|
-
input.destroy();
|
|
124
|
-
}
|
|
125
|
-
if (!metadata) throw new Error("Codex rollout metadata is incomplete");
|
|
126
|
-
const assertUnchanged = async () => {
|
|
127
|
-
params.assertCurrent();
|
|
128
|
-
if (selected !== plain) {
|
|
129
|
-
try {
|
|
130
|
-
await lstat(plain);
|
|
131
|
-
} catch (error) {
|
|
132
|
-
if (!isRecord(error) || error.code !== "ENOENT") throw error;
|
|
133
|
-
return await verifySelected();
|
|
134
|
-
}
|
|
135
|
-
throw new Error("Codex rollout selection changed during metadata observation");
|
|
136
|
-
}
|
|
137
|
-
await verifySelected();
|
|
138
|
-
};
|
|
139
|
-
const verifySelected = async () => {
|
|
140
|
-
params.assertCurrent();
|
|
141
|
-
const currentRoot = await lstat(params.sessionsRoot);
|
|
142
|
-
const fresh = await safeRoot.open(path.relative(params.sessionsRoot, selected));
|
|
143
|
-
try {
|
|
144
|
-
const stat = fresh.stat;
|
|
145
|
-
if (!unchanged(stat) || currentRoot.isSymbolicLink() || currentRoot.ino !== rootStat.ino || currentRoot.dev !== rootStat.dev) throw new Error("Codex rollout changed during metadata observation");
|
|
146
|
-
} finally {
|
|
147
|
-
await fresh.handle.close();
|
|
148
|
-
}
|
|
149
|
-
params.assertCurrent();
|
|
150
|
-
};
|
|
151
|
-
await assertUnchanged();
|
|
152
|
-
check();
|
|
153
|
-
return {
|
|
154
|
-
metadata,
|
|
155
|
-
assertUnchanged
|
|
156
|
-
};
|
|
157
|
-
} finally {
|
|
158
|
-
await opened.handle.close();
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
//#endregion
|
|
162
40
|
//#region extensions/codex/src/app-server/canonical-fork-preparation.ts
|
|
163
41
|
/** Creation preserves native declarations; admitted turns own all live executors. */
|
|
164
42
|
async function prepareCanonicalCodexFork(params) {
|
|
165
43
|
const { created, initialization, config, context } = params;
|
|
166
44
|
const assertCurrent = initialization.assertCurrent;
|
|
167
45
|
assertCurrent();
|
|
168
|
-
if (!initialization.prepareNativeToolPolicy) throw new Error("
|
|
46
|
+
if (!initialization.prepareNativeToolPolicy) throw new Error("Forking an OpenClaw Codex session requires host native tool policy preparation. Update the Gateway before retrying.");
|
|
169
47
|
const workspaceDir = resolveAgentWorkspaceDir(config, created.agentId);
|
|
170
48
|
const cwd = created.entry.spawnedCwd ?? workspaceDir;
|
|
171
49
|
const execution = resolveCodexNativeExecutionPolicy({
|
|
@@ -186,7 +64,7 @@ async function prepareCanonicalCodexFork(params) {
|
|
|
186
64
|
execPolicy: resolveOpenClawExecPolicyForCodexAppServer({
|
|
187
65
|
config,
|
|
188
66
|
agentId: created.agentId,
|
|
189
|
-
approvals:
|
|
67
|
+
approvals: await loadExecApprovalsReadOnlyAsync()
|
|
190
68
|
})
|
|
191
69
|
}),
|
|
192
70
|
start: context.appServer.start
|
|
@@ -468,60 +346,37 @@ async function resolveCodexUpstreamForkBoundary(params) {
|
|
|
468
346
|
turns,
|
|
469
347
|
localPrefix
|
|
470
348
|
});
|
|
471
|
-
const
|
|
472
|
-
const displayPrefix = selected.slice(0, -1);
|
|
349
|
+
const displayPrefix = (canonical ? entries.slice(0, entries.indexOf(target) + 1) : []).slice(0, -1);
|
|
473
350
|
if (canonical && (displayPrefix.length > 200 || Buffer.byteLength(JSON.stringify(displayPrefix)) > 524288)) return failure("upstream-unavailable", "The local display prefix exceeds the safe fork-copy limit. Use native Codex to fork this conversation.");
|
|
474
|
-
const frozen = structuredClone(selected);
|
|
475
|
-
const prefix = frozen.slice(0, -1);
|
|
476
351
|
return resolved.ok ? {
|
|
477
352
|
...resolved,
|
|
478
353
|
editorText: textOnlyMessage("content" in target.message ? target.message.content : void 0),
|
|
479
354
|
...canonical ? { canonical: {
|
|
480
355
|
thread,
|
|
481
356
|
turns,
|
|
482
|
-
prefix
|
|
483
|
-
assertUnchanged: async () => {
|
|
484
|
-
const current = await readVisibleSessionTranscriptMessageEntries(params);
|
|
485
|
-
const index = current.findIndex((entry) => entry.entryId === params.entryId);
|
|
486
|
-
if (index < 0 || !isDeepStrictEqual(current.slice(0, index + 1), frozen)) throw new Error("The local Codex fork prefix changed during initialization");
|
|
487
|
-
const currentThread = await params.control.readThread(threadId, false);
|
|
488
|
-
assertCodexThreadAcceptsDirectInput(currentThread);
|
|
489
|
-
if (currentThread.id !== thread.id || currentThread.path !== thread.path || currentThread.cwd !== thread.cwd || currentThread.historyMode !== thread.historyMode || currentThread.model !== thread.model || currentThread.modelProvider !== thread.modelProvider || currentThread.status?.type === "active") throw new Error("The canonical Codex source changed during initialization");
|
|
490
|
-
const currentTurns = await listCodexUpstreamTurns(params.control, threadId);
|
|
491
|
-
const cut = turns.findIndex((turn) => turn.id === resolved.boundary.beforeTurnId);
|
|
492
|
-
if (!isDeepStrictEqual(currentTurns.slice(0, cut + 1), turns.slice(0, cut + 1))) throw new Error("The canonical Codex fork boundary changed during initialization");
|
|
493
|
-
}
|
|
357
|
+
prefix: displayPrefix
|
|
494
358
|
} } : {}
|
|
495
359
|
} : resolved;
|
|
496
360
|
} catch {
|
|
497
361
|
return failure("upstream-unavailable", "The Codex thread could not be read. Check that Codex is available, then try again.");
|
|
498
362
|
}
|
|
499
363
|
}
|
|
500
|
-
function precheckCodexUpstreamForkBoundary(params) {
|
|
501
|
-
const target = params.turns.find((turn) => turn.id === params.boundary.beforeTurnId);
|
|
502
|
-
if (!target) return failure("upstream-unavailable", "The Codex thread changed before it could be forked. Refresh the session and try again.");
|
|
503
|
-
if (target.status === "inProgress") return failure("in-progress-turn", IN_PROGRESS_TURN_MESSAGE);
|
|
504
|
-
return {
|
|
505
|
-
ok: true,
|
|
506
|
-
boundary: params.boundary
|
|
507
|
-
};
|
|
508
|
-
}
|
|
509
364
|
//#endregion
|
|
510
365
|
//#region extensions/codex/src/app-server/canonical-session-fork.ts
|
|
511
366
|
/** Native history stays native; only the verified local display prefix is copied. */
|
|
512
367
|
async function forkCanonicalCodexSession(params) {
|
|
513
368
|
const { fork, resolved, control, bindingStore, sourceBinding, config } = params;
|
|
514
369
|
const context = control.forkContext;
|
|
515
|
-
if (!context?.localSessionsRoot || !resolved.canonical.thread.path) throw new Error("
|
|
370
|
+
if (!context?.localSessionsRoot || !resolved.canonical.thread.path) throw new Error("Forking an OpenClaw Codex session requires the verified local rollout on its selected connection. Fork an original imported message instead.");
|
|
516
371
|
const model = normalizeOptionalString(resolved.canonical.thread.model);
|
|
517
372
|
const modelProvider = normalizeOptionalString(resolved.canonical.thread.modelProvider);
|
|
518
|
-
if (!model || !modelProvider) throw new Error("Codex did not report the
|
|
373
|
+
if (!model || !modelProvider) throw new Error("Codex did not report the source thread's model selection. Use Codex 0.153.0 or newer, or fork an original imported message instead.");
|
|
519
374
|
const sourceIdentity = sessionBindingIdentity({
|
|
520
375
|
...fork.source,
|
|
521
376
|
config
|
|
522
377
|
});
|
|
523
378
|
return bindingStore.withLease(sourceIdentity, async () => {
|
|
524
|
-
if (!isDeepStrictEqual(bindingStore.read(sourceIdentity), sourceBinding)) throw new Error("Codex
|
|
379
|
+
if (!isDeepStrictEqual(bindingStore.read(sourceIdentity), sourceBinding)) throw new Error("Codex source binding changed before initialization");
|
|
525
380
|
let freshThreadId;
|
|
526
381
|
let ownership;
|
|
527
382
|
let subscriptionReleased = false;
|
|
@@ -538,7 +393,7 @@ async function forkCanonicalCodexSession(params) {
|
|
|
538
393
|
modelSelectionLocked: true
|
|
539
394
|
},
|
|
540
395
|
afterCreate: async (created) => {
|
|
541
|
-
if (!created.initialization) throw new Error("
|
|
396
|
+
if (!created.initialization) throw new Error("Forking an OpenClaw Codex session requires host creation authority");
|
|
542
397
|
const host = created.initialization;
|
|
543
398
|
const initialization = prepareCodexSessionInitialization({
|
|
544
399
|
initialization: host,
|
|
@@ -579,15 +434,11 @@ async function forkCanonicalCodexSession(params) {
|
|
|
579
434
|
initialization.assertCurrent();
|
|
580
435
|
if (ownership && !subscriptionReleased) ownership.assertCurrent();
|
|
581
436
|
};
|
|
582
|
-
const
|
|
583
|
-
sessionsRoot: context.localSessionsRoot,
|
|
584
|
-
rolloutPath: resolved.canonical.thread.path,
|
|
585
|
-
threadId: sourceBinding.threadId,
|
|
586
|
-
assertCurrent
|
|
587
|
-
});
|
|
437
|
+
const metadata = await readCodexSessionMeta(context.localSessionsRoot, resolved.canonical.thread.path.replace(/\.zst$/, ""), sourceBinding.threadId, { canonicalSource: true });
|
|
588
438
|
assertCurrent();
|
|
589
|
-
if (!
|
|
590
|
-
|
|
439
|
+
if (!metadata) throw new Error("The source Codex rollout metadata could not be verified");
|
|
440
|
+
if (!sourceBinding.dynamicToolsFingerprint) throw new Error("The source session has no verified native catalog binding");
|
|
441
|
+
const sourceCatalog = parseCodexNativeToolCatalog(metadata, sourceBinding.threadId, sourceBinding.dynamicToolsFingerprint);
|
|
591
442
|
const prepared = await prepareCanonicalCodexFork({
|
|
592
443
|
created,
|
|
593
444
|
initialization: host,
|
|
@@ -599,11 +450,7 @@ async function forkCanonicalCodexSession(params) {
|
|
|
599
450
|
dynamicTools: sourceCatalog
|
|
600
451
|
});
|
|
601
452
|
assertCurrent();
|
|
602
|
-
|
|
603
|
-
assertCurrent();
|
|
604
|
-
await resolved.canonical.assertUnchanged();
|
|
605
|
-
assertCurrent();
|
|
606
|
-
if (!isDeepStrictEqual(bindingStore.read(sourceIdentity), sourceBinding)) throw new Error("Codex canonical source binding changed during preparation");
|
|
453
|
+
if (!isDeepStrictEqual(bindingStore.read(sourceIdentity), sourceBinding)) throw new Error("Codex source binding changed during preparation");
|
|
607
454
|
assertCurrent();
|
|
608
455
|
let raw;
|
|
609
456
|
try {
|
|
@@ -623,14 +470,11 @@ async function forkCanonicalCodexSession(params) {
|
|
|
623
470
|
let response;
|
|
624
471
|
try {
|
|
625
472
|
response = assertCodexThreadForkResponse(raw);
|
|
473
|
+
if (!response.thread.id.trim() || response.thread.id === sourceBinding.threadId || response.thread.id === fork.upstream.threadId || response.thread.forkedFromId !== sourceBinding.threadId || await bindingStore.hasOtherThreadOwner(response.thread.id)) throw new Error("Codex fork returned an unsafe native thread identity");
|
|
626
474
|
} catch (error) {
|
|
627
475
|
control.retireConnection?.();
|
|
628
476
|
throw error;
|
|
629
477
|
}
|
|
630
|
-
if (!response.thread.id.trim() || response.thread.id === sourceBinding.threadId || response.thread.id === fork.upstream.threadId || response.thread.forkedFromId !== sourceBinding.threadId || await bindingStore.hasOtherThreadOwner(response.thread.id)) {
|
|
631
|
-
control.retireConnection?.();
|
|
632
|
-
throw new Error("Codex fork returned an unsafe native thread identity");
|
|
633
|
-
}
|
|
634
478
|
freshThreadId = response.thread.id;
|
|
635
479
|
ownership = await claimCodexAppServerLiveThread(context.client, freshThreadId);
|
|
636
480
|
if (!ownership) {
|
|
@@ -638,26 +482,22 @@ async function forkCanonicalCodexSession(params) {
|
|
|
638
482
|
throw new Error("Codex fork subscription ownership could not be acquired");
|
|
639
483
|
}
|
|
640
484
|
assertCurrent();
|
|
641
|
-
if (response.model !== model || response.thread.model !== model || response.modelProvider !== modelProvider || response.thread.modelProvider !== modelProvider) throw new Error("Codex fork did not preserve the exact
|
|
485
|
+
if (response.model !== model || response.thread.model !== model || response.modelProvider !== modelProvider || response.thread.modelProvider !== modelProvider) throw new Error("Codex fork did not preserve the exact source session and selected native model");
|
|
642
486
|
const turns = await listCodexUpstreamTurns(control, freshThreadId);
|
|
643
487
|
assertCurrent();
|
|
644
488
|
const cut = resolved.canonical.turns.findIndex((turn) => turn.id === resolved.boundary.beforeTurnId);
|
|
645
489
|
if (cut < 0 || !isDeepStrictEqual(turns, resolved.canonical.turns.slice(0, cut))) throw new Error("Codex did not apply the exact beforeTurnId cut. Reconnect to a compatible server and retry.");
|
|
646
|
-
const
|
|
490
|
+
const childMetadata = response.thread.path ? await readCodexSessionMeta(context.localSessionsRoot, response.thread.path, freshThreadId) : void 0;
|
|
647
491
|
assertCurrent();
|
|
648
|
-
if (!
|
|
649
|
-
const childCatalog = parseCodexNativeToolCatalog(
|
|
492
|
+
if (!childMetadata || childMetadata.model_provider !== modelProvider) throw new Error("The fresh Codex fork metadata could not be verified");
|
|
493
|
+
const childCatalog = parseCodexNativeToolCatalog(childMetadata, freshThreadId);
|
|
650
494
|
if (!isDeepStrictEqual(sourceCatalog, childCatalog)) throw new Error("Codex fork did not preserve the actual native tool catalog");
|
|
651
|
-
await snapshot.assertUnchanged();
|
|
652
|
-
assertCurrent();
|
|
653
495
|
await checkCodexThreadAppAvailability({
|
|
654
496
|
client: context.client,
|
|
655
497
|
threadId: freshThreadId,
|
|
656
498
|
appIds: prepared.provisionalAppIds
|
|
657
499
|
});
|
|
658
500
|
assertCurrent();
|
|
659
|
-
await resolved.canonical.assertUnchanged();
|
|
660
|
-
assertCurrent();
|
|
661
501
|
try {
|
|
662
502
|
await refreshCodexThreadPolicy({
|
|
663
503
|
client: context.client,
|
|
@@ -673,19 +513,18 @@ async function forkCanonicalCodexSession(params) {
|
|
|
673
513
|
}
|
|
674
514
|
throw error;
|
|
675
515
|
}
|
|
676
|
-
|
|
516
|
+
await appendSessionTranscriptMessagesByIdentity({
|
|
677
517
|
config,
|
|
678
518
|
storePath: resolveStorePath(config.session?.store, { agentId: created.agentId }),
|
|
679
519
|
agentId: created.agentId,
|
|
680
520
|
sessionKey: created.key,
|
|
681
521
|
sessionId: created.sessionId,
|
|
682
522
|
messages: resolved.canonical.prefix.map((entry) => ({
|
|
683
|
-
message:
|
|
523
|
+
message: entry.message,
|
|
684
524
|
idempotencyLookup: "scan"
|
|
685
525
|
}))
|
|
686
526
|
});
|
|
687
527
|
assertCurrent();
|
|
688
|
-
if (appended.length !== resolved.canonical.prefix.length || appended.some((item, index) => !item.appended || !isDeepStrictEqual(item.message, resolved.canonical.prefix[index]?.message) || index > 0 && item.effectiveParentId !== appended[index - 1]?.messageId)) throw new Error("The canonical Codex display prefix could not be copied completely");
|
|
689
528
|
await initialization.linkAsync({
|
|
690
529
|
sessionKey: created.key,
|
|
691
530
|
agentId: created.agentId,
|
|
@@ -719,8 +558,6 @@ async function forkCanonicalCodexSession(params) {
|
|
|
719
558
|
await ownership.release(freshThreadId, assertCurrent);
|
|
720
559
|
subscriptionReleased = true;
|
|
721
560
|
initialization.assertCurrent();
|
|
722
|
-
await resolved.canonical.assertUnchanged();
|
|
723
|
-
initialization.assertCurrent();
|
|
724
561
|
if (!isDeepStrictEqual(bindingStore.read(sourceIdentity), sourceBinding)) throw new Error("Codex source binding changed before fork readiness");
|
|
725
562
|
initialization.assertCurrent();
|
|
726
563
|
return { pluginExtensions: created.entry.pluginExtensions };
|
|
@@ -748,7 +585,7 @@ async function forkCodexUpstreamSession(params, options) {
|
|
|
748
585
|
const requestControl = sourceFingerprint ? await options.controlFactory.forUpstream(params.source.agentId, sourceFingerprint) : void 0;
|
|
749
586
|
if (!sourceFingerprint || !requestControl) return unavailable(UNAVAILABLE_CONNECTION_MESSAGE);
|
|
750
587
|
return await requestControl.withPinnedConnection(async (control) => {
|
|
751
|
-
const sourceBinding = options.bindingStore.
|
|
588
|
+
const sourceBinding = await options.bindingStore.readAsync(sessionBindingIdentity({
|
|
752
589
|
...params.source,
|
|
753
590
|
config: options.resolveConfig?.()
|
|
754
591
|
}));
|
|
@@ -792,16 +629,6 @@ async function forkCodexUpstreamSession(params, options) {
|
|
|
792
629
|
harnessRuntimeId: options.harnessRuntimeId,
|
|
793
630
|
config: options.resolveConfig?.() ?? {}
|
|
794
631
|
});
|
|
795
|
-
const liveTurns = await listCodexUpstreamTurns(control, sourceThreadId);
|
|
796
|
-
const precheck = precheckCodexUpstreamForkBoundary({
|
|
797
|
-
boundary: resolved.boundary,
|
|
798
|
-
turns: liveTurns
|
|
799
|
-
});
|
|
800
|
-
if (!precheck.ok) return {
|
|
801
|
-
status: "failed",
|
|
802
|
-
code: precheck.code,
|
|
803
|
-
message: precheck.message
|
|
804
|
-
};
|
|
805
632
|
let response;
|
|
806
633
|
let threadId;
|
|
807
634
|
try {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as shouldRefreshCodexRateLimitsForUsageLimitMessage, i as resolveCodexUsageLimitResetAtMs, n as formatCodexUsageLimitErrorMessage } from "./rate-limits-
|
|
3
|
-
import { t as CODEX_CONTROL_METHODS } from "./capabilities-
|
|
4
|
-
import {
|
|
1
|
+
import { r as isJsonObject } from "./protocol-CaPAVwe9.mjs";
|
|
2
|
+
import { a as shouldRefreshCodexRateLimitsForUsageLimitMessage, i as resolveCodexUsageLimitResetAtMs, n as formatCodexUsageLimitErrorMessage } from "./rate-limits-BpfURnuy.mjs";
|
|
3
|
+
import { t as CODEX_CONTROL_METHODS } from "./capabilities-DAS-JX1z.mjs";
|
|
4
|
+
import { G as rememberCodexRateLimitsRead, U as readCodexRateLimitsRevision, W as readRecentCodexRateLimits } from "./shared-client-CE_uY0A1.mjs";
|
|
5
5
|
import { readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { markAuthProfileBlockedUntil } from "openclaw/plugin-sdk/agent-runtime";
|
|
7
7
|
import { embeddedAgentLog, formatErrorMessage } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as buildCodexAppServerUsageSnapshot } from "./rate-limits-
|
|
2
|
-
import { t as readCodexAppServerUsage } from "./request-
|
|
3
|
-
import "./config-
|
|
4
|
-
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-
|
|
1
|
+
import { t as buildCodexAppServerUsageSnapshot } from "./rate-limits-BpfURnuy.mjs";
|
|
2
|
+
import { t as readCodexAppServerUsage } from "./request-ePeNJrOd.mjs";
|
|
3
|
+
import "./config-BfrAlTMT.mjs";
|
|
4
|
+
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-BZRizyuG.mjs";
|
|
5
5
|
import { CODEX_APP_SERVER_AUTH_MARKER } from "openclaw/plugin-sdk/agent-runtime";
|
|
6
6
|
//#region extensions/codex/src/app-server/usage.ts
|
|
7
7
|
/** Handles the synthetic usage credential for a Codex-backed OpenAI route. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as isJsonObject } from "./protocol-CaPAVwe9.mjs";
|
|
2
2
|
import { normalizeOptionalString, normalizeTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
//#region extensions/codex/src/app-server/web-search-item.ts
|
|
4
4
|
function projectCodexWebSearchItem(item) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { m as buildCodexNativeWebSearchThreadConfig } from "./thread-requests-
|
|
2
|
-
import { runBoundedCodexAppServerTurn } from "./bounded-turn-
|
|
3
|
-
import { t as projectCodexWebSearchItem } from "./web-search-item-
|
|
1
|
+
import { m as buildCodexNativeWebSearchThreadConfig } from "./thread-requests-BjawdIVV.mjs";
|
|
2
|
+
import { runBoundedCodexAppServerTurn } from "./bounded-turn-mN_ekXYW.mjs";
|
|
3
|
+
import { t as projectCodexWebSearchItem } from "./web-search-item-DHVuNSqk.mjs";
|
|
4
4
|
import { readStringParam, resolveSearchTimeoutSeconds, wrapWebContent } from "openclaw/plugin-sdk/provider-web-search";
|
|
5
5
|
//#region extensions/codex/src/web-search-provider.runtime.ts
|
|
6
6
|
async function executeCodexWebSearchProviderTool(ctx, args, executionContext, options) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as resolveCodexPrivateLauncher, n as isCodexAppServerProxyLaunch } from "./launch-args-DbFCehO7.mjs";
|
|
2
|
-
import { n as resolveCodexAppServerSpawnEnv, r as resolveCodexAppServerSpawnInvocation } from "./transport-stdio-
|
|
3
|
-
import { t as resolveCodexDoctorStartOptions } from "./doctor-start-options-
|
|
2
|
+
import { n as resolveCodexAppServerSpawnEnv, r as resolveCodexAppServerSpawnInvocation } from "./transport-stdio-Bq160Dhv.mjs";
|
|
3
|
+
import { t as resolveCodexDoctorStartOptions } from "./doctor-start-options-8uIBXIzR.mjs";
|
|
4
4
|
import { runUtf8CommandWithTimeout } from "openclaw/plugin-sdk/process-runtime";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import fs from "node:fs/promises";
|
package/dist/api.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as codexNativeProfileRecoveryHealthCheck } from "./.setup/auth-profile-health-
|
|
1
|
+
import { f as resolveManagedCodexNativeCommand, g as CODEX_APP_SERVER_VERSION, m as runCodexVersionCommand, s as parseCodexVersion, t as CODEX_VERSION_TIMEOUT_MS } from "./.setup/managed-binary-DbKvGXKl.mjs";
|
|
2
|
+
import { t as codexNativeProfileRecoveryHealthCheck } from "./.setup/auth-profile-health-BVPZU9I8.mjs";
|
|
3
3
|
import { n as findCodexAppServerSpawnError, t as describeCodexSpawnError } from "./.setup/spawn-error-CL3n6MAa.mjs";
|
|
4
|
-
import { t as resolveCodexDoctorStartOptions } from "./.setup/doctor-start-options-
|
|
5
|
-
import { runUtf8CommandWithTimeout } from "openclaw/plugin-sdk/process-runtime";
|
|
4
|
+
import { t as resolveCodexDoctorStartOptions } from "./.setup/doctor-start-options-8uIBXIzR.mjs";
|
|
6
5
|
import path from "node:path";
|
|
7
6
|
import { coerceErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
8
7
|
import { fileURLToPath } from "node:url";
|
|
9
8
|
//#region extensions/codex/src/doctor.ts
|
|
10
9
|
const CODEX_MANAGED_APP_SERVER_CHECK_ID = "codex/managed-app-server";
|
|
11
|
-
const CODEX_VERSION_TIMEOUT_MS = 5e3;
|
|
12
|
-
const CODEX_VERSION_MAX_BUFFER_BYTES = 65536;
|
|
13
10
|
function managedCodexFindings(params) {
|
|
14
11
|
return [{
|
|
15
12
|
checkId: CODEX_MANAGED_APP_SERVER_CHECK_ID,
|
|
@@ -21,30 +18,12 @@ function managedCodexFindings(params) {
|
|
|
21
18
|
...params.fixHint ? { fixHint: params.fixHint } : {}
|
|
22
19
|
}];
|
|
23
20
|
}
|
|
24
|
-
function parseCodexVersion(output) {
|
|
25
|
-
return /(?:^|\s)(\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?)(?:\s|$)/u.exec(output)?.[1];
|
|
26
|
-
}
|
|
27
|
-
async function runVersionCommand(command, env) {
|
|
28
|
-
const result = await runUtf8CommandWithTimeout([command, "--version"], {
|
|
29
|
-
baseEnv: env,
|
|
30
|
-
input: "",
|
|
31
|
-
timeoutMs: CODEX_VERSION_TIMEOUT_MS,
|
|
32
|
-
maxOutputBytes: CODEX_VERSION_MAX_BUFFER_BYTES,
|
|
33
|
-
outputCapture: "head",
|
|
34
|
-
terminateOnOutputLimit: true,
|
|
35
|
-
killProcessTree: true,
|
|
36
|
-
killSignal: "SIGKILL",
|
|
37
|
-
killGraceMs: 0
|
|
38
|
-
});
|
|
39
|
-
if (result.termination !== "exit" || result.code !== 0 || result.outputLimitExceeded) throw new Error(result.outputLimitExceeded ? "Version output exceeded its capture limit" : result.termination === "timeout" ? `Version check timed out after ${CODEX_VERSION_TIMEOUT_MS} ms` : `Version check failed (${result.signal ?? result.code ?? result.termination})`);
|
|
40
|
-
return result;
|
|
41
|
-
}
|
|
42
21
|
function createCodexManagedAppServerHealthCheck(params) {
|
|
43
22
|
const resolveNativeCommand = params.deps?.resolveNativeCommand ?? resolveManagedCodexNativeCommand;
|
|
44
23
|
return {
|
|
45
24
|
id: CODEX_MANAGED_APP_SERVER_CHECK_ID,
|
|
46
25
|
kind: "plugin",
|
|
47
|
-
description: "Verify the
|
|
26
|
+
description: "Verify the shipped managed Codex app-server binary and pinned version.",
|
|
48
27
|
source: "codex",
|
|
49
28
|
defaultEnabled: false,
|
|
50
29
|
async detect(ctx) {
|
|
@@ -80,7 +59,7 @@ function createCodexManagedAppServerHealthCheck(params) {
|
|
|
80
59
|
});
|
|
81
60
|
let output;
|
|
82
61
|
try {
|
|
83
|
-
output = await (params.deps?.runVersionCommand ? params.deps.runVersionCommand(nativeCommand) :
|
|
62
|
+
output = await (params.deps?.runVersionCommand ? params.deps.runVersionCommand(nativeCommand) : runCodexVersionCommand(nativeCommand, env));
|
|
84
63
|
} catch (error) {
|
|
85
64
|
const spawnFailure = findCodexAppServerSpawnError(describeCodexSpawnError(error, nativeCommand));
|
|
86
65
|
return managedCodexFindings({
|
|
@@ -91,7 +70,7 @@ function createCodexManagedAppServerHealthCheck(params) {
|
|
|
91
70
|
fixHint: versionFailureHint ?? "Repair or reinstall the staged OpenClaw package, then rerun the candidate check before cutover."
|
|
92
71
|
});
|
|
93
72
|
}
|
|
94
|
-
const detectedVersion = parseCodexVersion(
|
|
73
|
+
const detectedVersion = parseCodexVersion(output);
|
|
95
74
|
if (detectedVersion !== "0.160.0") return managedCodexFindings({
|
|
96
75
|
severity: versionFailureSeverity,
|
|
97
76
|
message: detectedVersion ? `Managed Codex app-server version mismatch: expected ${CODEX_APP_SERVER_VERSION}, detected ${detectedVersion}.` : `Managed Codex app-server did not report a parseable version; expected ${CODEX_APP_SERVER_VERSION}.`,
|
|
@@ -115,7 +94,7 @@ function registerCodexManagedAppServerDoctorChecks$1(host, deps) {
|
|
|
115
94
|
const CODEX_PLUGIN_ROOT = path.dirname(fileURLToPath(import.meta.url));
|
|
116
95
|
async function probeCodexWorkspaceWriteSandbox(params) {
|
|
117
96
|
try {
|
|
118
|
-
const { probeCodexWorkspaceWriteSandbox: probe } = await import("./.setup/workspace-write-sandbox-probe-
|
|
97
|
+
const { probeCodexWorkspaceWriteSandbox: probe } = await import("./.setup/workspace-write-sandbox-probe-DJxOXcF3.mjs");
|
|
119
98
|
return await probe({
|
|
120
99
|
...params,
|
|
121
100
|
pluginRoot: CODEX_PLUGIN_ROOT
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createCodexCatalogDecoder } from "./.setup/client-catalog-response-
|
|
1
|
+
import { t as createCodexCatalogDecoder } from "./.setup/client-catalog-response-jM38o5w1.mjs";
|
|
2
2
|
import { serveWorkerTasks } from "openclaw/plugin-sdk/worker-task-server";
|
|
3
3
|
//#region extensions/codex/catalog-page.worker.ts
|
|
4
4
|
const decode = createCodexCatalogDecoder();
|
package/dist/cli-metadata.js
CHANGED
|
@@ -2,7 +2,7 @@ import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
|
2
2
|
//#region extensions/codex/cli-metadata.ts
|
|
3
3
|
function registerCodexCliMetadata(api) {
|
|
4
4
|
api.registerCli(async ({ program }) => {
|
|
5
|
-
const { registerCodexSessionCli } = await import("./.setup/session-cli-
|
|
5
|
+
const { registerCodexSessionCli } = await import("./.setup/session-cli-CBGKiqdv.mjs");
|
|
6
6
|
registerCodexSessionCli(program);
|
|
7
7
|
}, { descriptors: [{
|
|
8
8
|
name: "codex",
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { a as resolveCodexAppServerStartOptionsForAgent } from "./.setup/config-options-DMFZkd3X.mjs";
|
|
2
|
+
import { d as resolveManagedCodexClientVersion, g as CODEX_APP_SERVER_VERSION } from "./.setup/managed-binary-DbKvGXKl.mjs";
|
|
3
|
+
import "./.setup/config-BfrAlTMT.mjs";
|
|
4
|
+
import { n as resolveCodexAppServerRuntimeOptions } from "./.setup/config-runtime-BZRizyuG.mjs";
|
|
5
|
+
//#region extensions/codex/client-version-api.ts
|
|
6
|
+
/**
|
|
7
|
+
* Codex client version for ChatGPT model discovery: the version of the binary
|
|
8
|
+
* managed turns run, so listed models match what the backend accepts for them.
|
|
9
|
+
* Custom commands and remote app-servers keep reporting the bundled pin.
|
|
10
|
+
*/
|
|
11
|
+
async function resolveCodexClientVersion(params) {
|
|
12
|
+
const { start } = resolveCodexAppServerRuntimeOptions({
|
|
13
|
+
pluginConfig: params.config?.plugins?.entries?.codex?.config,
|
|
14
|
+
env: params.env
|
|
15
|
+
});
|
|
16
|
+
if (start.transport !== "stdio" || start.commandSource !== "managed") return CODEX_APP_SERVER_VERSION;
|
|
17
|
+
const agentStart = params.agentDir ? resolveCodexAppServerStartOptionsForAgent({
|
|
18
|
+
startOptions: start,
|
|
19
|
+
agentDir: params.agentDir,
|
|
20
|
+
env: params.env
|
|
21
|
+
}) : start;
|
|
22
|
+
return resolveManagedCodexClientVersion(agentStart.managedCommandOrder ?? "package-first");
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { resolveCodexClientVersion };
|
|
@@ -248,15 +248,15 @@ const stateMigrations = [
|
|
|
248
248
|
{
|
|
249
249
|
id: "codex-app-server-sidecars-to-plugin-state",
|
|
250
250
|
label: "Codex app-server thread bindings",
|
|
251
|
-
detectLegacyState: async (params) => (await import("./.setup/session-binding-sidecars-
|
|
252
|
-
migrateLegacyState: async (params) => (await import("./.setup/session-binding-sidecars-
|
|
251
|
+
detectLegacyState: async (params) => (await import("./.setup/session-binding-sidecars-BNSS6WL4.mjs")).detectLegacySessionBindingSidecars(params),
|
|
252
|
+
migrateLegacyState: async (params) => (await import("./.setup/session-binding-sidecars-BNSS6WL4.mjs")).migrateLegacySessionBindingSidecars(params)
|
|
253
253
|
},
|
|
254
254
|
{
|
|
255
255
|
id: "codex-native-task-assignments",
|
|
256
256
|
label: "Codex native pending assignments",
|
|
257
|
-
collectBackupResources: async (params) => (await import("./.setup/native-task-assignments-
|
|
258
|
-
detectLegacyState: async (params) => (await import("./.setup/native-task-assignments-
|
|
259
|
-
migrateLegacyState: async (params) => (await import("./.setup/native-task-assignments-
|
|
257
|
+
collectBackupResources: async (params) => (await import("./.setup/native-task-assignments-YJopbaVO.mjs")).codexNativeTaskAssignmentMigration.collectBackupResources(params),
|
|
258
|
+
detectLegacyState: async (params) => (await import("./.setup/native-task-assignments-YJopbaVO.mjs")).codexNativeTaskAssignmentMigration.detectLegacyState(params),
|
|
259
|
+
migrateLegacyState: async (params) => (await import("./.setup/native-task-assignments-YJopbaVO.mjs")).codexNativeTaskAssignmentMigration.migrateLegacyState(params)
|
|
260
260
|
},
|
|
261
261
|
codexOrphanedSessionBindingMigration
|
|
262
262
|
];
|