@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,15 +1,15 @@
|
|
|
1
|
-
import { a as readCodexCatalogDecodeRoute, c as isRpcResponse, i as listenCodexAppServerLines, n as projectCodexCatalogMessage, o as CodexAppServerMessageDecoder, r as createCodexAppServerMessageWriter, s as redactCodexAppServerLinePreview } from "./client-catalog-response-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-DWzK-k0n.mjs";
|
|
1
|
+
import { a as readCodexCatalogDecodeRoute, c as isRpcResponse, i as listenCodexAppServerLines, n as projectCodexCatalogMessage, o as CodexAppServerMessageDecoder, r as createCodexAppServerMessageWriter, s as redactCodexAppServerLinePreview } from "./client-catalog-response-jM38o5w1.mjs";
|
|
2
|
+
import { r as isJsonObject } from "./protocol-CaPAVwe9.mjs";
|
|
3
|
+
import { a as closeCodexAppServerTransport, l as getCodexAppServerRegisteredTransportIdentity, o as closeCodexAppServerTransportAndWait, s as hasCodexAppServerNaturalExit, t as createStdioTransport } from "./transport-stdio-Bq160Dhv.mjs";
|
|
4
|
+
import { i as CodexAppServerScopedRequestRejectedError, n as CodexAppServerLocalRequestCancellationError, o as isCodexAppServerOverloadError, r as CodexAppServerRpcError, t as CODEX_APP_SERVER_OVERLOADED_ERROR_CODE } from "./rpc-error-DemqqaxE.mjs";
|
|
5
|
+
import { n as codexCatalogSourceForClient, o as recordCodexCatalogResponseSource, t as closeCodexCatalogClientSource } from "./session-catalog-source-DqyuNxCe.mjs";
|
|
6
|
+
import { i as reuseCodexCatalogPreview } from "./session-catalog-native-projection-G3lSDYYG.mjs";
|
|
7
|
+
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-BZRizyuG.mjs";
|
|
9
8
|
import { codexCatalogPageWorkerEntrypoint } from "../catalog-page-worker-entrypoint.js";
|
|
10
|
-
import { t as
|
|
11
|
-
import { t as
|
|
12
|
-
import {
|
|
9
|
+
import { a as isUnsupportedCodexAppServerVersionError, i as createCodexInitializeDiagnostics, n as buildCodexAppServerInitializeParams, r as buildCodexAppServerRuntimeIdentity, t as assertSupportedCodexAppServerVersion } from "./client-initialize-CjgZcX61.mjs";
|
|
10
|
+
import { t as createWebSocketTransport } from "./transport-websocket-0YqiI_MH.mjs";
|
|
11
|
+
import { t as __exportAll } from "./session-binding-sidecars-BNSS6WL4.mjs";
|
|
12
|
+
import { isRecord, readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
13
13
|
import { randomUUID } from "node:crypto";
|
|
14
14
|
import { normalizeJsonSchemaForTypeBox } from "openclaw/plugin-sdk/json-schema-runtime";
|
|
15
15
|
import { addSafeTimeoutDelayGraceMs, addTimerTimeoutGraceMs, parseStrictNonNegativeInteger } from "openclaw/plugin-sdk/number-runtime";
|
|
@@ -18,9 +18,8 @@ import path from "node:path";
|
|
|
18
18
|
import { coerceErrorMessage, toStringifiedError } from "openclaw/plugin-sdk/error-runtime";
|
|
19
19
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
20
20
|
import { createDeferred } from "openclaw/plugin-sdk/extension-shared";
|
|
21
|
-
import {
|
|
21
|
+
import { embeddedAgentLog, formatToolExecutionErrorMessage, normalizeQuestionTimeoutSeconds, resolveToolExecutionErrorKind } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
22
22
|
import { sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
23
|
-
import { parse } from "semver";
|
|
24
23
|
import { AsyncWorkScope } from "openclaw/plugin-sdk/concurrency-runtime";
|
|
25
24
|
import { copyInternalToolResultState, runWithAsyncWorkResources } from "openclaw/plugin-sdk/agent-harness-tool-runtime";
|
|
26
25
|
import { Compile } from "typebox/compile";
|
|
@@ -72,7 +71,6 @@ var CodexCatalogWorker = class {
|
|
|
72
71
|
this.pool = new WorkerTaskPool({
|
|
73
72
|
workerUrl: resolveRuntimeWorkerUrl(codexCatalogPageWorkerEntrypoint),
|
|
74
73
|
workerClass: "singleton",
|
|
75
|
-
maxWorkers: 1,
|
|
76
74
|
maxPendingTasks: 1,
|
|
77
75
|
maxPendingBytes: Number.MAX_SAFE_INTEGER,
|
|
78
76
|
idleTimeoutMs: 0,
|
|
@@ -179,165 +177,6 @@ function formatExitValue(value) {
|
|
|
179
177
|
return "unknown";
|
|
180
178
|
}
|
|
181
179
|
//#endregion
|
|
182
|
-
//#region extensions/codex/src/app-server/notification-policy.ts
|
|
183
|
-
const CODEX_APP_SERVER_OPT_OUT_NOTIFICATION_METHODS = [
|
|
184
|
-
"account/login/completed",
|
|
185
|
-
"app/list/updated",
|
|
186
|
-
"command/exec/outputDelta",
|
|
187
|
-
"deprecationNotice",
|
|
188
|
-
"externalAgentConfig/import/completed",
|
|
189
|
-
"externalAgentConfig/import/progress",
|
|
190
|
-
"fs/changed",
|
|
191
|
-
"fuzzyFileSearch/sessionCompleted",
|
|
192
|
-
"fuzzyFileSearch/sessionUpdated",
|
|
193
|
-
"mcpServer/event/stream/notification",
|
|
194
|
-
"mcpServer/oauthLogin/completed",
|
|
195
|
-
"mcpServer/startupStatus/updated",
|
|
196
|
-
"process/exited",
|
|
197
|
-
"process/outputDelta",
|
|
198
|
-
"project/changed",
|
|
199
|
-
"remoteControl/status/changed",
|
|
200
|
-
"thread/environment/connected",
|
|
201
|
-
"thread/environment/disconnected",
|
|
202
|
-
"thread/goal/cleared",
|
|
203
|
-
"thread/project/updated",
|
|
204
|
-
"thread/queue/changed",
|
|
205
|
-
"thread/realtime/closed",
|
|
206
|
-
"thread/realtime/error",
|
|
207
|
-
"thread/realtime/item/completed",
|
|
208
|
-
"thread/realtime/item/started",
|
|
209
|
-
"thread/realtime/item/transcript/delta",
|
|
210
|
-
"thread/realtime/itemAdded",
|
|
211
|
-
"thread/realtime/outputAudio/delta",
|
|
212
|
-
"thread/realtime/sdp",
|
|
213
|
-
"thread/realtime/started",
|
|
214
|
-
"thread/realtime/transcript/delta",
|
|
215
|
-
"thread/realtime/transcript/done",
|
|
216
|
-
"windows/worldWritableWarning",
|
|
217
|
-
"windowsSandbox/setupCompleted",
|
|
218
|
-
"turn/diff/updated",
|
|
219
|
-
"item/fileChange/outputDelta",
|
|
220
|
-
"thread/compacted"
|
|
221
|
-
];
|
|
222
|
-
//#endregion
|
|
223
|
-
//#region extensions/codex/src/app-server/client-initialize.ts
|
|
224
|
-
/** Scalar observations only: a stream callback is not a native response. */
|
|
225
|
-
function createCodexInitializeDiagnostics() {
|
|
226
|
-
let current;
|
|
227
|
-
let beforeClose;
|
|
228
|
-
return {
|
|
229
|
-
begin() {
|
|
230
|
-
let snapshot = {
|
|
231
|
-
boundary: "request",
|
|
232
|
-
outcome: "pending",
|
|
233
|
-
overloadAttemptOrdinal: 0,
|
|
234
|
-
writeState: "not-attempted",
|
|
235
|
-
wireOutcome: "not-written"
|
|
236
|
-
};
|
|
237
|
-
current = snapshot;
|
|
238
|
-
return {
|
|
239
|
-
boundary(boundary) {
|
|
240
|
-
if (current === snapshot) snapshot.boundary = boundary;
|
|
241
|
-
},
|
|
242
|
-
finish(succeeded) {
|
|
243
|
-
if (current === snapshot) snapshot.outcome = succeeded ? "succeeded" : "failed";
|
|
244
|
-
},
|
|
245
|
-
attempt(ordinal) {
|
|
246
|
-
if (current !== snapshot) return;
|
|
247
|
-
const attempt = {
|
|
248
|
-
boundary: "request",
|
|
249
|
-
outcome: "pending",
|
|
250
|
-
overloadAttemptOrdinal: ordinal,
|
|
251
|
-
writeState: "not-attempted",
|
|
252
|
-
wireOutcome: "retained-pending"
|
|
253
|
-
};
|
|
254
|
-
current = snapshot = attempt;
|
|
255
|
-
return {
|
|
256
|
-
observe(event) {
|
|
257
|
-
if (event.kind === "wire") attempt.wireOutcome = event.outcome;
|
|
258
|
-
else if (event.kind === "waiter") attempt.waiterOutcome = event.outcome;
|
|
259
|
-
else attempt.writeState = "possible-write";
|
|
260
|
-
},
|
|
261
|
-
writeResult(error) {
|
|
262
|
-
attempt.writeState = error ? "callback-error" : "callback-ok";
|
|
263
|
-
}
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
|
-
};
|
|
267
|
-
},
|
|
268
|
-
closing() {
|
|
269
|
-
if (current && !beforeClose) beforeClose = {
|
|
270
|
-
...current,
|
|
271
|
-
clientClosed: false
|
|
272
|
-
};
|
|
273
|
-
},
|
|
274
|
-
snapshot(clientClosed, beforeClientClose = false) {
|
|
275
|
-
if (beforeClientClose) return beforeClose ? { ...beforeClose } : void 0;
|
|
276
|
-
return current ? {
|
|
277
|
-
...current,
|
|
278
|
-
clientClosed
|
|
279
|
-
} : void 0;
|
|
280
|
-
}
|
|
281
|
-
};
|
|
282
|
-
}
|
|
283
|
-
function buildCodexAppServerInitializeParams() {
|
|
284
|
-
return {
|
|
285
|
-
clientInfo: {
|
|
286
|
-
name: "openclaw",
|
|
287
|
-
title: "OpenClaw",
|
|
288
|
-
version: OPENCLAW_VERSION
|
|
289
|
-
},
|
|
290
|
-
capabilities: {
|
|
291
|
-
experimentalApi: true,
|
|
292
|
-
optOutNotificationMethods: [...CODEX_APP_SERVER_OPT_OUT_NOTIFICATION_METHODS],
|
|
293
|
-
extensions: {
|
|
294
|
-
"openai/standard-form-input": {},
|
|
295
|
-
"openai/form": {},
|
|
296
|
-
"openai/elicitation": { form: {} },
|
|
297
|
-
"io.modelcontextprotocol/ui": { mimeTypes: ["text/html;profile=mcp-app"] }
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
};
|
|
301
|
-
}
|
|
302
|
-
function buildCodexAppServerRuntimeIdentity(response, serverVersion) {
|
|
303
|
-
const userAgent = normalizeOptionalString(response.userAgent);
|
|
304
|
-
const codexHome = normalizeOptionalString(response.codexHome);
|
|
305
|
-
const platformFamily = normalizeOptionalString(response.platformFamily);
|
|
306
|
-
const platformOs = normalizeOptionalString(response.platformOs);
|
|
307
|
-
return {
|
|
308
|
-
serverVersion,
|
|
309
|
-
...userAgent ? { userAgent } : {},
|
|
310
|
-
...codexHome ? { codexHome } : {},
|
|
311
|
-
...platformFamily ? { platformFamily } : {},
|
|
312
|
-
...platformOs ? { platformOs } : {}
|
|
313
|
-
};
|
|
314
|
-
}
|
|
315
|
-
var CodexAppServerVersionError = class extends Error {
|
|
316
|
-
constructor(detectedVersion) {
|
|
317
|
-
const detected = detectedVersion ? `detected ${detectedVersion}` : "OpenClaw could not determine the running Codex version";
|
|
318
|
-
super(`Codex app-server ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} or newer is required, but ${detected}. Update the configured Codex app-server binary, or remove custom command overrides to use the managed binary.`);
|
|
319
|
-
this.detectedVersion = detectedVersion;
|
|
320
|
-
this.name = "CodexAppServerVersionError";
|
|
321
|
-
}
|
|
322
|
-
};
|
|
323
|
-
function assertSupportedCodexAppServerVersion(response) {
|
|
324
|
-
const detectedVersion = readCodexVersionFromUserAgent(response.userAgent);
|
|
325
|
-
if (!detectedVersion) throw new CodexAppServerVersionError(detectedVersion);
|
|
326
|
-
const detected = parse(detectedVersion);
|
|
327
|
-
if (!detected || detected.compare("0.149.0") < 0) throw new CodexAppServerVersionError(detectedVersion);
|
|
328
|
-
if (detected.compare("0.160.0") > 0) embeddedAgentLog.warn("codex app-server is newer than OpenClaw's managed runtime; continuing with normal startup validation", {
|
|
329
|
-
detectedVersion,
|
|
330
|
-
validatedVersion: CODEX_APP_SERVER_VERSION
|
|
331
|
-
});
|
|
332
|
-
return detectedVersion;
|
|
333
|
-
}
|
|
334
|
-
function readCodexVersionFromUserAgent(userAgent) {
|
|
335
|
-
return (userAgent?.match(/^[^/]+\/(\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?)(?:[\s(]|$)/))?.[1];
|
|
336
|
-
}
|
|
337
|
-
function isUnsupportedCodexAppServerVersionError(error) {
|
|
338
|
-
return error instanceof CodexAppServerVersionError;
|
|
339
|
-
}
|
|
340
|
-
//#endregion
|
|
341
180
|
//#region extensions/codex/src/app-server/client-notifications.ts
|
|
342
181
|
const CODEX_APP_SERVER_PENDING_STARTUP_WARNINGS_MAX = 32;
|
|
343
182
|
const LOG_ONLY_CODEX_WARNING_PATTERNS = [/^Configured service tier `[^`\r\n]+` is not advertised as supported for model `[^`\r\n]+` and will be omitted from requests\.$/, /^Code Mode is enabled in configuration, but model `[^`\r\n]+` does not advertise Code Mode support\. This may degrade model performance\. Disable `features\.code_mode` and `features\.code_mode_only`, or select a model whose metadata enables Code Mode\.$/];
|
|
@@ -416,10 +255,9 @@ function dispatchCodexAppServerResponse(response, attempts, source, previewState
|
|
|
416
255
|
//#region extensions/codex/src/app-server/request-admission.ts
|
|
417
256
|
/** Consume authority once at the physical writer; waiter expiry never permits a late write. */
|
|
418
257
|
function dispatchCodexRequestAttempt(attempt, options, assertTransportCurrent, writeMessage) {
|
|
419
|
-
if (!attempt.pending) return;
|
|
420
258
|
let consumed = false;
|
|
421
259
|
const write = () => {
|
|
422
|
-
if (consumed)
|
|
260
|
+
if (consumed) return;
|
|
423
261
|
consumed = true;
|
|
424
262
|
if (!attempt.pending) return;
|
|
425
263
|
assertTransportCurrent();
|
|
@@ -428,14 +266,14 @@ function dispatchCodexRequestAttempt(attempt, options, assertTransportCurrent, w
|
|
|
428
266
|
} catch (cause) {
|
|
429
267
|
throw cause instanceof CodexAppServerScopedRequestRejectedError ? cause : new CodexAppServerScopedRequestRejectedError(coerceErrorMessage(cause), { cause });
|
|
430
268
|
}
|
|
431
|
-
|
|
269
|
+
writeMessage();
|
|
432
270
|
};
|
|
433
271
|
const rejectAdmission = (cause) => {
|
|
434
272
|
attempt.failLocal(!consumed && !(cause instanceof CodexAppServerScopedRequestRejectedError) ? new CodexAppServerScopedRequestRejectedError(coerceErrorMessage(cause), { cause }) : toStringifiedError(cause));
|
|
435
273
|
};
|
|
436
274
|
try {
|
|
437
275
|
if (options.withCurrent) options.withCurrent(write).then(() => {
|
|
438
|
-
if (!consumed
|
|
276
|
+
if (!consumed) throw new Error("Codex request authority did not admit the wire write");
|
|
439
277
|
}).catch(rejectAdmission);
|
|
440
278
|
else write();
|
|
441
279
|
} catch (error) {
|
|
@@ -444,6 +282,12 @@ function dispatchCodexRequestAttempt(attempt, options, assertTransportCurrent, w
|
|
|
444
282
|
}
|
|
445
283
|
//#endregion
|
|
446
284
|
//#region extensions/codex/src/app-server/request-attempt.ts
|
|
285
|
+
function remainingCodexRequestTime(method, signal, deadline) {
|
|
286
|
+
if (signal?.aborted) throw new CodexAppServerLocalRequestCancellationError(method, "aborted", false, signal.reason);
|
|
287
|
+
const remainingMs = deadline === void 0 ? void 0 : deadline - performance.now();
|
|
288
|
+
if (remainingMs !== void 0 && remainingMs <= 0) throw new CodexAppServerLocalRequestCancellationError(method, "timed out", false);
|
|
289
|
+
return remainingMs;
|
|
290
|
+
}
|
|
447
291
|
/** One caller per wire attempt; local waiter expiry need not imply a native response. */
|
|
448
292
|
function createCodexRequestAttempt(params) {
|
|
449
293
|
let pending = true;
|
|
@@ -475,23 +319,12 @@ function createCodexRequestAttempt(params) {
|
|
|
475
319
|
params.onSettled();
|
|
476
320
|
return true;
|
|
477
321
|
};
|
|
478
|
-
const currentWaiterError = () => {
|
|
479
|
-
if (!params.retainWritten || !waiter) return;
|
|
480
|
-
if (waiter.signal?.aborted) return {
|
|
481
|
-
error: params.cancellationError("aborted", mayHaveWritten, waiter.signal.reason),
|
|
482
|
-
outcome: "aborted"
|
|
483
|
-
};
|
|
484
|
-
if (waiter.deadline !== void 0 && performance.now() >= waiter.deadline) return {
|
|
485
|
-
error: params.cancellationError("timed out", mayHaveWritten),
|
|
486
|
-
outcome: "timed-out"
|
|
487
|
-
};
|
|
488
|
-
};
|
|
489
322
|
return {
|
|
490
323
|
method: params.method,
|
|
491
324
|
get pending() {
|
|
492
325
|
return pending;
|
|
493
326
|
},
|
|
494
|
-
wait(options
|
|
327
|
+
wait(options) {
|
|
495
328
|
const { timeoutMs, signal, overloadAttemptOrdinal } = options;
|
|
496
329
|
let observe = options.attemptWaiterFinished;
|
|
497
330
|
return new Promise((resolve, reject) => {
|
|
@@ -509,7 +342,7 @@ function createCodexRequestAttempt(params) {
|
|
|
509
342
|
timer = void 0;
|
|
510
343
|
removeAbort?.();
|
|
511
344
|
removeAbort = void 0;
|
|
512
|
-
|
|
345
|
+
finish(mayHaveWritten ? "correlation-closed" : "not-written");
|
|
513
346
|
observeAttempt({
|
|
514
347
|
kind: "waiter",
|
|
515
348
|
outcome: waiterOutcome
|
|
@@ -536,18 +369,11 @@ function createCodexRequestAttempt(params) {
|
|
|
536
369
|
},
|
|
537
370
|
reject: (error, outcome) => {
|
|
538
371
|
if (detach(outcome)) reject(error);
|
|
539
|
-
}
|
|
540
|
-
signal,
|
|
541
|
-
deadline
|
|
372
|
+
}
|
|
542
373
|
};
|
|
543
374
|
waiter = localWaiter;
|
|
544
|
-
if (params.retainWritten && deadline !== void 0 && performance.now() >= deadline) {
|
|
545
|
-
localWaiter.reject(params.cancellationError("timed out", mayHaveWritten), "timed-out");
|
|
546
|
-
return;
|
|
547
|
-
}
|
|
548
375
|
if (timeoutMs && Number.isFinite(timeoutMs) && timeoutMs > 0) {
|
|
549
|
-
|
|
550
|
-
timer = setTimeout(() => localWaiter.reject(params.cancellationError("timed out", mayHaveWritten), "timed-out"), Math.max(params.retainWritten ? 1 : 100, remaining));
|
|
376
|
+
timer = setTimeout(() => localWaiter.reject(params.cancellationError("timed out", mayHaveWritten), "timed-out"), Math.max(100, timeoutMs));
|
|
551
377
|
timer.unref?.();
|
|
552
378
|
}
|
|
553
379
|
if (signal) {
|
|
@@ -560,10 +386,7 @@ function createCodexRequestAttempt(params) {
|
|
|
560
386
|
},
|
|
561
387
|
resolve(value) {
|
|
562
388
|
if (!finish("native-ok")) return;
|
|
563
|
-
|
|
564
|
-
const error = currentWaiterError();
|
|
565
|
-
if (error) waiter?.reject(error.error, error.outcome);
|
|
566
|
-
else waiter?.resolve(value);
|
|
389
|
+
waiter?.resolve(value);
|
|
567
390
|
},
|
|
568
391
|
reject(error, definitelyNotEnqueued = false) {
|
|
569
392
|
if (finish(definitelyNotEnqueued ? "ingress-rejected" : "native-error")) {
|
|
@@ -571,9 +394,7 @@ function createCodexRequestAttempt(params) {
|
|
|
571
394
|
mayHaveWritten = false;
|
|
572
395
|
params.onIngressRejected?.();
|
|
573
396
|
}
|
|
574
|
-
params.
|
|
575
|
-
const current = currentWaiterError();
|
|
576
|
-
waiter?.reject(current?.error ?? (error instanceof CodexAppServerRpcError ? error : params.localError(error, mayHaveWritten)), current?.outcome ?? "native-error");
|
|
397
|
+
waiter?.reject(error instanceof CodexAppServerRpcError ? error : params.localError(error, mayHaveWritten), "native-error");
|
|
577
398
|
}
|
|
578
399
|
},
|
|
579
400
|
close(error) {
|
|
@@ -581,7 +402,7 @@ function createCodexRequestAttempt(params) {
|
|
|
581
402
|
},
|
|
582
403
|
failLocal(error) {
|
|
583
404
|
if (!pending) return;
|
|
584
|
-
|
|
405
|
+
finish(mayHaveWritten ? "correlation-closed" : "not-written");
|
|
585
406
|
waiter?.reject(params.localError(error, mayHaveWritten), "local-failed");
|
|
586
407
|
},
|
|
587
408
|
markWritten() {
|
|
@@ -3700,7 +3521,6 @@ function failedToolResponse(text) {
|
|
|
3700
3521
|
var client_exports = /* @__PURE__ */ __exportAll({
|
|
3701
3522
|
CodexAppServerClient: () => CodexAppServerClient,
|
|
3702
3523
|
isCodexAppServerApprovalRequest: () => isCodexAppServerApprovalRequest,
|
|
3703
|
-
isCodexAppServerConnectionClosedError: () => isCodexAppServerConnectionClosedError,
|
|
3704
3524
|
isCodexAppServerIndeterminateRequestCancellationError: () => isCodexAppServerIndeterminateRequestCancellationError,
|
|
3705
3525
|
isCodexAppServerIndeterminateTransportError: () => isCodexAppServerIndeterminateTransportError,
|
|
3706
3526
|
isCodexAppServerPrewriteRequestCancellationError: () => isCodexAppServerPrewriteRequestCancellationError,
|
|
@@ -3711,12 +3531,6 @@ var client_exports = /* @__PURE__ */ __exportAll({
|
|
|
3711
3531
|
const CODEX_APP_SERVER_STDERR_TAIL_MAX = 2e3;
|
|
3712
3532
|
const CODEX_APP_SERVER_OVERLOAD_MAX_RETRIES = 3;
|
|
3713
3533
|
const CODEX_APP_SERVER_OVERLOAD_RETRY_BASE_MS = 50;
|
|
3714
|
-
function remainingRequestTime(method, signal, deadline) {
|
|
3715
|
-
if (signal?.aborted) throw new CodexAppServerLocalRequestCancellationError(method, "aborted", false, signal.reason);
|
|
3716
|
-
const remainingMs = deadline === void 0 ? void 0 : deadline - performance.now();
|
|
3717
|
-
if (remainingMs !== void 0 && remainingMs <= 0) throw new CodexAppServerLocalRequestCancellationError(method, "timed out", false);
|
|
3718
|
-
return remainingMs;
|
|
3719
|
-
}
|
|
3720
3534
|
function isCodexAppServerRequestTimeoutError(error) {
|
|
3721
3535
|
return error instanceof Error && "code" in error && error.code === "CODEX_APP_SERVER_LOCAL_REQUEST_CANCELLED" && "reason" in error && error.reason === "timed out";
|
|
3722
3536
|
}
|
|
@@ -3743,11 +3557,6 @@ function isCodexAppServerIndeterminateTransportError(error) {
|
|
|
3743
3557
|
function hasRequestWriteState(error, code, written) {
|
|
3744
3558
|
return error instanceof Error && "code" in error && error.code === code && "mayHaveWritten" in error && error.mayHaveWritten === written;
|
|
3745
3559
|
}
|
|
3746
|
-
function isCodexAppServerConnectionClosedError(error) {
|
|
3747
|
-
if (!(error instanceof Error)) return false;
|
|
3748
|
-
if (isCodexAppServerIndeterminateTransportError(error)) return true;
|
|
3749
|
-
return error.message === "codex app-server client is closed" || error.message.startsWith("codex app-server exited:");
|
|
3750
|
-
}
|
|
3751
3560
|
var CodexAppServerClient = class CodexAppServerClient {
|
|
3752
3561
|
constructor(child) {
|
|
3753
3562
|
this.instanceId = randomUUID();
|
|
@@ -3801,7 +3610,10 @@ var CodexAppServerClient = class CodexAppServerClient {
|
|
|
3801
3610
|
headers: options?.headers ?? defaults.headers
|
|
3802
3611
|
};
|
|
3803
3612
|
if (startOptions.transport === "stdio" && startOptions.commandSource === "managed") throw new Error("Managed Codex app-server start options must be resolved before spawn.");
|
|
3804
|
-
if (startOptions.transport === "websocket" || startOptions.transport === "unix")
|
|
3613
|
+
if (startOptions.transport === "websocket" || startOptions.transport === "unix") {
|
|
3614
|
+
await assertCurrent?.();
|
|
3615
|
+
return new CodexAppServerClient(createWebSocketTransport(startOptions));
|
|
3616
|
+
}
|
|
3805
3617
|
let client;
|
|
3806
3618
|
try {
|
|
3807
3619
|
await createStdioTransport(startOptions, process.env, assertCurrent, (child) => {
|
|
@@ -3809,7 +3621,7 @@ var CodexAppServerClient = class CodexAppServerClient {
|
|
|
3809
3621
|
});
|
|
3810
3622
|
return client;
|
|
3811
3623
|
} catch (error) {
|
|
3812
|
-
assertCurrent?.();
|
|
3624
|
+
await assertCurrent?.();
|
|
3813
3625
|
if (client?.transportExited && hasCodexAppServerNaturalExit(client.child)) throw client.child.startupFailure?.error ?? buildCodexAppServerExitError(client.child.exitCode, client.child.signalCode, client.stderrTail);
|
|
3814
3626
|
const stderr = client?.getStderrDiagnostic();
|
|
3815
3627
|
throw stderr ? new Error(`${coerceErrorMessage(error)}; stderr=${JSON.stringify(stderr)}`, { cause: error }) : error;
|
|
@@ -3847,6 +3659,10 @@ var CodexAppServerClient = class CodexAppServerClient {
|
|
|
3847
3659
|
getInitializeDiagnostic(beforeClientClose = false) {
|
|
3848
3660
|
return this.initializeDiagnostics.snapshot(this.closed, beforeClientClose);
|
|
3849
3661
|
}
|
|
3662
|
+
/** Outstanding methods across this physical client, including peer turns; never arguments. */
|
|
3663
|
+
getPendingRequestMethods() {
|
|
3664
|
+
return [...new Set([...this.pending.values()].map(({ method }) => method))].toSorted();
|
|
3665
|
+
}
|
|
3850
3666
|
getServerVersion() {
|
|
3851
3667
|
return this.runtimeIdentity?.serverVersion;
|
|
3852
3668
|
}
|
|
@@ -3869,11 +3685,6 @@ var CodexAppServerClient = class CodexAppServerClient {
|
|
|
3869
3685
|
getModelCatalogRevision() {
|
|
3870
3686
|
return this.modelCatalogRevision;
|
|
3871
3687
|
}
|
|
3872
|
-
/** Installs the spawn-owner guard and retirement for config-loading thread requests. */
|
|
3873
|
-
setThreadSessionRequestGuard(guard, retireAfterIndeterminateRequest) {
|
|
3874
|
-
this.threadSessionRequestGuard = guard;
|
|
3875
|
-
this.retireAfterIndeterminateThreadRequest = retireAfterIndeterminateRequest;
|
|
3876
|
-
}
|
|
3877
3688
|
/** Returns the local transport PID for scoped child-process cleanup, when available. */
|
|
3878
3689
|
getTransportPid() {
|
|
3879
3690
|
return this.child.pid;
|
|
@@ -3885,95 +3696,35 @@ var CodexAppServerClient = class CodexAppServerClient {
|
|
|
3885
3696
|
const options = optionsInput ?? {};
|
|
3886
3697
|
if (this.closed) return Promise.reject(this.closeError ?? /* @__PURE__ */ new Error("codex app-server client is closed"));
|
|
3887
3698
|
if (options.signal?.aborted) return Promise.reject(new CodexAppServerLocalRequestCancellationError(method, "aborted", false, options.signal?.reason));
|
|
3888
|
-
const guard = method === "thread/start" || method === "thread/resume" || method === "thread/fork" ? this.threadSessionRequestGuard : void 0;
|
|
3889
|
-
if (guard) {
|
|
3890
|
-
const retire = this.retireAfterIndeterminateThreadRequest;
|
|
3891
|
-
if (!options.signal && !(options.timeoutMs !== void 0 && Number.isFinite(options.timeoutMs) && options.timeoutMs > 0)) return Promise.reject(/* @__PURE__ */ new TypeError(`${method} requires a positive finite timeout or abort signal`));
|
|
3892
|
-
return (async () => {
|
|
3893
|
-
const guardStartedAt = performance.now();
|
|
3894
|
-
const timeoutMessage = `${method} timed out`;
|
|
3895
|
-
const abortMessage = `${method} aborted`;
|
|
3896
|
-
let releaseGuard;
|
|
3897
|
-
try {
|
|
3898
|
-
releaseGuard = await guard({
|
|
3899
|
-
signal: options.signal,
|
|
3900
|
-
timeoutMs: options.timeoutMs,
|
|
3901
|
-
timeoutMessage,
|
|
3902
|
-
abortMessage
|
|
3903
|
-
});
|
|
3904
|
-
} catch (error) {
|
|
3905
|
-
if (error instanceof Error && error.message === timeoutMessage) throw new CodexAppServerLocalRequestCancellationError(method, "timed out", false);
|
|
3906
|
-
if (error instanceof Error && error.message === abortMessage) throw new CodexAppServerLocalRequestCancellationError(method, "aborted", false, options.signal?.reason);
|
|
3907
|
-
throw error;
|
|
3908
|
-
}
|
|
3909
|
-
let released = false;
|
|
3910
|
-
let removeExitHandler;
|
|
3911
|
-
const release = () => {
|
|
3912
|
-
if (released) return;
|
|
3913
|
-
released = true;
|
|
3914
|
-
removeExitHandler?.();
|
|
3915
|
-
releaseGuard();
|
|
3916
|
-
};
|
|
3917
|
-
let releaseWhenRequestSettles = true;
|
|
3918
|
-
let requestMayHaveWritten = false;
|
|
3919
|
-
let nativeResponded = false;
|
|
3920
|
-
try {
|
|
3921
|
-
const elapsedMs = performance.now() - guardStartedAt;
|
|
3922
|
-
const remainingTimeoutMs = options.timeoutMs === void 0 ? void 0 : options.timeoutMs - elapsedMs;
|
|
3923
|
-
if (remainingTimeoutMs !== void 0 && remainingTimeoutMs <= 0) throw new CodexAppServerLocalRequestCancellationError(method, "timed out", false);
|
|
3924
|
-
return await this.requestWithOverloadRetry(method, params, {
|
|
3925
|
-
...options,
|
|
3926
|
-
...remainingTimeoutMs !== void 0 ? { timeoutMs: remainingTimeoutMs } : {}
|
|
3927
|
-
}, (mayHaveWritten) => {
|
|
3928
|
-
requestMayHaveWritten = mayHaveWritten;
|
|
3929
|
-
nativeResponded = !mayHaveWritten;
|
|
3930
|
-
}, () => {
|
|
3931
|
-
nativeResponded = true;
|
|
3932
|
-
if (!releaseWhenRequestSettles) release();
|
|
3933
|
-
});
|
|
3934
|
-
} catch (error) {
|
|
3935
|
-
if (requestMayHaveWritten && !(error instanceof CodexAppServerRpcError)) {
|
|
3936
|
-
releaseWhenRequestSettles = false;
|
|
3937
|
-
if (nativeResponded) release();
|
|
3938
|
-
else removeExitHandler = this.addTransportExitHandler(release);
|
|
3939
|
-
if (!retire?.()) await this.closeAndRunAfterExit(release, method);
|
|
3940
|
-
}
|
|
3941
|
-
throw error;
|
|
3942
|
-
} finally {
|
|
3943
|
-
if (releaseWhenRequestSettles) release();
|
|
3944
|
-
}
|
|
3945
|
-
})();
|
|
3946
|
-
}
|
|
3947
3699
|
return this.requestWithOverloadRetry(method, params, options);
|
|
3948
3700
|
}
|
|
3949
|
-
async requestWithOverloadRetry(method, params, options
|
|
3701
|
+
async requestWithOverloadRetry(method, params, options) {
|
|
3950
3702
|
const deadline = options.timeoutMs !== void 0 && Number.isFinite(options.timeoutMs) ? performance.now() + options.timeoutMs : void 0;
|
|
3951
3703
|
for (let retry = 0;; retry += 1) {
|
|
3952
|
-
const remainingTimeoutMs =
|
|
3704
|
+
const remainingTimeoutMs = remainingCodexRequestTime(method, options.signal, deadline);
|
|
3953
3705
|
try {
|
|
3954
3706
|
return await this.requestOnce(method, params, {
|
|
3955
3707
|
...options,
|
|
3956
3708
|
...remainingTimeoutMs !== void 0 ? { timeoutMs: remainingTimeoutMs } : {}
|
|
3957
|
-
}, retry + 1,
|
|
3709
|
+
}, retry + 1, deadline);
|
|
3958
3710
|
} catch (error) {
|
|
3959
3711
|
if (!isCodexAppServerOverloadError(error) || retry >= CODEX_APP_SERVER_OVERLOAD_MAX_RETRIES) throw error;
|
|
3960
|
-
onWriteStateChange?.(false);
|
|
3961
3712
|
const backoffMs = Math.round(CODEX_APP_SERVER_OVERLOAD_RETRY_BASE_MS * 2 ** retry * (.75 + Math.random() * .5));
|
|
3962
3713
|
await this.waitForOverloadRetry(method, backoffMs, deadline, options.signal);
|
|
3963
3714
|
}
|
|
3964
3715
|
}
|
|
3965
3716
|
}
|
|
3966
3717
|
async waitForOverloadRetry(method, backoffMs, deadline, signal) {
|
|
3967
|
-
const remainingMs =
|
|
3718
|
+
const remainingMs = remainingCodexRequestTime(method, signal, deadline);
|
|
3968
3719
|
const delayMs = remainingMs === void 0 ? backoffMs : Math.min(backoffMs, remainingMs);
|
|
3969
3720
|
try {
|
|
3970
3721
|
await sleepWithAbort(delayMs, signal, { ref: false });
|
|
3971
3722
|
} catch (error) {
|
|
3972
|
-
|
|
3723
|
+
remainingCodexRequestTime(method, signal);
|
|
3973
3724
|
throw error;
|
|
3974
3725
|
}
|
|
3975
3726
|
}
|
|
3976
|
-
requestOnce(method, params, options, overloadAttemptOrdinal,
|
|
3727
|
+
requestOnce(method, params, options, overloadAttemptOrdinal, deadline) {
|
|
3977
3728
|
if (this.closed) return Promise.reject(this.closeError ?? /* @__PURE__ */ new Error("codex app-server client is closed"));
|
|
3978
3729
|
const id = codexCatalogRequestId(method, params, this.nextId++, options.catalogPreview);
|
|
3979
3730
|
if (method === "account/login/start" || method === "account/logout" || method === "config/value/write" || method === "config/batchWrite") this.modelCatalogRevision += 1;
|
|
@@ -3985,16 +3736,11 @@ var CodexAppServerClient = class CodexAppServerClient {
|
|
|
3985
3736
|
const initialize = method === "initialize" ? this.initializeObservation?.attempt(overloadAttemptOrdinal) : void 0;
|
|
3986
3737
|
const attempt = createCodexRequestAttempt({
|
|
3987
3738
|
method,
|
|
3988
|
-
retainWritten: onResponse !== void 0,
|
|
3989
3739
|
observe: initialize?.observe,
|
|
3990
3740
|
...method === "thread/list" ? { diagnosticIdentity: {
|
|
3991
3741
|
clientInstanceId: this.instanceId,
|
|
3992
3742
|
rpcId: id
|
|
3993
3743
|
} } : {},
|
|
3994
|
-
onResponse: onResponse ? (mayHaveWritten) => {
|
|
3995
|
-
onWriteStateChange?.(mayHaveWritten);
|
|
3996
|
-
onResponse();
|
|
3997
|
-
} : void 0,
|
|
3998
3744
|
onIngressRejected: options.onIngressRejected,
|
|
3999
3745
|
onSettled: () => {
|
|
4000
3746
|
if (this.pending.get(id) === attempt) this.pending.delete(id);
|
|
@@ -4010,15 +3756,12 @@ var CodexAppServerClient = class CodexAppServerClient {
|
|
|
4010
3756
|
const result = attempt.wait({
|
|
4011
3757
|
...options,
|
|
4012
3758
|
overloadAttemptOrdinal
|
|
4013
|
-
}
|
|
3759
|
+
});
|
|
4014
3760
|
dispatchCodexRequestAttempt(attempt, options, () => {
|
|
4015
3761
|
if (this.closed) throw this.closeError ?? /* @__PURE__ */ new Error("codex app-server client is closed");
|
|
4016
|
-
|
|
3762
|
+
remainingCodexRequestTime(method, options.signal, deadline);
|
|
4017
3763
|
}, () => {
|
|
4018
|
-
this.writeMessage(message, (error) => attempt.failLocal(error), () =>
|
|
4019
|
-
attempt.markWritten();
|
|
4020
|
-
onWriteStateChange?.(true);
|
|
4021
|
-
}, initialize?.writeResult);
|
|
3764
|
+
this.writeMessage(message, (error) => attempt.failLocal(error), () => attempt.markWritten(), initialize?.writeResult);
|
|
4022
3765
|
});
|
|
4023
3766
|
return result;
|
|
4024
3767
|
}
|
|
@@ -4065,19 +3808,6 @@ var CodexAppServerClient = class CodexAppServerClient {
|
|
|
4065
3808
|
await this.serverRequestsClosed;
|
|
4066
3809
|
await this.catalogWorkerClosed;
|
|
4067
3810
|
}
|
|
4068
|
-
/** Closes this transport and runs cleanup only after physical process exit. */
|
|
4069
|
-
async closeAndRunAfterExit(onExit, operation) {
|
|
4070
|
-
this.addTransportExitHandler(onExit);
|
|
4071
|
-
if (this.transportExited) return;
|
|
4072
|
-
try {
|
|
4073
|
-
await this.closeAndWait();
|
|
4074
|
-
} catch (closeError) {
|
|
4075
|
-
embeddedAgentLog.warn("codex app-server shutdown after indeterminate request failed", {
|
|
4076
|
-
closeError,
|
|
4077
|
-
operation
|
|
4078
|
-
});
|
|
4079
|
-
}
|
|
4080
|
-
}
|
|
4081
3811
|
/** Protect private loopback route capabilities before native diagnostics can mention them. */
|
|
4082
3812
|
protectPrivateTransportSecret(secret) {
|
|
4083
3813
|
if (!/^[A-Za-z0-9_-]{43}$/.test(secret) || this.privateTransportSecrets.size >= 8) {
|
|
@@ -4163,4 +3893,4 @@ function isCodexAppServerApprovalRequest(method) {
|
|
|
4163
3893
|
return CODEX_APP_SERVER_APPROVAL_REQUEST_METHODS.has(method);
|
|
4164
3894
|
}
|
|
4165
3895
|
//#endregion
|
|
4166
|
-
export {
|
|
3896
|
+
export { failedToolResult as A, createCodexElicitationResponse as C, toCodexDynamicToolProtocolResponse as D, toCodexDynamicToolProgressResponse as E, getCodexAppServerClientInstanceId as M, isCodexAppServerBrokenPipeError as N, resolveCodexToolAbortTerminalReason as O, resolveCodexAppServerClientInstanceId as P, resolveCodexThreadRolloutPath as S, resolveDynamicToolCallTimeoutMs as T, assertExactSupervisionModelSelection as _, isCodexAppServerIndeterminateTransportError as a, readCodexTurnCompletedNotification as b, CodexServerRequestResolvedError as c, assertCodexPassiveTurnItems as d, assertCodexThreadAcceptsDirectInput as f, assertCodexTurnStartResponse as g, assertCodexThreadStartResponse as h, isCodexAppServerIndeterminateRequestCancellationError as i, readCodexAppServerWarningMessage as j, createFailedDynamicToolResponse as k, CodexThreadDirectInputError as l, assertCodexThreadResumeResponse as m, client_exports as n, isCodexAppServerPrewriteRequestCancellationError as o, assertCodexThreadForkResponse as p, isCodexAppServerApprovalRequest as r, isCodexAppServerRequestTimeoutError as s, CodexAppServerClient as t, assertCodexModelListResponse as u, readCodexDynamicToolCallParams as v, handleDynamicToolCallWithTimeout as w, readSupervisionResponseThreadId as x, readCodexErrorNotification as y };
|
package/dist/.setup/{client-catalog-response-Du2GmrOV.mjs → client-catalog-response-jM38o5w1.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as projectCodexCatalogNativeResponse, r as projectCodexCatalogNativeThread } from "./session-catalog-native-projection-
|
|
1
|
+
import { r as isJsonObject } from "./protocol-CaPAVwe9.mjs";
|
|
2
|
+
import { n as projectCodexCatalogNativeResponse, r as projectCodexCatalogNativeThread } from "./session-catalog-native-projection-G3lSDYYG.mjs";
|
|
3
3
|
import { embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-registration";
|
|
4
4
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
5
5
|
import { sanitizeTerminalText } from "openclaw/plugin-sdk/text-chunking";
|