@openclaw/codex 2026.10.7 → 2026.10.9
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 +2 -0
- package/dist/.setup/{account-usage-runtime-gzHf_Qtb.mjs → account-usage-runtime-DAt_3QG0.mjs} +3 -3
- package/dist/.setup/{app-server-policy-V8zuN8q_.mjs → app-server-policy-CF-JwGUD.mjs} +1 -1
- package/dist/.setup/{apply-BaBl0hiG.mjs → apply-DmhHTC5c.mjs} +8 -8
- package/dist/.setup/{attempt-client-cleanup-jWVRH043.mjs → attempt-client-cleanup-DQBa7iiq.mjs} +5 -5
- package/dist/.setup/{attempt-workspace-context-BkA0W8Jy.mjs → attempt-workspace-context-EAeScFrg.mjs} +1 -1
- package/dist/.setup/{auth-binding-BFTkrP_b.mjs → auth-binding-D1TJwzWf.mjs} +1 -1
- package/dist/.setup/{auth-cache-key-DrieYJUQ.mjs → auth-cache-key-KogLtj0t.mjs} +3 -3
- package/dist/.setup/{binding-connection-C0t9TBX_.mjs → binding-connection-BIo1-hoT.mjs} +2 -2
- package/dist/.setup/{binding-connection.runtime-Wdm5G_bw.mjs → binding-connection.runtime-C5yDsKBQ.mjs} +1 -1
- package/dist/.setup/{bounded-turn-s9yVsxaM.mjs → bounded-turn-B91suzbV.mjs} +11 -11
- package/dist/.setup/{bounded-turn-isolation-CIQJykuM.mjs → bounded-turn-isolation-BRNgfoRl.mjs} +2 -2
- package/dist/.setup/{build-state-B5mKL-in.mjs → build-state-CvGKuaeP.mjs} +1 -1
- package/dist/.setup/{client-BM97zH3z.mjs → client-CafYfF2n.mjs} +311 -24
- package/dist/.setup/{command-dispatch-DsaWfzET.mjs → command-dispatch-C2tNChTq.mjs} +1 -1
- package/dist/.setup/{command-handlers-zgDE_J40.mjs → command-handlers-yb5vwwrx.mjs} +22 -22
- package/dist/.setup/{command-rpc-CAG1xrqm.mjs → command-rpc-CZmpQF4z.mjs} +11 -11
- package/dist/.setup/{compact-BZK-e5zD.mjs → compact-CeD2d2_k.mjs} +13 -13
- package/dist/.setup/{computer-use-CZhx4nNO.mjs → computer-use-C4HhkAcj.mjs} +7 -7
- package/dist/.setup/{config-LQemoqTL.mjs → config-d0gOFYEk.mjs} +2 -2
- package/dist/.setup/{config-runtime-DGB1-VbB.mjs → config-runtime-BUH-IDVE.mjs} +1 -1
- package/dist/.setup/{conversation-binding-qGuQR4jw.mjs → conversation-binding-HX8U8A3K.mjs} +15 -15
- package/dist/.setup/{conversation-binding-data-GRGSgAro.mjs → conversation-binding-data-BqzGWkPW.mjs} +1 -1
- package/dist/.setup/{conversation-control-BtPxevoK.mjs → conversation-control-D5qVEey9.mjs} +3 -3
- package/dist/.setup/{doctor-start-options-C28ek2hD.mjs → doctor-start-options-DyLrwtq-.mjs} +3 -3
- package/dist/.setup/{dynamic-tool-build-Dp4v52Kl.mjs → dynamic-tool-build-BPkHfpul.mjs} +3 -3
- package/dist/.setup/{dynamic-tools-C1Egdhrx.mjs → dynamic-tools-CCezdz5n.mjs} +8 -8
- package/dist/.setup/{effective-mcp-catalog-BNwgItdW.mjs → effective-mcp-catalog-SjTJ-F2i.mjs} +6 -6
- package/dist/.setup/{ephemeral-turn-DeppK8zz.mjs → ephemeral-turn-CgKjGBaW.mjs} +2 -2
- package/dist/.setup/{inference-proxy-DSnaS-uS.mjs → inference-proxy-BZgN5W8m.mjs} +3 -3
- package/dist/.setup/{isolated-completion-BUS9Mqfm.mjs → isolated-completion-C5ifbI0F.mjs} +5 -5
- package/dist/.setup/{managed-binary-DwC9wxch.mjs → managed-binary-Boj8_lWV.mjs} +1 -1
- package/dist/.setup/{mcp-app-session-preparation-D9F1O5si.mjs → mcp-app-session-preparation-hnw_eGnR.mjs} +8 -8
- package/dist/.setup/{model-catalog-BBg4thof.mjs → model-catalog-BO573-NN.mjs} +7 -7
- package/dist/.setup/{models-B65GHU4g.mjs → models-Dw0qUZl3.mjs} +3 -3
- package/dist/.setup/native-assignment-repair-BjS4uyQr.mjs +162 -0
- package/dist/.setup/{native-auth-CveRfTpz.mjs → native-auth-TAGxZP-r.mjs} +3 -3
- package/dist/.setup/{native-hook-relay-Ctyky2Qt.mjs → native-hook-relay-CwkDznGH.mjs} +4 -4
- package/dist/.setup/{native-mcp-app-DprMGBqj.mjs → native-mcp-app-B7N--ols.mjs} +5 -5
- package/dist/.setup/{native-skill-isolation-C4XYLm33.mjs → native-skill-isolation-0pEyxLRX.mjs} +3 -3
- package/dist/.setup/{native-subagent-monitor-CJaIve3h.mjs → native-subagent-monitor-D_tvjJxa.mjs} +161 -53
- package/dist/.setup/{native-subagent-pending-assignments-DmVhedNs.mjs → native-subagent-pending-assignments-BAOzwy85.mjs} +49 -11
- package/dist/.setup/{native-task-assignments-DYL9uxNe.mjs → native-task-assignments-Dap5NqiR.mjs} +4 -4
- package/dist/.setup/{node-cli-sessions-BxVYZNuY.mjs → node-cli-sessions-BQNAFnCa.mjs} +2 -2
- package/dist/.setup/{node-exec-server.runtime-8RehgPdQ.mjs → node-exec-server.runtime-B-4ogz9C.mjs} +2 -2
- package/dist/.setup/{plan-GqWF4XGA.mjs → plan-BE7gWwkn.mjs} +5 -5
- package/dist/.setup/{plugin-activation-BgfNFH2L.mjs → plugin-activation-Dbq2m2gh.mjs} +2 -2
- package/dist/.setup/{plugin-approval-roundtrip-x7UI_uqk.mjs → plugin-approval-roundtrip-ts-2EU8i.mjs} +1 -1
- package/dist/.setup/{plugin-inventory-OhiCoyPH.mjs → plugin-inventory-CZLnMaxf.mjs} +1 -1
- package/dist/.setup/{project-doc-thread-config-D_sWbxFR.mjs → project-doc-thread-config-BYFXSVGk.mjs} +3 -3
- package/dist/.setup/{provider-Bi9QCsg1.mjs → provider-D8R-IBhv.mjs} +4 -4
- package/dist/.setup/{provider-capabilities-BCZeV7xZ.mjs → provider-capabilities-C4ENlstc.mjs} +10 -3
- package/dist/.setup/{request-XC1RG34l.mjs → request-ufWmJNN1.mjs} +5 -5
- package/dist/.setup/{run-attempt-8U2CrqjW.mjs → run-attempt-CGHsrfPB.mjs} +131 -60
- package/dist/.setup/{runtime-artifact-CCPLKFGR.mjs → runtime-artifact-Ch7fCcgJ.mjs} +3 -3
- package/dist/.setup/{runtime-artifact-connection-dFoSOKy7.mjs → runtime-artifact-connection-C3ootnwd.mjs} +2 -2
- package/dist/.setup/{sandbox-guard-Cf9XMRrg.mjs → sandbox-guard-CwOc36_1.mjs} +1 -1
- package/dist/.setup/{session-binding-BDnNz-Co.mjs → session-binding-_RE7vtVN.mjs} +38 -12
- package/dist/.setup/{session-binding-record-C2kDBZhx.mjs → session-binding-record-O62ZRFhy.mjs} +2 -2
- package/dist/.setup/{session-binding-sidecars-DijNZb31.mjs → session-binding-sidecars-CAHe3enw.mjs} +1 -1
- package/dist/.setup/{session-catalog-adoption-Cl6fHxS5.mjs → session-catalog-adoption-DuChFASf.mjs} +5 -5
- package/dist/.setup/{session-catalog-archive-CUU7jEkO.mjs → session-catalog-archive-Bs5cP3zm.mjs} +5 -5
- package/dist/.setup/{session-catalog-events-CpEyDv0D.mjs → session-catalog-events-DnLfF9Xo.mjs} +4 -4
- package/dist/.setup/{session-catalog-index-DpYCf1-8.mjs → session-catalog-index-Bbph2EwS.mjs} +8 -8
- package/dist/.setup/{session-catalog-index-order-B30rjUEJ.mjs → session-catalog-index-order-CTSrDiE1.mjs} +1 -1
- package/dist/.setup/{session-catalog-limits-Daqt3JLk.mjs → session-catalog-limits-9Ay62KQ0.mjs} +1 -1
- package/dist/.setup/{session-catalog-list-request-SJyGz02j.mjs → session-catalog-list-request-uKKvUIoN.mjs} +3 -3
- package/dist/.setup/{session-catalog-native-projection-BYV0ICja.mjs → session-catalog-native-projection-CHtG8DwY.mjs} +4 -4
- package/dist/.setup/{session-catalog-node-adoption-D11N0CMr.mjs → session-catalog-node-adoption-BjYvYtAd.mjs} +2 -2
- package/dist/.setup/{session-catalog-node-continue-Ct62GeL1.mjs → session-catalog-node-continue-BEI9D3ev.mjs} +5 -5
- package/dist/.setup/{session-catalog-node-lookup-DQVe6vhs.mjs → session-catalog-node-lookup-CBomNvUN.mjs} +2 -2
- package/dist/.setup/{session-catalog-parsing-B4OyhylL.mjs → session-catalog-parsing-DmZmgRou.mjs} +1 -1
- package/dist/.setup/{session-catalog-projection-B0IyXrHt.mjs → session-catalog-projection-BgENBUS2.mjs} +4 -4
- package/dist/.setup/{session-catalog-source-CfIBVrbT.mjs → session-catalog-source-qHe5r9i_.mjs} +1 -1
- package/dist/.setup/{session-cli-BoJSZfGd.mjs → session-cli-CKzNw4c4.mjs} +2 -2
- package/dist/.setup/{session-history-import-DgwRu2eD.mjs → session-history-import-BhOzqhyI.mjs} +4 -4
- package/dist/.setup/{session-history.worker-DJQfek5p.mjs → session-history.worker-D2v5yRcB.mjs} +5 -3
- package/dist/.setup/{session-initialization-BjVtsTzi.mjs → session-initialization-Bwe0Bikj.mjs} +1 -1
- package/dist/.setup/{session-retirement-CKIS7jFv.mjs → session-retirement-BdHruV7q.mjs} +6 -6
- package/dist/.setup/{settled-turn-finalizer-CnIWbqN7.mjs → settled-turn-finalizer-Ca_Qd_9g.mjs} +5 -5
- package/dist/.setup/{shared-client-AdQX0Tdq.mjs → shared-client-C0gEybHs.mjs} +15 -13
- package/dist/.setup/{side-question-ZVehuPZn.mjs → side-question-Nn6D01tP.mjs} +17 -17
- package/dist/.setup/{source-BszpKEvi.mjs → source-CgYvv2h-.mjs} +4 -4
- package/dist/.setup/{thread-lifecycle-run-DezS4UNT.mjs → thread-lifecycle-run-BHM-L-56.mjs} +40 -19
- package/dist/.setup/{thread-ownership-OXzPB_RV.mjs → thread-ownership-BJpeo5Xk.mjs} +4 -4
- package/dist/.setup/{thread-policy-Dp4CQjdL.mjs → thread-policy-BlzkKVno.mjs} +3 -3
- package/dist/.setup/{thread-requests-DjyDmCo4.mjs → thread-requests-pX9_RXpU.mjs} +2 -2
- package/dist/.setup/{thread-resume-8YKfRoX6.mjs → thread-resume-BDd8b3E_.mjs} +4 -4
- package/dist/.setup/{transcript-mirror-DVEzdOs0.mjs → transcript-mirror-CPdcVWTn.mjs} +1 -1
- package/dist/.setup/{transport-stdio-lgeKKHyw.mjs → transport-stdio-BsXQmXll.mjs} +1 -1
- package/dist/.setup/{transport-websocket-CEBjEtFP.mjs → transport-websocket-B5mq2Iq2.mjs} +1 -1
- package/dist/.setup/{turn-router-DnfbVPvu.mjs → turn-router-8CkGlezp.mjs} +2 -2
- package/dist/.setup/{upstream-session-fork-BhADVCrb.mjs → upstream-session-fork-BW_UbivO.mjs} +17 -17
- package/dist/.setup/{usage-BoTUkAoJ.mjs → usage-fX3ctGZb.mjs} +3 -3
- package/dist/.setup/{usage-limit-error-EoQ7Vl2A.mjs → usage-limit-error-DycN7mED.mjs} +1 -1
- package/dist/.setup/{web-search-provider.runtime-Cc6vN-2C.mjs → web-search-provider.runtime-DEBVJch2.mjs} +2 -2
- package/dist/.setup/{workspace-write-sandbox-probe-DvfWTvuR.mjs → workspace-write-sandbox-probe-DB6Y3XLX.mjs} +2 -2
- package/dist/.source-module-urls/0560e3825cf513bbe9e095a85951c1215dfced0c1e581c5f32b007a3e759636e.json +1 -0
- package/dist/.source-module-urls/61f8912a558f2bfc87dcddd651d7f5d3cf17ba02e1e5359b050bf670840c0e0e.json +1 -0
- package/dist/api.js +3 -3
- package/dist/catalog-page.worker.js +340 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/doctor-contract-api.js +14 -5
- package/dist/harness.js +20 -20
- package/dist/index.js +68 -58
- package/dist/media-understanding-provider.js +2 -2
- package/dist/migration-provider-api.js +1 -1
- package/dist/provider-discovery.js +1 -1
- package/dist/session-history-worker-runtime.js +4 -2
- package/dist/session-history.worker.js +1 -1
- package/openclaw.plugin.json +5 -0
- package/package.json +4 -4
- package/dist/.setup/client-catalog-response-DhB266B_.mjs +0 -310
package/README.md
CHANGED
|
@@ -44,6 +44,8 @@ When assembled context bootstraps a Codex thread, redacted tool payloads retain
|
|
|
44
44
|
|
|
45
45
|
Settled-turn finalization uses the same configured Codex App Server transport as the supervised conversation. Remote websocket App Server configurations stay on their configured transport. Managed user-home stdio launches running inside an Agent home, and not through the proxy launcher, use a private stdio side turn for native-tool isolation. The bounded finalizer preserves the selected model, provider, and native authorization returned by Codex, and rejects native tool evidence outside the finalization contract. It may mirror a final answer after completed tool work; it does not diagnose why a model omitted a visible final message.
|
|
46
46
|
|
|
47
|
+
An internal system turn that mirrors no prompt and has no transcript recorder, such as the stranded-reply retry after a `message_tool_only` final, anchors its evidence at the turn's first mirrored row; the user turn that produced it stays prior context and is never borrowed as the turn's prompt.
|
|
48
|
+
|
|
47
49
|
When settled-turn recovery rejects history, the `codex settled-turn finalization context capture failed` warning includes a stable `reason`, such as `item_limit`, `byte_limit`, `field_limit`, `unsupported_user_image`, or `snapshot_invalidated`. Unknown failures use `history_read_failed`. The warning excludes transcript content and exception text. Rejected history remains unavailable for finalization, and completed actions are never replayed.
|
|
48
50
|
|
|
49
51
|
See the [Codex harness](https://docs.openclaw.ai/plugins/codex-harness) and [Codex supervision](https://docs.openclaw.ai/plugins/codex-supervision) guides.
|
package/dist/.setup/{account-usage-runtime-gzHf_Qtb.mjs → account-usage-runtime-DAt_3QG0.mjs}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as isCodexAppServerProxyLaunch } from "./launch-args-DbFCehO7.mjs";
|
|
2
2
|
import { t as buildCodexAppServerUsageSnapshot } from "./rate-limits-CI8pTPqL.mjs";
|
|
3
|
-
import { t as readCodexAppServerUsage } from "./request-
|
|
4
|
-
import "./config-
|
|
5
|
-
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-
|
|
3
|
+
import { t as readCodexAppServerUsage } from "./request-ufWmJNN1.mjs";
|
|
4
|
+
import "./config-d0gOFYEk.mjs";
|
|
5
|
+
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-BUH-IDVE.mjs";
|
|
6
6
|
import { a as resolveCodexAppServerAuthProfileStore } from "./auth-profile-CgHQ8Vot.mjs";
|
|
7
7
|
import { isDeepStrictEqual } from "node:util";
|
|
8
8
|
import { listAgentIds, resolveAgentDir } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as canUseCodexModelBackedApprovalsReviewerForModel } from "./config-
|
|
1
|
+
import { n as canUseCodexModelBackedApprovalsReviewerForModel } from "./config-d0gOFYEk.mjs";
|
|
2
2
|
//#region extensions/codex/src/app-server/app-server-policy.ts
|
|
3
3
|
function resolveCodexAppServerForModelProvider(params) {
|
|
4
4
|
return params.appServer.approvalsReviewer === "user" || canUseCodexModelBackedApprovalsReviewerForModel({
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { s as resolveCodexAppServerFallbackApiKeyCacheKey } from "./auth-cache-key-
|
|
1
|
+
import { s as resolveCodexAppServerFallbackApiKeyCacheKey } from "./auth-cache-key-KogLtj0t.mjs";
|
|
2
2
|
import { a as defaultCodexAppInventoryCache, r as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-Bg9DbDI6.mjs";
|
|
3
|
-
import { r as requestCodexAppServerJson } from "./request-
|
|
4
|
-
import { r as isOpenAiCuratedMarketplaceName, u as CODEX_PLUGINS_MARKETPLACE_NAME } from "./plugin-inventory-
|
|
5
|
-
import "./config-
|
|
6
|
-
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-
|
|
3
|
+
import { r as requestCodexAppServerJson } from "./request-ufWmJNN1.mjs";
|
|
4
|
+
import { r as isOpenAiCuratedMarketplaceName, u as CODEX_PLUGINS_MARKETPLACE_NAME } from "./plugin-inventory-CZLnMaxf.mjs";
|
|
5
|
+
import "./config-d0gOFYEk.mjs";
|
|
6
|
+
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-BUH-IDVE.mjs";
|
|
7
7
|
import { i as resolveCodexAppServerAuthProfileIdForAgent } from "./auth-profile-CgHQ8Vot.mjs";
|
|
8
|
-
import { c as getLeasedSharedCodexAppServerClient, h as releaseLeasedSharedCodexAppServerClient, it as resolveCodexAppServerAuthAccountCacheKey, o as clearSharedCodexAppServerClientIfCurrentAndWait } from "./shared-client-
|
|
9
|
-
import { t as ensureCodexPluginActivation } from "./plugin-activation-
|
|
10
|
-
import { CODEX_PLUGIN_CONFIG_PATH, buildCodexMigrationPlan, buildCodexPluginsConfigValue, hasCodexPluginConfigConflict, n as resolveCodexConfigPatchMode, readCodexPluginMigrationConfigEntry, t as createCodexAuthItemApplier } from "./plan-
|
|
8
|
+
import { c as getLeasedSharedCodexAppServerClient, h as releaseLeasedSharedCodexAppServerClient, it as resolveCodexAppServerAuthAccountCacheKey, o as clearSharedCodexAppServerClientIfCurrentAndWait } from "./shared-client-C0gEybHs.mjs";
|
|
9
|
+
import { t as ensureCodexPluginActivation } from "./plugin-activation-Dbq2m2gh.mjs";
|
|
10
|
+
import { CODEX_PLUGIN_CONFIG_PATH, buildCodexMigrationPlan, buildCodexPluginsConfigValue, hasCodexPluginConfigConflict, n as resolveCodexConfigPatchMode, readCodexPluginMigrationConfigEntry, t as createCodexAuthItemApplier } from "./plan-BE7gWwkn.mjs";
|
|
11
11
|
import { uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
12
12
|
import { parseStrictNonNegativeInteger } from "openclaw/plugin-sdk/number-runtime";
|
|
13
13
|
import path from "node:path";
|
package/dist/.setup/{attempt-client-cleanup-jWVRH043.mjs → attempt-client-cleanup-DQBa7iiq.mjs}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { I as isCodexAppServerBrokenPipeError, c as isCodexAppServerRequestTimeoutError } from "./client-CafYfF2n.mjs";
|
|
2
|
+
import { w as retireSharedCodexAppServerClientIfCurrent } from "./auth-cache-key-KogLtj0t.mjs";
|
|
2
3
|
import { a as codexPrewriteRejectionCause, o as isCodexAppServerOverloadError, r as CodexAppServerRpcError } from "./rpc-error-C98SHchT.mjs";
|
|
3
|
-
import { X as unsubscribeCodexAppServerLiveThread, gt as isCodexAppServerStartupError, u as isCodexAppServerStartSelectionChangedError } from "./shared-client-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { t as __exportAll } from "./session-binding-sidecars-DijNZb31.mjs";
|
|
4
|
+
import { X as unsubscribeCodexAppServerLiveThread, gt as isCodexAppServerStartupError, u as isCodexAppServerStartSelectionChangedError } from "./shared-client-C0gEybHs.mjs";
|
|
5
|
+
import { n as getCodexAppServerTurnRouter } from "./turn-router-8CkGlezp.mjs";
|
|
6
|
+
import { t as __exportAll } from "./session-binding-sidecars-CAHe3enw.mjs";
|
|
7
7
|
import { createDeferred } from "openclaw/plugin-sdk/extension-shared";
|
|
8
8
|
import { AgentHarnessPreflightError, embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
9
9
|
//#region extensions/codex/src/app-server/attempt-client-cleanup.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as flattenCodexDynamicToolFunctions } from "./protocol-CANUwXJ3.mjs";
|
|
2
|
-
import { I as isMessageOnlyCodexSourceReply } from "./thread-requests-
|
|
2
|
+
import { I as isMessageOnlyCodexSourceReply } from "./thread-requests-pX9_RXpU.mjs";
|
|
3
3
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { buildAgentWorkspaceInstructionSnapshot, buildBootstrapContextForFiles, embeddedAgentLog, prepareAgentWorkspaceContext } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as isCodexResponsesOAuthCredential, o as resolveCodexResponsesOAuthProfileFingerprint } from "./responses-oauth-twnuTaAa.mjs";
|
|
2
|
-
import { t as __exportAll } from "./session-binding-sidecars-
|
|
2
|
+
import { t as __exportAll } from "./session-binding-sidecars-CAHe3enw.mjs";
|
|
3
3
|
import { resolveApiKeyForProfile } from "openclaw/plugin-sdk/agent-runtime";
|
|
4
4
|
import { fingerprintResolvedAuthProfileCredential } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
5
5
|
import { resolveOpenAICodexAuthIdentity } from "openclaw/plugin-sdk/provider-auth";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as defineCodexBuildState } from "./build-state-
|
|
2
|
-
import { u as resolveMacOSDesktopCodexAppPathCandidates } from "./managed-binary-
|
|
3
|
-
import { n as resolveCodexAppServerSpawnEnv } from "./transport-stdio-
|
|
1
|
+
import { n as defineCodexBuildState } from "./build-state-CvGKuaeP.mjs";
|
|
2
|
+
import { u as resolveMacOSDesktopCodexAppPathCandidates } from "./managed-binary-Boj8_lWV.mjs";
|
|
3
|
+
import { n as resolveCodexAppServerSpawnEnv } from "./transport-stdio-BsXQmXll.mjs";
|
|
4
4
|
import { isRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import fs, { constants, existsSync, watch } from "node:fs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __exportAll } from "./session-binding-sidecars-
|
|
1
|
+
import { t as __exportAll } from "./session-binding-sidecars-CAHe3enw.mjs";
|
|
2
2
|
import { AgentHarnessPreflightError } from "openclaw/plugin-sdk/agent-harness-registration";
|
|
3
3
|
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
|
4
4
|
//#region extensions/codex/src/app-server/binding-connection.ts
|
|
@@ -44,7 +44,7 @@ function requireCodexSupervisionModelSelection(binding) {
|
|
|
44
44
|
}
|
|
45
45
|
/** Registration publishes the resolver; connection policy loads only for an actual request. */
|
|
46
46
|
async function resolveCodexBindingAppServerConnection(params) {
|
|
47
|
-
return (await import("./binding-connection.runtime-
|
|
47
|
+
return (await import("./binding-connection.runtime-C5yDsKBQ.mjs")).resolveCodexBindingAppServerConnection(params, catalogHomes.tryGetRuntime());
|
|
48
48
|
}
|
|
49
49
|
//#endregion
|
|
50
50
|
export { setCodexCatalogConnectionHomeResolver as a, resolveCodexBindingAppServerConnection as i, binding_connection_exports as n, requireCodexSupervisionModelSelection as r, assertCodexSessionRuntimeOwnership as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { d as readCodexPluginConfig } from "./config-parsing-CVK2Q463.mjs";
|
|
2
2
|
import { n as resolveCodexAppServerLocalHomeDir } from "./auth-start-options-BPIPeEX8.mjs";
|
|
3
3
|
import { t as buildCodexAppServerConnectionFingerprint } from "./plugin-app-cache-key-Bg9DbDI6.mjs";
|
|
4
|
-
import { n as resolveCodexAppServerRuntimeOptions, r as resolveCodexSupervisionAppServerRuntimeOptions } from "./config-runtime-
|
|
4
|
+
import { n as resolveCodexAppServerRuntimeOptions, r as resolveCodexSupervisionAppServerRuntimeOptions } from "./config-runtime-BUH-IDVE.mjs";
|
|
5
5
|
//#region extensions/codex/src/app-server/binding-connection.runtime.ts
|
|
6
6
|
/** Resolves connection and auth ownership exclusively from the private thread binding. */
|
|
7
7
|
async function resolveCodexBindingAppServerConnection(params, discoverHomes) {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
+
import { _ as assertCodexTurnStartResponse, b as readCodexErrorNotification, g as assertCodexThreadStartResponse, w as createCodexElicitationResponse } from "./client-CafYfF2n.mjs";
|
|
1
2
|
import { i as isJsonObject } from "./protocol-CANUwXJ3.mjs";
|
|
2
3
|
import { a as resolveCodexPrivateLauncher, i as readCodexAppServerConfigOptions } from "./launch-args-DbFCehO7.mjs";
|
|
3
4
|
import { d as readCodexEffectiveConfig } from "./config-options-CZmH25Xq.mjs";
|
|
4
5
|
import { a as codexPrewriteRejectionCause } from "./rpc-error-C98SHchT.mjs";
|
|
5
|
-
import "./config-
|
|
6
|
-
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-
|
|
7
|
-
import { u as isCodexAppServerStartSelectionChangedError } from "./shared-client-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { d as mergeCodexThreadConfigs } from "./project-doc-thread-config-D_sWbxFR.mjs";
|
|
6
|
+
import "./config-d0gOFYEk.mjs";
|
|
7
|
+
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-BUH-IDVE.mjs";
|
|
8
|
+
import { u as isCodexAppServerStartSelectionChangedError } from "./shared-client-C0gEybHs.mjs";
|
|
9
|
+
import { o as closeCodexStartupClientBestEffort, s as interruptCodexTurnAndWaitBestEffort, t as CODEX_APP_SERVER_INTERRUPT_TIMEOUT_MS } from "./attempt-client-cleanup-DQBa7iiq.mjs";
|
|
10
|
+
import { t as CodexEphemeralTurn } from "./ephemeral-turn-CgKjGBaW.mjs";
|
|
11
|
+
import { i as readModelListResult } from "./models-Dw0qUZl3.mjs";
|
|
12
|
+
import { d as mergeCodexThreadConfigs } from "./project-doc-thread-config-BYFXSVGk.mjs";
|
|
13
13
|
import { n as resolveCodexAppServerReasoningEffort } from "./reasoning-effort-CS9kKWB9.mjs";
|
|
14
|
-
import { n as buildCodexRingZeroThreadConfigPatch, p as attestCodexRestrictedToolSurfaceMcpServersDisabled, r as buildCodexRuntimeThreadConfig, t as assertCodexManagedRequirementsDoNotOverrideToolPolicy, u as readCodexInheritedMcpServerNames } from "./thread-requests-
|
|
15
|
-
import { a as resolveCodexPromptError } from "./usage-limit-error-
|
|
14
|
+
import { n as buildCodexRingZeroThreadConfigPatch, p as attestCodexRestrictedToolSurfaceMcpServersDisabled, r as buildCodexRuntimeThreadConfig, t as assertCodexManagedRequirementsDoNotOverrideToolPolicy, u as readCodexInheritedMcpServerNames } from "./thread-requests-pX9_RXpU.mjs";
|
|
15
|
+
import { a as resolveCodexPromptError } from "./usage-limit-error-DycN7mED.mjs";
|
|
16
16
|
import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
17
17
|
import { parse } from "smol-toml";
|
|
18
18
|
import path from "node:path";
|
|
@@ -147,7 +147,7 @@ async function runBoundedCodexAppServerTurnInWorkspace(params, appServer, worksp
|
|
|
147
147
|
assertCurrent: params.assertCurrent,
|
|
148
148
|
...params.signal ? { abandonSignal: params.signal } : {}
|
|
149
149
|
};
|
|
150
|
-
const client = params.options.clientFactory ? await params.options.clientFactory(clientOptions) : await import("./shared-client-
|
|
150
|
+
const client = params.options.clientFactory ? await params.options.clientFactory(clientOptions) : await import("./shared-client-C0gEybHs.mjs").then((n) => n.v).then(({ createIsolatedCodexAppServerClient }) => createIsolatedCodexAppServerClient({
|
|
151
151
|
...clientOptions,
|
|
152
152
|
authProfileStore: params.authProfileStore
|
|
153
153
|
}));
|
package/dist/.setup/{bounded-turn-isolation-CIQJykuM.mjs → bounded-turn-isolation-BRNgfoRl.mjs}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { d as readCodexPluginConfig } from "./config-parsing-CVK2Q463.mjs";
|
|
2
2
|
import { n as isCodexAppServerProxyLaunch } from "./launch-args-DbFCehO7.mjs";
|
|
3
3
|
import { i as resolveCodexAppServerHomeScope } from "./config-options-CZmH25Xq.mjs";
|
|
4
|
-
import "./config-
|
|
5
|
-
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-
|
|
4
|
+
import "./config-d0gOFYEk.mjs";
|
|
5
|
+
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-BUH-IDVE.mjs";
|
|
6
6
|
//#region extensions/codex/src/app-server/bounded-turn-isolation.ts
|
|
7
7
|
function resolveCodexBoundedTurnIsolation(options) {
|
|
8
8
|
const pluginConfig = readCodexPluginConfig(options.pluginConfig);
|
|
@@ -1,16 +1,16 @@
|
|
|
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-DhB266B_.mjs";
|
|
2
1
|
import { i as isJsonObject } from "./protocol-CANUwXJ3.mjs";
|
|
3
|
-
import { c as MIN_SUPPORTED_CODEX_APP_SERVER_VERSION, s as CODEX_APP_SERVER_VERSION } from "./managed-binary-
|
|
4
|
-
import { a as closeCodexAppServerTransportAndWait, c as getCodexAppServerRegisteredTransportIdentity, i as closeCodexAppServerTransport, o as hasCodexAppServerNaturalExit, t as createStdioTransport } from "./transport-stdio-
|
|
2
|
+
import { c as MIN_SUPPORTED_CODEX_APP_SERVER_VERSION, s as CODEX_APP_SERVER_VERSION } from "./managed-binary-Boj8_lWV.mjs";
|
|
3
|
+
import { a as closeCodexAppServerTransportAndWait, c as getCodexAppServerRegisteredTransportIdentity, i as closeCodexAppServerTransport, o as hasCodexAppServerNaturalExit, t as createStdioTransport } from "./transport-stdio-BsXQmXll.mjs";
|
|
5
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-C98SHchT.mjs";
|
|
6
|
-
import { n as codexCatalogSourceForClient, s as recordCodexCatalogResponseSource, t as closeCodexCatalogClientSource } from "./session-catalog-source-
|
|
7
|
-
import { i as reuseCodexCatalogPreview } from "./session-catalog-native-projection-
|
|
8
|
-
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-
|
|
5
|
+
import { n as codexCatalogSourceForClient, s as recordCodexCatalogResponseSource, t as closeCodexCatalogClientSource } from "./session-catalog-source-qHe5r9i_.mjs";
|
|
6
|
+
import { i as reuseCodexCatalogPreview, n as projectCodexCatalogNativeResponse, r as projectCodexCatalogNativeThread } from "./session-catalog-native-projection-CHtG8DwY.mjs";
|
|
7
|
+
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-BUH-IDVE.mjs";
|
|
9
8
|
import { codexCatalogPageWorkerEntrypoint } from "../catalog-page-worker-entrypoint.js";
|
|
10
|
-
import { t as createWebSocketTransport } from "./transport-websocket-
|
|
11
|
-
import { t as __exportAll } from "./session-binding-sidecars-
|
|
9
|
+
import { t as createWebSocketTransport } from "./transport-websocket-B5mq2Iq2.mjs";
|
|
10
|
+
import { t as __exportAll } from "./session-binding-sidecars-CAHe3enw.mjs";
|
|
12
11
|
import { isRecord, normalizeOptionalString, readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
13
12
|
import { randomUUID } from "node:crypto";
|
|
13
|
+
import { embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-registration";
|
|
14
14
|
import { normalizeJsonSchemaForTypeBox } from "openclaw/plugin-sdk/json-schema-runtime";
|
|
15
15
|
import { addSafeTimeoutDelayGraceMs, addTimerTimeoutGraceMs, parseStrictNonNegativeInteger } from "openclaw/plugin-sdk/number-runtime";
|
|
16
16
|
import { sliceUtf16Safe, truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
@@ -18,12 +18,299 @@ 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 { OPENCLAW_VERSION, embeddedAgentLog, formatToolExecutionErrorMessage, normalizeQuestionTimeoutSeconds, resolveToolExecutionErrorKind } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
21
|
+
import { OPENCLAW_VERSION as OPENCLAW_VERSION$1, embeddedAgentLog as embeddedAgentLog$1, formatToolExecutionErrorMessage, normalizeQuestionTimeoutSeconds, resolveToolExecutionErrorKind } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
22
22
|
import { sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
23
|
+
import { sanitizeTerminalText } from "openclaw/plugin-sdk/text-chunking";
|
|
23
24
|
import { parse } from "semver";
|
|
24
25
|
import { AsyncWorkScope } from "openclaw/plugin-sdk/concurrency-runtime";
|
|
25
26
|
import { copyInternalToolResultState, runWithAsyncWorkResources } from "openclaw/plugin-sdk/agent-harness-tool-runtime";
|
|
26
27
|
import { Compile } from "typebox/compile";
|
|
28
|
+
//#region extensions/codex/src/app-server/protocol-json.ts
|
|
29
|
+
function isRpcResponse(message) {
|
|
30
|
+
return message !== null && typeof message === "object" && "id" in message && (typeof message.id === "number" || typeof message.id === "string") && !("method" in message);
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region extensions/codex/src/app-server/client-line-preview.ts
|
|
34
|
+
const CODEX_APP_SERVER_PARSE_LOG_MAX = 500;
|
|
35
|
+
function redactCodexAppServerLinePreview(value) {
|
|
36
|
+
const redacted = value.replace(/\s+/g, " ").trim().replace(/(Bearer\s+)[A-Za-z0-9._~+/-]+/gi, "$1<redacted>").replace(/("(?:api_?key|authorization|token|access_token|refresh_token)"\s*:\s*")([^"]+)(")/gi, "$1<redacted>$3").replace(/\b([a-z0-9_]*(?:api_?key|authorization|access_token|refresh_token|token))(\s*=\s*)(["']?)[^\s"']+(\3)/gi, "$1$2$3<redacted>$4");
|
|
37
|
+
return redacted.length > CODEX_APP_SERVER_PARSE_LOG_MAX ? `${truncateUtf16Safe(redacted, CODEX_APP_SERVER_PARSE_LOG_MAX)}...` : redacted;
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region extensions/codex/src/app-server/client-message-decoder.ts
|
|
41
|
+
const PARSE_BUFFER_MAX = 8388608;
|
|
42
|
+
const PARSE_BUFFER_MAX_LINES = 1e3;
|
|
43
|
+
const UNICODE_ESCAPE_QUAD = /^[\da-fA-F]{4}$/u;
|
|
44
|
+
/** Recovers the raw newlines observed inside native JSON string values. */
|
|
45
|
+
var CodexAppServerMessageDecoder = class {
|
|
46
|
+
constructor(reportError) {
|
|
47
|
+
this.reportError = reportError;
|
|
48
|
+
}
|
|
49
|
+
clear() {
|
|
50
|
+
this.pending = void 0;
|
|
51
|
+
}
|
|
52
|
+
get hasPending() {
|
|
53
|
+
return this.pending !== void 0;
|
|
54
|
+
}
|
|
55
|
+
parse(line) {
|
|
56
|
+
const rawLine = line.endsWith("\r") ? line.slice(0, -1) : line;
|
|
57
|
+
const pending = this.pending;
|
|
58
|
+
let candidate;
|
|
59
|
+
let withinBounds = true;
|
|
60
|
+
if (pending) {
|
|
61
|
+
pending.fragments.push(rawLine);
|
|
62
|
+
pending.length += 2 + rawLine.length;
|
|
63
|
+
withinBounds = pending.length <= PARSE_BUFFER_MAX && pending.fragments.length <= PARSE_BUFFER_MAX_LINES;
|
|
64
|
+
if (withinBounds && pending.inString && scanJsonString(rawLine, 0) === rawLine.length) return;
|
|
65
|
+
candidate = pending.fragments.join("\\n");
|
|
66
|
+
this.pending = void 0;
|
|
67
|
+
} else {
|
|
68
|
+
candidate = rawLine.trim();
|
|
69
|
+
if (!candidate) return;
|
|
70
|
+
}
|
|
71
|
+
try {
|
|
72
|
+
return JSON.parse(candidate);
|
|
73
|
+
} catch (error) {
|
|
74
|
+
const text = pending ? candidate : rawLine.trimStart();
|
|
75
|
+
const inString = withinBounds ? recoverableJsonStringState(text, error) : void 0;
|
|
76
|
+
if (inString !== void 0) {
|
|
77
|
+
if (pending) pending.inString = inString;
|
|
78
|
+
this.pending = pending ?? {
|
|
79
|
+
fragments: [text],
|
|
80
|
+
length: text.length,
|
|
81
|
+
inString
|
|
82
|
+
};
|
|
83
|
+
} else this.reportError(candidate, error, pending?.fragments.length ?? 1);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
/** Undefined rejects malformed JSON; false retains a trailing escape for native parsing. */
|
|
88
|
+
function recoverableJsonStringState(value, error) {
|
|
89
|
+
if (!(error instanceof SyntaxError) || !value.startsWith("{") && !value.startsWith("[")) return;
|
|
90
|
+
const closers = [];
|
|
91
|
+
for (let index = 0; index < value.length; index++) {
|
|
92
|
+
const character = value[index];
|
|
93
|
+
if (character === "{" || character === "[") closers.push(character === "{" ? "}" : "]");
|
|
94
|
+
else if (character === "}" || character === "]") closers.pop();
|
|
95
|
+
if (character !== "\"") continue;
|
|
96
|
+
const end = scanJsonString(value, index + 1);
|
|
97
|
+
if (end < 0) return;
|
|
98
|
+
if (end >= value.length) {
|
|
99
|
+
const closing = closers.toReversed().join("");
|
|
100
|
+
for (const suffix of ["\"", "\":null"]) try {
|
|
101
|
+
JSON.parse(`${value}\\n${suffix}${closing}`);
|
|
102
|
+
return end === value.length;
|
|
103
|
+
} catch {}
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
index = end;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/** Finds a closing quote; incomplete or invalid escapes require native parsing. */
|
|
110
|
+
function scanJsonString(value, start) {
|
|
111
|
+
for (let index = start; index < value.length; index++) {
|
|
112
|
+
const character = value[index];
|
|
113
|
+
if (character === "\"") return index;
|
|
114
|
+
if (value.charCodeAt(index) < 32) return -1;
|
|
115
|
+
if (character !== "\\") continue;
|
|
116
|
+
const escape = value[++index];
|
|
117
|
+
if (!escape) return value.length + 1;
|
|
118
|
+
else if (escape === "u") {
|
|
119
|
+
if (!UNICODE_ESCAPE_QUAD.test(value.slice(index + 1, index + 5))) return -1;
|
|
120
|
+
index += 4;
|
|
121
|
+
} else if (!"\"\\/bfnrt".includes(escape)) return -1;
|
|
122
|
+
}
|
|
123
|
+
return value.length;
|
|
124
|
+
}
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region extensions/codex/src/app-server/client-message-frames.ts
|
|
127
|
+
function createCodexAppServerMessageWriter(options) {
|
|
128
|
+
return (message, onError, beforeWrite, onWriteResult) => {
|
|
129
|
+
if (options.isClosed()) return;
|
|
130
|
+
const child = options.getTransport();
|
|
131
|
+
const id = "id" in message ? message.id : void 0;
|
|
132
|
+
const method = "method" in message ? message.method : void 0;
|
|
133
|
+
const frame = JSON.stringify(message, (_key, value) => typeof value === "string" ? value.replace(UNPAIRED_SURROGATE_RE, "") : value) ?? "null";
|
|
134
|
+
if (child.maxFrameBytes && Buffer.byteLength(frame) > child.maxFrameBytes) throw new Error("Codex request exceeds the transport frame limit; reduce attached images or context.");
|
|
135
|
+
beforeWrite?.();
|
|
136
|
+
if (method === "command/exec") options.onNativeExecution();
|
|
137
|
+
child.stdin.write(`${frame}\n`, (error) => {
|
|
138
|
+
onWriteResult?.(error);
|
|
139
|
+
if (error) {
|
|
140
|
+
embeddedAgentLog.warn("codex app-server write failed", {
|
|
141
|
+
error,
|
|
142
|
+
id,
|
|
143
|
+
method
|
|
144
|
+
});
|
|
145
|
+
onError?.(error);
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
const UNPAIRED_SURROGATE_RE = /[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g;
|
|
151
|
+
/** One byte reader owns framing and stops at an asynchronous page decode. */
|
|
152
|
+
function listenCodexAppServerLines(input, onLine, onError) {
|
|
153
|
+
let fragments = [];
|
|
154
|
+
let length = 0;
|
|
155
|
+
let remainder;
|
|
156
|
+
let waiting = false;
|
|
157
|
+
let ended = false;
|
|
158
|
+
let closed = false;
|
|
159
|
+
const close = () => {
|
|
160
|
+
closed = true;
|
|
161
|
+
fragments = [];
|
|
162
|
+
remainder = void 0;
|
|
163
|
+
input.off("data", onData);
|
|
164
|
+
input.off("end", onEnd);
|
|
165
|
+
input.pause();
|
|
166
|
+
};
|
|
167
|
+
const deliver = (tail) => {
|
|
168
|
+
const line = fragments.length ? Buffer.concat([...fragments, tail], length + tail.length) : tail;
|
|
169
|
+
fragments = [];
|
|
170
|
+
length = 0;
|
|
171
|
+
const completion = onLine(line);
|
|
172
|
+
if (!completion) return true;
|
|
173
|
+
waiting = true;
|
|
174
|
+
input.pause();
|
|
175
|
+
completion.then(() => {
|
|
176
|
+
waiting = false;
|
|
177
|
+
if (!closed) {
|
|
178
|
+
drain();
|
|
179
|
+
if (!waiting && !ended && !closed) input.resume();
|
|
180
|
+
}
|
|
181
|
+
}).catch((error) => {
|
|
182
|
+
close();
|
|
183
|
+
onError(error);
|
|
184
|
+
});
|
|
185
|
+
return false;
|
|
186
|
+
};
|
|
187
|
+
const drain = () => {
|
|
188
|
+
try {
|
|
189
|
+
const chunk = remainder;
|
|
190
|
+
remainder = void 0;
|
|
191
|
+
if (chunk) {
|
|
192
|
+
let start = 0;
|
|
193
|
+
let end;
|
|
194
|
+
while ((end = chunk.indexOf(10, start)) !== -1) {
|
|
195
|
+
if (closed) return;
|
|
196
|
+
remainder = chunk.subarray(end + 1);
|
|
197
|
+
if (!deliver(chunk.subarray(start, end))) return;
|
|
198
|
+
remainder = void 0;
|
|
199
|
+
start = end + 1;
|
|
200
|
+
}
|
|
201
|
+
if (!closed && start < chunk.length) {
|
|
202
|
+
fragments.push(chunk.subarray(start));
|
|
203
|
+
length += chunk.length - start;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
if (ended && !closed) {
|
|
207
|
+
if (length && !deliver(Buffer.alloc(0))) return;
|
|
208
|
+
close();
|
|
209
|
+
}
|
|
210
|
+
} catch (error) {
|
|
211
|
+
close();
|
|
212
|
+
onError(error);
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
const onData = (chunk) => {
|
|
216
|
+
remainder = chunk;
|
|
217
|
+
drain();
|
|
218
|
+
};
|
|
219
|
+
const onEnd = () => {
|
|
220
|
+
ended = true;
|
|
221
|
+
if (!waiting) drain();
|
|
222
|
+
};
|
|
223
|
+
input.on("data", onData);
|
|
224
|
+
input.once("end", onEnd);
|
|
225
|
+
return close;
|
|
226
|
+
}
|
|
227
|
+
function codexCatalogResponseRoute(id) {
|
|
228
|
+
return typeof id === "number" && Number.isSafeInteger(id) && id >= 2 ** 52 ? {
|
|
229
|
+
id,
|
|
230
|
+
kind: id % 2 === 1 ? "list" : "thread"
|
|
231
|
+
} : void 0;
|
|
232
|
+
}
|
|
233
|
+
/** Read bounded envelope keys and IDs; skip native payload strings as bytes. */
|
|
234
|
+
function readCodexCatalogDecodeRoute(line) {
|
|
235
|
+
let depth = 0;
|
|
236
|
+
let route;
|
|
237
|
+
let response = false;
|
|
238
|
+
for (let index = 0; index < line.length; index++) {
|
|
239
|
+
const byte = line[index];
|
|
240
|
+
if (byte === 123 || byte === 91) depth++;
|
|
241
|
+
else if (byte === 125 || byte === 93) depth--;
|
|
242
|
+
else if (byte === 34) {
|
|
243
|
+
const start = index;
|
|
244
|
+
for (;;) {
|
|
245
|
+
index = line.indexOf(34, index + 1);
|
|
246
|
+
if (index < 0) return "unresolved";
|
|
247
|
+
let slash = index - 1;
|
|
248
|
+
while (line[slash] === 92) slash--;
|
|
249
|
+
if ((index - slash) % 2 === 1) break;
|
|
250
|
+
}
|
|
251
|
+
if (depth !== 1 || index - start > 64) continue;
|
|
252
|
+
let colon = index + 1;
|
|
253
|
+
while (line[colon] === 32 || line[colon] === 9 || line[colon] === 13) colon++;
|
|
254
|
+
if (line[colon] !== 58) continue;
|
|
255
|
+
const token = line.toString("utf8", start, index + 1);
|
|
256
|
+
let key = token.slice(1, -1);
|
|
257
|
+
if (token.includes("\\")) try {
|
|
258
|
+
key = JSON.parse(token);
|
|
259
|
+
} catch {
|
|
260
|
+
return "unresolved";
|
|
261
|
+
}
|
|
262
|
+
if (key === "method") return;
|
|
263
|
+
if (key === "result" || key === "error") {
|
|
264
|
+
response = true;
|
|
265
|
+
if (route) return route;
|
|
266
|
+
}
|
|
267
|
+
if (key !== "id") continue;
|
|
268
|
+
const match = /^\s*:\s*(\d+)(?=\s*[,}])/u.exec(line.toString("utf8", index + 1, Math.min(index + 100, line.length)));
|
|
269
|
+
if (!match) continue;
|
|
270
|
+
route = codexCatalogResponseRoute(Number(match[1]));
|
|
271
|
+
if (!route || response) return route;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
return response || route ? "unresolved" : void 0;
|
|
275
|
+
}
|
|
276
|
+
//#endregion
|
|
277
|
+
//#region extensions/codex/src/app-server/client-catalog-response.ts
|
|
278
|
+
function projectCodexCatalogMessage(parsed, input, cachedPreview) {
|
|
279
|
+
const result = {
|
|
280
|
+
pending: false,
|
|
281
|
+
failures: []
|
|
282
|
+
};
|
|
283
|
+
if (!isJsonObject(parsed)) return result;
|
|
284
|
+
result.message = parsed;
|
|
285
|
+
if (!isRpcResponse(parsed)) return result;
|
|
286
|
+
const message = parsed;
|
|
287
|
+
const route = codexCatalogResponseRoute(message.id);
|
|
288
|
+
if (message.error || !route) return result;
|
|
289
|
+
const remainingRows = input.route === "unresolved" ? input.catalogRows?.has(route.id) ? input.catalogRows.get(route.id) : 0 : input.remainingRows;
|
|
290
|
+
try {
|
|
291
|
+
if (!isJsonObject(message.result)) throw new Error("Codex catalog response contains an invalid result");
|
|
292
|
+
if (route.kind === "list") {
|
|
293
|
+
const raw = message.result;
|
|
294
|
+
message.result = projectCodexCatalogNativeResponse(raw, sanitizeTerminalText, cachedPreview, remainingRows);
|
|
295
|
+
if (!cachedPreview) result.previewStates = Array.isArray(raw.data) ? raw.data.slice(0, Array.isArray(message.result.data) ? message.result.data.length : 0).map((row) => isJsonObject(row) && typeof row.preview === "string" ? Boolean(row.preview) : void 0) : [];
|
|
296
|
+
} else {
|
|
297
|
+
const thread = message.result.thread;
|
|
298
|
+
message.result = { thread: {
|
|
299
|
+
...projectCodexCatalogNativeThread(thread, sanitizeTerminalText),
|
|
300
|
+
...isJsonObject(thread) && typeof thread.cwd === "string" ? { cwd: thread.cwd } : {},
|
|
301
|
+
...isJsonObject(thread) && (thread.historyMode === "paginated" || thread.historyMode === "legacy") ? { historyMode: thread.historyMode } : {}
|
|
302
|
+
} };
|
|
303
|
+
}
|
|
304
|
+
} catch (error) {
|
|
305
|
+
delete result.message;
|
|
306
|
+
result.projectionError = {
|
|
307
|
+
id: route.id,
|
|
308
|
+
error: error instanceof Error ? error : new Error("Codex catalog projection failed", { cause: error })
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
return result;
|
|
312
|
+
}
|
|
313
|
+
//#endregion
|
|
27
314
|
//#region extensions/codex/src/app-server/client-catalog-worker.ts
|
|
28
315
|
const INLINE_CATALOG_MAX_BYTES = 65536;
|
|
29
316
|
const CATALOG_WORKER_IDLE_MS = 6e4;
|
|
@@ -139,9 +426,9 @@ function observeCodexAppServerStderr(stderr, consume) {
|
|
|
139
426
|
stderr.setEncoding("utf8");
|
|
140
427
|
stderr.on("data", (chunk) => {
|
|
141
428
|
const text = consume(chunk).trim();
|
|
142
|
-
if (text) embeddedAgentLog.debug(`codex app-server stderr: ${text}`);
|
|
429
|
+
if (text) embeddedAgentLog$1.debug(`codex app-server stderr: ${text}`);
|
|
143
430
|
});
|
|
144
|
-
stderr.on("error", (error) => embeddedAgentLog.warn("codex app-server stderr stream failed", { error }));
|
|
431
|
+
stderr.on("error", (error) => embeddedAgentLog$1.warn("codex app-server stderr stream failed", { error }));
|
|
145
432
|
}
|
|
146
433
|
function appendBoundedTail(current, next, maxLength) {
|
|
147
434
|
const combined = `${current}${next}`;
|
|
@@ -155,7 +442,7 @@ function buildCodexAppServerExitError(code, signal, stderrTail) {
|
|
|
155
442
|
function logCodexAppServerParseFailure(value, error, fragmentCount) {
|
|
156
443
|
const linePreview = redactCodexAppServerLinePreview(value);
|
|
157
444
|
const suffix = fragmentCount > 1 ? ` fragments=${fragmentCount}` : "";
|
|
158
|
-
embeddedAgentLog.warn("failed to parse codex app-server message", {
|
|
445
|
+
embeddedAgentLog$1.warn("failed to parse codex app-server message", {
|
|
159
446
|
error,
|
|
160
447
|
errorMessage: coerceErrorMessage(error),
|
|
161
448
|
fragmentCount,
|
|
@@ -285,7 +572,7 @@ function buildCodexAppServerInitializeParams() {
|
|
|
285
572
|
clientInfo: {
|
|
286
573
|
name: "openclaw",
|
|
287
574
|
title: "OpenClaw",
|
|
288
|
-
version: OPENCLAW_VERSION
|
|
575
|
+
version: OPENCLAW_VERSION$1
|
|
289
576
|
},
|
|
290
577
|
capabilities: {
|
|
291
578
|
experimentalApi: true,
|
|
@@ -325,7 +612,7 @@ function assertSupportedCodexAppServerVersion(response) {
|
|
|
325
612
|
if (!detectedVersion) throw new CodexAppServerVersionError(detectedVersion);
|
|
326
613
|
const detected = parse(detectedVersion);
|
|
327
614
|
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", {
|
|
615
|
+
if (detected.compare("0.160.0") > 0) embeddedAgentLog$1.warn("codex app-server is newer than OpenClaw's managed runtime; continuing with normal startup validation", {
|
|
329
616
|
detectedVersion,
|
|
330
617
|
validatedVersion: CODEX_APP_SERVER_VERSION
|
|
331
618
|
});
|
|
@@ -350,7 +637,7 @@ function logCodexAppServerManagedWarning(notification) {
|
|
|
350
637
|
const message = readCodexAppServerWarningMessage(notification.params);
|
|
351
638
|
if (!(notification.method === "warning" && notification.params.threadId === null && CODEX_LOG_WRITE_WARNINGS.has(message)) && !LOG_ONLY_CODEX_WARNING_PATTERNS.some((pattern) => pattern.test(message))) return false;
|
|
352
639
|
try {
|
|
353
|
-
embeddedAgentLog.warn(message);
|
|
640
|
+
embeddedAgentLog$1.warn(message);
|
|
354
641
|
} catch {}
|
|
355
642
|
return true;
|
|
356
643
|
}
|
|
@@ -373,10 +660,10 @@ var CodexAppServerNotifications = class {
|
|
|
373
660
|
}
|
|
374
661
|
for (const handler of this.handlers) try {
|
|
375
662
|
Promise.resolve(handler(notification)).catch((error) => {
|
|
376
|
-
embeddedAgentLog.warn("codex app-server notification handler failed", { error });
|
|
663
|
+
embeddedAgentLog$1.warn("codex app-server notification handler failed", { error });
|
|
377
664
|
});
|
|
378
665
|
} catch (error) {
|
|
379
|
-
embeddedAgentLog.warn("codex app-server notification handler failed", { error });
|
|
666
|
+
embeddedAgentLog$1.warn("codex app-server notification handler failed", { error });
|
|
380
667
|
}
|
|
381
668
|
}
|
|
382
669
|
};
|
|
@@ -756,7 +1043,7 @@ async function handleDynamicToolCallWithTimeout(params) {
|
|
|
756
1043
|
params.onAgentToolResult?.(event);
|
|
757
1044
|
} catch (error) {
|
|
758
1045
|
const message = formatToolExecutionErrorMessage(error, "Unknown error");
|
|
759
|
-
embeddedAgentLog.warn(`onAgentToolResult handler failed: tool=${params.call.tool} error=${message}`);
|
|
1046
|
+
embeddedAgentLog$1.warn(`onAgentToolResult handler failed: tool=${params.call.tool} error=${message}`);
|
|
760
1047
|
}
|
|
761
1048
|
};
|
|
762
1049
|
const notifyFailedToolResult = (message, terminalReason = "failed") => {
|
|
@@ -816,7 +1103,7 @@ async function handleDynamicToolCallWithTimeout(params) {
|
|
|
816
1103
|
params.onFallbackSelected?.();
|
|
817
1104
|
controller.abort(new Error(timeoutDetails.responseMessage));
|
|
818
1105
|
params.onTimeout?.();
|
|
819
|
-
embeddedAgentLog.warn("codex dynamic tool call timed out", {
|
|
1106
|
+
embeddedAgentLog$1.warn("codex dynamic tool call timed out", {
|
|
820
1107
|
...timeoutDetails.meta,
|
|
821
1108
|
consoleMessage: timeoutDetails.consoleMessage
|
|
822
1109
|
});
|
|
@@ -3626,7 +3913,7 @@ var CodexServerRequests = class {
|
|
|
3626
3913
|
const armTimeout = () => {
|
|
3627
3914
|
clearTimeout(timeout);
|
|
3628
3915
|
timeout = setTimeout(() => {
|
|
3629
|
-
embeddedAgentLog.warn("codex app-server server request timed out", {
|
|
3916
|
+
embeddedAgentLog$1.warn("codex app-server server request timed out", {
|
|
3630
3917
|
id: request.id,
|
|
3631
3918
|
method: request.method,
|
|
3632
3919
|
timeoutMs
|
|
@@ -3660,7 +3947,7 @@ var CodexServerRequests = class {
|
|
|
3660
3947
|
});
|
|
3661
3948
|
} catch (error) {
|
|
3662
3949
|
if (this.active.get(request.id) === entry) {
|
|
3663
|
-
embeddedAgentLog.warn("codex app-server server request handler failed", {
|
|
3950
|
+
embeddedAgentLog$1.warn("codex app-server server request handler failed", {
|
|
3664
3951
|
id: request.id,
|
|
3665
3952
|
method: request.method,
|
|
3666
3953
|
error
|
|
@@ -4076,7 +4363,7 @@ var CodexAppServerClient = class CodexAppServerClient {
|
|
|
4076
4363
|
try {
|
|
4077
4364
|
await this.closeAndWait();
|
|
4078
4365
|
} catch (closeError) {
|
|
4079
|
-
embeddedAgentLog.warn("codex app-server shutdown after indeterminate request failed", {
|
|
4366
|
+
embeddedAgentLog$1.warn("codex app-server shutdown after indeterminate request failed", {
|
|
4080
4367
|
closeError,
|
|
4081
4368
|
operation
|
|
4082
4369
|
});
|
|
@@ -4145,7 +4432,7 @@ var CodexAppServerClient = class CodexAppServerClient {
|
|
|
4145
4432
|
this.decoder.clear();
|
|
4146
4433
|
this.catalogWorkerClosed = this.catalogWorker.close(error);
|
|
4147
4434
|
this.catalogWorkerClosed?.catch((closeError) => {
|
|
4148
|
-
embeddedAgentLog.warn("codex catalog worker shutdown failed", { error: closeError });
|
|
4435
|
+
embeddedAgentLog$1.warn("codex catalog worker shutdown failed", { error: closeError });
|
|
4149
4436
|
});
|
|
4150
4437
|
this.serverRequestsClosed = this.serverRequests.close(error);
|
|
4151
4438
|
for (const pending of this.pending.values()) pending.close(error);
|
|
@@ -4153,7 +4440,7 @@ var CodexAppServerClient = class CodexAppServerClient {
|
|
|
4153
4440
|
for (const handler of this.closeHandlers) try {
|
|
4154
4441
|
handler(this);
|
|
4155
4442
|
} catch (closeError) {
|
|
4156
|
-
embeddedAgentLog.warn("codex app-server close handler failed", { error: closeError });
|
|
4443
|
+
embeddedAgentLog$1.warn("codex app-server close handler failed", { error: closeError });
|
|
4157
4444
|
}
|
|
4158
4445
|
return true;
|
|
4159
4446
|
}
|
|
@@ -8,7 +8,7 @@ async function handleCodexCommand(ctx, options) {
|
|
|
8
8
|
};
|
|
9
9
|
const { resolvePluginConfig, ...subcommandOptions } = options;
|
|
10
10
|
try {
|
|
11
|
-
const { handleCodexSubcommand } = await import("./command-handlers-
|
|
11
|
+
const { handleCodexSubcommand } = await import("./command-handlers-yb5vwwrx.mjs");
|
|
12
12
|
return await handleCodexSubcommand(commandContext, {
|
|
13
13
|
...subcommandOptions,
|
|
14
14
|
pluginConfig: resolvePluginConfig?.() ?? subcommandOptions.pluginConfig
|