@openclaw/codex 2026.9.5 → 2026.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.setup/{account-usage-runtime-C2MOIvfq.mjs → account-usage-runtime-Eem_WGqY.mjs} +5 -5
- package/dist/.setup/{apply-CJ0ZfmBG.mjs → apply-DDOi8uNx.mjs} +22 -28
- package/dist/.setup/{attempt-client-cleanup-BpYKdTA0.mjs → attempt-client-cleanup-CEv1cKwF.mjs} +58 -43
- package/dist/.setup/attempt-workspace-context-DUVEn_CS.mjs +331 -0
- package/dist/.setup/{auth-cache-key-QirmgiCo.mjs → auth-cache-key-B2mpaI9D.mjs} +9 -81
- package/dist/.setup/auth-profile-health-oHizqgye.mjs +53 -0
- package/dist/.setup/auth-profile-recovery-BREezV0L.mjs +14 -0
- package/dist/.setup/{binding-connection-Bm38niE8.mjs → binding-connection-ThoatDcb.mjs} +1 -1
- package/dist/.setup/{binding-connection.runtime-CnRMC0ta.mjs → binding-connection.runtime-yoHrABt-.mjs} +4 -4
- package/dist/.setup/{bounded-turn-BtlZcivC.mjs → bounded-turn-B2HScEgT.mjs} +138 -32
- package/dist/.setup/{build-state-Xx9ybZqa.mjs → build-state-C7EnDVgr.mjs} +1 -1
- package/dist/.setup/{capabilities-_vXcZGSx.mjs → capabilities-CDXOOFdZ.mjs} +1 -1
- package/dist/.setup/{client-vXs2929Q.mjs → client-Cs08OXVQ.mjs} +583 -559
- package/dist/.setup/client-catalog-response-BMgt_4q4.mjs +285 -0
- package/dist/.setup/{command-dispatch-naHIZwwF.mjs → command-dispatch-B4JuOsOk.mjs} +8 -4
- package/dist/.setup/{command-formatters-CGEkdawF.mjs → command-formatters-Bmqvr9tO.mjs} +8 -4
- package/dist/.setup/{command-handlers-BtAJEW1X.mjs → command-handlers-DW7Lx9oH.mjs} +106 -172
- package/dist/.setup/{command-rpc-DHFpn4le.mjs → command-rpc-DixIj3HW.mjs} +36 -21
- package/dist/.setup/{compact-C3i3qlzj.mjs → compact-Du5UvtxA.mjs} +14 -21
- package/dist/.setup/{config-CedDWjM-.mjs → config-BoTP_mrL.mjs} +3 -3
- package/dist/.setup/{config-options-BsanJ8QG.mjs → config-options-BvaRs51b.mjs} +46 -30
- package/dist/.setup/{config-runtime-CeAhl_h4.mjs → config-runtime-C8Rw1m1m.mjs} +1 -1
- package/dist/.setup/{config-security-BRQ2mgW9.mjs → config-security-BEReZ6go.mjs} +35 -120
- package/dist/.setup/{conversation-binding-DhzrpTM6.mjs → conversation-binding-DP-gMrBP.mjs} +21 -32
- package/dist/.setup/{conversation-control-DN53ns41.mjs → conversation-control-uK9Jomlc.mjs} +28 -67
- package/dist/.setup/{dynamic-tools-D16lOp67.mjs → dynamic-tools-BDXl-8Cw.mjs} +848 -578
- package/dist/.setup/{effective-mcp-catalog-K6kLCN8X.mjs → effective-mcp-catalog-CvnvnGIe.mjs} +3 -3
- package/dist/.setup/{ephemeral-turn-R1gA8Sn6.mjs → ephemeral-turn-poidXgek.mjs} +9 -6
- package/dist/.setup/{event-projector-assistant-message-DNUR1s0A.mjs → event-projector-assistant-message-BsruvNrH.mjs} +2 -4
- package/dist/.setup/{event-projector-items-DyTQ_XqL.mjs → event-projector-items-C6L_5ZiT.mjs} +42 -8
- package/dist/.setup/{event-projector-usage-C7Ntzs-f.mjs → event-projector-usage-CnBS8Wa3.mjs} +1 -1
- package/dist/.setup/{harness-rxaaoN-o.mjs → harness-a_MsE4-_.mjs} +23 -17
- package/dist/.setup/{inference-context-fulhZuz8.mjs → inference-context-D96l9-ew.mjs} +1 -1
- package/dist/.setup/inference-proxy-b-aJMSxm.mjs +601 -0
- package/dist/.setup/{isolated-completion-B6srt48J.mjs → isolated-completion-BIZFhTNG.mjs} +17 -10
- package/dist/.setup/launch-args-DbFCehO7.mjs +196 -0
- package/dist/.setup/{managed-binary-DP6Rib3P.mjs → managed-binary-BnshlFag.mjs} +13 -2
- package/dist/.setup/{model-catalog-DkvUuBey.mjs → model-catalog-CfXJf9Ay.mjs} +9 -10
- package/dist/.setup/{models-BDFgm_G-.mjs → models-KnqBv0hE.mjs} +3 -3
- package/dist/.setup/{native-auth-BLZGqFjw.mjs → native-auth-rWbGbMn3.mjs} +4 -4
- package/dist/.setup/{native-subagent-history-YXaL6dMd.mjs → native-subagent-history-0nYYgo0k.mjs} +26 -13
- package/dist/.setup/{native-subagent-monitor-B1hxzIOy.mjs → native-subagent-monitor-D3filLY2.mjs} +145 -317
- package/dist/.setup/{native-subagent-task-ids-DsuOonKv.mjs → native-subagent-task-ids-wb8CKZGN.mjs} +69 -39
- package/dist/.setup/{node-cli-sessions-Cl8b2ZF3.mjs → node-cli-sessions-r3avj02l.mjs} +86 -68
- package/dist/.setup/node-exec-server.runtime-BDwWXVpK.mjs +247 -0
- package/dist/.setup/{plan-xD7WKYTM.mjs → plan-CN3VwfNU.mjs} +74 -76
- package/dist/.setup/{plugin-activation-r8nq5Jzp.mjs → plugin-activation-DT3MNtqj.mjs} +7 -16
- package/dist/.setup/{plugin-app-cache-key-BOxKP7db.mjs → plugin-app-cache-key-B2CsSdnV.mjs} +4 -20
- package/dist/.setup/{plugin-approval-roundtrip-CjfzafAZ.mjs → plugin-approval-roundtrip-C0MZzCuP.mjs} +1 -1
- package/dist/.setup/{plugin-inventory-DUle8DLz.mjs → plugin-inventory-BoRei8Z4.mjs} +16 -7
- package/dist/.setup/{plugin-marketplace-discovery-P-Vndfqq.mjs → plugin-marketplace-discovery-CDOi8IFs.mjs} +4 -1
- package/dist/.setup/{plugin-metadata-cache-DsS5buNa.mjs → plugin-metadata-cache-Ctmo83k_.mjs} +224 -154
- package/dist/.setup/protocol-CANUwXJ3.mjs +17 -0
- package/dist/.setup/{provider-fFh_-VR3.mjs → provider-BOsxQHOM.mjs} +9 -5
- package/dist/.setup/{provider-capabilities-B8J4Dy-O.mjs → provider-capabilities-BfE88FZ5.mjs} +31 -3
- package/dist/.setup/{rate-limits-DOEGYRNs.mjs → rate-limits-CMU3DUD0.mjs} +116 -137
- package/dist/.setup/{request-BioXJLYa.mjs → request-D2L0zMrq.mjs} +23 -15
- package/dist/.setup/{run-attempt-rlA07pUv.mjs → run-attempt-BHu11r7h.mjs} +1197 -617
- package/dist/.setup/{runtime-artifact-Dy38Z5iU.mjs → runtime-artifact-CLZ8udh-.mjs} +29 -45
- package/dist/.setup/{sandbox-guard-BBP-RbTf.mjs → sandbox-guard-C2sRMOEY.mjs} +1 -1
- package/dist/.setup/{session-binding-_0W_fHRr.mjs → session-binding-Cm0apEbd.mjs} +3 -32
- package/dist/.setup/{session-binding-record-TH3xA0zj.mjs → session-binding-record-BGoz8wOK.mjs} +22 -3
- package/dist/.setup/{session-binding-sidecars-CKYEcfNn.mjs → session-binding-sidecars-BlB5EvIS.mjs} +48 -45
- package/dist/.setup/{session-catalog-fUdWDx-U.mjs → session-catalog-Pno1xGcl.mjs} +482 -182
- package/dist/.setup/{session-catalog-adoption-CR_whkEW.mjs → session-catalog-adoption-BI6UTDZT.mjs} +57 -25
- package/dist/.setup/{session-catalog-archive-CwZaPacf.mjs → session-catalog-archive-lHBqzhaO.mjs} +6 -6
- package/dist/.setup/{session-catalog-events-jMcYfQyd.mjs → session-catalog-events-Bj6j94E_.mjs} +122 -25
- package/dist/.setup/{session-catalog-index-B141u15s.mjs → session-catalog-index-B9_VQIUz.mjs} +178 -78
- package/dist/.setup/{session-catalog-index-order-Cc5BzlQr.mjs → session-catalog-index-order-hcdz07yN.mjs} +2 -2
- package/dist/.setup/{session-catalog-index-state-BAuDztHN.mjs → session-catalog-index-state-Dgh8ORJm.mjs} +5 -2
- package/dist/.setup/{session-catalog-native-projection-ChV3cCtm.mjs → session-catalog-native-projection-DowriLid.mjs} +30 -13
- package/dist/.setup/{session-catalog-node-adoption-BVRsYOSh.mjs → session-catalog-node-adoption-ITddWx_X.mjs} +24 -12
- package/dist/.setup/{session-catalog-node-continue-Dowv8osw.mjs → session-catalog-node-continue-6g6qi4A9.mjs} +22 -13
- package/dist/.setup/{session-catalog-projection-C1Bj9Jl-.mjs → session-catalog-projection-zK_PUsiE.mjs} +13 -5
- package/dist/.setup/{session-cli-DIj-IE-E.mjs → session-cli-irrD-uo7.mjs} +4 -4
- package/dist/.setup/{session-history-C--SrLI8.mjs → session-history-BrqhSCf9.mjs} +17 -22
- package/dist/.setup/{session-history-import-JHXT5Xfi.mjs → session-history-import-D-3wAgOP.mjs} +4 -4
- package/dist/.setup/{session-history.worker-CpNj7H_P.mjs → session-history.worker-CaCh0xF_.mjs} +5 -18
- package/dist/.setup/{session-initialization-DH1z6fXn.mjs → session-initialization-rcgbZiid.mjs} +2 -2
- package/dist/.setup/{session-permission-policy-DhurXY0l.mjs → session-permission-policy-BI1QK_98.mjs} +2 -2
- package/dist/.setup/{session-retirement-CU87AOg9.mjs → session-retirement-BH-S6qkJ.mjs} +25 -6
- package/dist/.setup/{settled-turn-finalizer-CiY2bLFK.mjs → settled-turn-finalizer-DiAi6Kx6.mjs} +8 -8
- package/dist/.setup/{shared-client-BpTtuLQ5.mjs → shared-client-DA4VR4Eb.mjs} +59 -89
- package/dist/.setup/{side-question-DSCZyoBD.mjs → side-question-BJ1wSDcB.mjs} +147 -211
- package/dist/.setup/{source-Bjp4UQij.mjs → source-CUzJq5WN.mjs} +9 -9
- package/dist/.setup/spawn-error-CL3n6MAa.mjs +57 -0
- package/dist/.setup/{thread-archive-guard-jmecf6OJ.mjs → thread-archive-guard-C9frICzX.mjs} +10 -3
- package/dist/.setup/{thread-history-page-BTx-4xsg.mjs → thread-history-page-DoVpnHim.mjs} +1 -1
- package/dist/.setup/{thread-lifecycle-Cik28qWn.mjs → thread-lifecycle-B3mfz1TG.mjs} +172 -2271
- package/dist/.setup/{thread-ownership-skomxnIt.mjs → thread-ownership-DcTtAcXj.mjs} +4 -2
- package/dist/.setup/{thread-policy-Cjs4B8xf.mjs → thread-policy-DGuQsuFC.mjs} +19 -3
- package/dist/.setup/thread-requests-BLvGkP2R.mjs +2205 -0
- package/dist/.setup/{thread-resume-BkNpj9Pz.mjs → thread-resume-DIBXwOpE.mjs} +6 -6
- package/dist/.setup/{timeout-DZF05XrR.mjs → timeout-C910MdAB.mjs} +19 -2
- package/dist/.setup/{transcript-history-projection-DHNBDhCU.mjs → transcript-history-projection-ZZpkFkJ_.mjs} +94 -64
- package/dist/.setup/{transcript-mirror-D4qp_leP.mjs → transcript-mirror-BtHDBp1G.mjs} +218 -198
- package/dist/.setup/{transport-stdio-Cmx94Oiy.mjs → transport-stdio-h2VHOskC.mjs} +135 -55
- package/dist/.setup/{upstream-session-fork-D3UKxgVD.mjs → upstream-session-fork-BUr4OUbC.mjs} +44 -36
- package/dist/.setup/{usage-BOgBEKso.mjs → usage-BML0r-ua.mjs} +5 -4
- package/dist/.setup/{usage-limit-error-C0ow7DOc.mjs → usage-limit-error-DUMbefVY.mjs} +4 -4
- package/dist/.setup/{web-search-provider.runtime-CTGuJt6i.mjs → web-search-provider.runtime-CDKlN-Rv.mjs} +4 -3
- package/dist/api.js +23 -12
- package/dist/catalog-page-worker-entrypoint.js +12 -0
- package/dist/catalog-page.worker.js +9 -0
- package/dist/cli-metadata.js +1 -1
- package/dist/doctor-contract-api.js +2 -2
- package/dist/harness.js +1 -1
- package/dist/index.js +221 -170
- 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 +15 -32
- package/dist/session-history.worker.js +1 -1
- package/package.json +9 -6
- package/dist/.setup/attempt-context-VXVwTCfS.mjs +0 -636
- package/dist/.setup/inference-proxy-CC15HuSi.mjs +0 -311
- package/dist/.setup/launch-args-DnMak49W.mjs +0 -111
- package/dist/.setup/node-exec-server.runtime-BaViBKNz.mjs +0 -226
- package/dist/.setup/version-CoqzXPgK.mjs +0 -12
- package/dist/.setup/{native-execution-policy-YBMHSzC4.mjs → native-execution-policy-umd0tgh4.mjs} +1 -1
package/dist/.setup/{account-usage-runtime-C2MOIvfq.mjs → account-usage-runtime-Eem_WGqY.mjs}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as isCodexAppServerProxyLaunch } from "./launch-args-
|
|
2
|
-
import { t as buildCodexAppServerUsageSnapshot } from "./rate-limits-
|
|
3
|
-
import { n as readCodexAppServerUsage } from "./request-
|
|
4
|
-
import "./config-
|
|
5
|
-
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-
|
|
1
|
+
import { n as isCodexAppServerProxyLaunch } from "./launch-args-DbFCehO7.mjs";
|
|
2
|
+
import { t as buildCodexAppServerUsageSnapshot } from "./rate-limits-CMU3DUD0.mjs";
|
|
3
|
+
import { n as readCodexAppServerUsage } from "./request-D2L0zMrq.mjs";
|
|
4
|
+
import "./config-BoTP_mrL.mjs";
|
|
5
|
+
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-C8Rw1m1m.mjs";
|
|
6
6
|
import { a as resolveCodexAppServerAuthProfileStore } from "./auth-profile-WqZtZfXN.mjs";
|
|
7
7
|
import { isDeepStrictEqual } from "node:util";
|
|
8
8
|
import { listAgentIds, resolveAgentDir } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { c as CODEX_PLUGINS_MARKETPLACE_NAME } from "./plugin-inventory-
|
|
1
|
+
import { c as CODEX_PLUGINS_MARKETPLACE_NAME, n as isOpenAiCuratedMarketplace } from "./plugin-inventory-BoRei8Z4.mjs";
|
|
2
2
|
import { d as readCodexPluginConfig } from "./config-parsing-CcB9iPoq.mjs";
|
|
3
|
-
import { s as resolveCodexAppServerFallbackApiKeyCacheKey } from "./auth-cache-key-
|
|
4
|
-
import { a as defaultCodexAppInventoryCache, r as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-
|
|
5
|
-
import { i as requestCodexAppServerJson } from "./request-
|
|
6
|
-
import "./config-
|
|
7
|
-
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-
|
|
3
|
+
import { s as resolveCodexAppServerFallbackApiKeyCacheKey } from "./auth-cache-key-B2mpaI9D.mjs";
|
|
4
|
+
import { a as defaultCodexAppInventoryCache, r as buildCodexPluginAppCacheKey } from "./plugin-app-cache-key-B2CsSdnV.mjs";
|
|
5
|
+
import { i as requestCodexAppServerJson } from "./request-D2L0zMrq.mjs";
|
|
6
|
+
import "./config-BoTP_mrL.mjs";
|
|
7
|
+
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-C8Rw1m1m.mjs";
|
|
8
8
|
import { i as resolveCodexAppServerAuthProfileIdForAgent } from "./auth-profile-WqZtZfXN.mjs";
|
|
9
|
-
import { X as resolveCodexAppServerAuthAccountCacheKey, c as getLeasedSharedCodexAppServerClient, h as releaseLeasedSharedCodexAppServerClient, o as clearSharedCodexAppServerClientIfCurrentAndWait } from "./shared-client-
|
|
10
|
-
import { t as ensureCodexPluginActivation } from "./plugin-activation-
|
|
11
|
-
import { CODEX_PLUGIN_CONFIG_PATH, buildCodexMigrationPlan, buildCodexPluginsConfigValue, hasCodexPluginConfigConflict, n as
|
|
9
|
+
import { X as resolveCodexAppServerAuthAccountCacheKey, c as getLeasedSharedCodexAppServerClient, h as releaseLeasedSharedCodexAppServerClient, o as clearSharedCodexAppServerClientIfCurrentAndWait } from "./shared-client-DA4VR4Eb.mjs";
|
|
10
|
+
import { t as ensureCodexPluginActivation } from "./plugin-activation-DT3MNtqj.mjs";
|
|
11
|
+
import { CODEX_PLUGIN_CONFIG_PATH, buildCodexMigrationPlan, buildCodexPluginsConfigValue, hasCodexPluginConfigConflict, n as resolveCodexConfigPatchMode, readCodexPluginMigrationConfigEntry, t as createCodexAuthItemApplier } from "./plan-CN3VwfNU.mjs";
|
|
12
12
|
import { uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
13
13
|
import { parseStrictNonNegativeInteger } from "openclaw/plugin-sdk/number-runtime";
|
|
14
14
|
import path from "node:path";
|
|
15
15
|
import { coerceErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
16
16
|
import { sleep } from "openclaw/plugin-sdk/runtime-env";
|
|
17
17
|
import { MIGRATION_REASON_TARGET_EXISTS, applyMigrationManualItem, markMigrationItemConflict, markMigrationItemError, markMigrationItemSkipped, resolveMigrationConfigRuntime, summarizeMigrationItems, writeMigrationConfigPath } from "openclaw/plugin-sdk/migration";
|
|
18
|
-
import { archiveMigrationItem, copyMemoryMigrationFileItem, copyMigrationFileItem, withCachedMigrationConfigRuntime, writeMigrationReport } from "openclaw/plugin-sdk/migration-runtime";
|
|
18
|
+
import { archiveMigrationItem, copyMemoryMigrationFileItem, copyMigrationFileItem, resolvePlannedMigrationTargets, withCachedMigrationConfigRuntime, writeMigrationReport } from "openclaw/plugin-sdk/migration-runtime";
|
|
19
19
|
//#region extensions/codex/src/migration/apply-report.ts
|
|
20
20
|
function codexPluginActivationReportState(result) {
|
|
21
21
|
switch (result.reason) {
|
|
@@ -69,7 +69,7 @@ function shouldReturnCodexPluginConfigPatch(ctx) {
|
|
|
69
69
|
}
|
|
70
70
|
function prepareTargetCodexAppServer(ctx) {
|
|
71
71
|
const appServer = resolveTargetCodexAppServer(ctx);
|
|
72
|
-
const targets =
|
|
72
|
+
const targets = resolvePlannedMigrationTargets(ctx);
|
|
73
73
|
let warmedClient;
|
|
74
74
|
const ready = getLeasedSharedCodexAppServerClient({
|
|
75
75
|
startOptions: appServer.start,
|
|
@@ -92,7 +92,7 @@ async function applyCodexMigrationPlan(params) {
|
|
|
92
92
|
const plan = params.plan ?? await buildCodexMigrationPlan(params.ctx);
|
|
93
93
|
const reportDir = params.ctx.reportDir ?? path.join(params.ctx.stateDir, "migration", "codex");
|
|
94
94
|
const items = [];
|
|
95
|
-
const targets =
|
|
95
|
+
const targets = resolvePlannedMigrationTargets(params.ctx);
|
|
96
96
|
const codexHome = typeof plan.metadata?.codexHome === "string" && plan.metadata.codexHome.trim() ? plan.metadata.codexHome : plan.source;
|
|
97
97
|
const authSource = {
|
|
98
98
|
codexHome,
|
|
@@ -104,18 +104,19 @@ async function applyCodexMigrationPlan(params) {
|
|
|
104
104
|
...params.ctx,
|
|
105
105
|
runtime
|
|
106
106
|
};
|
|
107
|
+
const applyAuthItem = createCodexAuthItemApplier({
|
|
108
|
+
ctx: applyCtx,
|
|
109
|
+
source: authSource,
|
|
110
|
+
targets,
|
|
111
|
+
items: plan.items
|
|
112
|
+
});
|
|
107
113
|
for (const item of plan.items) {
|
|
108
114
|
if (item.status !== "planned") {
|
|
109
115
|
items.push(item);
|
|
110
116
|
continue;
|
|
111
117
|
}
|
|
112
118
|
if (item.id === "config:codex-plugins") items.push(await applyCodexPluginConfigItem(applyCtx, item, items));
|
|
113
|
-
else if (item.kind === "auth") items.push(...await
|
|
114
|
-
ctx: applyCtx,
|
|
115
|
-
item,
|
|
116
|
-
source: authSource,
|
|
117
|
-
targets
|
|
118
|
-
}));
|
|
119
|
+
else if (item.kind === "auth") items.push(...await applyAuthItem(item));
|
|
119
120
|
else if (item.kind === "plugin" && item.action === "install") items.push(await applyCodexPluginInstallItem(applyCtx, item));
|
|
120
121
|
else if (item.kind === "manual") items.push(applyMigrationManualItem(item));
|
|
121
122
|
else if (item.action === "archive") items.push(await archiveMigrationItem(item, reportDir));
|
|
@@ -159,7 +160,7 @@ async function applyCodexPluginInstallItem(ctx, item) {
|
|
|
159
160
|
requestParams,
|
|
160
161
|
timeoutMs: 6e4,
|
|
161
162
|
startOptions: appServer.start,
|
|
162
|
-
agentDir:
|
|
163
|
+
agentDir: resolvePlannedMigrationTargets(ctx).agentDir,
|
|
163
164
|
config: ctx.config,
|
|
164
165
|
isolated: false
|
|
165
166
|
}),
|
|
@@ -241,26 +242,19 @@ async function requestTargetCodexAppServerJson(params) {
|
|
|
241
242
|
const discoveryTimeoutMs = targetCodexMarketplaceDiscoveryTimeoutMs();
|
|
242
243
|
const discoveryDeadline = Math.min(deadline, Date.now() + discoveryTimeoutMs);
|
|
243
244
|
let lastResponse;
|
|
244
|
-
let attempt = 0;
|
|
245
245
|
do {
|
|
246
|
-
attempt += 1;
|
|
247
246
|
const remainingMs = Math.max(1, discoveryDeadline - Date.now());
|
|
248
247
|
lastResponse = await requestCodexAppServerJson({
|
|
249
248
|
...params,
|
|
250
249
|
timeoutMs: remainingMs
|
|
251
250
|
});
|
|
252
|
-
if (
|
|
251
|
+
if (lastResponse.marketplaces.some(isOpenAiCuratedMarketplace)) return lastResponse;
|
|
253
252
|
if (Date.now() >= discoveryDeadline) return lastResponse;
|
|
254
253
|
const waitMs = Math.min(TARGET_CODEX_MARKETPLACE_DISCOVERY_POLL_MS, discoveryDeadline - Date.now());
|
|
255
254
|
await sleep(waitMs);
|
|
256
255
|
} while (Date.now() < discoveryDeadline);
|
|
257
256
|
return lastResponse;
|
|
258
257
|
}
|
|
259
|
-
function hasOpenAiCuratedMarketplace(response) {
|
|
260
|
-
if (!response || typeof response !== "object" || !("marketplaces" in response)) return false;
|
|
261
|
-
const marketplaces = response.marketplaces;
|
|
262
|
-
return Array.isArray(marketplaces) && marketplaces.some((marketplace) => marketplace && typeof marketplace === "object" && marketplace.name === "openai-curated");
|
|
263
|
-
}
|
|
264
258
|
function targetCodexMarketplaceDiscoveryTimeoutMs(env = process.env) {
|
|
265
259
|
const configured = parseStrictNonNegativeInteger(env[TARGET_CODEX_MARKETPLACE_DISCOVERY_TIMEOUT_ENV]);
|
|
266
260
|
if (configured !== void 0) return configured;
|
|
@@ -270,7 +264,7 @@ function isCodexPluginLoadWarningItem(item) {
|
|
|
270
264
|
return item.kind === "plugin" && item.action === "install" && item.status === "warning" && item.details?.warningReason === CODEX_PLUGIN_LOAD_WARNING;
|
|
271
265
|
}
|
|
272
266
|
async function buildTargetCodexPluginAppCacheKey(ctx) {
|
|
273
|
-
const targets =
|
|
267
|
+
const targets = resolvePlannedMigrationTargets(ctx);
|
|
274
268
|
const appServer = resolveTargetCodexAppServer(ctx);
|
|
275
269
|
const authProfileId = resolveCodexAppServerAuthProfileIdForAgent({
|
|
276
270
|
agentDir: targets.agentDir,
|
package/dist/.setup/{attempt-client-cleanup-BpYKdTA0.mjs → attempt-client-cleanup-CEv1cKwF.mjs}
RENAMED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { h as unknownItemStatus } from "./event-projector-items-
|
|
6
|
-
import { G as unsubscribeCodexAppServerLiveThread, rt as isCodexAppServerStartupError, u as isCodexAppServerStartSelectionChangedError } from "./shared-client-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
|
|
2
|
+
import { i as isJsonObject } from "./protocol-CANUwXJ3.mjs";
|
|
3
|
+
import { h as retireSharedCodexAppServerClientIfCurrent } from "./session-catalog-events-Bj6j94E_.mjs";
|
|
4
|
+
import { n as waitForPromiseOrAbort, o as CodexAppServerRpcError, t as abortReason } from "./timeout-C910MdAB.mjs";
|
|
5
|
+
import { h as unknownItemStatus } from "./event-projector-items-C6L_5ZiT.mjs";
|
|
6
|
+
import { G as unsubscribeCodexAppServerLiveThread, rt as isCodexAppServerStartupError, u as isCodexAppServerStartSelectionChangedError } from "./shared-client-DA4VR4Eb.mjs";
|
|
7
|
+
import { T as readCodexTurnCompletedNotification, a as isCodexAppServerBrokenPipeError, d as isCodexAppServerRequestTimeoutError, l as isCodexAppServerOverloadError } from "./client-Cs08OXVQ.mjs";
|
|
7
8
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
9
|
import { AsyncResource } from "node:async_hooks";
|
|
9
10
|
import { createDeferred } from "openclaw/plugin-sdk/extension-shared";
|
|
10
|
-
import { AgentHarnessPreflightError, embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
11
11
|
import { sanitizeTerminalText } from "openclaw/plugin-sdk/text-chunking";
|
|
12
|
+
import { AgentHarnessPreflightError, embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
12
13
|
import { redactSensitiveText } from "openclaw/plugin-sdk/logging-core";
|
|
13
14
|
//#region extensions/codex/src/app-server/notification-correlation.ts
|
|
14
15
|
/**
|
|
@@ -115,9 +116,7 @@ var ClientTurnRouter = class {
|
|
|
115
116
|
this.nativeTurnCompletionWatchers = /* @__PURE__ */ new Map();
|
|
116
117
|
client.addNotificationHandler((notification) => this.routeNotification(notification));
|
|
117
118
|
client.addRequestHandler((request, signal, setExecutionTimeoutMs) => this.routeRequest(request, signal, setExecutionTimeoutMs));
|
|
118
|
-
client.addCloseHandler((closedClient) =>
|
|
119
|
-
this.dispose(closedClient.getCloseError());
|
|
120
|
-
});
|
|
119
|
+
client.addCloseHandler((closedClient) => this.dispose(closedClient.getCloseError()));
|
|
121
120
|
}
|
|
122
121
|
reserveThread(options) {
|
|
123
122
|
this.assertActive();
|
|
@@ -160,7 +159,7 @@ var ClientTurnRouter = class {
|
|
|
160
159
|
armTurn: () => this.armTurn(route),
|
|
161
160
|
bindTurn: (turnId, bindingOptions) => this.bindTurn(route, turnId, bindingOptions),
|
|
162
161
|
cancelTurn: () => this.cancelTurn(route),
|
|
163
|
-
drain: () => this.
|
|
162
|
+
drain: () => this.waitForNotifications(route),
|
|
164
163
|
release: () => this.release(route)
|
|
165
164
|
};
|
|
166
165
|
}
|
|
@@ -266,10 +265,22 @@ var ClientTurnRouter = class {
|
|
|
266
265
|
if (route.gate !== "armed") throw new Error(`codex app-server thread route cannot bind from ${route.gate}`);
|
|
267
266
|
route.gate = "bound";
|
|
268
267
|
route.turnId = turnId;
|
|
268
|
+
if (options?.beforeNotifications) {
|
|
269
|
+
route.notificationPause = options.beforeNotifications.then(() => {
|
|
270
|
+
route.notificationPause = void 0;
|
|
271
|
+
this.flushNotifications(route);
|
|
272
|
+
}, (cause) => {
|
|
273
|
+
const error = new Error("codex app-server notification barrier failed", { cause });
|
|
274
|
+
this.release(route, error);
|
|
275
|
+
throw error;
|
|
276
|
+
});
|
|
277
|
+
route.notificationPause.catch(() => {});
|
|
278
|
+
}
|
|
269
279
|
this.flushNotifications(route);
|
|
270
280
|
route.binding?.resolve();
|
|
271
281
|
await this.waitForNotifications(route);
|
|
272
282
|
this.assertRoute(route, turnId);
|
|
283
|
+
await route.notificationPause;
|
|
273
284
|
await route.notificationTail;
|
|
274
285
|
}
|
|
275
286
|
routeNotification(notification) {
|
|
@@ -282,13 +293,14 @@ var ClientTurnRouter = class {
|
|
|
282
293
|
this.bufferNotification(route, notification, { threadId: route.threadId }, Date.now());
|
|
283
294
|
if (route.gate === "bound") this.flushNotifications(route);
|
|
284
295
|
}
|
|
285
|
-
return Promise.all([...this.routes.values()].map((route) => route
|
|
296
|
+
return Promise.all([...this.routes.values()].map((route) => this.waitForNotifications(route))).then(() => void 0);
|
|
286
297
|
}
|
|
287
298
|
const watchers = scope.threadId ? this.nativeTurnCompletionWatchers.get(scope.threadId) : void 0;
|
|
288
299
|
const route = scope.threadId ? this.routes.get(scope.threadId) : void 0;
|
|
289
300
|
if (!watchers && !route) return;
|
|
301
|
+
const completedTurn = notification.method === "turn/completed" && readCodexTurnCompletedNotification(notification.params) !== void 0;
|
|
290
302
|
if (scope.turnId && watchers) {
|
|
291
|
-
for (const watcher of watchers) if (watcher.turnId === scope.turnId &&
|
|
303
|
+
for (const watcher of watchers) if (watcher.turnId === scope.turnId && completedTurn) watcher.finish(true);
|
|
292
304
|
else if (watcher.turnId === scope.turnId && notification.method === "turn/started") watcher.onStarted?.();
|
|
293
305
|
}
|
|
294
306
|
if (!route) return;
|
|
@@ -304,7 +316,7 @@ var ClientTurnRouter = class {
|
|
|
304
316
|
id: scope.turnId,
|
|
305
317
|
completed: false
|
|
306
318
|
};
|
|
307
|
-
} else if (
|
|
319
|
+
} else if (completedTurn) {
|
|
308
320
|
if (route.gate === "bound") route.completedNativeTurnIds.clear();
|
|
309
321
|
route.completedNativeTurnIds.add(scope.turnId);
|
|
310
322
|
if (!route.observedNativeTurn || route.observedNativeTurn.completed || route.observedNativeTurn.id === scope.turnId) route.observedNativeTurn = {
|
|
@@ -323,7 +335,7 @@ var ClientTurnRouter = class {
|
|
|
323
335
|
this.warnDroppedStaleTurnNotification(route, notification, routeScope);
|
|
324
336
|
return;
|
|
325
337
|
}
|
|
326
|
-
if (route.gate === "armed") {
|
|
338
|
+
if (route.gate === "armed" || route.notificationPause) {
|
|
327
339
|
this.bufferNotification(route, notification, routeScope, receivedAtMs);
|
|
328
340
|
return;
|
|
329
341
|
}
|
|
@@ -375,10 +387,16 @@ var ClientTurnRouter = class {
|
|
|
375
387
|
this.warnDroppedStaleTurnNotification(route, pending.notification, pending.scope);
|
|
376
388
|
continue;
|
|
377
389
|
}
|
|
378
|
-
|
|
379
|
-
|
|
390
|
+
this.observeNotificationReceipt(route, pending);
|
|
391
|
+
if (route.notificationPause) route.pending.push(pending);
|
|
392
|
+
else this.enqueueNotification(route, handler, pending.notification, pending.scope);
|
|
380
393
|
}
|
|
381
394
|
}
|
|
395
|
+
observeNotificationReceipt(route, pending) {
|
|
396
|
+
if (pending.receiptObserved) return;
|
|
397
|
+
pending.receiptObserved = true;
|
|
398
|
+
route.handlers?.onNotificationReceived?.(pending.notification, pending.scope, pending.receivedAtMs);
|
|
399
|
+
}
|
|
382
400
|
warnDroppedStaleTurnNotification(route, notification, scope) {
|
|
383
401
|
if (notification.method === "turn/completed" || !scope.turnId || !route.turnId) return;
|
|
384
402
|
const eventKind = redactCodexEventKind(notification.method);
|
|
@@ -396,12 +414,14 @@ var ClientTurnRouter = class {
|
|
|
396
414
|
});
|
|
397
415
|
}
|
|
398
416
|
bufferNotification(route, notification, scope, receivedAtMs) {
|
|
417
|
+
const pending = {
|
|
418
|
+
notification,
|
|
419
|
+
receivedAtMs,
|
|
420
|
+
scope
|
|
421
|
+
};
|
|
422
|
+
if (route.gate === "bound") this.observeNotificationReceipt(route, pending);
|
|
399
423
|
if (route.pending.length < DEFAULT_PREBIND_NOTIFICATION_LIMIT) {
|
|
400
|
-
route.pending.push(
|
|
401
|
-
notification,
|
|
402
|
-
receivedAtMs,
|
|
403
|
-
scope
|
|
404
|
-
});
|
|
424
|
+
route.pending.push(pending);
|
|
405
425
|
return;
|
|
406
426
|
}
|
|
407
427
|
const error = /* @__PURE__ */ new Error(`codex app-server pre-bind notification buffer exceeded ${DEFAULT_PREBIND_NOTIFICATION_LIMIT} entries for thread ${route.threadId}`);
|
|
@@ -420,9 +440,7 @@ var ClientTurnRouter = class {
|
|
|
420
440
|
});
|
|
421
441
|
}
|
|
422
442
|
async waitForNotifications(route) {
|
|
423
|
-
await Promise.race([route.
|
|
424
|
-
}
|
|
425
|
-
async drainNotifications(route) {
|
|
443
|
+
if (route.notificationPause) await Promise.race([route.notificationPause, route.ended.promise]);
|
|
426
444
|
await Promise.race([route.notificationTail, route.ended.promise]);
|
|
427
445
|
}
|
|
428
446
|
release(route, error = /* @__PURE__ */ new Error("codex app-server thread route is released")) {
|
|
@@ -446,23 +464,6 @@ var ClientTurnRouter = class {
|
|
|
446
464
|
if (route.released && !this.canDrainClosedTurn(route, completedTurnId)) throw route.released;
|
|
447
465
|
}
|
|
448
466
|
};
|
|
449
|
-
async function waitForPromiseOrAbort(promise, signal) {
|
|
450
|
-
if (signal.aborted) return false;
|
|
451
|
-
let removeAbort;
|
|
452
|
-
try {
|
|
453
|
-
return await Promise.race([promise.then(() => true), new Promise((resolve) => {
|
|
454
|
-
const onAbort = () => resolve(false);
|
|
455
|
-
signal.addEventListener("abort", onAbort, { once: true });
|
|
456
|
-
removeAbort = () => signal.removeEventListener("abort", onAbort);
|
|
457
|
-
if (signal.aborted) onAbort();
|
|
458
|
-
})]);
|
|
459
|
-
} finally {
|
|
460
|
-
removeAbort?.();
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
function abortReason(signal) {
|
|
464
|
-
return signal.reason instanceof Error ? signal.reason : new Error(String(signal.reason ?? "codex app-server thread route aborted"));
|
|
465
|
-
}
|
|
466
467
|
function readScope(value) {
|
|
467
468
|
if (!isJsonObject(value)) return {};
|
|
468
469
|
const threadId = readCodexNotificationThreadId(value);
|
|
@@ -482,6 +483,20 @@ function requireId(value, label) {
|
|
|
482
483
|
/**
|
|
483
484
|
* Best-effort cleanup helpers for Codex app-server startup attempts and turns.
|
|
484
485
|
*/
|
|
486
|
+
var attempt_client_cleanup_exports = /* @__PURE__ */ __exportAll({
|
|
487
|
+
CODEX_APP_SERVER_INTERRUPT_TIMEOUT_MS: () => CODEX_APP_SERVER_INTERRUPT_TIMEOUT_MS,
|
|
488
|
+
CODEX_APP_SERVER_UNSUBSCRIBE_TIMEOUT_MS: () => CODEX_APP_SERVER_UNSUBSCRIBE_TIMEOUT_MS,
|
|
489
|
+
CodexAppServerUnsafeSubscriptionError: () => CodexAppServerUnsafeSubscriptionError,
|
|
490
|
+
assertCodexThreadResumeSubscription: () => assertCodexThreadResumeSubscription,
|
|
491
|
+
closeCodexStartupClientBestEffort: () => closeCodexStartupClientBestEffort,
|
|
492
|
+
interruptCodexTurnAndWaitBestEffort: () => interruptCodexTurnAndWaitBestEffort,
|
|
493
|
+
isCodexAppServerUnsafeSubscriptionError: () => isCodexAppServerUnsafeSubscriptionError,
|
|
494
|
+
isCodexNoActiveTurnInterruptError: () => isCodexNoActiveTurnInterruptError,
|
|
495
|
+
retireUnsafeCodexTurnClientBestEffort: () => retireUnsafeCodexTurnClientBestEffort,
|
|
496
|
+
shouldRetireCodexStartupClient: () => shouldRetireCodexStartupClient,
|
|
497
|
+
terminateCodexBackgroundTerminals: () => terminateCodexBackgroundTerminals,
|
|
498
|
+
unsubscribeCodexThreadBestEffort: () => unsubscribeCodexThreadBestEffort
|
|
499
|
+
});
|
|
485
500
|
/** Timeout for best-effort app-server turn interruption during cleanup. */
|
|
486
501
|
const CODEX_APP_SERVER_INTERRUPT_TIMEOUT_MS = 5e3;
|
|
487
502
|
/** Timeout for best-effort thread unsubscribe during cleanup. */
|
|
@@ -620,4 +635,4 @@ function shouldRetireCodexStartupClient(error, spawnedBy, signal) {
|
|
|
620
635
|
return !isCodexAppServerStartSelectionChangedError(error) && !isCodexAppServerOverloadError(error) && !(error instanceof AgentHarnessPreflightError && error.scope === void 0) && (isCodexAppServerBrokenPipeError(error) || !spawnedBy);
|
|
621
636
|
}
|
|
622
637
|
//#endregion
|
|
623
|
-
export { CodexProjectionDiagnostics as _,
|
|
638
|
+
export { CodexProjectionDiagnostics as _, attempt_client_cleanup_exports as a, readCodexNotificationTurnId as b, isCodexAppServerUnsafeSubscriptionError as c, shouldRetireCodexStartupClient as d, terminateCodexBackgroundTerminals as f, hasCodexAppServerSiblingRouteWork as g, getCodexAppServerTurnRouter as h, assertCodexThreadResumeSubscription as i, isCodexNoActiveTurnInterruptError as l, CODEX_APP_SERVER_NATIVE_TURN_WAIT_TIMEOUT_MS as m, CODEX_APP_SERVER_UNSUBSCRIBE_TIMEOUT_MS as n, closeCodexStartupClientBestEffort as o, unsubscribeCodexThreadBestEffort as p, CodexAppServerUnsafeSubscriptionError as r, interruptCodexTurnAndWaitBestEffort as s, CODEX_APP_SERVER_INTERRUPT_TIMEOUT_MS as t, retireUnsafeCodexTurnClientBestEffort as u, isCodexNotificationForTurn as v, readCodexNotificationThreadId as y };
|