@openclaw/codex 2026.10.5-beta.3 → 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-CBR8imwK.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-CfWD3Bk6.mjs → apply-BVSXYkTV.mjs} +11 -11
- package/dist/.setup/{attempt-client-cleanup-D3YvP0N7.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-BzYrcgwJ.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-BmChqNaK.mjs → bounded-turn-mN_ekXYW.mjs} +18 -22
- package/dist/.setup/{build-state-sjOWPg_o.mjs → build-state-VcujMRqP.mjs} +1 -1
- package/dist/.setup/{capabilities-DbOzOglY.mjs → capabilities-DAS-JX1z.mjs} +1 -1
- package/dist/.setup/{client-aPKNc4Ii.mjs → client-BS8X7HmG.mjs} +47 -317
- package/dist/.setup/{client-catalog-response-Du2GmrOV.mjs → client-catalog-response-jM38o5w1.mjs} +2 -2
- package/dist/.setup/client-initialize-CjgZcX61.mjs +165 -0
- package/dist/.setup/{command-dispatch-CF6mgl3u.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-DlycReQg.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-C6yYfm6-.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-CP_mK17t.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-DKko0Jjw.mjs → dynamic-tool-build-BjFAIG-f.mjs} +208 -218
- package/dist/.setup/{dynamic-tools-8hqa1jVc.mjs → dynamic-tools-XqWsVjcC.mjs} +344 -118
- package/dist/.setup/{effective-mcp-catalog-uIZ4w7Nh.mjs → effective-mcp-catalog-C3ta5hHc.mjs} +11 -9
- package/dist/.setup/{ephemeral-turn-DAlEbytF.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-BWEjVHBf.mjs → isolated-completion-P-r8NRE4.mjs} +7 -7
- package/dist/.setup/managed-binary-DbKvGXKl.mjs +395 -0
- package/dist/.setup/{mcp-app-session-preparation-CJR8ib5s.mjs → mcp-app-session-preparation-fnsnCovu.mjs} +18 -14
- package/dist/.setup/{model-catalog-Ben3FsFp.mjs → model-catalog-Y_esgRPY.mjs} +28 -17
- package/dist/.setup/{models-BB0l-gUb.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-DQzvuJ-W.mjs → native-hook-relay-C7aaLJaP.mjs} +45 -10
- package/dist/.setup/{native-mcp-app-UkwXOBfS.mjs → native-mcp-app-CsWj-v_x.mjs} +5 -5
- package/dist/.setup/{native-skill-isolation-DoRxgQPX.mjs → native-skill-isolation-CMimsKYy.mjs} +7 -7
- package/dist/.setup/{native-subagent-monitor-DC4clzAD.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-DFVngccH.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-68FoMlaZ.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-DWH29sy3.mjs → provider-capabilities-DjcKunHS.mjs} +1 -1
- package/dist/.setup/{provider-BCXRBKEb.mjs → provider-wj_LFJH3.mjs} +4 -4
- package/dist/.setup/{rate-limits-CI8pTPqL.mjs → rate-limits-BpfURnuy.mjs} +1 -1
- package/dist/.setup/{request-DInueZ2q.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-BN-0TO0P.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-DujfzcAY.mjs → session-catalog-events-DK0opVp3.mjs} +5 -5
- package/dist/.setup/{session-catalog-index-DQ9_sj42.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-BY2zMkMO.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-BTXOyzl_.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-yQpy2Y6b.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-CIDqLMII.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-C6tjH8RJ.mjs → settled-turn-finalizer-D3-KXsbP.mjs} +8 -8
- package/dist/.setup/{shared-client-CCz9ldpr.mjs → shared-client-CE_uY0A1.mjs} +380 -557
- package/dist/.setup/side-question-OM18H9WJ.mjs +998 -0
- package/dist/.setup/{source-DsubBCYm.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-CxVfnkG-.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-_2e1sjfi.mjs → thread-ownership-t6Y9fLQS.mjs} +7 -7
- package/dist/.setup/{thread-policy-CLTwg3ZA.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-C6qsk8_o.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-CSJl3yYQ.mjs → turn-router-Dbw17k3K.mjs} +2 -2
- package/dist/.setup/{upstream-session-fork-BC45E4Pe.mjs → upstream-session-fork-_LYkh0nZ.mjs} +46 -219
- package/dist/.setup/{usage-limit-error-CJoJ_F8V.mjs → usage-limit-error-DcOSH3J4.mjs} +4 -4
- package/dist/.setup/{usage-1eNaNDM2.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-Qq_wUrvv.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-CUy4Bo-0.mjs +0 -247
- package/dist/.setup/compact-BCCjM_cb.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-COaYBoON.mjs +0 -826
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { i as CodexAppServerScopedRequestRejectedError, r as CodexAppServerRpcError } from "./rpc-error-
|
|
2
|
-
import { t as CODEX_CONTROL_METHODS } from "./capabilities-
|
|
1
|
+
import { i as CodexAppServerScopedRequestRejectedError, r as CodexAppServerRpcError } from "./rpc-error-DemqqaxE.mjs";
|
|
2
|
+
import { t as CODEX_CONTROL_METHODS } from "./capabilities-DAS-JX1z.mjs";
|
|
3
3
|
import { i as withTimeout$1, r as withAbortableTimeout } from "./timeout-D0mEWSGG.mjs";
|
|
4
|
-
import { t as __exportAll } from "./session-binding-sidecars-
|
|
4
|
+
import { t as __exportAll } from "./session-binding-sidecars-BNSS6WL4.mjs";
|
|
5
5
|
import { embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-registration";
|
|
6
|
-
import { areDiagnosticsEnabledForProcess } from "openclaw/plugin-sdk/diagnostic-runtime";
|
|
7
6
|
import { raceWithTimeout } from "openclaw/plugin-sdk/time-runtime";
|
|
7
|
+
import { areDiagnosticsEnabledForProcess } from "openclaw/plugin-sdk/diagnostic-runtime";
|
|
8
8
|
//#region extensions/codex/src/app-server/request-diagnostics.ts
|
|
9
9
|
const DIAGNOSTIC_METHODS = /* @__PURE__ */ new Set([
|
|
10
10
|
...Object.values(CODEX_CONTROL_METHODS),
|
|
@@ -19,13 +19,6 @@ const DIAGNOSTIC_METHODS = /* @__PURE__ */ new Set([
|
|
|
19
19
|
"experimentalFeature/list"
|
|
20
20
|
]);
|
|
21
21
|
const MAX_METHODS = 8;
|
|
22
|
-
function readInitializeSnapshot(read, beforeClose = false) {
|
|
23
|
-
try {
|
|
24
|
-
return read?.(beforeClose);
|
|
25
|
-
} catch {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
22
|
/** Counts awaited APIs, not native execution or proof that a request was written. */
|
|
30
23
|
function createCodexRequestTimeoutDiagnostics(timeoutMs) {
|
|
31
24
|
if (!areDiagnosticsEnabledForProcess() || !embeddedAgentLog.isEnabled("warn")) return;
|
|
@@ -50,8 +43,8 @@ function createCodexRequestTimeoutDiagnostics(timeoutMs) {
|
|
|
50
43
|
if (observation.boundary === "cleanup") {
|
|
51
44
|
if (current.acquireLastObservedBoundary !== "cleanup") {
|
|
52
45
|
current.acquireBoundaryBeforeCleanup = current.acquireLastObservedBoundary;
|
|
53
|
-
const snapshot =
|
|
54
|
-
current.initializeBeforeCleanup = snapshot?.clientClosed ?
|
|
46
|
+
const snapshot = current.initializeSnapshot?.();
|
|
47
|
+
current.initializeBeforeCleanup = snapshot?.clientClosed ? current.initializeSnapshot?.(true) : snapshot;
|
|
55
48
|
current.initializeBeforeCleanupSource = current.initializeBeforeCleanup ? snapshot?.clientClosed ? "before-client-close" : "at-cleanup" : void 0;
|
|
56
49
|
}
|
|
57
50
|
} else {
|
|
@@ -64,30 +57,18 @@ function createCodexRequestTimeoutDiagnostics(timeoutMs) {
|
|
|
64
57
|
},
|
|
65
58
|
onStartedClient(client) {
|
|
66
59
|
if (attempt !== current || current.phase !== "acquire-client") return;
|
|
67
|
-
current.lastStartedClientInstanceId = void 0;
|
|
68
|
-
current.lastStartedTransportIdentity = void 0;
|
|
69
|
-
current.initializeSnapshot = void 0;
|
|
70
60
|
current.initializeBeforeCleanup = void 0;
|
|
71
61
|
current.initializeBeforeCleanupSource = void 0;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
try {
|
|
77
|
-
const identity = client.getRegisteredTransportIdentity();
|
|
78
|
-
current.lastStartedTransportIdentity = identity ? {
|
|
79
|
-
pid: identity.pid,
|
|
80
|
-
startedAt: identity.startedAt
|
|
81
|
-
} : void 0;
|
|
82
|
-
} catch {}
|
|
62
|
+
current.lastStartedClientInstanceId = client.getInstanceId();
|
|
63
|
+
current.initializeSnapshot = (beforeClose) => client.getInitializeDiagnostic(beforeClose);
|
|
64
|
+
const identity = client.getRegisteredTransportIdentity();
|
|
65
|
+
current.lastStartedTransportIdentity = identity;
|
|
83
66
|
}
|
|
84
67
|
};
|
|
85
68
|
},
|
|
86
69
|
acquired(client) {
|
|
87
70
|
attempt.phase = "callback";
|
|
88
|
-
|
|
89
|
-
attempt.clientInstanceId = client.getInstanceId();
|
|
90
|
-
} catch {}
|
|
71
|
+
attempt.clientInstanceId = client.getInstanceId();
|
|
91
72
|
},
|
|
92
73
|
request(method) {
|
|
93
74
|
const current = attempt;
|
|
@@ -108,7 +89,7 @@ function createCodexRequestTimeoutDiagnostics(timeoutMs) {
|
|
|
108
89
|
if (!areDiagnosticsEnabledForProcess() || !embeddedAgentLog.isEnabled("warn")) return;
|
|
109
90
|
const methods = [...attempt.methods].toSorted(([a], [b]) => a.localeCompare(b));
|
|
110
91
|
const pending = methods.reduce((count, [, active]) => count + active, 0);
|
|
111
|
-
const initialize =
|
|
92
|
+
const initialize = attempt.initializeSnapshot?.();
|
|
112
93
|
embeddedAgentLog.warn("codex app-server scope timed out", {
|
|
113
94
|
phase: attempt.phase === "callback" && pending > 0 ? "client-request" : attempt.phase,
|
|
114
95
|
timeoutMs,
|
|
@@ -164,23 +145,34 @@ async function requestCodexAppServerClientJson(params) {
|
|
|
164
145
|
let phase = "prepare";
|
|
165
146
|
observeControl(params.controlObservation, phase);
|
|
166
147
|
try {
|
|
167
|
-
const {
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
148
|
+
const { prepareCodexAppServerDirectSandboxBypassBlock } = await import("./sandbox-guard-DneAfNye.mjs").then((n) => n.a);
|
|
149
|
+
const sandboxGuard = await prepareCodexAppServerDirectSandboxBypassBlock(params);
|
|
150
|
+
try {
|
|
151
|
+
if (sandboxGuard.block) throw new Error(sandboxGuard.block);
|
|
152
|
+
const timeoutMs = params.timeoutMs ?? 6e4;
|
|
153
|
+
const method = params.method;
|
|
154
|
+
const requestParams = params.requestParams;
|
|
155
|
+
const attemptWaiterFinished = method === "thread/list" ? params.controlObservation?.attemptWaiterFinished : void 0;
|
|
156
|
+
const options = {
|
|
157
|
+
timeoutMs,
|
|
158
|
+
signal: params.signal,
|
|
159
|
+
withCurrent: async (write) => {
|
|
160
|
+
await params.assertCurrentAsync?.();
|
|
161
|
+
await sandboxGuard.assertCurrent();
|
|
162
|
+
if (params.withCurrent) await params.withCurrent(write);
|
|
163
|
+
else write();
|
|
164
|
+
},
|
|
165
|
+
assertCurrent: () => {
|
|
166
|
+
params.assertCurrent?.();
|
|
167
|
+
},
|
|
168
|
+
...attemptWaiterFinished ? { attemptWaiterFinished } : {}
|
|
169
|
+
};
|
|
170
|
+
phase = "client-request";
|
|
171
|
+
observeControl(params.controlObservation, phase);
|
|
172
|
+
return await withTimeout$1(params.client.request(method, requestParams, options), timeoutMs, `codex app-server ${params.method} timed out`);
|
|
173
|
+
} finally {
|
|
174
|
+
sandboxGuard.release();
|
|
175
|
+
}
|
|
184
176
|
} catch (error) {
|
|
185
177
|
observeControl(params.controlObservation, phase, { error });
|
|
186
178
|
throw error;
|
|
@@ -188,16 +180,20 @@ async function requestCodexAppServerClientJson(params) {
|
|
|
188
180
|
}
|
|
189
181
|
async function requestCodexAppServerJson(params) {
|
|
190
182
|
observeControl(params.controlObservation, "prepare");
|
|
191
|
-
const {
|
|
192
|
-
const
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
183
|
+
const { prepareCodexAppServerDirectSandboxBypassBlock } = await import("./sandbox-guard-DneAfNye.mjs").then((n) => n.a);
|
|
184
|
+
const sandboxGuard = await prepareCodexAppServerDirectSandboxBypassBlock(params);
|
|
185
|
+
try {
|
|
186
|
+
if (sandboxGuard.block) throw new Error(sandboxGuard.block);
|
|
187
|
+
return await withCodexAppServerJsonClient({
|
|
188
|
+
...params,
|
|
189
|
+
timeoutMessage: `codex app-server ${params.method} timed out`
|
|
190
|
+
}, async (request) => await request({
|
|
191
|
+
method: params.method,
|
|
192
|
+
requestParams: params.requestParams
|
|
193
|
+
}));
|
|
194
|
+
} finally {
|
|
195
|
+
sandboxGuard.release();
|
|
196
|
+
}
|
|
201
197
|
}
|
|
202
198
|
function createScopeCleanupError(message) {
|
|
203
199
|
const stackTraceLimit = Error.stackTraceLimit;
|
|
@@ -292,51 +288,54 @@ async function withCodexAppServerJsonClient(params, run) {
|
|
|
292
288
|
timeoutMs,
|
|
293
289
|
timeoutMessage,
|
|
294
290
|
promise: (async () => {
|
|
295
|
-
const {
|
|
296
|
-
const { createIsolatedCodexAppServerClient, getLeasedSharedCodexAppServerClient,
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
291
|
+
const { prepareCodexAppServerDirectSandboxBypassBlock } = await import("./sandbox-guard-DneAfNye.mjs").then((n) => n.a);
|
|
292
|
+
const { createIsolatedCodexAppServerClient, getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("./shared-client-CE_uY0A1.mjs").then((n) => n.m);
|
|
293
|
+
errorPhase = void 0;
|
|
294
|
+
setPhase("prepare");
|
|
295
|
+
throwIfAbandoned();
|
|
296
|
+
const acquireClient = params.isolated ? createIsolatedCodexAppServerClient : getLeasedSharedCodexAppServerClient;
|
|
297
|
+
const acquireObservation = timeoutDiagnostics?.beginAttempt(1);
|
|
298
|
+
const acquireOptions = {
|
|
299
|
+
startOptions: params.startOptions,
|
|
300
|
+
pluginConfig: params.pluginConfig,
|
|
301
|
+
timeoutMs: remainingTimeoutMs(),
|
|
302
|
+
authProfileId: params.authProfileId,
|
|
303
|
+
authProfileStore: params.authProfileStore,
|
|
304
|
+
authBindingFingerprint: params.authBindingFingerprint,
|
|
305
|
+
preparedAuth: params.preparedAuth,
|
|
306
|
+
authRequirement: params.authRequirement,
|
|
307
|
+
agentDir: params.agentDir,
|
|
308
|
+
config: params.config,
|
|
309
|
+
abandonSignal: timeoutController.signal,
|
|
310
|
+
assertCurrent: params.assertCurrent,
|
|
311
|
+
assertCurrentAsync: params.assertCurrentAsync,
|
|
312
|
+
...acquireObservation
|
|
313
|
+
};
|
|
314
|
+
setPhase("acquire-client");
|
|
315
|
+
const client = await acquireClient(acquireOptions);
|
|
316
|
+
timeoutDiagnostics?.acquired(client);
|
|
317
|
+
let scopeActive = true;
|
|
318
|
+
const assertCurrent = () => {
|
|
300
319
|
throwIfAbandoned();
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
authProfileStore: params.authProfileStore,
|
|
309
|
-
authBindingFingerprint: params.authBindingFingerprint,
|
|
310
|
-
preparedAuth: params.preparedAuth,
|
|
311
|
-
authRequirement: params.authRequirement,
|
|
312
|
-
agentDir: params.agentDir,
|
|
313
|
-
config: params.config,
|
|
314
|
-
abandonSignal: timeoutController.signal,
|
|
315
|
-
assertCurrent: params.assertCurrent,
|
|
316
|
-
...acquireObservation
|
|
317
|
-
};
|
|
318
|
-
setPhase("acquire-client");
|
|
319
|
-
const client = await acquireClient(acquireOptions);
|
|
320
|
-
timeoutDiagnostics?.acquired(client);
|
|
321
|
-
let scopeActive = true;
|
|
322
|
-
const assertCurrent = () => {
|
|
323
|
-
throwIfAbandoned();
|
|
324
|
-
if (!scopeActive) throw new CodexAppServerScopedRequestRejectedError("Codex app-server request scope is closed");
|
|
325
|
-
assertRequestOwnerCurrent(params.assertCurrent);
|
|
326
|
-
};
|
|
327
|
-
try {
|
|
320
|
+
if (!scopeActive) throw new CodexAppServerScopedRequestRejectedError("Codex app-server request scope is closed");
|
|
321
|
+
assertRequestOwnerCurrent(params.assertCurrent);
|
|
322
|
+
};
|
|
323
|
+
try {
|
|
324
|
+
setPhase("prepare");
|
|
325
|
+
assertCurrent();
|
|
326
|
+
const scopedRequest = async (request) => {
|
|
328
327
|
setPhase("prepare");
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
if (
|
|
328
|
+
const sandboxGuard = await prepareCodexAppServerDirectSandboxBypassBlock({
|
|
329
|
+
method: request.method,
|
|
330
|
+
requestParams: request.requestParams,
|
|
331
|
+
config: params.config,
|
|
332
|
+
sessionKey: params.sessionKey,
|
|
333
|
+
sessionId: params.sessionId,
|
|
334
|
+
agentId: params.agentId,
|
|
335
|
+
storePath: params.storePath
|
|
336
|
+
});
|
|
337
|
+
try {
|
|
338
|
+
if (sandboxGuard.block) throw new CodexAppServerScopedRequestRejectedError(sandboxGuard.block);
|
|
340
339
|
assertCurrent();
|
|
341
340
|
const method = request.method;
|
|
342
341
|
const requestParams = request.requestParams;
|
|
@@ -353,6 +352,14 @@ async function withCodexAppServerJsonClient(params, run) {
|
|
|
353
352
|
assertCurrent: () => {
|
|
354
353
|
assertCurrent();
|
|
355
354
|
request.assertCurrent?.();
|
|
355
|
+
},
|
|
356
|
+
withCurrent: async (write) => {
|
|
357
|
+
await params.assertCurrentAsync?.();
|
|
358
|
+
await request.assertCurrentAsync?.();
|
|
359
|
+
await sandboxGuard.assertCurrent();
|
|
360
|
+
assertCurrent();
|
|
361
|
+
request.assertCurrent?.();
|
|
362
|
+
write();
|
|
356
363
|
}
|
|
357
364
|
};
|
|
358
365
|
setPhase("client-request");
|
|
@@ -362,43 +369,32 @@ async function withCodexAppServerJsonClient(params, run) {
|
|
|
362
369
|
} finally {
|
|
363
370
|
settled?.();
|
|
364
371
|
}
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
assertCurrent,
|
|
368
|
-
abort: (reason) => {
|
|
369
|
-
if (scopeActive) timeoutController.abort(reason);
|
|
370
|
-
}
|
|
371
|
-
});
|
|
372
|
-
} catch (error) {
|
|
373
|
-
errorPhase = activePhase;
|
|
374
|
-
if (!isCodexAppServerStartSelectionChangedError(error) || attempt > 0) throw error;
|
|
375
|
-
errorPhase = void 0;
|
|
376
|
-
try {
|
|
377
|
-
if (!params.isolated) {
|
|
378
|
-
setPhase("release-client");
|
|
379
|
-
retireSharedCodexAppServerClientIfCurrent(client);
|
|
380
|
-
}
|
|
381
|
-
setPhase("prepare");
|
|
382
|
-
throwIfAbandoned();
|
|
383
|
-
} catch (retryError) {
|
|
384
|
-
errorPhase = activePhase;
|
|
385
|
-
throw retryError;
|
|
372
|
+
} finally {
|
|
373
|
+
sandboxGuard.release();
|
|
386
374
|
}
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
375
|
+
};
|
|
376
|
+
return await run(scopedRequest, client, {
|
|
377
|
+
assertCurrent,
|
|
378
|
+
abort: (reason) => {
|
|
379
|
+
if (scopeActive) timeoutController.abort(reason);
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
} catch (error) {
|
|
383
|
+
errorPhase = activePhase;
|
|
384
|
+
throw error;
|
|
385
|
+
} finally {
|
|
386
|
+
scopeActive = false;
|
|
387
|
+
setPhase("release-client");
|
|
388
|
+
timeoutDiagnostics?.release();
|
|
389
|
+
const requestErrorPhase = errorPhase;
|
|
390
|
+
errorPhase = activePhase;
|
|
391
|
+
if (params.isolated) await client.closeAndWait({
|
|
392
|
+
exitTimeoutMs: params.isolatedShutdown?.exitTimeoutMs ?? 2e3,
|
|
393
|
+
forceKillDelayMs: params.isolatedShutdown?.forceKillDelayMs ?? 250
|
|
394
|
+
});
|
|
395
|
+
else releaseLeasedSharedCodexAppServerClient(client);
|
|
396
|
+
errorPhase = requestErrorPhase;
|
|
400
397
|
}
|
|
401
|
-
throw new Error("Codex app-server selection retry loop exited unexpectedly");
|
|
402
398
|
})()
|
|
403
399
|
});
|
|
404
400
|
} catch (error) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
-
import {
|
|
2
|
+
import { findPersistedAuthProfileCredentialAsync, isPendingOAuthRefreshFence, isSameOAuthRefreshGeneration, resolveApiKeyForProfile } from "openclaw/plugin-sdk/agent-runtime";
|
|
3
3
|
import { decodeOpenAICodexJwtPayload } from "openclaw/plugin-sdk/provider-auth";
|
|
4
4
|
//#region extensions/codex/src/app-server/responses-oauth.ts
|
|
5
5
|
const CODEX_RESPONSES_OAUTH_PROVIDER = "openclaw_token_sharing";
|
|
@@ -43,9 +43,8 @@ async function resolveCodexResponsesOAuthProfileFingerprint(params) {
|
|
|
43
43
|
return fingerprintCodexResponsesOAuth(credential);
|
|
44
44
|
}
|
|
45
45
|
/** Keep OAuth refresh and persisted grant ownership in OpenClaw, outside native Codex auth. */
|
|
46
|
-
function createCodexResponsesOAuth(params) {
|
|
47
|
-
const persisted = Boolean(
|
|
48
|
-
const readCredential = () => persisted ? findPersistedAuthProfileCredential(params) : params.store.profiles[params.profileId];
|
|
46
|
+
async function createCodexResponsesOAuth(params) {
|
|
47
|
+
const persisted = Boolean(await findPersistedAuthProfileCredentialAsync(params)) || params.store.runtimePersistedProfileIds?.includes(params.profileId) === true;
|
|
49
48
|
const validate = (credential) => {
|
|
50
49
|
if (fingerprintCodexResponsesOAuth(credential) !== params.fingerprint) throw new Error("ChatGPT subscription sharing identity changed; reconnect before retrying.");
|
|
51
50
|
};
|
|
@@ -60,7 +59,7 @@ function createCodexResponsesOAuth(params) {
|
|
|
60
59
|
validate(credential);
|
|
61
60
|
};
|
|
62
61
|
return { async resolve(forceRefresh) {
|
|
63
|
-
const credential =
|
|
62
|
+
const credential = persisted ? await findPersistedAuthProfileCredentialAsync(params) : params.store.profiles[params.profileId];
|
|
64
63
|
validateCurrent(credential, lastCredential);
|
|
65
64
|
const resolved = await resolveApiKeyForProfile({
|
|
66
65
|
cfg: params.config,
|
|
@@ -81,8 +80,9 @@ function createCodexResponsesOAuth(params) {
|
|
|
81
80
|
const resolvedCredential = resolved.credential;
|
|
82
81
|
validate(resolvedCredential);
|
|
83
82
|
lastCredential = resolvedCredential;
|
|
83
|
+
if (persisted && !resolved.readCurrentCredential) throw new Error("ChatGPT subscription sharing credential authority is unavailable.");
|
|
84
|
+
const readCredential = resolved.readCurrentCredential ?? (() => params.store.profiles[params.profileId]);
|
|
84
85
|
const assertCurrent = () => validateCurrent(readCredential(), resolvedCredential);
|
|
85
|
-
assertCurrent();
|
|
86
86
|
return {
|
|
87
87
|
token: resolved.apiKey,
|
|
88
88
|
assertCurrent
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { coerceErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
1
|
+
import { r as isJsonObject } from "./protocol-CaPAVwe9.mjs";
|
|
2
|
+
import { coerceErrorMessage, formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
3
3
|
//#region extensions/codex/src/app-server/rpc-error.ts
|
|
4
4
|
const CODEX_APP_SERVER_OVERLOADED_ERROR_CODE = -32001;
|
|
5
5
|
/** A scoped guard rejected the request before a physical write. */
|
|
@@ -50,5 +50,9 @@ var CodexAppServerLocalRequestCancellationError = class extends Error {
|
|
|
50
50
|
function isCodexAppServerOverloadError(error) {
|
|
51
51
|
return error instanceof CodexAppServerRpcError && error.code === -32001;
|
|
52
52
|
}
|
|
53
|
+
function isMissingCodexParentThreadError(error) {
|
|
54
|
+
const message = formatErrorMessage(error);
|
|
55
|
+
return message.includes("no rollout found for thread id") || message.includes("includeTurns is unavailable before first user message");
|
|
56
|
+
}
|
|
53
57
|
//#endregion
|
|
54
|
-
export { codexPrewriteRejectionCause as a, CodexAppServerScopedRequestRejectedError as i, CodexAppServerLocalRequestCancellationError as n, isCodexAppServerOverloadError as o, CodexAppServerRpcError as r, isCodexThreadReadMissingError as s, CODEX_APP_SERVER_OVERLOADED_ERROR_CODE as t };
|
|
58
|
+
export { codexPrewriteRejectionCause as a, isMissingCodexParentThreadError as c, CodexAppServerScopedRequestRejectedError as i, CodexAppServerLocalRequestCancellationError as n, isCodexAppServerOverloadError as o, CodexAppServerRpcError as r, isCodexThreadReadMissingError as s, CODEX_APP_SERVER_OVERLOADED_ERROR_CODE as t };
|