@openclaw/codex 2026.9.33 → 2026.9.35
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-dYM1lh1V.mjs → account-usage-runtime-BaJamBiM.mjs} +3 -3
- package/dist/.setup/{apply-C82xe8Bk.mjs → apply-CxwOGLd_.mjs} +8 -8
- package/dist/.setup/{attempt-client-cleanup-D1aznv7C.mjs → attempt-client-cleanup-BVtNsTOE.mjs} +4 -4
- package/dist/.setup/{attempt-workspace-context-DKAbD-vI.mjs → attempt-workspace-context-XRsWP165.mjs} +1 -1
- package/dist/.setup/{auth-binding-BLWz7stm.mjs → auth-binding-Bnaj0_iV.mjs} +1 -1
- package/dist/.setup/{auth-cache-key-CWpIEtTm.mjs → auth-cache-key-CskfconU.mjs} +3 -3
- package/dist/.setup/{binding-connection-DTtN1KrX.mjs → binding-connection-DRPlnIgg.mjs} +2 -2
- package/dist/.setup/{binding-connection.runtime-6TpgD1M6.mjs → binding-connection.runtime-DC3oUqo-.mjs} +1 -1
- package/dist/.setup/{bounded-turn-Ca4urQ25.mjs → bounded-turn-DBwLoFDR.mjs} +11 -11
- package/dist/.setup/{bounded-turn-isolation-B8K_ylqk.mjs → bounded-turn-isolation-Ce-oOk-D.mjs} +2 -2
- package/dist/.setup/{build-state-E-CRUdgh.mjs → build-state-B3lvV1Op.mjs} +1 -1
- package/dist/.setup/{client-6GbdZFc0.mjs → client-DcTISXe3.mjs} +7 -7
- package/dist/.setup/{client-catalog-response-HvvnCxvX.mjs → client-catalog-response-BcbsrQXY.mjs} +1 -1
- package/dist/.setup/{command-dispatch-_PPJobF7.mjs → command-dispatch-MOoD3rsD.mjs} +1 -1
- package/dist/.setup/{command-handlers-Do_MOc5V.mjs → command-handlers-Cevt_YwM.mjs} +23 -23
- package/dist/.setup/{command-rpc-Bc_OIgK0.mjs → command-rpc-kf7Uq4L-.mjs} +11 -11
- package/dist/.setup/{compact-BVSQoyh-.mjs → compact-BNKuKa7o.mjs} +13 -13
- package/dist/.setup/{config-DKhXquav.mjs → config-DqmrqI23.mjs} +2 -2
- package/dist/.setup/{config-runtime-C0NbLms1.mjs → config-runtime-DDhvIeUC.mjs} +1 -1
- package/dist/.setup/{conversation-binding-CvjxRWI-.mjs → conversation-binding-CKYGEvcX.mjs} +15 -15
- package/dist/.setup/{conversation-binding-data-C746z5Pn.mjs → conversation-binding-data-DlsG-dQu.mjs} +1 -1
- package/dist/.setup/{conversation-control-DoxkQ9nq.mjs → conversation-control-CoWUL35l.mjs} +5 -5
- package/dist/.setup/{dynamic-tools-CGMXNyuw.mjs → dynamic-tools-Dr0ye5P3.mjs} +7 -7
- package/dist/.setup/{effective-mcp-catalog-C1zwj-bq.mjs → effective-mcp-catalog-BFJCwjSI.mjs} +4 -4
- package/dist/.setup/{ephemeral-turn-Cyu_xJDs.mjs → ephemeral-turn-Dj3iTfSP.mjs} +2 -2
- package/dist/.setup/{event-projector-assistant-message-CAI4foF8.mjs → event-projector-assistant-message-DXDX94zH.mjs} +1 -1
- package/dist/.setup/incognito-session-C5ve_-63.mjs +1 -0
- package/dist/.setup/{isolated-completion-DPr7Nsl7.mjs → isolated-completion-GB52W-qA.mjs} +6 -6
- package/dist/.setup/{managed-binary-B6hQ1UKR.mjs → managed-binary-Ckgvm_4V.mjs} +1 -1
- package/dist/.setup/{model-catalog-gcv3irT9.mjs → model-catalog-DxSrOSY0.mjs} +7 -7
- package/dist/.setup/{models-Bs4aEhpG.mjs → models-BwkZaXXj.mjs} +3 -3
- package/dist/.setup/{native-auth-BN-BD2AV.mjs → native-auth-BNGz77PF.mjs} +3 -3
- package/dist/.setup/{native-subagent-monitor-DbNIloTJ.mjs → native-subagent-monitor-g-ZDkvCr.mjs} +118 -27
- package/dist/.setup/{native-subagent-pending-assignments-DwkCzLvD.mjs → native-subagent-pending-assignments-XHNn4k5q.mjs} +51 -14
- package/dist/.setup/{native-task-assignments-DMQ0g3hu.mjs → native-task-assignments-Dna952zv.mjs} +2 -2
- package/dist/.setup/{node-cli-sessions-HC4W6FLI.mjs → node-cli-sessions-BwhIYgCZ.mjs} +2 -2
- package/dist/.setup/{node-exec-server.runtime-BS7jsvK-.mjs → node-exec-server.runtime-9IZtsOmo.mjs} +2 -2
- package/dist/.setup/{plan-NTSBQtKx.mjs → plan-Cwp_21m-.mjs} +5 -5
- package/dist/.setup/{plugin-activation-cNHRfaxU.mjs → plugin-activation-BaDnJKJd.mjs} +2 -2
- package/dist/.setup/{plugin-inventory-Cky2XJUw.mjs → plugin-inventory-B4uqIw4J.mjs} +1 -1
- package/dist/.setup/{plugin-metadata-cache-Z06WuND0.mjs → plugin-metadata-cache-C-LRxilF.mjs} +7 -7
- package/dist/.setup/{provider-BnX84knz.mjs → provider-DUotqBZ6.mjs} +4 -4
- package/dist/.setup/{provider-capabilities-CYK-rMwC.mjs → provider-capabilities-DBs9l8oL.mjs} +2 -2
- package/dist/.setup/{request-DQh7X3fU.mjs → request-CWERwKIL.mjs} +5 -5
- package/dist/.setup/{run-attempt-Bp6qFrIQ.mjs → run-attempt-ypT0LYSD.mjs} +77 -42
- package/dist/.setup/{runtime-artifact-D7lCXdhV.mjs → runtime-artifact-Riq878B2.mjs} +3 -3
- package/dist/.setup/{runtime-artifact-connection-D68qQn1m.mjs → runtime-artifact-connection-Bjv8P6Sx.mjs} +2 -2
- package/dist/.setup/{sandbox-guard-DjCz2eOw.mjs → sandbox-guard-OIYEmTRF.mjs} +1 -1
- package/dist/.setup/{session-binding-DGCYAfvD.mjs → session-binding-Fn7Ekzuv.mjs} +19 -4
- package/dist/.setup/{session-binding-record-Oe9L-CNY.mjs → session-binding-record-CUKpUKVm.mjs} +1 -1
- package/dist/.setup/{session-binding-sidecars-jo6H8dFr.mjs → session-binding-sidecars-BuEALwJY.mjs} +1 -1
- package/dist/.setup/{session-catalog-DFZmNlhW.mjs → session-catalog-DMagZcW-.mjs} +22 -22
- package/dist/.setup/{session-catalog-adoption-BU_pHWG7.mjs → session-catalog-adoption-58bqOngU.mjs} +5 -5
- package/dist/.setup/{session-catalog-archive-spHfihri.mjs → session-catalog-archive-BM9gCB82.mjs} +5 -5
- package/dist/.setup/{session-catalog-events-DVLgp99B.mjs → session-catalog-events-r59AxcQ4.mjs} +3 -3
- package/dist/.setup/{session-catalog-index-v3Yjgaih.mjs → session-catalog-index-CY1lNpxF.mjs} +8 -8
- package/dist/.setup/{session-catalog-index-order-BcQpHks3.mjs → session-catalog-index-order-DQhmgM3b.mjs} +1 -1
- package/dist/.setup/{session-catalog-index-state-TeO7EyO-.mjs → session-catalog-index-state-DhLoAnfy.mjs} +3 -3
- package/dist/.setup/{session-catalog-limits-DDxOsQeC.mjs → session-catalog-limits-bz5ZvjtY.mjs} +1 -1
- package/dist/.setup/{session-catalog-list-request-CvtxrYSe.mjs → session-catalog-list-request-A1wN4sKw.mjs} +2 -2
- package/dist/.setup/{session-catalog-native-projection-LshItrMe.mjs → session-catalog-native-projection-CXTe4qQr.mjs} +4 -4
- package/dist/.setup/{session-catalog-node-adoption-DgXvSGu0.mjs → session-catalog-node-adoption-BdS7zDuY.mjs} +2 -2
- package/dist/.setup/{session-catalog-node-continue-DjKXHBbi.mjs → session-catalog-node-continue-XFJG3JGh.mjs} +5 -5
- package/dist/.setup/{session-catalog-node-lookup-CtAXI5W5.mjs → session-catalog-node-lookup-D9AP5D5o.mjs} +2 -2
- package/dist/.setup/{session-catalog-parsing-CPGaPYr-.mjs → session-catalog-parsing-CnEH565l.mjs} +1 -1
- package/dist/.setup/{session-catalog-projection-CCBFozaQ.mjs → session-catalog-projection-DcDKizZd.mjs} +4 -4
- package/dist/.setup/{session-cli-KhdG-_Aj.mjs → session-cli-C3GejWcm.mjs} +2 -2
- package/dist/.setup/{session-history-import-WhX-X33a.mjs → session-history-import-tquj9DCz.mjs} +4 -4
- package/dist/.setup/{session-initialization-6aveB9qb.mjs → session-initialization-DefAI1_5.mjs} +2 -2
- package/dist/.setup/{session-permission-policy-Ci_fVX6y.mjs → session-permission-policy-7lM447LW.mjs} +1 -1
- package/dist/.setup/{session-retirement-ERjp2r4a.mjs → session-retirement-CQCMiDul.mjs} +7 -7
- package/dist/.setup/{settled-turn-finalizer-DbS1Mwoq.mjs → settled-turn-finalizer-w92T5Rbb.mjs} +7 -7
- package/dist/.setup/{shared-client-zsK3DTPh.mjs → shared-client-ZXKMsK6f.mjs} +96 -46
- package/dist/.setup/{shared-client-lifecycle-4LdC3gM4.mjs → shared-client-lifecycle-BH_y_i8l.mjs} +24 -2
- package/dist/.setup/{side-question-DW4W4HY7.mjs → side-question-BBZJibHK.mjs} +15 -15
- package/dist/.setup/{source-DzsIjGO7.mjs → source-Iusn97ly.mjs} +4 -4
- package/dist/.setup/{thread-lifecycle-D03WesNn.mjs → thread-lifecycle-CzzYMvTL.mjs} +31 -15
- package/dist/.setup/{thread-ownership-B0xUCXOU.mjs → thread-ownership-BT_SeSUp.mjs} +4 -4
- package/dist/.setup/{thread-policy-g1TKKqWj.mjs → thread-policy-MM5YD22L.mjs} +3 -3
- package/dist/.setup/{thread-requests-15uBuGjw.mjs → thread-requests-y_MnVuWC.mjs} +9 -9
- package/dist/.setup/{thread-resume-BZfwM8Jh.mjs → thread-resume-B9clyqXE.mjs} +5 -5
- package/dist/.setup/{transcript-mirror-kxmCYsuF.mjs → transcript-mirror-BRNhyb1o.mjs} +1 -1
- package/dist/.setup/{transport-stdio-CbutOIEh.mjs → transport-stdio-DU8dIOCj.mjs} +1 -1
- package/dist/.setup/{transport-websocket-BTBE-LD9.mjs → transport-websocket-zu3jRPnu.mjs} +1 -1
- package/dist/.setup/{upstream-session-fork--vHya1T-.mjs → upstream-session-fork-2ipYynVl.mjs} +14 -14
- package/dist/.setup/{usage-CdWiiqqY.mjs → usage-BgB8DOas.mjs} +3 -3
- package/dist/.setup/{usage-limit-error-BEyQJjD_.mjs → usage-limit-error-B1FCZdeH.mjs} +1 -1
- package/dist/.setup/{web-search-provider.runtime--55TuUQG.mjs → web-search-provider.runtime-BWbZnYAL.mjs} +2 -2
- package/dist/.source-module-urls/78bb81623f5bb4c04c8cbd3fb1e9f10b4529f4811dc3cd99cedf5880f01c9b28.json +1 -0
- package/dist/api.js +3 -3
- package/dist/catalog-page.worker.js +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/doctor-contract-api.js +5 -5
- package/dist/harness.js +19 -19
- package/dist/index.js +53 -43
- package/dist/media-understanding-provider.js +2 -2
- package/dist/migration-provider-api.js +1 -2
- package/dist/provider-discovery.js +1 -1
- package/dist/session-history.worker.js +1 -2
- package/package.json +5 -5
- package/dist/.setup/incognito-session-DWYapfwf.mjs +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as assertCodexModelListResponse } from "./client-
|
|
1
|
+
import { g as assertCodexModelListResponse } from "./client-DcTISXe3.mjs";
|
|
2
2
|
import { normalizeOptionalString, normalizeUniqueTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
//#region extensions/codex/src/app-server/models.ts
|
|
4
4
|
const DEFAULT_MODEL_DISCOVERY_TIMEOUT_MS = 1e4;
|
|
@@ -32,8 +32,8 @@ async function withCodexAppServerModelRequest(options, run) {
|
|
|
32
32
|
if (options.request) return await run(options.request);
|
|
33
33
|
const timeoutMs = options.timeoutMs ?? 1e4;
|
|
34
34
|
const useSharedClient = options.sharedClient !== false;
|
|
35
|
-
const { createIsolatedCodexAppServerClient, getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("./shared-client-
|
|
36
|
-
const { requestCodexAppServerClientJson } = await import("./request-
|
|
35
|
+
const { createIsolatedCodexAppServerClient, getLeasedSharedCodexAppServerClient, releaseLeasedSharedCodexAppServerClient } = await import("./shared-client-ZXKMsK6f.mjs").then((n) => n.v);
|
|
36
|
+
const { requestCodexAppServerClientJson } = await import("./request-CWERwKIL.mjs").then((n) => n.a);
|
|
37
37
|
const client = await (useSharedClient ? getLeasedSharedCodexAppServerClient : createIsolatedCodexAppServerClient)({
|
|
38
38
|
startOptions: options.startOptions,
|
|
39
39
|
timeoutMs,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { d as readCodexPluginConfig } from "./config-parsing-b088LyhT.mjs";
|
|
2
2
|
import { n as isCodexAppServerProxyLaunch, t as buildCodexLoginStatusArgs } from "./launch-args-DbFCehO7.mjs";
|
|
3
|
-
import { r as resolveManagedCodexAppServerStartOptions } from "./managed-binary-
|
|
4
|
-
import { n as resolveCodexAppServerSpawnEnv } from "./transport-stdio-
|
|
5
|
-
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-
|
|
3
|
+
import { r as resolveManagedCodexAppServerStartOptions } from "./managed-binary-Ckgvm_4V.mjs";
|
|
4
|
+
import { n as resolveCodexAppServerSpawnEnv } from "./transport-stdio-DU8dIOCj.mjs";
|
|
5
|
+
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-DDhvIeUC.mjs";
|
|
6
6
|
import { runUtf8CommandWithTimeout } from "openclaw/plugin-sdk/process-runtime";
|
|
7
7
|
import { materializeWindowsSpawnProgram, resolveWindowsSpawnProgram } from "openclaw/plugin-sdk/windows-spawn";
|
|
8
8
|
//#region extensions/codex/src/app-server/native-auth.ts
|
package/dist/.setup/{native-subagent-monitor-DbNIloTJ.mjs → native-subagent-monitor-g-ZDkvCr.mjs}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { c as codexNativeSubagentRunId, d as readNativeSubagentThreadIds, f as readThreadParentThreadId, l as normalizeIdentifier, m as assertHistoryOwnerMatchesRegistration, p as readThreadSpawnSource, t as matchesNativeAssignmentLifecycle, u as readCodexNativeSubagentRunId } from "./native-subagent-pending-assignments-
|
|
1
|
+
import { c as codexNativeSubagentRunId, d as readNativeSubagentThreadIds, f as readThreadParentThreadId, l as normalizeIdentifier, m as assertHistoryOwnerMatchesRegistration, p as readThreadSpawnSource, t as matchesNativeAssignmentLifecycle, u as readCodexNativeSubagentRunId } from "./native-subagent-pending-assignments-XHNn4k5q.mjs";
|
|
2
2
|
import { i as isJsonObject } from "./protocol-CANUwXJ3.mjs";
|
|
3
3
|
import { c as readNonEmptyString, o as readHookOutputEntries, r as normalizeOptionalString$1, s as readItem, u as readNullableString } from "./event-projector-values-DJSz8BTk.mjs";
|
|
4
4
|
import { t as attachCodexMirrorIdentity } from "./upstream-prompt-provenance-fXkKbPVC.mjs";
|
|
5
5
|
import { t as readCodexMirroredSessionHistoryMessages } from "./session-history-D83lJWHG.mjs";
|
|
6
|
-
import { P as claimCodexAppServerLiveThread, R as hasCodexAppServerLiveThread,
|
|
7
|
-
import { A as itemStatus, D as isSideEffectingNativeToolItem, E as isProjectedNativeToolItem, M as matchesCodexSnapshotTurn, O as itemKind, P as unknownItemStatus, S as auditNativeToolTerminalStatus, T as isNonSuccessItemStatus, j as itemTitle, k as itemName, s as interruptCodexTurnAndWaitBestEffort, w as isMutatingNativeToolItem, x as auditNativeToolName } from "./attempt-client-cleanup-
|
|
8
|
-
import { t as __exportAll } from "./session-binding-sidecars-
|
|
6
|
+
import { P as claimCodexAppServerLiveThread, R as hasCodexAppServerLiveThread, ht as resolveCodexGatewayTimeoutWithGraceMs, q as retainCodexAppServerLiveThread } from "./shared-client-ZXKMsK6f.mjs";
|
|
7
|
+
import { A as itemStatus, D as isSideEffectingNativeToolItem, E as isProjectedNativeToolItem, M as matchesCodexSnapshotTurn, O as itemKind, P as unknownItemStatus, S as auditNativeToolTerminalStatus, T as isNonSuccessItemStatus, j as itemTitle, k as itemName, s as interruptCodexTurnAndWaitBestEffort, w as isMutatingNativeToolItem, x as auditNativeToolName } from "./attempt-client-cleanup-BVtNsTOE.mjs";
|
|
8
|
+
import { t as __exportAll } from "./session-binding-sidecars-BuEALwJY.mjs";
|
|
9
9
|
import { asFiniteNumber, asNonArrayRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeTrimmedStringList, readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
10
10
|
import { randomUUID } from "node:crypto";
|
|
11
11
|
import { asDateTimestampMs } from "openclaw/plugin-sdk/number-runtime";
|
|
@@ -560,6 +560,7 @@ var CodexNativeSubagentAssignmentInventory = class {
|
|
|
560
560
|
this.dependencies = dependencies;
|
|
561
561
|
this.writes = /* @__PURE__ */ new Map();
|
|
562
562
|
this.snapshots = /* @__PURE__ */ new WeakMap();
|
|
563
|
+
this.acknowledged = /* @__PURE__ */ new WeakSet();
|
|
563
564
|
}
|
|
564
565
|
hasWrites(state) {
|
|
565
566
|
return this.writes.has(state);
|
|
@@ -597,7 +598,7 @@ var CodexNativeSubagentAssignmentInventory = class {
|
|
|
597
598
|
}
|
|
598
599
|
record(state, child) {
|
|
599
600
|
const assignment = this.fact(child);
|
|
600
|
-
if (!assignment || !state.assignmentStore || child.nativeCompletionDelivered || child.subscriptionClosed) return;
|
|
601
|
+
if (!assignment || !state.assignmentStore || child.nativeCompletionDelivered || child.completionDeliveryAbandoned || child.subscriptionClosed) return;
|
|
601
602
|
const snapshot = JSON.stringify(assignment);
|
|
602
603
|
if (this.snapshots.get(child) === snapshot) return;
|
|
603
604
|
this.snapshots.set(child, snapshot);
|
|
@@ -612,25 +613,66 @@ var CodexNativeSubagentAssignmentInventory = class {
|
|
|
612
613
|
}
|
|
613
614
|
settle(state, child) {
|
|
614
615
|
const assignment = this.fact(child);
|
|
615
|
-
if (!assignment || !state.assignmentStore || !child.nativeCompletionDelivered && (!child.subscriptionClosed || child.pendingCompletion)) return;
|
|
616
|
+
if (!assignment || !state.assignmentStore || this.acknowledged.has(child) || !child.nativeCompletionDelivered && (!child.subscriptionClosed || child.pendingCompletion)) return;
|
|
616
617
|
this.enqueue(state, async () => {
|
|
617
618
|
await state.assignmentStore?.consume(assignment, () => this.dependencies.assertCurrent(state));
|
|
618
619
|
});
|
|
619
620
|
}
|
|
621
|
+
abandon(state, child, assertCurrent) {
|
|
622
|
+
return this.enqueue(state, async () => {
|
|
623
|
+
const assignment = this.fact(child);
|
|
624
|
+
if (!assignment || !state.assignmentStore || !child.pendingCompletion) return;
|
|
625
|
+
if (!await state.assignmentStore.consume(assignment, () => {
|
|
626
|
+
this.dependencies.assertCurrent(state);
|
|
627
|
+
assertCurrent();
|
|
628
|
+
}, { status: child.pendingCompletion.status })) throw new Error("Undeliverable native assignment was not retired.");
|
|
629
|
+
});
|
|
630
|
+
}
|
|
631
|
+
async settleNestedCompletion(state, child, assertCurrent) {
|
|
632
|
+
const owner = child.historyOwner;
|
|
633
|
+
if (!owner || owner.parentThreadId === child.nativeParentThreadId || !await this.dependencies.isNativeChildThread(child.nativeParentThreadId)) return false;
|
|
634
|
+
await this.acknowledge(state, child, () => {
|
|
635
|
+
assertCurrent();
|
|
636
|
+
assertHistoryOwnerMatchesRegistration(owner, state.historyOwner, owner.parentThreadId, true);
|
|
637
|
+
});
|
|
638
|
+
child.nativeCompletionDelivered = true;
|
|
639
|
+
child.pendingCompletion = void 0;
|
|
640
|
+
return true;
|
|
641
|
+
}
|
|
642
|
+
acknowledge(state, child, assertCurrent) {
|
|
643
|
+
return this.enqueue(state, async () => {
|
|
644
|
+
const assertAdmission = () => {
|
|
645
|
+
this.dependencies.assertCurrent(state);
|
|
646
|
+
assertCurrent();
|
|
647
|
+
};
|
|
648
|
+
assertAdmission();
|
|
649
|
+
const assignment = this.fact(child);
|
|
650
|
+
if (!assignment || !state.assignmentStore || this.acknowledged.has(child)) return;
|
|
651
|
+
if (!await state.assignmentStore.consume(assignment, assertAdmission)) throw new Error("Native assignment was not acknowledged.");
|
|
652
|
+
this.acknowledged.add(child);
|
|
653
|
+
assertAdmission();
|
|
654
|
+
});
|
|
655
|
+
}
|
|
620
656
|
async restore(state, owner) {
|
|
621
657
|
const store = state.assignmentStore;
|
|
622
658
|
const current = state.historyOwner;
|
|
623
659
|
if (!store || !current || !owner.completionCustody?.isCurrent()) return;
|
|
624
660
|
const custody = owner.completionCustody.retain();
|
|
625
661
|
try {
|
|
662
|
+
await this.drain(state);
|
|
626
663
|
store.assertCurrent();
|
|
627
664
|
for (const assignment of store.read()) {
|
|
628
665
|
if (!matchesNativeAssignmentLifecycle(assignment.owner, current)) continue;
|
|
629
666
|
const recovery = await this.dependencies.readHistory(assignment);
|
|
667
|
+
const pending = store.read();
|
|
630
668
|
if (!this.dependencies.isCurrent(state) || !custody.isCurrent()) return;
|
|
631
669
|
store.assertCurrent();
|
|
632
670
|
if (!recovery || recovery.parentThreadId !== assignment.nativeParentThreadId) continue;
|
|
633
|
-
|
|
671
|
+
const surviving = pending.find((entry) => entry.childThreadId === assignment.childThreadId && entry.nativeParentThreadId === assignment.nativeParentThreadId && matchesNativeAssignmentLifecycle(entry.owner, assignment.owner) && (entry.nativeTurnId === assignment.nativeTurnId && (entry.nativeTurnId !== void 0 || entry.runId === assignment.runId) || recovery.nativeTurnId !== void 0 && entry.nativeTurnId === recovery.nativeTurnId && (assignment.nativeTurnId === void 0 || entry.runId === assignment.runId)));
|
|
672
|
+
if (surviving) {
|
|
673
|
+
await this.dependencies.restore(state, surviving, recovery, custody);
|
|
674
|
+
await this.drain(state);
|
|
675
|
+
}
|
|
634
676
|
}
|
|
635
677
|
} catch (error) {
|
|
636
678
|
embeddedAgentLog.warn("Native pending assignments remain for reconciliation", { error: formatErrorMessage$1(error) });
|
|
@@ -991,7 +1033,18 @@ var CodexNativeSubagentCompletionDelivery = class {
|
|
|
991
1033
|
childState.deliveringCompletion = true;
|
|
992
1034
|
let deferredToForeground = false;
|
|
993
1035
|
try {
|
|
1036
|
+
if (await this.dependencies.settleNestedCompletion(state, childState, () => {
|
|
1037
|
+
if (!this.isCurrent(state, childState) || childState.completionCustody && !childState.completionCustody.isCurrent()) throw new Error("Native completion acknowledgement is no longer current.");
|
|
1038
|
+
})) {
|
|
1039
|
+
this.dependencies.unregisterChild(childState);
|
|
1040
|
+
return;
|
|
1041
|
+
}
|
|
1042
|
+
if (!this.isCurrent(state, childState)) return;
|
|
994
1043
|
if (!this.prepareDelivery(state, childState)) return;
|
|
1044
|
+
if (childState.completionDeliveryAbandoned) {
|
|
1045
|
+
await this.abandon(state, childState);
|
|
1046
|
+
return;
|
|
1047
|
+
}
|
|
995
1048
|
if (state.owners.size > 0 || !state.completionScope) {
|
|
996
1049
|
deferredToForeground = state.owners.size > 0;
|
|
997
1050
|
return;
|
|
@@ -1026,15 +1079,15 @@ var CodexNativeSubagentCompletionDelivery = class {
|
|
|
1026
1079
|
return;
|
|
1027
1080
|
}
|
|
1028
1081
|
if (delivery.recoveryBlocked) {
|
|
1029
|
-
this.
|
|
1082
|
+
await this.abandon(state, childState);
|
|
1030
1083
|
return;
|
|
1031
1084
|
}
|
|
1032
1085
|
if (delivery.recoveryPending) {
|
|
1033
|
-
this.scheduleRetry(childState, delivery.error ?? "requester recovery owns completion", false);
|
|
1086
|
+
await this.scheduleRetry(state, childState, delivery.error ?? "requester recovery owns completion", false);
|
|
1034
1087
|
return;
|
|
1035
1088
|
}
|
|
1036
1089
|
const error = delivery.error ?? "completion delivery did not produce a parent response";
|
|
1037
|
-
this.scheduleRetry(childState, error);
|
|
1090
|
+
await this.scheduleRetry(state, childState, error);
|
|
1038
1091
|
} catch (error) {
|
|
1039
1092
|
if (!this.dependencies.isCurrentChild(childState) || !this.dependencies.isCurrentParent(state) || this.dependencies.isRetiredParent(state)) return;
|
|
1040
1093
|
if (!this.claim(state, childState)) {
|
|
@@ -1042,7 +1095,7 @@ var CodexNativeSubagentCompletionDelivery = class {
|
|
|
1042
1095
|
return;
|
|
1043
1096
|
}
|
|
1044
1097
|
const message = formatErrorMessage$1(error);
|
|
1045
|
-
this.scheduleRetry(childState, message);
|
|
1098
|
+
await this.scheduleRetry(state, childState, message, !childState.completionDeliveryAbandoned);
|
|
1046
1099
|
embeddedAgentLog.warn("Failed to deliver Codex native subagent completion", {
|
|
1047
1100
|
parentThreadId: state.parentThreadId,
|
|
1048
1101
|
childThreadId: completion.childThreadId,
|
|
@@ -1105,22 +1158,41 @@ var CodexNativeSubagentCompletionDelivery = class {
|
|
|
1105
1158
|
this.dependencies.releaseClientRetentionIfIdle();
|
|
1106
1159
|
return true;
|
|
1107
1160
|
}
|
|
1108
|
-
|
|
1161
|
+
async abandon(state, child) {
|
|
1162
|
+
child.completionDeliveryAbandoned = true;
|
|
1163
|
+
try {
|
|
1164
|
+
await this.dependencies.abandon(state, child, () => {
|
|
1165
|
+
if (child.nativeCompletionDelivered || !this.isCurrent(state, child) || !this.claim(state, child)) throw new Error("Native completion retirement is no longer current.");
|
|
1166
|
+
});
|
|
1167
|
+
this.dependencies.unregisterChild(child);
|
|
1168
|
+
} catch (error) {
|
|
1169
|
+
if (this.isCurrent(state, child) && child.nativeCompletionDelivered) {
|
|
1170
|
+
this.prepareDelivery(state, child);
|
|
1171
|
+
return;
|
|
1172
|
+
}
|
|
1173
|
+
embeddedAgentLog.warn("Native completion retirement remains pending", {
|
|
1174
|
+
childThreadId: child.childThreadId,
|
|
1175
|
+
error: formatErrorMessage$1(error)
|
|
1176
|
+
});
|
|
1177
|
+
await this.scheduleRetry(state, child, formatErrorMessage$1(error), false);
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
async scheduleRetry(state, childState, error, chargeAttempt = true) {
|
|
1109
1181
|
if (!childState.pendingCompletion || childState.completionDeliveryTimer || !this.dependencies.isCurrentChild(childState)) return;
|
|
1110
1182
|
if (chargeAttempt && childState.completionDeliveryAttempt >= this.maxRetries) {
|
|
1111
1183
|
embeddedAgentLog.warn("Native subagent completion retries exhausted", {
|
|
1112
1184
|
childThreadId: childState.childThreadId,
|
|
1113
1185
|
error
|
|
1114
1186
|
});
|
|
1115
|
-
this.
|
|
1187
|
+
await this.abandon(state, childState);
|
|
1116
1188
|
return;
|
|
1117
1189
|
}
|
|
1118
1190
|
const delayMs = delayForAttempt(this.retryDelaysMs, chargeAttempt ? childState.completionDeliveryAttempt++ : childState.completionDeliveryAttempt);
|
|
1119
1191
|
childState.completionDeliveryTimer = setTimeout(() => {
|
|
1120
1192
|
childState.completionDeliveryTimer = void 0;
|
|
1121
1193
|
if (!this.dependencies.isCurrentChild(childState)) return;
|
|
1122
|
-
const
|
|
1123
|
-
if (
|
|
1194
|
+
const currentParent = this.dependencies.getParent(childState.parentThreadId);
|
|
1195
|
+
if (currentParent) this.deliverPending(currentParent, childState);
|
|
1124
1196
|
}, delayMs);
|
|
1125
1197
|
childState.completionDeliveryTimer.unref();
|
|
1126
1198
|
}
|
|
@@ -1128,7 +1200,7 @@ var CodexNativeSubagentCompletionDelivery = class {
|
|
|
1128
1200
|
if (childState.completionCustody && !childState.completionCustody.isCurrent()) return false;
|
|
1129
1201
|
const requesterSessionKey = state.requesterSessionKey?.trim();
|
|
1130
1202
|
if (!requesterSessionKey) return true;
|
|
1131
|
-
const key = `${requesterSessionKey}\0${childState.runId}`;
|
|
1203
|
+
const key = childState.deliveryOwnerKey ?? `${requesterSessionKey}\0${childState.nativeTurnId ? codexNativeSubagentRunId(childState.childThreadId, childState.nativeTurnId) : childState.runId}`;
|
|
1132
1204
|
try {
|
|
1133
1205
|
state.assignmentStore?.assertCurrent();
|
|
1134
1206
|
assertHistoryOwnerMatchesRegistration(childState.historyOwner, state.historyOwner, childState.nativeParentThreadId, state.historyOwner !== void 0);
|
|
@@ -1406,6 +1478,10 @@ var CodexNativeSubagentHistoryRecovery = class {
|
|
|
1406
1478
|
itemsView: "full"
|
|
1407
1479
|
}, { timeoutMs: THREAD_READ_TIMEOUT_MS });
|
|
1408
1480
|
}
|
|
1481
|
+
async isNativeChildThread(threadId) {
|
|
1482
|
+
const response = await this.requestThreadRead(threadId, false);
|
|
1483
|
+
return response.thread.id === threadId && Boolean(readThreadParentThreadId(response.thread));
|
|
1484
|
+
}
|
|
1409
1485
|
async read(assignment, options) {
|
|
1410
1486
|
const { childThreadId } = assignment;
|
|
1411
1487
|
const { recordedCompletion } = options;
|
|
@@ -2119,7 +2195,7 @@ async function registerNativeSubagentParent(input, dependencies) {
|
|
|
2119
2195
|
state.pendingRegistrations -= 1;
|
|
2120
2196
|
dependencies.prune(registeredState);
|
|
2121
2197
|
}
|
|
2122
|
-
const ready = dependencies.assignments.restore(state, owner);
|
|
2198
|
+
const ready = dependencies.submissions.drain(registeredState).then(() => dependencies.assignments.restore(state, owner)).then(() => dependencies.assignments.drain(registeredState));
|
|
2123
2199
|
let registered = true;
|
|
2124
2200
|
let settlement;
|
|
2125
2201
|
return {
|
|
@@ -2631,6 +2707,7 @@ var CodexNativeSubagentSubmissionOwner = class {
|
|
|
2631
2707
|
if (!this.isObserving(state, custody) || !this.admitTurn(state, custody.receipt, turn, custody.owner, historyValidated, custody.completionCustody)) return;
|
|
2632
2708
|
custody.phase = "promoting";
|
|
2633
2709
|
if (custody.timer) clearTimeout(custody.timer);
|
|
2710
|
+
custody.release();
|
|
2634
2711
|
}
|
|
2635
2712
|
settleChild(state, child) {
|
|
2636
2713
|
for (const custody of this.pending.get(state)?.values() ?? []) {
|
|
@@ -4580,6 +4657,8 @@ var Monitor = class {
|
|
|
4580
4657
|
isRetiredParent: (state) => this.retiredParentStates.has(state),
|
|
4581
4658
|
getParent: (id) => this.parentStates.get(id),
|
|
4582
4659
|
unregisterChild: (child) => this.unregisterChild(child),
|
|
4660
|
+
abandon: (state, child, assertCurrent) => this.assignments.abandon(state, child, assertCurrent),
|
|
4661
|
+
settleNestedCompletion: (state, child, assertCurrent) => this.assignments.settleNestedCompletion(state, child, assertCurrent),
|
|
4583
4662
|
releaseClientRetentionIfIdle: () => this.releaseClientRetentionIfIdle()
|
|
4584
4663
|
});
|
|
4585
4664
|
this.turnObservation = new CodexNativeSubagentTurnObservation({
|
|
@@ -4695,8 +4774,9 @@ var Monitor = class {
|
|
|
4695
4774
|
revision.release();
|
|
4696
4775
|
}
|
|
4697
4776
|
},
|
|
4777
|
+
isNativeChildThread: async (threadId) => this.knownChildren.has(threadId) || await this.historyRecovery.isNativeChildThread(threadId),
|
|
4698
4778
|
restore: async (state, assignment, recovery, custody) => {
|
|
4699
|
-
const existing = this.childStates.get(assignment.runId);
|
|
4779
|
+
const existing = this.childStates.get(assignment.runId) ?? [...this.childStates.values()].find((child) => assignment.nativeTurnId !== void 0 && child.childThreadId === assignment.childThreadId && child.nativeTurnId === assignment.nativeTurnId && child.nativeParentThreadId === assignment.nativeParentThreadId && child.historyOwner !== void 0 && matchesNativeAssignmentLifecycle(child.historyOwner, assignment.owner));
|
|
4700
4780
|
if (existing) {
|
|
4701
4781
|
const original = this.parentStates.get(existing.parentThreadId);
|
|
4702
4782
|
if (original && original.requesterSessionKey === state.requesterSessionKey && original.historyOwner && state.historyOwner && matchesNativeAssignmentLifecycle(original.historyOwner, state.historyOwner)) original.assignmentStore = state.assignmentStore;
|
|
@@ -4843,6 +4923,9 @@ var Monitor = class {
|
|
|
4843
4923
|
});
|
|
4844
4924
|
if (!capture) return;
|
|
4845
4925
|
try {
|
|
4926
|
+
const known = this.knownChildren.get(request.threadId);
|
|
4927
|
+
const child = known ? this.admitFollowupChild(known, request.threadId) : void 0;
|
|
4928
|
+
if (child?.nativeTurnId === request.turnId && child.settledWithoutCompletion) this.resumeChild(child);
|
|
4846
4929
|
await this.persistModelAssignment(request, capture);
|
|
4847
4930
|
request.signal?.throwIfAborted();
|
|
4848
4931
|
capture.assertCurrent();
|
|
@@ -5016,6 +5099,7 @@ var Monitor = class {
|
|
|
5016
5099
|
childState.settledWithoutCompletion = false;
|
|
5017
5100
|
childState.fallbackCompletion = void 0;
|
|
5018
5101
|
this.releaseClientRetention ??= this.retainClient?.();
|
|
5102
|
+
this.retainParentThreadForChild(childState.parentThreadId);
|
|
5019
5103
|
}
|
|
5020
5104
|
settleResumableChild(childState) {
|
|
5021
5105
|
if (childState.terminal) return;
|
|
@@ -5026,6 +5110,7 @@ var Monitor = class {
|
|
|
5026
5110
|
releaseNativeDirectChild(childState);
|
|
5027
5111
|
releaseNativeModelExecution(childState);
|
|
5028
5112
|
this.recovery.clearRecoveryTimers(childState);
|
|
5113
|
+
this.releaseParentThreadIfChildrenSettled(childState.parentThreadId);
|
|
5029
5114
|
this.releaseClientRetentionIfIdle();
|
|
5030
5115
|
}
|
|
5031
5116
|
async handleChildTurnCompletion(notification, childState) {
|
|
@@ -5199,6 +5284,7 @@ var Monitor = class {
|
|
|
5199
5284
|
this.recovery.markTerminalRevision(childState.childThreadId);
|
|
5200
5285
|
releaseNativeDirectChild(childState);
|
|
5201
5286
|
this.recovery.clearRecoveryTimers(childState);
|
|
5287
|
+
this.releaseParentThreadIfChildrenSettled(state.parentThreadId);
|
|
5202
5288
|
this.applyNativeReceipts(state, childState.deliveryReceipts.record(childState.runId, this.knownChildren.get(childState.childThreadId)?.agentPaths ?? [childState.childThreadId], acceptedCompletion.result));
|
|
5203
5289
|
await this.completionDelivery.deliverPending(state, childState);
|
|
5204
5290
|
}
|
|
@@ -5258,10 +5344,7 @@ var Monitor = class {
|
|
|
5258
5344
|
if (!childState) {
|
|
5259
5345
|
this.updateChildThreadOwnership("claim", childThreadId, this.claimChildThread);
|
|
5260
5346
|
this.releaseClientRetention ??= this.retainClient?.();
|
|
5261
|
-
|
|
5262
|
-
const releaseParentThread = this.retainParentThread?.(parentThreadId);
|
|
5263
|
-
if (releaseParentThread) this.parentThreadRetentions.set(parentThreadId, releaseParentThread);
|
|
5264
|
-
}
|
|
5347
|
+
this.retainParentThreadForChild(parentThreadId);
|
|
5265
5348
|
childState = {
|
|
5266
5349
|
runId,
|
|
5267
5350
|
nativeTurnId: assignment.nativeTurnId,
|
|
@@ -5480,6 +5563,7 @@ var Monitor = class {
|
|
|
5480
5563
|
}
|
|
5481
5564
|
if (!transitioned) claimOwner.onDirectChildAccepted?.();
|
|
5482
5565
|
}
|
|
5566
|
+
this.observeActiveChild(child);
|
|
5483
5567
|
this.admissionCustody.bindEventSink(child);
|
|
5484
5568
|
return child;
|
|
5485
5569
|
}
|
|
@@ -5534,11 +5618,7 @@ var Monitor = class {
|
|
|
5534
5618
|
this.recovery.clearRecoveryTimers(childState);
|
|
5535
5619
|
this.completionDelivery.release(childState);
|
|
5536
5620
|
if (this.childStates.get(childState.runId) === childState) this.childStates.delete(childState.runId);
|
|
5537
|
-
|
|
5538
|
-
const releaseParentThread = this.parentThreadRetentions.get(childState.parentThreadId);
|
|
5539
|
-
this.parentThreadRetentions.delete(childState.parentThreadId);
|
|
5540
|
-
releaseParentThread?.();
|
|
5541
|
-
}
|
|
5621
|
+
this.releaseParentThreadIfChildrenSettled(childState.parentThreadId);
|
|
5542
5622
|
this.recovery.collectThreadStatusRevision(childState.childThreadId);
|
|
5543
5623
|
this.releaseClientRetentionIfIdle();
|
|
5544
5624
|
const state = this.parentStates.get(childState.parentThreadId);
|
|
@@ -5563,6 +5643,17 @@ var Monitor = class {
|
|
|
5563
5643
|
});
|
|
5564
5644
|
});
|
|
5565
5645
|
}
|
|
5646
|
+
retainParentThreadForChild(parentThreadId) {
|
|
5647
|
+
if (this.parentThreadRetentions.has(parentThreadId)) return;
|
|
5648
|
+
const releaseParentThread = this.retainParentThread?.(parentThreadId);
|
|
5649
|
+
if (releaseParentThread) this.parentThreadRetentions.set(parentThreadId, releaseParentThread);
|
|
5650
|
+
}
|
|
5651
|
+
releaseParentThreadIfChildrenSettled(parentThreadId) {
|
|
5652
|
+
for (const childState of this.childStates.values()) if (childState.parentThreadId === parentThreadId && !childState.terminal && !childState.settledWithoutCompletion) return;
|
|
5653
|
+
const releaseParentThread = this.parentThreadRetentions.get(parentThreadId);
|
|
5654
|
+
this.parentThreadRetentions.delete(parentThreadId);
|
|
5655
|
+
releaseParentThread?.();
|
|
5656
|
+
}
|
|
5566
5657
|
releaseClientRetentionIfIdle() {
|
|
5567
5658
|
if ([...this.childStates.values()].some((childState) => !childState.terminal && !childState.settledWithoutCompletion)) return;
|
|
5568
5659
|
this.releaseRetainedClient();
|
|
@@ -166,7 +166,7 @@ const assignmentSchema = z.object({
|
|
|
166
166
|
const inventorySchema = z.object({
|
|
167
167
|
version: z.literal(1),
|
|
168
168
|
assignments: z.array(assignmentSchema)
|
|
169
|
-
}).strict()
|
|
169
|
+
}).strict();
|
|
170
170
|
/** Native parent rotation is not physical requester or connection adoption. */
|
|
171
171
|
function matchesNativeAssignmentLifecycle(saved, current) {
|
|
172
172
|
return saved.sessionId === current.sessionId && saved.lifecycleRevision === current.lifecycleRevision && saved.connectionFingerprint === current.connectionFingerprint;
|
|
@@ -174,29 +174,66 @@ function matchesNativeAssignmentLifecycle(saved, current) {
|
|
|
174
174
|
function readNativePendingAssignments(value) {
|
|
175
175
|
if (value === void 0) return;
|
|
176
176
|
const parsed = inventorySchema.safeParse(value);
|
|
177
|
-
if (!parsed.success) throw new Error("Invalid Codex native pending assignment metadata.");
|
|
177
|
+
if (!parsed.success || new Set(parsed.data.assignments.map((entry) => entry.runId)).size !== parsed.data.assignments.length) throw new Error("Invalid Codex native pending assignment metadata.");
|
|
178
178
|
return parsed.data;
|
|
179
179
|
}
|
|
180
|
+
function mergeNativeAssignmentMetadata(current, incoming) {
|
|
181
|
+
const genericRunId = codexNativeSubagentRunId(current.childThreadId);
|
|
182
|
+
if (current.runId !== incoming.runId && current.runId !== genericRunId && incoming.runId !== genericRunId || current.submission && incoming.submission && !isDeepStrictEqual(current.submission, incoming.submission) || current.recordedCompletion && incoming.recordedCompletion && !isDeepStrictEqual(current.recordedCompletion, incoming.recordedCompletion)) throw new Error("Conflicting Codex native pending assignment metadata.");
|
|
183
|
+
if (current.runId === genericRunId) current.runId = incoming.runId;
|
|
184
|
+
if (incoming.submission) current.submission = incoming.submission;
|
|
185
|
+
if (incoming.recordedCompletion) current.recordedCompletion = incoming.recordedCompletion;
|
|
186
|
+
}
|
|
187
|
+
/** Doctor and binding writes merge compatible facts for one obligation, never distinct turns. */
|
|
188
|
+
function normalizeNativePendingAssignments(value) {
|
|
189
|
+
if (value === void 0) return;
|
|
190
|
+
return {
|
|
191
|
+
version: 1,
|
|
192
|
+
assignments: mergeNativePendingAssignments(inventorySchema.parse(value).assignments)
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
function mergeNativePendingAssignments(entries) {
|
|
196
|
+
const assignments = [];
|
|
197
|
+
for (const entry of entries) {
|
|
198
|
+
const existing = assignments.find((saved) => saved.childThreadId === entry.childThreadId && saved.nativeTurnId === entry.nativeTurnId && (entry.nativeTurnId !== void 0 || saved.runId === entry.runId));
|
|
199
|
+
if (!existing) {
|
|
200
|
+
assignments.push(entry);
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
if (existing.nativeParentThreadId !== entry.nativeParentThreadId || !isDeepStrictEqual(existing.owner, entry.owner)) throw new Error("Conflicting Codex native pending assignment metadata.");
|
|
204
|
+
mergeNativeAssignmentMetadata(existing, entry);
|
|
205
|
+
}
|
|
206
|
+
if (new Set(assignments.map((entry) => entry.runId)).size !== assignments.length) throw new Error("Conflicting Codex native pending assignment metadata.");
|
|
207
|
+
return assignments;
|
|
208
|
+
}
|
|
180
209
|
function mutateNativePendingAssignments(params) {
|
|
181
|
-
const current =
|
|
182
|
-
|
|
210
|
+
const current = normalizeNativePendingAssignments(params.current);
|
|
211
|
+
let assignment = assignmentSchema.parse(params.assignment);
|
|
183
212
|
const owner = codexNativeSubagentHistoryOwnerSchema.parse(params.owner);
|
|
184
213
|
if (!matchesNativeAssignmentLifecycle(assignment.owner, owner)) return { applied: false };
|
|
185
214
|
const assignments = current?.assignments ?? [];
|
|
186
|
-
const existing = assignments.find((entry) => entry.runId === assignment.runId);
|
|
187
|
-
if (
|
|
188
|
-
|
|
215
|
+
const existing = assignments.find((entry) => entry.runId === assignment.runId) ?? assignments.find((entry) => assignment.nativeTurnId !== void 0 && entry.childThreadId === assignment.childThreadId && entry.nativeTurnId === assignment.nativeTurnId);
|
|
216
|
+
if (params.consume && !existing) return {
|
|
217
|
+
applied: false,
|
|
218
|
+
absent: true
|
|
219
|
+
};
|
|
220
|
+
if (existing && (!isDeepStrictEqual(existing.owner, assignment.owner) || existing.nativeParentThreadId !== assignment.nativeParentThreadId || existing.childThreadId !== assignment.childThreadId) || params.consume && existing?.nativeTurnId !== assignment.nativeTurnId) return { applied: false };
|
|
189
221
|
const remaining = assignments.filter((entry) => entry !== existing);
|
|
190
|
-
if (!params.consume)
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
222
|
+
if (!params.consume) {
|
|
223
|
+
if (existing && existing.nativeTurnId === assignment.nativeTurnId) {
|
|
224
|
+
mergeNativeAssignmentMetadata(existing, assignment);
|
|
225
|
+
assignment = existing;
|
|
226
|
+
} else if (existing?.recordedCompletion && !assignment.recordedCompletion) assignment.recordedCompletion = existing.recordedCompletion;
|
|
227
|
+
remaining.push(assignment);
|
|
228
|
+
}
|
|
229
|
+
const next = !params.consume && existing && existing.nativeTurnId !== assignment.nativeTurnId ? mergeNativePendingAssignments(remaining) : remaining;
|
|
194
230
|
return {
|
|
195
231
|
applied: true,
|
|
196
|
-
next:
|
|
232
|
+
next: next.length ? {
|
|
197
233
|
version: 1,
|
|
198
|
-
assignments:
|
|
199
|
-
} : void 0
|
|
234
|
+
assignments: next
|
|
235
|
+
} : void 0,
|
|
236
|
+
consumed: params.consume ? existing : void 0
|
|
200
237
|
};
|
|
201
238
|
}
|
|
202
239
|
//#endregion
|
package/dist/.setup/{native-task-assignments-DMQ0g3hu.mjs → native-task-assignments-Dna952zv.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as readCodexNativeSubagentHistoryOwner, h as codexNativeSubagentHistoryConnectionFingerprint, r as readNativePendingAssignments, u as readCodexNativeSubagentRunId } from "./native-subagent-pending-assignments-
|
|
2
|
-
import { _ as readStoredCodexAppServerBinding, r as bindingStoreKey } from "./session-binding-record-
|
|
1
|
+
import { _ as readCodexNativeSubagentHistoryOwner, h as codexNativeSubagentHistoryConnectionFingerprint, r as readNativePendingAssignments, u as readCodexNativeSubagentRunId } from "./native-subagent-pending-assignments-XHNn4k5q.mjs";
|
|
2
|
+
import { _ as readStoredCodexAppServerBinding, r as bindingStoreKey } from "./session-binding-record-CUKpUKVm.mjs";
|
|
3
3
|
import { n as CODEX_APP_SERVER_BINDING_NAMESPACE, t as CODEX_APP_SERVER_BINDING_MAX_ENTRIES } from "./session-binding-meta-B7aEMU7g.mjs";
|
|
4
4
|
import { isDeepStrictEqual } from "node:util";
|
|
5
5
|
import { z } from "zod";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as unwrapNodeInvokePayload, x as readBoundedOptionalString } from "./session-catalog-parsing-
|
|
1
|
+
import { A as unwrapNodeInvokePayload, x as readBoundedOptionalString } from "./session-catalog-parsing-CnEH565l.mjs";
|
|
2
2
|
import { r as resolveCodexAppServerUserHomeDir } from "./auth-start-options-BPIPeEX8.mjs";
|
|
3
3
|
import { o as formatCodexDisplayText } from "./command-formatters-R3ckE3Co.mjs";
|
|
4
4
|
import { t as codexCatalogHomeId } from "./session-catalog-home-id-vlih0B_g.mjs";
|
|
@@ -187,7 +187,7 @@ async function resumeCodexCliSessionOnNode(params) {
|
|
|
187
187
|
let catalogAgentId;
|
|
188
188
|
let catalogHomeId;
|
|
189
189
|
if (params.sessionKey) {
|
|
190
|
-
const { adoptionSessionKeyRest, CODEX_NODE_SESSION_KEY_PREFIX, readNodeSessionMarker } = await import("./session-catalog-node-adoption-
|
|
190
|
+
const { adoptionSessionKeyRest, CODEX_NODE_SESSION_KEY_PREFIX, readNodeSessionMarker } = await import("./session-catalog-node-adoption-BdS7zDuY.mjs");
|
|
191
191
|
const entry = params.runtime.agent.session.getSessionEntry({
|
|
192
192
|
sessionKey: params.sessionKey,
|
|
193
193
|
readConsistency: "latest"
|
package/dist/.setup/{node-exec-server.runtime-BS7jsvK-.mjs → node-exec-server.runtime-9IZtsOmo.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as resolveManagedCodexNativeCommand, r as resolveManagedCodexAppServerStartOptions, t as isManagedCodexDesktopCommand } from "./managed-binary-
|
|
2
|
-
import { a as closeCodexAppServerTransportAndWait, t as createStdioTransport } from "./transport-stdio-
|
|
1
|
+
import { i as resolveManagedCodexNativeCommand, r as resolveManagedCodexAppServerStartOptions, t as isManagedCodexDesktopCommand } from "./managed-binary-Ckgvm_4V.mjs";
|
|
2
|
+
import { a as closeCodexAppServerTransportAndWait, t as createStdioTransport } from "./transport-stdio-DU8dIOCj.mjs";
|
|
3
3
|
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { stripVTControlCharacters } from "node:util";
|
|
5
5
|
import { killProcessTree } from "openclaw/plugin-sdk/process-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { u as CODEX_PLUGINS_MARKETPLACE_NAME } from "./plugin-inventory-
|
|
1
|
+
import { u as CODEX_PLUGINS_MARKETPLACE_NAME } from "./plugin-inventory-B4uqIw4J.mjs";
|
|
2
2
|
import { t as isOnlyMigrationKind } from "./scope-DOC1Xjc8.mjs";
|
|
3
|
-
import "./config-
|
|
4
|
-
import { i as hasCodexSource, n as defaultCodexHome, o as readJsonObject, r as discoverCodexSource, s as sanitizeName, t as codexPluginMigrationSubscriptionWarning } from "./source-
|
|
3
|
+
import "./config-DqmrqI23.mjs";
|
|
4
|
+
import { i as hasCodexSource, n as defaultCodexHome, o as readJsonObject, r as discoverCodexSource, s as sanitizeName, t as codexPluginMigrationSubscriptionWarning } from "./source-Iusn97ly.mjs";
|
|
5
5
|
import { asBoolean, asOptionalRecord, isRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { createHash } from "node:crypto";
|
|
7
7
|
import { runCommandBuffered } from "openclaw/plugin-sdk/process-runtime";
|
|
@@ -97,8 +97,8 @@ async function readCodexCliCredentialsAsync(options) {
|
|
|
97
97
|
options.signal?.throwIfAborted();
|
|
98
98
|
if (!options.allowKeychainPrompt) return;
|
|
99
99
|
const home = await fs.realpath(options.codexHome).catch(() => path.resolve(options.codexHome));
|
|
100
|
-
const { CodexAppServerClient } = await import("./client-
|
|
101
|
-
const { resolveManagedCodexPackageEntrypoint, resolveManagedCodexNativeCommand } = await import("./managed-binary-
|
|
100
|
+
const { CodexAppServerClient } = await import("./client-DcTISXe3.mjs").then((n) => n.n);
|
|
101
|
+
const { resolveManagedCodexPackageEntrypoint, resolveManagedCodexNativeCommand } = await import("./managed-binary-Ckgvm_4V.mjs").then((n) => n.n);
|
|
102
102
|
const launcher = resolveManagedCodexPackageEntrypoint(path.dirname(fileURLToPath(import.meta.url)));
|
|
103
103
|
const command = launcher ? resolveManagedCodexNativeCommand(launcher) : void 0;
|
|
104
104
|
if (!command) return;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as listCodexPluginMetadata, n as isOpenAiCuratedMarketplace, o as pluginReadParams, r as isOpenAiCuratedMarketplaceName, t as findCodexMarketplacePluginSummary, u as CODEX_PLUGINS_MARKETPLACE_NAME } from "./plugin-inventory-
|
|
1
|
+
import { i as listCodexPluginMetadata, n as isOpenAiCuratedMarketplace, o as pluginReadParams, r as isOpenAiCuratedMarketplaceName, t as findCodexMarketplacePluginSummary, u as CODEX_PLUGINS_MARKETPLACE_NAME } from "./plugin-inventory-B4uqIw4J.mjs";
|
|
2
2
|
import { n as CodexAppServerRpcError } from "./rpc-error-BlD2vuzn.mjs";
|
|
3
|
-
import "./config-
|
|
3
|
+
import "./config-DqmrqI23.mjs";
|
|
4
4
|
import { coerceErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
5
5
|
//#region extensions/codex/src/app-server/plugin-activation.ts
|
|
6
6
|
/** Activates legacy curated plugins without granting install authority to other marketplaces. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { f as resolveCodexPluginsPolicy } from "./config-parsing-b088LyhT.mjs";
|
|
2
2
|
import { c as findCodexAppById } from "./plugin-app-cache-key-BL9B5H0L.mjs";
|
|
3
|
-
import "./config-
|
|
3
|
+
import "./config-DqmrqI23.mjs";
|
|
4
4
|
import { embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
5
5
|
//#region extensions/codex/src/app-server/config-contracts.ts
|
|
6
6
|
const CODEX_PLUGINS_MARKETPLACE_NAME = "openai-curated";
|
package/dist/.setup/{plugin-metadata-cache-Z06WuND0.mjs → plugin-metadata-cache-C-LRxilF.mjs}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as resolveCodexAppServerHomeDir } from "./auth-start-options-BPIPeEX8.mjs";
|
|
2
2
|
import { o as resolveCodexComputerUseConfig } from "./config-options-CzyWLTJt.mjs";
|
|
3
|
-
import { d as resolveMacOSDesktopCodexBundledMarketplaceCandidates, t as isManagedCodexDesktopCommand } from "./managed-binary-
|
|
3
|
+
import { d as resolveMacOSDesktopCodexBundledMarketplaceCandidates, t as isManagedCodexDesktopCommand } from "./managed-binary-Ckgvm_4V.mjs";
|
|
4
4
|
import { n as describeControlFailure } from "./capabilities-B3WEZl4e.mjs";
|
|
5
|
-
import { r as requestCodexAppServerClientJson } from "./request-
|
|
6
|
-
import "./config-
|
|
7
|
-
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-
|
|
8
|
-
import { O as acquireCodexNativeConfigFence, at as
|
|
9
|
-
import { c as isCodexAppServerIndeterminateTransportError, o as isCodexAppServerConnectionClosedError, s as isCodexAppServerIndeterminateRequestCancellationError } from "./client-
|
|
10
|
-
import { r as CodexAppServerUnsafeSubscriptionError, u as retireUnsafeCodexTurnClientBestEffort } from "./attempt-client-cleanup-
|
|
5
|
+
import { r as requestCodexAppServerClientJson } from "./request-CWERwKIL.mjs";
|
|
6
|
+
import "./config-DqmrqI23.mjs";
|
|
7
|
+
import { n as resolveCodexAppServerRuntimeOptions } from "./config-runtime-DDhvIeUC.mjs";
|
|
8
|
+
import { O as acquireCodexNativeConfigFence, at as resolveClientManagedBundledMarketplacePath, b as withLeasedCodexAppServerClientStartSelectionRetry, c as getLeasedSharedCodexAppServerClient, ct as resolveManagedCodexComputerUseConfig, d as readCodexAppServerClientDesktopGeneration, g as resolveCodexNativeConfigFenceKey, h as releaseLeasedSharedCodexAppServerClient, it as resolveBundledComputerUseMarketplacePath, lt as ensureCodexComputerUseSharedPluginCache, ot as hasLegacyCodexComputerUseMcpPolicy, p as readCodexAppServerClientProcessIdentity, st as isLegacyCodexComputerUsePluginDisabled, t as assertCodexAppServerClientStartSelectionCurrent, tt as reconcileCodexComputerUseStartArtifacts, u as isCodexAppServerStartSelectionChangedError, ut as assertNotSymlink, y as waitForCodexAppServerClientDesktopGenerationDrain } from "./shared-client-ZXKMsK6f.mjs";
|
|
9
|
+
import { c as isCodexAppServerIndeterminateTransportError, o as isCodexAppServerConnectionClosedError, s as isCodexAppServerIndeterminateRequestCancellationError } from "./client-DcTISXe3.mjs";
|
|
10
|
+
import { r as CodexAppServerUnsafeSubscriptionError, u as retireUnsafeCodexTurnClientBestEffort } from "./attempt-client-cleanup-BVtNsTOE.mjs";
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
import fs from "node:fs/promises";
|
|
13
13
|
import { toErrorObject } from "openclaw/plugin-sdk/error-runtime";
|
|
@@ -11,7 +11,7 @@ function buildCodexMigrationProvider(params = {}) {
|
|
|
11
11
|
].join(" "),
|
|
12
12
|
supportedItemKinds: ["memory", "auth"],
|
|
13
13
|
async detect(ctx) {
|
|
14
|
-
const { discoverCodexSource, hasCodexSource } = await import("./source-
|
|
14
|
+
const { discoverCodexSource, hasCodexSource } = await import("./source-Iusn97ly.mjs").then((n) => n.a);
|
|
15
15
|
const memoryOnly = isOnlyMigrationKind(ctx, "memory");
|
|
16
16
|
const authOnly = isOnlyMigrationKind(ctx, "auth");
|
|
17
17
|
const source = await discoverCodexSource({
|
|
@@ -29,16 +29,16 @@ function buildCodexMigrationProvider(params = {}) {
|
|
|
29
29
|
};
|
|
30
30
|
},
|
|
31
31
|
async plan(ctx) {
|
|
32
|
-
const { buildCodexMigrationPlan } = await import("./plan-
|
|
32
|
+
const { buildCodexMigrationPlan } = await import("./plan-Cwp_21m-.mjs");
|
|
33
33
|
return buildCodexMigrationPlan(ctx);
|
|
34
34
|
},
|
|
35
35
|
deferredApply: { retrySafe: true },
|
|
36
36
|
prepareApply(ctx) {
|
|
37
37
|
if (isOnlyMigrationKind(ctx, "memory") || isOnlyMigrationKind(ctx, "auth")) return;
|
|
38
|
-
return import("./apply-
|
|
38
|
+
return import("./apply-CxwOGLd_.mjs").then(({ prepareTargetCodexAppServer }) => prepareTargetCodexAppServer(ctx));
|
|
39
39
|
},
|
|
40
40
|
async apply(ctx, plan) {
|
|
41
|
-
const { applyCodexMigrationPlan } = await import("./apply-
|
|
41
|
+
const { applyCodexMigrationPlan } = await import("./apply-CxwOGLd_.mjs");
|
|
42
42
|
return await applyCodexMigrationPlan({
|
|
43
43
|
ctx,
|
|
44
44
|
plan,
|
package/dist/.setup/{provider-capabilities-CYK-rMwC.mjs → provider-capabilities-DBs9l8oL.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h as releaseLeasedSharedCodexAppServerClient } from "./shared-client-
|
|
2
|
-
import { dt as normalizeCodexDynamicToolName } from "./thread-requests-
|
|
1
|
+
import { h as releaseLeasedSharedCodexAppServerClient } from "./shared-client-ZXKMsK6f.mjs";
|
|
2
|
+
import { dt as normalizeCodexDynamicToolName } from "./thread-requests-y_MnVuWC.mjs";
|
|
3
3
|
import { pinExecToolTarget } from "openclaw/plugin-sdk/codex-mcp-projection";
|
|
4
4
|
import { loadNodeExecAvailability } from "openclaw/plugin-sdk/node-selection-runtime";
|
|
5
5
|
//#region extensions/codex/src/app-server/shell-dynamic-tools.ts
|