@openclaw/codex 2026.10.2 → 2026.10.5-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.setup/{account-usage-runtime-DPXsyONK.mjs → account-usage-runtime-B6S1BQU7.mjs} +8 -7
- package/dist/.setup/{app-server-policy-Bg4FZw1f.mjs → app-server-policy-D_zv8J7V.mjs} +3 -4
- package/dist/.setup/{apply-CQ3brq3z.mjs → apply-Cc1DfWPz.mjs} +40 -51
- package/dist/.setup/{attempt-client-cleanup-DPUGAWP2.mjs → attempt-client-cleanup-CxX4cTSi.mjs} +6 -6
- package/dist/.setup/attempt-terminal-jO5IMj9K.mjs +2 -0
- package/dist/.setup/{attempt-workspace-context-GllQy8mw.mjs → attempt-workspace-context-CcwP3DA3.mjs} +21 -18
- package/dist/.setup/{auth-binding-BoMwpuPN.mjs → auth-binding-BaxlhaNx.mjs} +2 -2
- package/dist/.setup/{auth-cache-key-BE1HXsNo.mjs → auth-cache-key-tENCQOub.mjs} +30 -41
- package/dist/.setup/{binding-connection-C-08ez1w.mjs → binding-connection-B7HAAZSI.mjs} +2 -2
- package/dist/.setup/{binding-connection.runtime-Dn2p-fdy.mjs → binding-connection.runtime-DAXn7iFl.mjs} +6 -5
- package/dist/.setup/{bounded-turn-9YflG60n.mjs → bounded-turn-DxtRqV8t.mjs} +21 -17
- package/dist/.setup/{bounded-turn-isolation-DklXNk3k.mjs → bounded-turn-isolation-BfDAo-qZ.mjs} +4 -4
- package/dist/.setup/{build-state-LS-A65iX.mjs → build-state-CMYRQ_We.mjs} +1 -1
- package/dist/.setup/{capabilities-kQntafj_.mjs → capabilities-DbOzOglY.mjs} +1 -1
- package/dist/.setup/{client-catalog-response-BprQziLV.mjs → client-catalog-response-B7oqHQGO.mjs} +25 -32
- package/dist/.setup/{client-ChJtGEdJ.mjs → client-zrCKOu_E.mjs} +198 -247
- package/dist/.setup/{command-dispatch-BoC9hvFs.mjs → command-dispatch-ImiHvcyW.mjs} +3 -4
- package/dist/.setup/{command-formatters-DV3DHhdr.mjs → command-formatters-xW9KpoSZ.mjs} +16 -26
- package/dist/.setup/{command-handlers-BVX2quUD.mjs → command-handlers-B8CT4ngS.mjs} +270 -360
- package/dist/.setup/{command-rpc-M4gYsRiV.mjs → command-rpc-HtQjCQBg.mjs} +19 -18
- package/dist/.setup/{compact-D3JNLG_b.mjs → compact-Do9HPeDr.mjs} +41 -61
- package/dist/.setup/{computer-use-CF0jsDi1.mjs → computer-use-CeF5GuCX.mjs} +109 -147
- package/dist/.setup/{config-0Gxk3_eq.mjs → config-C1YVVLEA.mjs} +32 -59
- package/dist/.setup/config-contracts.shared-D85SGEuq.mjs +4 -0
- package/dist/.setup/{config-options-HG_Rr3W_.mjs → config-options-DDzeNQ8m.mjs} +52 -90
- package/dist/.setup/{config-parsing-BQq-CHTF.mjs → config-parsing-DsWSCPHO.mjs} +19 -55
- package/dist/.setup/{config-runtime-cUYrqu_a.mjs → config-runtime-DWzK-k0n.mjs} +2 -2
- package/dist/.setup/{config-security-KAPScztc.mjs → config-security-clxAZYWX.mjs} +35 -39
- package/dist/.setup/config-utils-DN_YT7dE.mjs +47 -0
- package/dist/.setup/{context-engine-projection-CsgYSQhW.mjs → context-engine-projection-ps-yn_ci.mjs} +10 -22
- package/dist/.setup/{conversation-binding-7kceEUf0.mjs → conversation-binding-D78aEdkE.mjs} +85 -119
- package/dist/.setup/{conversation-binding-data-DJ4ix-W5.mjs → conversation-binding-data-UgLuTSQT.mjs} +9 -8
- package/dist/.setup/{conversation-control-BpJpPo0t.mjs → conversation-control-GXM3unE4.mjs} +7 -10
- package/dist/.setup/{cyber-failover-Bb1J6hS1.mjs → cyber-failover-D4dgNfFf.mjs} +2 -5
- package/dist/.setup/{cyber-failover-notice-XR03ef31.mjs → cyber-failover-notice-ljgGGL0s.mjs} +1 -1
- package/dist/.setup/{doctor-start-options-DPW9JxIE.mjs → doctor-start-options-JjTAl-q_.mjs} +5 -5
- package/dist/.setup/{dynamic-tool-build-BCi00feJ.mjs → dynamic-tool-build-BMiiFROa.mjs} +57 -69
- package/dist/.setup/{dynamic-tools-DUv6Sr6h.mjs → dynamic-tools-DPPHrGKB.mjs} +680 -709
- package/dist/.setup/{effective-mcp-catalog-CIdbHp1t.mjs → effective-mcp-catalog-x3JVEcJp.mjs} +11 -20
- package/dist/.setup/{elicitation-input-r9axtppm.mjs → elicitation-input-DXG_qaXr.mjs} +14 -20
- package/dist/.setup/{ephemeral-turn-U4th15a6.mjs → ephemeral-turn-Dk0wWoqi.mjs} +3 -3
- package/dist/.setup/{event-projector-assistant-message-BwG5TUYW.mjs → event-projector-assistant-message-CLMKN4x-.mjs} +2 -2
- package/dist/.setup/{event-projector-usage-03R0I2dM.mjs → event-projector-usage-BpKfdoTm.mjs} +20 -33
- package/dist/.setup/{event-projector-values-DTqZHizf.mjs → event-projector-values-CLvG1Hil.mjs} +4 -5
- package/dist/.setup/history-rejection-B4nOXNXF.mjs +13 -0
- package/dist/.setup/{inference-context-D-9gWlTR.mjs → inference-context-DNlGwzwy.mjs} +10 -11
- package/dist/.setup/{inference-dispatch-B5UKEUyC.mjs → inference-dispatch-CO6tTs4q.mjs} +5 -4
- package/dist/.setup/{inference-metadata-CgIf7sOx.mjs → inference-metadata-DCvcG_N_.mjs} +36 -41
- package/dist/.setup/{inference-proxy-DUO5E2QQ.mjs → inference-proxy-BDWV0djM.mjs} +10 -14
- package/dist/.setup/{isolated-completion-C6QKyyDS.mjs → isolated-completion-z0ii1a_V.mjs} +8 -8
- package/dist/.setup/local-runtime-attribution-CZz2DJ4q.mjs +15 -0
- package/dist/.setup/{managed-binary-C1VFoVPf.mjs → managed-binary-BtIjV7yN.mjs} +16 -36
- package/dist/.setup/{mcp-app-session-preparation-JFCtSkRp.mjs → mcp-app-session-preparation-GTx-bRGN.mjs} +24 -25
- package/dist/.setup/{mcp-tool-metadata-j10HhfTC.mjs → mcp-tool-metadata-DW41snf3.mjs} +1 -1
- package/dist/.setup/{model-catalog-DD-evckc.mjs → model-catalog-VUdFUqnH.mjs} +8 -8
- package/dist/.setup/{models-DaW-7tld.mjs → models-Dph0RqpR.mjs} +6 -10
- package/dist/.setup/{native-auth-Cjb9y7IZ.mjs → native-auth-esN5MdIv.mjs} +5 -5
- package/dist/.setup/{native-execution-policy-ClzpdG3D.mjs → native-execution-policy-MXEe7PB3.mjs} +11 -28
- package/dist/.setup/native-hook-relay-CSZpcjwq.mjs +561 -0
- package/dist/.setup/{native-mcp-app-ChpyWmL-.mjs → native-mcp-app-CDrrBaTE.mjs} +6 -6
- package/dist/.setup/native-skill-isolation-BAatEJZb.mjs +391 -0
- package/dist/.setup/{native-subagent-monitor-wh_-K3Vo.mjs → native-subagent-monitor-D5O_o07p.mjs} +505 -639
- package/dist/.setup/{native-subagent-pending-assignments-BDqhOdJp.mjs → native-subagent-pending-assignments-DmVhedNs.mjs} +11 -23
- package/dist/.setup/{native-task-assignments-C6KVqiN1.mjs → native-task-assignments-DimsQ9Qa.mjs} +73 -27
- package/dist/.setup/{node-cli-sessions-B5oNDkUS.mjs → node-cli-sessions-CzKg2nGq.mjs} +18 -26
- package/dist/.setup/{node-exec-server.runtime-0xSEjKYt.mjs → node-exec-server.runtime-BWkULhBM.mjs} +5 -8
- package/dist/.setup/{plan-CUHSuL6_.mjs → plan-QNW5zpFp.mjs} +40 -50
- package/dist/.setup/{plugin-activation-BcyBv8PG.mjs → plugin-activation-D7WkJMvU.mjs} +4 -5
- package/dist/.setup/{plugin-app-cache-key-BW8rd98k.mjs → plugin-app-cache-key-Bg9DbDI6.mjs} +18 -23
- package/dist/.setup/{plugin-approval-roundtrip-bPQbG8BI.mjs → plugin-approval-roundtrip-DOQ3Tibe.mjs} +4 -6
- package/dist/.setup/{plugin-inventory-Bf0_piTw.mjs → plugin-inventory-CYgdo14P.mjs} +28 -43
- package/dist/.setup/{plugin-marketplace-discovery-SQPhSuic.mjs → plugin-marketplace-discovery-BblHM3DU.mjs} +7 -10
- package/dist/.setup/{plugin-metadata-cache-DWnB7VMj.mjs → plugin-metadata-cache-Bi8TAPwX.mjs} +5 -10
- package/dist/.setup/project-doc-thread-config-BVcvnps8.mjs +490 -0
- package/dist/.setup/{provider-Ct6-1lsF.mjs → provider-BG5nXBnY.mjs} +4 -4
- package/dist/.setup/{provider-capabilities-DhkeeHJd.mjs → provider-capabilities-DtJKxDf6.mjs} +1 -1
- package/dist/.setup/{rate-limits-CMPy24F5.mjs → rate-limits-CI8pTPqL.mjs} +15 -32
- package/dist/.setup/reasoning-effort-CS9kKWB9.mjs +37 -0
- package/dist/.setup/{request-CZkKkN6c.mjs → request-6piO0U_P.mjs} +28 -48
- package/dist/.setup/{rpc-error-hmWM21RB.mjs → rpc-error-C98SHchT.mjs} +3 -6
- package/dist/.setup/{run-attempt-C6-678kR.mjs → run-attempt-DejV9vDW.mjs} +927 -860
- package/dist/.setup/{run-attempt-lifecycle-BuZgVbDA.mjs → run-attempt-lifecycle-KN4oh-7O.mjs} +13 -4
- package/dist/.setup/{runtime-artifact-CUTOOnKw.mjs → runtime-artifact-C13pR7tD.mjs} +18 -22
- package/dist/.setup/{runtime-artifact-connection-CADz3_BY.mjs → runtime-artifact-connection-jS5DeCok.mjs} +3 -3
- package/dist/.setup/{sandbox-guard-WqE8yPge.mjs → sandbox-guard-DIImwCy1.mjs} +4 -6
- package/dist/.setup/service-tier-normalization-BPgw2Wdt.mjs +9 -0
- package/dist/.setup/{session-binding-Ce7BqiPN.mjs → session-binding-JEHNMPsr.mjs} +13 -40
- package/dist/.setup/{session-binding-record-BZB8RgcF.mjs → session-binding-record-DU_0biMD.mjs} +4 -4
- package/dist/.setup/{session-binding-record-codec-z4ZpDn6E.mjs → session-binding-record-codec-BpH8u_G9.mjs} +16 -39
- package/dist/.setup/{session-binding-sidecars-BrdV95Fg.mjs → session-binding-sidecars-DD-enC8w.mjs} +49 -54
- package/dist/.setup/{session-catalog-adoption-CPIP4S_y.mjs → session-catalog-adoption-Ca3OYGYM.mjs} +23 -27
- package/dist/.setup/{session-catalog-archive-DcgwvSbF.mjs → session-catalog-archive-Bv6gV7x9.mjs} +6 -6
- package/dist/.setup/{session-catalog-events-Cj-b2FpC.mjs → session-catalog-events-BziNSfLx.mjs} +6 -5
- package/dist/.setup/{session-catalog-index-BnvC43eZ.mjs → session-catalog-index-BmaZFGEH.mjs} +111 -105
- package/dist/.setup/{session-catalog-index-order-nhyO0wdW.mjs → session-catalog-index-order-CTfoefow.mjs} +28 -5
- package/dist/.setup/{session-catalog-limits-DEU36Qlo.mjs → session-catalog-limits-BynIoOYm.mjs} +1 -1
- package/dist/.setup/{session-catalog-list-request-tXephOB4.mjs → session-catalog-list-request-D4MYNgDB.mjs} +11 -8
- package/dist/.setup/{session-catalog-native-projection-DCtsWKSF.mjs → session-catalog-native-projection-4CsufcT8.mjs} +5 -61
- package/dist/.setup/{session-catalog-node-adoption-7-WEQTB1.mjs → session-catalog-node-adoption-BdP9Zjqo.mjs} +2 -2
- package/dist/.setup/{session-catalog-node-continue-DLWBwAAO.mjs → session-catalog-node-continue-CNJibO4_.mjs} +27 -49
- package/dist/.setup/{session-catalog-node-lookup-Uufckwcm.mjs → session-catalog-node-lookup-BH_DBGa9.mjs} +3 -3
- package/dist/.setup/{session-catalog-parsing-B-qWJh2x.mjs → session-catalog-parsing-DkeoVn60.mjs} +9 -19
- package/dist/.setup/{session-catalog-projection-Cn0bLb-d.mjs → session-catalog-projection-CcIdJdsd.mjs} +8 -22
- package/dist/.setup/session-catalog-source-CdPqS9sa.mjs +58 -0
- package/dist/.setup/{session-cli-kH4vuGod.mjs → session-cli-GwU0izn-.mjs} +20 -41
- package/dist/.setup/{session-history-BogBHKLk.mjs → session-history-BO6i_pfk.mjs} +1 -1
- package/dist/.setup/{session-history-import-NWKPa4ZO.mjs → session-history-import-CaO8s6ta.mjs} +4 -4
- package/dist/.setup/{session-history-read-CNN8zwbD.mjs → session-history-read-BI_2jRED.mjs} +4 -15
- package/dist/.setup/{session-history.worker-Cq_4DYgN.mjs → session-history.worker-DJQfek5p.mjs} +147 -159
- package/dist/.setup/{session-initialization-D6dtFQkE.mjs → session-initialization-Bi_2DKhc.mjs} +3 -5
- package/dist/.setup/{session-permission-policy-BxIUJ0Zd.mjs → session-permission-policy-CD2MAWU8.mjs} +12 -20
- package/dist/.setup/{session-retirement-Bo81t4Fb.mjs → session-retirement-CcWVhLVr.mjs} +7 -7
- package/dist/.setup/{settled-turn-context-BZsMjkIO.mjs → settled-turn-context-BPL6D3RO.mjs} +1 -1
- package/dist/.setup/{settled-turn-finalizer-CFARFqNd.mjs → settled-turn-finalizer-BezKSo-Y.mjs} +12 -11
- package/dist/.setup/{shared-client-5NUq43f3.mjs → shared-client-BjiqpbC5.mjs} +164 -227
- package/dist/.setup/{side-question-oTlegAz3.mjs → side-question-YQ5FObkD.mjs} +116 -137
- package/dist/.setup/{source-1cabQi3x.mjs → source-Ce3XIIsU.mjs} +37 -56
- package/dist/.setup/thread-archive-guard-LKdwQKyr.mjs +56 -0
- package/dist/.setup/{thread-lifecycle--EPPTNTe.mjs → thread-lifecycle-run-BWy0LDLB.mjs} +338 -478
- package/dist/.setup/thread-model-selection-DcVebr8N.mjs +61 -0
- package/dist/.setup/{thread-ownership-T7T_iffm.mjs → thread-ownership-5X4197vk.mjs} +5 -5
- package/dist/.setup/{thread-ownership-queue-Dp24d7-F.mjs → thread-ownership-queue-CeyYScUC.mjs} +5 -6
- package/dist/.setup/{thread-policy-VtqLex1l.mjs → thread-policy-BEecBTJM.mjs} +4 -4
- package/dist/.setup/thread-requests-BgzJwJtS.mjs +745 -0
- package/dist/.setup/{thread-resume-buZujRcC.mjs → thread-resume-BXY_6o6Z.mjs} +5 -5
- package/dist/.setup/{timeout-CXOfNoaX.mjs → timeout-D0mEWSGG.mjs} +6 -12
- package/dist/.setup/{transcript-history-projection-B9a7HwUV.mjs → transcript-history-projection-DfKcoZCB.mjs} +3 -4
- package/dist/.setup/{transcript-mirror-BfLRARNL.mjs → transcript-mirror-Bee2o6jj.mjs} +68 -68
- package/dist/.setup/{transcript-mirror-attestation-YSegaktH.mjs → transcript-mirror-attestation-BzUXnrvv.mjs} +5 -2
- package/dist/.setup/{transport-stdio-a0HDa2Mj.mjs → transport-stdio-CRWTkKOn.mjs} +67 -77
- package/dist/.setup/{transport-websocket-zqJ0Cmtn.mjs → transport-websocket-DIyPfkHo.mjs} +8 -16
- package/dist/.setup/{turn-router-BOKSJmfw.mjs → turn-router-D8DLkZgH.mjs} +30 -31
- package/dist/.setup/upstream-prompt-provenance-Ccd9MFRJ.mjs +44 -0
- package/dist/.setup/{upstream-session-fork-C4sbIoZb.mjs → upstream-session-fork-DQZbaYMK.mjs} +50 -43
- package/dist/.setup/{usage-Cq21xTMZ.mjs → usage-DVR5mNJK.mjs} +4 -4
- package/dist/.setup/{usage-limit-error-CGJUoQu8.mjs → usage-limit-error-BEONfgt-.mjs} +12 -21
- package/dist/.setup/web-search-item-CvokaZOo.mjs +20 -0
- package/dist/.setup/{web-search-provider.runtime-DrVE7-Br.mjs → web-search-provider.runtime-CffHOpYY.mjs} +3 -3
- package/dist/.setup/{workspace-write-sandbox-probe-DmUHLrrl.mjs → workspace-write-sandbox-probe-BDWO2Qkh.mjs} +4 -4
- package/dist/api.js +15 -15
- package/dist/catalog-page.worker.js +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/doctor-contract-api.js +5 -6
- package/dist/harness.js +32 -61
- package/dist/index.js +302 -416
- package/dist/media-understanding-provider.js +32 -43
- package/dist/migration-provider-api.js +1 -1
- package/dist/native-session-binding-api.js +1 -1
- package/dist/native-tool-policy.js +23 -1
- package/dist/provider-discovery.js +1 -1
- package/dist/session-history-worker-runtime.js +52 -31
- package/dist/session-history.worker.js +1 -1
- package/openclaw.plugin.json +20 -3
- package/package.json +7 -7
- package/dist/.setup/attempt-terminal-gZrxQ35N.mjs +0 -5
- package/dist/.setup/plugin-thread-config-deadline-C5i1S6RN.mjs +0 -124
- package/dist/.setup/service-tier-normalization-Cei89SW6.mjs +0 -15
- package/dist/.setup/shell-dynamic-tools-Bmedt1QE.mjs +0 -85
- package/dist/.setup/thread-archive-guard-C9frICzX.mjs +0 -60
- package/dist/.setup/thread-requests-Bj_Lixmv.mjs +0 -2111
- package/dist/.setup/upstream-prompt-provenance-fXkKbPVC.mjs +0 -37
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { i as CodexAppServerScopedRequestRejectedError, o as isCodexAppServerOverloadError, r as CodexAppServerRpcError } from "./rpc-error-
|
|
2
|
-
import { r as publishCodexCatalogResume } from "./session-catalog-events-
|
|
3
|
-
import { L as forgetCodexWorkspaceReferences, ft as isCodexAppServerStartupError, u as isCodexAppServerStartSelectionChangedError } from "./shared-client-
|
|
4
|
-
import { h as assertCodexThreadResumeResponse, s as isCodexAppServerPrewriteRequestCancellationError } from "./client-
|
|
5
|
-
import { f as unsubscribeCodexThreadBestEffort, i as assertCodexThreadResumeSubscription, r as CodexAppServerUnsafeSubscriptionError } from "./attempt-client-cleanup-
|
|
1
|
+
import { i as CodexAppServerScopedRequestRejectedError, o as isCodexAppServerOverloadError, r as CodexAppServerRpcError } from "./rpc-error-C98SHchT.mjs";
|
|
2
|
+
import { r as publishCodexCatalogResume } from "./session-catalog-events-BziNSfLx.mjs";
|
|
3
|
+
import { L as forgetCodexWorkspaceReferences, ft as isCodexAppServerStartupError, u as isCodexAppServerStartSelectionChangedError } from "./shared-client-BjiqpbC5.mjs";
|
|
4
|
+
import { h as assertCodexThreadResumeResponse, s as isCodexAppServerPrewriteRequestCancellationError } from "./client-zrCKOu_E.mjs";
|
|
5
|
+
import { f as unsubscribeCodexThreadBestEffort, i as assertCodexThreadResumeSubscription, r as CodexAppServerUnsafeSubscriptionError } from "./attempt-client-cleanup-CxX4cTSi.mjs";
|
|
6
6
|
import { sanitizeTerminalText } from "openclaw/plugin-sdk/text-chunking";
|
|
7
7
|
//#region extensions/codex/src/app-server/thread-resume.ts
|
|
8
8
|
/** Owns Codex thread/resume subscription safety. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { withTimeout } from "openclaw/plugin-sdk/time-runtime";
|
|
1
|
+
import { racePromiseWithAbortSignal, withTimeout } from "openclaw/plugin-sdk/time-runtime";
|
|
2
2
|
//#region extensions/codex/src/app-server/timeout.ts
|
|
3
3
|
function resolveAbortError(signal) {
|
|
4
4
|
return signal.reason instanceof Error ? signal.reason : new Error("Codex app-server operation aborted", { cause: signal.reason });
|
|
@@ -27,17 +27,11 @@ async function withAbortableTimeout(params) {
|
|
|
27
27
|
}
|
|
28
28
|
async function waitForPromiseOrAbort(promise, signal) {
|
|
29
29
|
if (signal.aborted) return false;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
removeAbort = () => signal.removeEventListener("abort", onAbort);
|
|
36
|
-
if (signal.aborted) onAbort();
|
|
37
|
-
})]);
|
|
38
|
-
} finally {
|
|
39
|
-
removeAbort?.();
|
|
40
|
-
}
|
|
30
|
+
const aborted = Symbol("codex-promise-aborted");
|
|
31
|
+
return await racePromiseWithAbortSignal(promise.then(() => true), signal, () => aborted).catch((error) => {
|
|
32
|
+
if (error !== aborted) throw error;
|
|
33
|
+
return false;
|
|
34
|
+
});
|
|
41
35
|
}
|
|
42
36
|
function abortReason(signal) {
|
|
43
37
|
return signal.reason instanceof Error ? signal.reason : new Error(String(signal.reason ?? "codex app-server thread route aborted"));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as readCodexAsyncQuestions } from "./async-questions-DdhOCwGi.mjs";
|
|
2
|
-
import { i as readCodexProviderRefusal, t as codexProviderRefusalDiagnostics } from "./event-projector-values-
|
|
3
|
-
import {
|
|
2
|
+
import { i as readCodexProviderRefusal, t as codexProviderRefusalDiagnostics } from "./event-projector-values-CLvG1Hil.mjs";
|
|
3
|
+
import { n as attachCodexMirrorIdentity } from "./upstream-prompt-provenance-Ccd9MFRJ.mjs";
|
|
4
4
|
import { isRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { truncateUtf8Prefix } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
6
6
|
import { Buffer } from "node:buffer";
|
|
@@ -133,7 +133,7 @@ function projectCodexThreadHistory(params) {
|
|
|
133
133
|
}, identity);
|
|
134
134
|
projected.push(projectCodexHistoryMessage(message, text));
|
|
135
135
|
}
|
|
136
|
-
if (
|
|
136
|
+
if (!hasAssistantMessage && turn.status === "failed" && turn.error?.message) {
|
|
137
137
|
const timestamp = (turn.completedAt ?? turn.startedAt ?? threadTimestamp / 1e3) * 1e3;
|
|
138
138
|
const text = normalizeImportedHistoryText(turn.error.message) ?? "Codex turn failed.";
|
|
139
139
|
const message = attachCodexMirrorIdentity({
|
|
@@ -168,7 +168,6 @@ function projectBoundedCodexThreadHistory(params) {
|
|
|
168
168
|
thread: params.thread,
|
|
169
169
|
turns: selectTurnsThroughBoundary(params.thread, params.throughTurnId),
|
|
170
170
|
importedAt: params.importedAt,
|
|
171
|
-
includeErrorOnlyTurns: true,
|
|
172
171
|
...params.modelProvider ? { modelProvider: params.modelProvider } : {}
|
|
173
172
|
});
|
|
174
173
|
const selected = selectBoundedCodexHistoryTail(projected);
|
|
@@ -1,29 +1,21 @@
|
|
|
1
1
|
import { t as readCodexAsyncQuestions } from "./async-questions-DdhOCwGi.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { t as projectBoundedCodexThreadHistory } from "./transcript-history-projection-
|
|
4
|
-
import { a as
|
|
5
|
-
import { t as __exportAll } from "./session-binding-sidecars-
|
|
2
|
+
import { a as readUpstreamUserText, i as readMirrorIdentity, n as attachCodexMirrorIdentity, o as takeCodexAssistantItemIds, r as attachUpstreamUserText } from "./upstream-prompt-provenance-Ccd9MFRJ.mjs";
|
|
3
|
+
import { t as projectBoundedCodexThreadHistory } from "./transcript-history-projection-DfKcoZCB.mjs";
|
|
4
|
+
import { a as buildCodexMirrorIdempotencyKey, c as isMirroredAgentMessage, i as buildCodexMirrorDedupeIdentity, l as readCodexMirrorSourceFingerprint, n as attachCodexMirrorAttestation, o as fingerprintCodexMirrorSourceMessage, r as attachCodexMirrorRunId, t as applyCodexTranscriptTaint } from "./transcript-mirror-attestation-BzUXnrvv.mjs";
|
|
5
|
+
import { t as __exportAll } from "./session-binding-sidecars-DD-enC8w.mjs";
|
|
6
6
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { deliverAgentHarnessUserInputPrompt, embeddedAgentLog, formatErrorMessage, projectAgentHarnessTranscriptMessageForDisplay, restorePreparedUserTurnOperationalMetaForRuntime, runAgentHarnessBeforeMessageWriteHook } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { withCodexSessionTranscriptMirrorWrite } from "openclaw/plugin-sdk/codex-session-transcript-runtime";
|
|
9
|
+
import { createNativeSessionBindingAuthority } from "openclaw/plugin-sdk/agent-harness-session-runtime";
|
|
10
|
+
import { composeSessionTranscriptWriteAssertion, publishSessionTranscriptUpdateByIdentity } from "openclaw/plugin-sdk/session-transcript-runtime";
|
|
10
11
|
//#region extensions/codex/src/app-server/user-prompt-message.ts
|
|
11
|
-
function buildSenderLabel(params) {
|
|
12
|
-
const label = params.senderName ?? params.senderUsername ?? params.senderE164 ?? params.senderId;
|
|
13
|
-
if (!label) return;
|
|
14
|
-
return !params.senderId || label.includes(params.senderId) ? label : `${label} (${params.senderId})`;
|
|
15
|
-
}
|
|
16
12
|
function buildFromPrepared(params, preparedUserMessage) {
|
|
17
13
|
const senderId = normalizeOptionalString(params.senderId);
|
|
18
14
|
const senderName = normalizeOptionalString(params.senderName);
|
|
19
15
|
const senderUsername = normalizeOptionalString(params.senderUsername);
|
|
20
16
|
const senderE164 = normalizeOptionalString(params.senderE164);
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
senderName,
|
|
24
|
-
senderUsername,
|
|
25
|
-
senderE164
|
|
26
|
-
});
|
|
17
|
+
const label = senderName ?? senderUsername ?? senderE164 ?? senderId;
|
|
18
|
+
const senderLabel = label && senderId && !label.includes(senderId) ? `${label} (${senderId})` : label;
|
|
27
19
|
const sourceChannel = normalizeOptionalString(params.inputProvenance?.sourceChannel ?? params.messageChannel ?? params.messageProvider);
|
|
28
20
|
return {
|
|
29
21
|
role: "user",
|
|
@@ -74,52 +66,79 @@ async function mirror(params) {
|
|
|
74
66
|
messagesPresent: [],
|
|
75
67
|
userMessageReceipts: []
|
|
76
68
|
};
|
|
77
|
-
const candidates = messages.map((
|
|
69
|
+
const candidates = messages.map((source) => {
|
|
70
|
+
const message = { ...source };
|
|
71
|
+
const assistantItemIds = takeCodexAssistantItemIds(message);
|
|
78
72
|
const dedupeIdentity = buildCodexMirrorDedupeIdentity(message);
|
|
79
73
|
const sourceFingerprint = fingerprintCodexMirrorSourceMessage(message);
|
|
80
74
|
return {
|
|
81
75
|
dedupeIdentity,
|
|
82
|
-
idempotencyKey: (message.role === "user" ? normalizeOptionalString("idempotencyKey" in message ? message.idempotencyKey : void 0) : void 0) ?? (params.idempotencyScope ?
|
|
76
|
+
idempotencyKey: (message.role === "user" ? normalizeOptionalString("idempotencyKey" in message ? message.idempotencyKey : void 0) : void 0) ?? (params.idempotencyScope ? buildCodexMirrorIdempotencyKey(params.idempotencyScope, dedupeIdentity) : void 0),
|
|
83
77
|
message,
|
|
84
|
-
sourceFingerprint
|
|
78
|
+
sourceFingerprint,
|
|
79
|
+
assistantItemIds
|
|
85
80
|
};
|
|
86
81
|
});
|
|
87
82
|
const candidateIdempotencyKeys = candidates.flatMap(({ idempotencyKey }) => idempotencyKey ? [idempotencyKey] : []);
|
|
88
83
|
const transcriptTarget = resolveCodexMirrorTranscriptTarget(params);
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
84
|
+
const publishCommitted = async (update) => {
|
|
85
|
+
try {
|
|
86
|
+
const terminalOwner = params.terminalAssistantOwner;
|
|
87
|
+
const terminalRunId = update.message.role === "assistant" && terminalOwner && readMirrorIdentity(update.message) === terminalOwner.mirrorIdentity ? terminalOwner.runId : void 0;
|
|
88
|
+
await publishSessionTranscriptUpdateByIdentity({
|
|
89
|
+
...transcriptTarget,
|
|
90
|
+
update: {
|
|
91
|
+
...update,
|
|
92
|
+
...params.agentId ? { agentId: params.agentId } : {},
|
|
93
|
+
...terminalRunId ? { runId: terminalRunId } : {},
|
|
94
|
+
sessionKey: transcriptTarget.sessionKey
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
} catch (error) {
|
|
98
|
+
embeddedAgentLog.warn("failed to publish codex app-server transcript update", { error: formatErrorMessage(error) });
|
|
99
|
+
}
|
|
92
100
|
};
|
|
101
|
+
const assertWritable = composeSessionTranscriptWriteAssertion([params.assertCurrent, params.assertWriteCurrent]);
|
|
93
102
|
assertWritable();
|
|
94
|
-
const
|
|
103
|
+
const result = await withCodexSessionTranscriptMirrorWrite({
|
|
95
104
|
...transcriptTarget,
|
|
96
105
|
config: params.config
|
|
97
106
|
}, async (transcript) => {
|
|
98
107
|
assertWritable();
|
|
99
|
-
const nextAppendedUpdates = [];
|
|
100
108
|
const nextAssistantMirrorIdentitiesOwned = /* @__PURE__ */ new Set();
|
|
109
|
+
const recordAssistantOwnership = (identity) => {
|
|
110
|
+
nextAssistantMirrorIdentitiesOwned.add(identity);
|
|
111
|
+
params.onAssistantMessageOwned?.(identity);
|
|
112
|
+
};
|
|
101
113
|
const nextAnchorsByMirrorIdentity = /* @__PURE__ */ new Map();
|
|
102
114
|
const nextMessagesPresent = [];
|
|
103
115
|
const nextUserMessageReceipts = [];
|
|
104
116
|
const mirrorFacts = await transcript.readMessageFacts({ idempotencyKeys: candidateIdempotencyKeys });
|
|
105
117
|
assertWritable();
|
|
106
118
|
const taint = { tainted: false };
|
|
107
|
-
for (const { dedupeIdentity, idempotencyKey, message, sourceFingerprint } of candidates) {
|
|
119
|
+
for (const { dedupeIdentity, idempotencyKey, message, sourceFingerprint, assistantItemIds } of candidates) {
|
|
108
120
|
const sourceMessage = applyCodexTranscriptTaint(message, taint);
|
|
109
121
|
const mirrorIdentity = readMirrorIdentity(message);
|
|
110
122
|
const ownsRun = Boolean(params.runId && (!params.runMirrorIdentityPrefix || mirrorIdentity?.startsWith(params.runMirrorIdentityPrefix)));
|
|
111
123
|
const terminalOwner = params.terminalAssistantOwner;
|
|
112
124
|
const ownsTerminal = Boolean(ownsRun && terminalOwner && mirrorIdentity === terminalOwner.mirrorIdentity);
|
|
113
|
-
const
|
|
114
|
-
const
|
|
115
|
-
...attachCodexMirrorAttestation(
|
|
125
|
+
const withRunOwnership = (candidate) => ownsRun && params.runId ? attachCodexMirrorRunId(candidate, params.runId, ownsTerminal, terminalOwner?.settlementWarning) : candidate;
|
|
126
|
+
const withAttestation = (candidate) => ({
|
|
127
|
+
...attachCodexMirrorAttestation(candidate, sourceFingerprint),
|
|
116
128
|
...idempotencyKey ? { idempotencyKey } : {}
|
|
117
|
-
};
|
|
129
|
+
});
|
|
130
|
+
const transcriptMessage = withAttestation(withRunOwnership(sourceMessage));
|
|
118
131
|
if (idempotencyKey && mirrorFacts.existingIdempotencyKeys.has(idempotencyKey)) {
|
|
119
132
|
const persistedMessage = mirrorFacts.messagesByIdempotencyKey.get(idempotencyKey);
|
|
120
133
|
const persistedAnchor = mirrorFacts.anchorsByIdempotencyKey.get(idempotencyKey);
|
|
121
134
|
if (persistedMessage && isMirroredAgentMessage(persistedMessage)) {
|
|
122
135
|
nextMessagesPresent.push(persistedMessage);
|
|
136
|
+
if (assistantItemIds && persistedAnchor && readCodexMirrorSourceFingerprint(persistedMessage) === sourceFingerprint) await publishCommitted({
|
|
137
|
+
messageId: persistedAnchor.entryId,
|
|
138
|
+
messageSeq: persistedAnchor.activeMessagePosition + 1,
|
|
139
|
+
message: persistedMessage,
|
|
140
|
+
assistantItemIds
|
|
141
|
+
});
|
|
123
142
|
if (persistedMessage.role === "user" && persistedAnchor) nextUserMessageReceipts.push({
|
|
124
143
|
anchor: persistedAnchor,
|
|
125
144
|
appended: false,
|
|
@@ -127,7 +146,7 @@ async function mirror(params) {
|
|
|
127
146
|
});
|
|
128
147
|
}
|
|
129
148
|
if (persistedAnchor) nextAnchorsByMirrorIdentity.set(dedupeIdentity, persistedAnchor);
|
|
130
|
-
if (message.role === "assistant")
|
|
149
|
+
if (message.role === "assistant") recordAssistantOwnership(dedupeIdentity);
|
|
131
150
|
continue;
|
|
132
151
|
}
|
|
133
152
|
assertWritable();
|
|
@@ -148,19 +167,15 @@ async function mirror(params) {
|
|
|
148
167
|
prepareAssistantTranscriptMessage: ownsTerminal ? params.prepareAssistantTranscriptMessage : void 0
|
|
149
168
|
});
|
|
150
169
|
if (!nextMessage) {
|
|
151
|
-
if (message.role === "assistant")
|
|
170
|
+
if (message.role === "assistant") recordAssistantOwnership(dedupeIdentity);
|
|
152
171
|
continue;
|
|
153
172
|
}
|
|
154
|
-
|
|
173
|
+
let messageToAppend = withAttestation(restorePreparedUserTurnOperationalMetaForRuntime({
|
|
155
174
|
runtimeMessage: nextMessage,
|
|
156
175
|
preparedMessage: preparedUserMessage
|
|
157
|
-
});
|
|
158
|
-
let messageToAppend = {
|
|
159
|
-
...attachCodexMirrorAttestation(restoredMessage, sourceFingerprint),
|
|
160
|
-
...idempotencyKey ? { idempotencyKey } : {}
|
|
161
|
-
};
|
|
176
|
+
}));
|
|
162
177
|
if (mirrorIdentity) messageToAppend = attachCodexMirrorIdentity(messageToAppend, mirrorIdentity);
|
|
163
|
-
|
|
178
|
+
messageToAppend = withRunOwnership(messageToAppend);
|
|
164
179
|
if (message.role === "assistant" && message.openclawAsyncDelivery) {
|
|
165
180
|
const questions = isMirroredAgentMessage(messageToAppend) && readMirroredAssistantText(messageToAppend) === asyncSourceText ? readCodexAsyncQuestions(messageToAppend.openclawAsyncDelivery?.questions) : void 0;
|
|
166
181
|
messageToAppend = Object.assign(messageToAppend, { openclawAsyncDelivery: {
|
|
@@ -176,40 +191,44 @@ async function mirror(params) {
|
|
|
176
191
|
assertWritable();
|
|
177
192
|
const { lifecycleRevision, messageSeq, result: appended } = await transcript.appendMessageWithMessageSequence({
|
|
178
193
|
message: messageToAppend,
|
|
179
|
-
...params.assertCurrent || params.assertWriteCurrent ? {
|
|
180
|
-
|
|
181
|
-
|
|
194
|
+
...params.assertCurrent || params.assertWriteCurrent ? { preparation: {
|
|
195
|
+
prepareMessage: async (preparedMessage) => preparedMessage,
|
|
196
|
+
source: assertWritable
|
|
182
197
|
} } : {},
|
|
183
198
|
idempotencyLookup: "scan",
|
|
184
199
|
cwd: params.cwd
|
|
185
200
|
});
|
|
186
|
-
|
|
187
|
-
if (!appended)
|
|
201
|
+
if (appended && message.role === "assistant") recordAssistantOwnership(dedupeIdentity);
|
|
202
|
+
if (!appended) {
|
|
203
|
+
params.assertCurrent?.();
|
|
204
|
+
continue;
|
|
205
|
+
}
|
|
188
206
|
const { messageId, message: appendedMessage } = appended;
|
|
189
207
|
if (isMirroredAgentMessage(appendedMessage)) {
|
|
190
208
|
nextMessagesPresent.push(appendedMessage);
|
|
191
209
|
if (idempotencyKey) mirrorFacts.messagesByIdempotencyKey.set(idempotencyKey, appendedMessage);
|
|
192
210
|
}
|
|
193
|
-
if (message.role === "assistant") nextAssistantMirrorIdentitiesOwned.add(dedupeIdentity);
|
|
194
211
|
if (appended.anchor) nextAnchorsByMirrorIdentity.set(dedupeIdentity, appended.anchor);
|
|
195
212
|
if (appendedMessage.role === "user" && appended.anchor) nextUserMessageReceipts.push({
|
|
196
213
|
anchor: appended.anchor,
|
|
197
214
|
appended: appended.appended,
|
|
198
215
|
message: appendedMessage
|
|
199
216
|
});
|
|
200
|
-
|
|
217
|
+
const committedItemIds = isMirroredAgentMessage(appendedMessage) && readCodexMirrorSourceFingerprint(appendedMessage) === sourceFingerprint ? assistantItemIds : void 0;
|
|
218
|
+
if (appended.appended || committedItemIds) await publishCommitted({
|
|
201
219
|
lifecycleRevision,
|
|
202
220
|
messageId,
|
|
203
221
|
message: appendedMessage,
|
|
204
|
-
...messageSeq !== void 0 ? { messageSeq } : {}
|
|
222
|
+
...messageSeq !== void 0 ? { messageSeq } : {},
|
|
223
|
+
...committedItemIds ? { assistantItemIds: committedItemIds } : {}
|
|
205
224
|
});
|
|
225
|
+
params.assertCurrent?.();
|
|
206
226
|
if (idempotencyKey) {
|
|
207
227
|
mirrorFacts.existingIdempotencyKeys.add(idempotencyKey);
|
|
208
228
|
if (appended.anchor) mirrorFacts.anchorsByIdempotencyKey.set(idempotencyKey, appended.anchor);
|
|
209
229
|
}
|
|
210
230
|
}
|
|
211
231
|
return {
|
|
212
|
-
appendedUpdates: nextAppendedUpdates,
|
|
213
232
|
assistantMirrorIdentitiesOwned: [...nextAssistantMirrorIdentitiesOwned],
|
|
214
233
|
anchorsByMirrorIdentity: nextAnchorsByMirrorIdentity,
|
|
215
234
|
messagesPresent: nextMessagesPresent,
|
|
@@ -217,25 +236,6 @@ async function mirror(params) {
|
|
|
217
236
|
};
|
|
218
237
|
});
|
|
219
238
|
params.assertCurrent?.();
|
|
220
|
-
const { appendedUpdates, ...result } = mirrorBatch;
|
|
221
|
-
for (const update of appendedUpdates) try {
|
|
222
|
-
const terminalOwner = params.terminalAssistantOwner;
|
|
223
|
-
const terminalRunId = update.message.role === "assistant" && terminalOwner && readMirrorIdentity(update.message) === terminalOwner.mirrorIdentity ? terminalOwner.runId : void 0;
|
|
224
|
-
await publishSessionTranscriptUpdateByIdentity({
|
|
225
|
-
...transcriptTarget,
|
|
226
|
-
update: {
|
|
227
|
-
lifecycleRevision: update.lifecycleRevision,
|
|
228
|
-
...params.agentId ? { agentId: params.agentId } : {},
|
|
229
|
-
message: update.message,
|
|
230
|
-
messageId: update.messageId,
|
|
231
|
-
...update.messageSeq !== void 0 ? { messageSeq: update.messageSeq } : {},
|
|
232
|
-
...terminalRunId ? { runId: terminalRunId } : {},
|
|
233
|
-
sessionKey: transcriptTarget.sessionKey
|
|
234
|
-
}
|
|
235
|
-
});
|
|
236
|
-
} catch (error) {
|
|
237
|
-
embeddedAgentLog.warn("failed to publish codex app-server transcript update", { error: formatErrorMessage(error) });
|
|
238
|
-
}
|
|
239
239
|
return result;
|
|
240
240
|
}
|
|
241
241
|
function resolveCodexMirrorTranscriptTarget(params) {
|
|
@@ -399,7 +399,7 @@ async function mirrorPromptAtTurnStartBestEffort(params) {
|
|
|
399
399
|
return;
|
|
400
400
|
}
|
|
401
401
|
const mirrorResult = await mirror({
|
|
402
|
-
assertCurrent: params.params.hostCapabilities.assertActive,
|
|
402
|
+
assertCurrent: createNativeSessionBindingAuthority([], params.params.hostCapabilities.assertActive).assertLegacyCurrent,
|
|
403
403
|
agentId: params.agentId,
|
|
404
404
|
sessionKey: params.sessionKey,
|
|
405
405
|
sessionId: params.params.sessionId,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as readCodexAsyncQuestions } from "./async-questions-DdhOCwGi.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { a as readUpstreamUserText, i as readMirrorIdentity } from "./upstream-prompt-provenance-Ccd9MFRJ.mjs";
|
|
3
3
|
import { asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
5
|
//#region extensions/codex/src/app-server/transcript-mirror-attestation.ts
|
|
@@ -15,6 +15,9 @@ function buildCodexMirrorDedupeIdentity(message) {
|
|
|
15
15
|
});
|
|
16
16
|
return `${message.role}:${createHash("sha256").update(payload).digest("hex").slice(0, 16)}`;
|
|
17
17
|
}
|
|
18
|
+
function buildCodexMirrorIdempotencyKey(scope, identity) {
|
|
19
|
+
return `${scope}:${identity}`;
|
|
20
|
+
}
|
|
18
21
|
const MIRROR_ORIGIN_META_KEY = "mirrorOrigin";
|
|
19
22
|
const MIRROR_SOURCE_FINGERPRINT_META_KEY = "mirrorSourceFingerprint";
|
|
20
23
|
const CODEX_APP_SERVER_MIRROR_ORIGIN = "codex-app-server";
|
|
@@ -88,4 +91,4 @@ function fingerprintCodexMirrorSourceMessage(message) {
|
|
|
88
91
|
return createHash("sha256").update(serializeCodexMirrorSourceEvidence(message)).digest("hex").slice(0, 32);
|
|
89
92
|
}
|
|
90
93
|
//#endregion
|
|
91
|
-
export {
|
|
94
|
+
export { buildCodexMirrorIdempotencyKey as a, isMirroredAgentMessage as c, buildCodexMirrorDedupeIdentity as i, readCodexMirrorSourceFingerprint as l, attachCodexMirrorAttestation as n, fingerprintCodexMirrorSourceMessage as o, attachCodexMirrorRunId as r, hasCodexMirrorOrigin as s, applyCodexTranscriptTaint as t, serializeCodexMirrorSourceEvidence as u };
|