@openclaw/codex 2026.10.2 → 2026.10.5-beta.2
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-DPXsyONK.mjs → account-usage-runtime-B6S1BQU7.mjs} +8 -7
- package/dist/.setup/{app-server-policy-Bg4FZw1f.mjs → app-server-policy-D_zv8J7V.mjs} +3 -4
- package/dist/.setup/{apply-CQ3brq3z.mjs → apply-Cc1DfWPz.mjs} +40 -51
- package/dist/.setup/{attempt-client-cleanup-DPUGAWP2.mjs → attempt-client-cleanup-CxX4cTSi.mjs} +6 -6
- package/dist/.setup/attempt-terminal-jO5IMj9K.mjs +2 -0
- package/dist/.setup/{attempt-workspace-context-GllQy8mw.mjs → attempt-workspace-context-CcwP3DA3.mjs} +21 -18
- package/dist/.setup/{auth-binding-BoMwpuPN.mjs → auth-binding-BaxlhaNx.mjs} +2 -2
- package/dist/.setup/{auth-cache-key-BE1HXsNo.mjs → auth-cache-key-tENCQOub.mjs} +30 -41
- package/dist/.setup/{binding-connection-C-08ez1w.mjs → binding-connection-B7HAAZSI.mjs} +2 -2
- package/dist/.setup/{binding-connection.runtime-Dn2p-fdy.mjs → binding-connection.runtime-DAXn7iFl.mjs} +6 -5
- package/dist/.setup/{bounded-turn-9YflG60n.mjs → bounded-turn-DxtRqV8t.mjs} +21 -17
- package/dist/.setup/{bounded-turn-isolation-DklXNk3k.mjs → bounded-turn-isolation-BfDAo-qZ.mjs} +4 -4
- package/dist/.setup/{build-state-LS-A65iX.mjs → build-state-CMYRQ_We.mjs} +1 -1
- package/dist/.setup/{capabilities-kQntafj_.mjs → capabilities-DbOzOglY.mjs} +1 -1
- package/dist/.setup/{client-catalog-response-BprQziLV.mjs → client-catalog-response-B7oqHQGO.mjs} +25 -32
- package/dist/.setup/{client-ChJtGEdJ.mjs → client-zrCKOu_E.mjs} +198 -247
- package/dist/.setup/{command-dispatch-BoC9hvFs.mjs → command-dispatch-ImiHvcyW.mjs} +3 -4
- package/dist/.setup/{command-formatters-DV3DHhdr.mjs → command-formatters-xW9KpoSZ.mjs} +16 -26
- package/dist/.setup/{command-handlers-BVX2quUD.mjs → command-handlers-B8CT4ngS.mjs} +270 -360
- package/dist/.setup/{command-rpc-M4gYsRiV.mjs → command-rpc-HtQjCQBg.mjs} +19 -18
- package/dist/.setup/{compact-D3JNLG_b.mjs → compact-Do9HPeDr.mjs} +41 -61
- package/dist/.setup/{computer-use-CF0jsDi1.mjs → computer-use-CeF5GuCX.mjs} +109 -147
- package/dist/.setup/{config-0Gxk3_eq.mjs → config-C1YVVLEA.mjs} +32 -59
- package/dist/.setup/config-contracts.shared-D85SGEuq.mjs +4 -0
- package/dist/.setup/{config-options-HG_Rr3W_.mjs → config-options-DDzeNQ8m.mjs} +52 -90
- package/dist/.setup/{config-parsing-BQq-CHTF.mjs → config-parsing-DsWSCPHO.mjs} +19 -55
- package/dist/.setup/{config-runtime-cUYrqu_a.mjs → config-runtime-DWzK-k0n.mjs} +2 -2
- package/dist/.setup/{config-security-KAPScztc.mjs → config-security-clxAZYWX.mjs} +35 -39
- package/dist/.setup/config-utils-DN_YT7dE.mjs +47 -0
- package/dist/.setup/{context-engine-projection-CsgYSQhW.mjs → context-engine-projection-ps-yn_ci.mjs} +10 -22
- package/dist/.setup/{conversation-binding-7kceEUf0.mjs → conversation-binding-D78aEdkE.mjs} +85 -119
- package/dist/.setup/{conversation-binding-data-DJ4ix-W5.mjs → conversation-binding-data-UgLuTSQT.mjs} +9 -8
- package/dist/.setup/{conversation-control-BpJpPo0t.mjs → conversation-control-GXM3unE4.mjs} +7 -10
- package/dist/.setup/{cyber-failover-Bb1J6hS1.mjs → cyber-failover-D4dgNfFf.mjs} +2 -5
- package/dist/.setup/{cyber-failover-notice-XR03ef31.mjs → cyber-failover-notice-ljgGGL0s.mjs} +1 -1
- package/dist/.setup/{doctor-start-options-DPW9JxIE.mjs → doctor-start-options-JjTAl-q_.mjs} +5 -5
- package/dist/.setup/{dynamic-tool-build-BCi00feJ.mjs → dynamic-tool-build-BMiiFROa.mjs} +57 -69
- package/dist/.setup/{dynamic-tools-DUv6Sr6h.mjs → dynamic-tools-DPPHrGKB.mjs} +680 -709
- package/dist/.setup/{effective-mcp-catalog-CIdbHp1t.mjs → effective-mcp-catalog-x3JVEcJp.mjs} +11 -20
- package/dist/.setup/{elicitation-input-r9axtppm.mjs → elicitation-input-DXG_qaXr.mjs} +14 -20
- package/dist/.setup/{ephemeral-turn-U4th15a6.mjs → ephemeral-turn-Dk0wWoqi.mjs} +3 -3
- package/dist/.setup/{event-projector-assistant-message-BwG5TUYW.mjs → event-projector-assistant-message-CLMKN4x-.mjs} +2 -2
- package/dist/.setup/{event-projector-usage-03R0I2dM.mjs → event-projector-usage-BpKfdoTm.mjs} +20 -33
- package/dist/.setup/{event-projector-values-DTqZHizf.mjs → event-projector-values-CLvG1Hil.mjs} +4 -5
- package/dist/.setup/history-rejection-B4nOXNXF.mjs +13 -0
- package/dist/.setup/{inference-context-D-9gWlTR.mjs → inference-context-DNlGwzwy.mjs} +10 -11
- package/dist/.setup/{inference-dispatch-B5UKEUyC.mjs → inference-dispatch-CO6tTs4q.mjs} +5 -4
- package/dist/.setup/{inference-metadata-CgIf7sOx.mjs → inference-metadata-DCvcG_N_.mjs} +36 -41
- package/dist/.setup/{inference-proxy-DUO5E2QQ.mjs → inference-proxy-BDWV0djM.mjs} +10 -14
- package/dist/.setup/{isolated-completion-C6QKyyDS.mjs → isolated-completion-z0ii1a_V.mjs} +8 -8
- package/dist/.setup/local-runtime-attribution-CZz2DJ4q.mjs +15 -0
- package/dist/.setup/{managed-binary-C1VFoVPf.mjs → managed-binary-BtIjV7yN.mjs} +16 -36
- package/dist/.setup/{mcp-app-session-preparation-JFCtSkRp.mjs → mcp-app-session-preparation-GTx-bRGN.mjs} +24 -25
- package/dist/.setup/{mcp-tool-metadata-j10HhfTC.mjs → mcp-tool-metadata-DW41snf3.mjs} +1 -1
- package/dist/.setup/{model-catalog-DD-evckc.mjs → model-catalog-VUdFUqnH.mjs} +8 -8
- package/dist/.setup/{models-DaW-7tld.mjs → models-Dph0RqpR.mjs} +6 -10
- package/dist/.setup/{native-auth-Cjb9y7IZ.mjs → native-auth-esN5MdIv.mjs} +5 -5
- package/dist/.setup/{native-execution-policy-ClzpdG3D.mjs → native-execution-policy-MXEe7PB3.mjs} +11 -28
- package/dist/.setup/native-hook-relay-CSZpcjwq.mjs +561 -0
- package/dist/.setup/{native-mcp-app-ChpyWmL-.mjs → native-mcp-app-CDrrBaTE.mjs} +6 -6
- package/dist/.setup/native-skill-isolation-BAatEJZb.mjs +391 -0
- package/dist/.setup/{native-subagent-monitor-wh_-K3Vo.mjs → native-subagent-monitor-D5O_o07p.mjs} +505 -639
- package/dist/.setup/{native-subagent-pending-assignments-BDqhOdJp.mjs → native-subagent-pending-assignments-DmVhedNs.mjs} +11 -23
- package/dist/.setup/{native-task-assignments-C6KVqiN1.mjs → native-task-assignments-DimsQ9Qa.mjs} +73 -27
- package/dist/.setup/{node-cli-sessions-B5oNDkUS.mjs → node-cli-sessions-CzKg2nGq.mjs} +18 -26
- package/dist/.setup/{node-exec-server.runtime-0xSEjKYt.mjs → node-exec-server.runtime-BWkULhBM.mjs} +5 -8
- package/dist/.setup/{plan-CUHSuL6_.mjs → plan-QNW5zpFp.mjs} +40 -50
- package/dist/.setup/{plugin-activation-BcyBv8PG.mjs → plugin-activation-D7WkJMvU.mjs} +4 -5
- package/dist/.setup/{plugin-app-cache-key-BW8rd98k.mjs → plugin-app-cache-key-Bg9DbDI6.mjs} +18 -23
- package/dist/.setup/{plugin-approval-roundtrip-bPQbG8BI.mjs → plugin-approval-roundtrip-DOQ3Tibe.mjs} +4 -6
- package/dist/.setup/{plugin-inventory-Bf0_piTw.mjs → plugin-inventory-CYgdo14P.mjs} +28 -43
- package/dist/.setup/{plugin-marketplace-discovery-SQPhSuic.mjs → plugin-marketplace-discovery-BblHM3DU.mjs} +7 -10
- package/dist/.setup/{plugin-metadata-cache-DWnB7VMj.mjs → plugin-metadata-cache-Bi8TAPwX.mjs} +5 -10
- package/dist/.setup/project-doc-thread-config-BVcvnps8.mjs +490 -0
- package/dist/.setup/{provider-Ct6-1lsF.mjs → provider-BG5nXBnY.mjs} +4 -4
- package/dist/.setup/{provider-capabilities-DhkeeHJd.mjs → provider-capabilities-DtJKxDf6.mjs} +1 -1
- package/dist/.setup/{rate-limits-CMPy24F5.mjs → rate-limits-CI8pTPqL.mjs} +15 -32
- package/dist/.setup/reasoning-effort-CS9kKWB9.mjs +37 -0
- package/dist/.setup/{request-CZkKkN6c.mjs → request-6piO0U_P.mjs} +28 -48
- package/dist/.setup/{rpc-error-hmWM21RB.mjs → rpc-error-C98SHchT.mjs} +3 -6
- package/dist/.setup/{run-attempt-C6-678kR.mjs → run-attempt-DejV9vDW.mjs} +927 -860
- package/dist/.setup/{run-attempt-lifecycle-BuZgVbDA.mjs → run-attempt-lifecycle-KN4oh-7O.mjs} +13 -4
- package/dist/.setup/{runtime-artifact-CUTOOnKw.mjs → runtime-artifact-C13pR7tD.mjs} +18 -22
- package/dist/.setup/{runtime-artifact-connection-CADz3_BY.mjs → runtime-artifact-connection-jS5DeCok.mjs} +3 -3
- package/dist/.setup/{sandbox-guard-WqE8yPge.mjs → sandbox-guard-DIImwCy1.mjs} +4 -6
- package/dist/.setup/service-tier-normalization-BPgw2Wdt.mjs +9 -0
- package/dist/.setup/{session-binding-Ce7BqiPN.mjs → session-binding-JEHNMPsr.mjs} +13 -40
- package/dist/.setup/{session-binding-record-BZB8RgcF.mjs → session-binding-record-DU_0biMD.mjs} +4 -4
- package/dist/.setup/{session-binding-record-codec-z4ZpDn6E.mjs → session-binding-record-codec-BpH8u_G9.mjs} +16 -39
- package/dist/.setup/{session-binding-sidecars-BrdV95Fg.mjs → session-binding-sidecars-DD-enC8w.mjs} +49 -54
- package/dist/.setup/{session-catalog-adoption-CPIP4S_y.mjs → session-catalog-adoption-Ca3OYGYM.mjs} +23 -27
- package/dist/.setup/{session-catalog-archive-DcgwvSbF.mjs → session-catalog-archive-Bv6gV7x9.mjs} +6 -6
- package/dist/.setup/{session-catalog-events-Cj-b2FpC.mjs → session-catalog-events-BziNSfLx.mjs} +6 -5
- package/dist/.setup/{session-catalog-index-BnvC43eZ.mjs → session-catalog-index-BmaZFGEH.mjs} +111 -105
- package/dist/.setup/{session-catalog-index-order-nhyO0wdW.mjs → session-catalog-index-order-CTfoefow.mjs} +28 -5
- package/dist/.setup/{session-catalog-limits-DEU36Qlo.mjs → session-catalog-limits-BynIoOYm.mjs} +1 -1
- package/dist/.setup/{session-catalog-list-request-tXephOB4.mjs → session-catalog-list-request-D4MYNgDB.mjs} +11 -8
- package/dist/.setup/{session-catalog-native-projection-DCtsWKSF.mjs → session-catalog-native-projection-4CsufcT8.mjs} +5 -61
- package/dist/.setup/{session-catalog-node-adoption-7-WEQTB1.mjs → session-catalog-node-adoption-BdP9Zjqo.mjs} +2 -2
- package/dist/.setup/{session-catalog-node-continue-DLWBwAAO.mjs → session-catalog-node-continue-CNJibO4_.mjs} +27 -49
- package/dist/.setup/{session-catalog-node-lookup-Uufckwcm.mjs → session-catalog-node-lookup-BH_DBGa9.mjs} +3 -3
- package/dist/.setup/{session-catalog-parsing-B-qWJh2x.mjs → session-catalog-parsing-DkeoVn60.mjs} +9 -19
- package/dist/.setup/{session-catalog-projection-Cn0bLb-d.mjs → session-catalog-projection-CcIdJdsd.mjs} +8 -22
- package/dist/.setup/session-catalog-source-CdPqS9sa.mjs +58 -0
- package/dist/.setup/{session-cli-kH4vuGod.mjs → session-cli-GwU0izn-.mjs} +20 -41
- package/dist/.setup/{session-history-BogBHKLk.mjs → session-history-BO6i_pfk.mjs} +1 -1
- package/dist/.setup/{session-history-import-NWKPa4ZO.mjs → session-history-import-CaO8s6ta.mjs} +4 -4
- package/dist/.setup/{session-history-read-CNN8zwbD.mjs → session-history-read-BI_2jRED.mjs} +4 -15
- package/dist/.setup/{session-history.worker-Cq_4DYgN.mjs → session-history.worker-DJQfek5p.mjs} +147 -159
- package/dist/.setup/{session-initialization-D6dtFQkE.mjs → session-initialization-Bi_2DKhc.mjs} +3 -5
- package/dist/.setup/{session-permission-policy-BxIUJ0Zd.mjs → session-permission-policy-CD2MAWU8.mjs} +12 -20
- package/dist/.setup/{session-retirement-Bo81t4Fb.mjs → session-retirement-CcWVhLVr.mjs} +7 -7
- package/dist/.setup/{settled-turn-context-BZsMjkIO.mjs → settled-turn-context-BPL6D3RO.mjs} +1 -1
- package/dist/.setup/{settled-turn-finalizer-CFARFqNd.mjs → settled-turn-finalizer-BezKSo-Y.mjs} +12 -11
- package/dist/.setup/{shared-client-5NUq43f3.mjs → shared-client-BjiqpbC5.mjs} +164 -227
- package/dist/.setup/{side-question-oTlegAz3.mjs → side-question-YQ5FObkD.mjs} +116 -137
- package/dist/.setup/{source-1cabQi3x.mjs → source-Ce3XIIsU.mjs} +37 -56
- package/dist/.setup/thread-archive-guard-LKdwQKyr.mjs +56 -0
- package/dist/.setup/{thread-lifecycle--EPPTNTe.mjs → thread-lifecycle-run-BWy0LDLB.mjs} +338 -478
- package/dist/.setup/thread-model-selection-DcVebr8N.mjs +61 -0
- package/dist/.setup/{thread-ownership-T7T_iffm.mjs → thread-ownership-5X4197vk.mjs} +5 -5
- package/dist/.setup/{thread-ownership-queue-Dp24d7-F.mjs → thread-ownership-queue-CeyYScUC.mjs} +5 -6
- package/dist/.setup/{thread-policy-VtqLex1l.mjs → thread-policy-BEecBTJM.mjs} +4 -4
- package/dist/.setup/thread-requests-BgzJwJtS.mjs +745 -0
- package/dist/.setup/{thread-resume-buZujRcC.mjs → thread-resume-BXY_6o6Z.mjs} +5 -5
- package/dist/.setup/{timeout-CXOfNoaX.mjs → timeout-D0mEWSGG.mjs} +6 -12
- package/dist/.setup/{transcript-history-projection-B9a7HwUV.mjs → transcript-history-projection-DfKcoZCB.mjs} +3 -4
- package/dist/.setup/{transcript-mirror-BfLRARNL.mjs → transcript-mirror-Bee2o6jj.mjs} +68 -68
- package/dist/.setup/{transcript-mirror-attestation-YSegaktH.mjs → transcript-mirror-attestation-BzUXnrvv.mjs} +5 -2
- package/dist/.setup/{transport-stdio-a0HDa2Mj.mjs → transport-stdio-CRWTkKOn.mjs} +67 -77
- package/dist/.setup/{transport-websocket-zqJ0Cmtn.mjs → transport-websocket-DIyPfkHo.mjs} +8 -16
- package/dist/.setup/{turn-router-BOKSJmfw.mjs → turn-router-D8DLkZgH.mjs} +30 -31
- package/dist/.setup/upstream-prompt-provenance-Ccd9MFRJ.mjs +44 -0
- package/dist/.setup/{upstream-session-fork-C4sbIoZb.mjs → upstream-session-fork-DQZbaYMK.mjs} +50 -43
- package/dist/.setup/{usage-Cq21xTMZ.mjs → usage-DVR5mNJK.mjs} +4 -4
- package/dist/.setup/{usage-limit-error-CGJUoQu8.mjs → usage-limit-error-BEONfgt-.mjs} +12 -21
- package/dist/.setup/web-search-item-CvokaZOo.mjs +20 -0
- package/dist/.setup/{web-search-provider.runtime-DrVE7-Br.mjs → web-search-provider.runtime-CffHOpYY.mjs} +3 -3
- package/dist/.setup/{workspace-write-sandbox-probe-DmUHLrrl.mjs → workspace-write-sandbox-probe-BDWO2Qkh.mjs} +4 -4
- package/dist/api.js +15 -15
- package/dist/catalog-page.worker.js +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/doctor-contract-api.js +5 -6
- package/dist/harness.js +32 -61
- package/dist/index.js +302 -416
- package/dist/media-understanding-provider.js +32 -43
- package/dist/migration-provider-api.js +1 -1
- package/dist/native-session-binding-api.js +1 -1
- package/dist/native-tool-policy.js +23 -1
- package/dist/provider-discovery.js +1 -1
- package/dist/session-history-worker-runtime.js +52 -31
- package/dist/session-history.worker.js +1 -1
- package/openclaw.plugin.json +20 -3
- package/package.json +7 -7
- package/dist/.setup/attempt-terminal-gZrxQ35N.mjs +0 -5
- package/dist/.setup/plugin-thread-config-deadline-C5i1S6RN.mjs +0 -124
- package/dist/.setup/service-tier-normalization-Cei89SW6.mjs +0 -15
- package/dist/.setup/shell-dynamic-tools-Bmedt1QE.mjs +0 -85
- package/dist/.setup/thread-archive-guard-C9frICzX.mjs +0 -60
- package/dist/.setup/thread-requests-Bj_Lixmv.mjs +0 -2111
- package/dist/.setup/upstream-prompt-provenance-fXkKbPVC.mjs +0 -37
package/dist/.setup/{effective-mcp-catalog-CIdbHp1t.mjs → effective-mcp-catalog-x3JVEcJp.mjs}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { m as sessionBindingIdentity } from "./session-binding-record-
|
|
2
|
-
import { S as retainSharedCodexAppServerClientByInstanceId } from "./auth-cache-key-
|
|
3
|
-
import { U as protectCodexAppServerLiveThread } from "./shared-client-
|
|
4
|
-
import "./session-binding-
|
|
5
|
-
import { n as projectCodexMcpToolMetadata, t as projectCodexMcpServerMetadata } from "./mcp-tool-metadata-
|
|
1
|
+
import { m as sessionBindingIdentity } from "./session-binding-record-DU_0biMD.mjs";
|
|
2
|
+
import { S as retainSharedCodexAppServerClientByInstanceId } from "./auth-cache-key-tENCQOub.mjs";
|
|
3
|
+
import { U as protectCodexAppServerLiveThread } from "./shared-client-BjiqpbC5.mjs";
|
|
4
|
+
import "./session-binding-JEHNMPsr.mjs";
|
|
5
|
+
import { n as projectCodexMcpToolMetadata, t as projectCodexMcpServerMetadata } from "./mcp-tool-metadata-DW41snf3.mjs";
|
|
6
6
|
import { asOptionalRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { assignMcpCatalogSafeServerNames } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
8
8
|
//#region extensions/codex/src/app-server/effective-mcp-catalog.ts
|
|
@@ -35,9 +35,9 @@ function buildCodexEffectiveMcpCatalog(statuses, toolOverrides) {
|
|
|
35
35
|
const safeServerName = safeNames.get(status.name) ?? status.name;
|
|
36
36
|
const denialMap = toolOverrides?.mcpToolsDeny;
|
|
37
37
|
const deniedNames = new Set(denialMap && Object.hasOwn(denialMap, status.name) ? denialMap[status.name] : []);
|
|
38
|
-
const observedNames =
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
const observedNames = new Set(Object.keys(status.tools));
|
|
39
|
+
const toolEntries = [...Object.entries(status.tools).toSorted(([left], [right]) => left.localeCompare(right)), ...[...deniedNames].filter((name) => !observedNames.has(name)).toSorted().map((name) => [name, void 0])];
|
|
40
|
+
for (const [toolName, raw] of toolEntries) {
|
|
41
41
|
const deniedBySession = deniedNames.has(toolName) ? true : void 0;
|
|
42
42
|
const tool = catalogTool({
|
|
43
43
|
serverName: status.name,
|
|
@@ -48,19 +48,10 @@ function buildCodexEffectiveMcpCatalog(statuses, toolOverrides) {
|
|
|
48
48
|
});
|
|
49
49
|
(deniedBySession ? sessionDeniedTools : tools).push(tool);
|
|
50
50
|
}
|
|
51
|
-
for (const toolName of [...deniedNames].toSorted()) {
|
|
52
|
-
if (observedNames.has(toolName)) continue;
|
|
53
|
-
sessionDeniedTools.push(catalogTool({
|
|
54
|
-
serverName: status.name,
|
|
55
|
-
safeServerName,
|
|
56
|
-
toolName,
|
|
57
|
-
deniedBySession: true
|
|
58
|
-
}));
|
|
59
|
-
}
|
|
60
51
|
serverEntries.push([status.name, {
|
|
61
52
|
...projectCodexMcpServerMetadata(status),
|
|
62
53
|
safeServerName,
|
|
63
|
-
toolCount:
|
|
54
|
+
toolCount: toolEntries.length
|
|
64
55
|
}]);
|
|
65
56
|
}
|
|
66
57
|
return {
|
|
@@ -116,7 +107,7 @@ async function acquireCodexMcpAppRuntime(params, options) {
|
|
|
116
107
|
if (!retained && params.prepareSession) {
|
|
117
108
|
const preparation = await params.prepareSession();
|
|
118
109
|
params.assertCurrent();
|
|
119
|
-
const { prepareCodexMcpAppSession } = await import("./mcp-app-session-preparation-
|
|
110
|
+
const { prepareCodexMcpAppSession } = await import("./mcp-app-session-preparation-GTx-bRGN.mjs");
|
|
120
111
|
await prepareCodexMcpAppSession({
|
|
121
112
|
preparation,
|
|
122
113
|
bindingStore: options.bindingStore,
|
|
@@ -137,7 +128,7 @@ async function acquireCodexMcpAppRuntime(params, options) {
|
|
|
137
128
|
};
|
|
138
129
|
params.assertCurrent();
|
|
139
130
|
assertBinding();
|
|
140
|
-
const { createNativeMcpRuntime } = await import("./native-mcp-app-
|
|
131
|
+
const { createNativeMcpRuntime } = await import("./native-mcp-app-CDrrBaTE.mjs").then((n) => n.n);
|
|
141
132
|
params.assertCurrent();
|
|
142
133
|
const runtime = createNativeMcpRuntime({
|
|
143
134
|
client: retained.client,
|
|
@@ -4,34 +4,28 @@ import { agentHarnessStructuredInput } from "openclaw/plugin-sdk/agent-harness-r
|
|
|
4
4
|
function compileCodexOrdinaryElicitation(params) {
|
|
5
5
|
const requestTurnId = readValue(params.snapshot, "turnId");
|
|
6
6
|
if (typeof requestTurnId === "string" && requestTurnId !== params.turnId) return { kind: "ignored" };
|
|
7
|
-
|
|
7
|
+
return {
|
|
8
8
|
kind: "compiled",
|
|
9
|
-
input:
|
|
9
|
+
input: compileInput()
|
|
10
|
+
};
|
|
11
|
+
function compileInput() {
|
|
12
|
+
if (requestTurnId !== null && typeof requestTurnId !== "string") return {
|
|
10
13
|
kind: "unsupported",
|
|
11
14
|
message: "OpenClaw declined an MCP elicitation with invalid turn correlation."
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
if (mode === "url") return {
|
|
16
|
-
kind: "compiled",
|
|
17
|
-
input: agentHarnessStructuredInput.compileUrl({
|
|
15
|
+
};
|
|
16
|
+
const mode = readCodexElicitationString(params.snapshot, "mode");
|
|
17
|
+
if (mode === "url") return agentHarnessStructuredInput.compileUrl({
|
|
18
18
|
url: readValue(params.snapshot, "url"),
|
|
19
19
|
elicitationId: readValue(params.snapshot, "elicitationId"),
|
|
20
20
|
message: readValue(params.snapshot, "message"),
|
|
21
21
|
fallbackMessage: "Codex provided a URL",
|
|
22
22
|
protocolName: "MCP"
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
if (mode !== "form" && mode !== "openai/form" && mode !== "openaiForm") return {
|
|
26
|
-
kind: "compiled",
|
|
27
|
-
input: {
|
|
23
|
+
});
|
|
24
|
+
if (mode !== "form" && mode !== "openai/form" && mode !== "openaiForm") return {
|
|
28
25
|
kind: "unsupported",
|
|
29
26
|
message: `OpenClaw does not support MCP elicitation mode ${JSON.stringify(mode ?? "unknown")}.`
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return {
|
|
33
|
-
kind: "compiled",
|
|
34
|
-
input: agentHarnessStructuredInput.compileForm({
|
|
27
|
+
};
|
|
28
|
+
return agentHarnessStructuredInput.compileForm({
|
|
35
29
|
schema: readValue(params.snapshot, "requestedSchema"),
|
|
36
30
|
message: readCodexElicitationString(params.snapshot, "message"),
|
|
37
31
|
fallbackMessage: "Codex needs input",
|
|
@@ -45,8 +39,8 @@ function compileCodexOrdinaryElicitation(params) {
|
|
|
45
39
|
allowImagePicker: mode === "openai/form",
|
|
46
40
|
metadata: { secretPath: ["isSecret"] }
|
|
47
41
|
}
|
|
48
|
-
})
|
|
49
|
-
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
50
44
|
}
|
|
51
45
|
function readValue(record, key) {
|
|
52
46
|
return Object.hasOwn(record, key) ? record[key] : void 0;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as isJsonObject } from "./protocol-CANUwXJ3.mjs";
|
|
2
|
-
import { x as readCodexTurnCompletedNotification } from "./client-
|
|
3
|
-
import { n as getCodexAppServerTurnRouter } from "./turn-router-
|
|
4
|
-
import { o as isTerminalTurnStatus, s as readCodexNotificationItem, t as CodexUsageProjection } from "./event-projector-usage-
|
|
2
|
+
import { x as readCodexTurnCompletedNotification } from "./client-zrCKOu_E.mjs";
|
|
3
|
+
import { n as getCodexAppServerTurnRouter } from "./turn-router-D8DLkZgH.mjs";
|
|
4
|
+
import { o as isTerminalTurnStatus, s as readCodexNotificationItem, t as CodexUsageProjection } from "./event-projector-usage-BpKfdoTm.mjs";
|
|
5
5
|
import { readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { toStringifiedError } from "openclaw/plugin-sdk/error-runtime";
|
|
7
7
|
import { createDeferred } from "openclaw/plugin-sdk/extension-shared";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as codexProviderRefusalDiagnostics } from "./event-projector-values-
|
|
2
|
-
import {
|
|
1
|
+
import { t as codexProviderRefusalDiagnostics } from "./event-projector-values-CLvG1Hil.mjs";
|
|
2
|
+
import { t as resolveCodexLocalRuntimeAttribution } from "./local-runtime-attribution-CZz2DJ4q.mjs";
|
|
3
3
|
import { createAgentHarnessAssistantMessage } from "openclaw/plugin-sdk/agent-harness-attempt-runtime";
|
|
4
4
|
//#region extensions/codex/src/app-server/event-projector-assistant-message.ts
|
|
5
5
|
function createAssistantMessage(params, text, options) {
|
package/dist/.setup/{event-projector-usage-03R0I2dM.mjs → event-projector-usage-BpKfdoTm.mjs}
RENAMED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { i as isJsonObject } from "./protocol-CANUwXJ3.mjs";
|
|
2
|
+
import { n as extractRawResponseItemText } from "./event-projector-values-CLvG1Hil.mjs";
|
|
2
3
|
import { asSafeIntegerInRange, readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
4
|
import { normalizeUsage } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
4
5
|
//#region extensions/codex/src/app-server/attempt-notifications.ts
|
|
@@ -20,17 +21,16 @@ function readNotificationItemId(notification) {
|
|
|
20
21
|
const item = isJsonObject(notification.params.item) ? notification.params.item : void 0;
|
|
21
22
|
return (item ? readStringField(item, "id") : void 0) ?? readStringField(notification.params, "itemId") ?? readStringField(notification.params, "id");
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
-
if (notification.method !== "item/completed" || !isJsonObject(notification.params)) return
|
|
24
|
+
function completePendingOpenClawDynamicToolNotification(notification, pendingOpenClawDynamicToolCompletionIds) {
|
|
25
|
+
if (notification.method !== "item/completed" || !isJsonObject(notification.params)) return;
|
|
25
26
|
const itemId = readNotificationItemId(notification);
|
|
26
|
-
if (!itemId || !pendingOpenClawDynamicToolCompletionIds.has(itemId)) return
|
|
27
|
+
if (!itemId || !pendingOpenClawDynamicToolCompletionIds.has(itemId)) return;
|
|
27
28
|
const item = isJsonObject(notification.params.item) ? notification.params.item : void 0;
|
|
28
29
|
const itemType = item ? readStringField(item, "type") : void 0;
|
|
29
|
-
|
|
30
|
+
if (itemType === void 0 || itemType === "dynamicToolCall") pendingOpenClawDynamicToolCompletionIds.delete(itemId);
|
|
30
31
|
}
|
|
31
32
|
function isRawFunctionToolOutputCompletionNotification(notification) {
|
|
32
|
-
|
|
33
|
-
const item = isJsonObject(notification.params.item) ? notification.params.item : void 0;
|
|
33
|
+
const item = readCompletedRawItem(notification);
|
|
34
34
|
return item ? readStringField(item, "type") === "function_call_output" : false;
|
|
35
35
|
}
|
|
36
36
|
function isTerminalTurnStatus(status) {
|
|
@@ -38,26 +38,13 @@ function isTerminalTurnStatus(status) {
|
|
|
38
38
|
}
|
|
39
39
|
/** Detects Codex's interrupted-turn marker, not user-authored copies of it. */
|
|
40
40
|
function isCodexTurnAbortMarkerNotification(notification, options = {}) {
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const currentPromptTexts = [options.currentPromptText, ...options.currentPromptTexts ?? []].filter((prompt) => typeof prompt === "string" && prompt.length > 0).map((prompt) => prompt.trim());
|
|
47
|
-
if (role === "user" && currentPromptTexts.includes(text)) return false;
|
|
41
|
+
const item = readCompletedRawItem(notification);
|
|
42
|
+
const role = item ? readStringField(item, "role") : void 0;
|
|
43
|
+
if (!item || readStringField(item, "type") !== "message" || role !== "user" && role !== "developer") return false;
|
|
44
|
+
const text = extractRawResponseItemText(item, "input_text") ?? "";
|
|
45
|
+
if (role === "user" && options.currentPromptText?.trim() === text) return false;
|
|
48
46
|
return text.startsWith(CODEX_TURN_ABORT_MARKER_START) && text.endsWith(CODEX_TURN_ABORT_MARKER_END);
|
|
49
47
|
}
|
|
50
|
-
function extractRawResponseItemText(item) {
|
|
51
|
-
const content = item.content;
|
|
52
|
-
if (!Array.isArray(content)) return "";
|
|
53
|
-
return content.flatMap((entry) => {
|
|
54
|
-
if (!isJsonObject(entry)) return [];
|
|
55
|
-
const type = readStringField(entry, "type");
|
|
56
|
-
if (type !== "input_text" && type !== "text") return [];
|
|
57
|
-
const text = readStringField(entry, "text");
|
|
58
|
-
return text ? [text] : [];
|
|
59
|
-
}).join("");
|
|
60
|
-
}
|
|
61
48
|
function readCodexNotificationItem(params) {
|
|
62
49
|
if (!isJsonObject(params) || !isJsonObject(params.item)) return;
|
|
63
50
|
const item = params.item;
|
|
@@ -65,8 +52,7 @@ function readCodexNotificationItem(params) {
|
|
|
65
52
|
}
|
|
66
53
|
/** Reads the stable call id from a model-emitted raw tool item. */
|
|
67
54
|
function readRawResponseToolCallId(notification) {
|
|
68
|
-
|
|
69
|
-
const item = isJsonObject(notification.params.item) ? notification.params.item : void 0;
|
|
55
|
+
const item = readCompletedRawItem(notification);
|
|
70
56
|
if (!item) return;
|
|
71
57
|
switch (readStringField(item, "type")) {
|
|
72
58
|
case "custom_tool_call":
|
|
@@ -78,16 +64,15 @@ function readRawResponseToolCallId(notification) {
|
|
|
78
64
|
default: return;
|
|
79
65
|
}
|
|
80
66
|
}
|
|
67
|
+
function readCompletedRawItem(notification) {
|
|
68
|
+
if (notification.method !== "rawResponseItem/completed" || !isJsonObject(notification.params)) return;
|
|
69
|
+
return isJsonObject(notification.params.item) ? notification.params.item : void 0;
|
|
70
|
+
}
|
|
81
71
|
//#endregion
|
|
82
72
|
//#region extensions/codex/src/app-server/event-projector-usage.ts
|
|
83
73
|
function readTokenCount(record, key) {
|
|
84
74
|
return asSafeIntegerInRange(record[key], { min: 0 });
|
|
85
75
|
}
|
|
86
|
-
function readCodexThreadTokenUsage(params) {
|
|
87
|
-
const tokenUsage = isJsonObject(params.tokenUsage) ? params.tokenUsage : void 0;
|
|
88
|
-
const last = tokenUsage && isJsonObject(tokenUsage.last) ? tokenUsage.last : void 0;
|
|
89
|
-
return last ? normalizeCodexResponseTokenUsage(last) : void 0;
|
|
90
|
-
}
|
|
91
76
|
function readCodexThreadContextSnapshot(params) {
|
|
92
77
|
const tokenUsage = isJsonObject(params.tokenUsage) ? params.tokenUsage : void 0;
|
|
93
78
|
const last = tokenUsage && isJsonObject(tokenUsage.last) ? tokenUsage.last : void 0;
|
|
@@ -152,7 +137,9 @@ var CodexUsageProjection = class {
|
|
|
152
137
|
this.contextUsage = { state: "unavailable" };
|
|
153
138
|
}
|
|
154
139
|
recordThread(params) {
|
|
155
|
-
const
|
|
140
|
+
const tokenUsage = isJsonObject(params.tokenUsage) ? params.tokenUsage : void 0;
|
|
141
|
+
const last = tokenUsage && isJsonObject(tokenUsage.last) ? tokenUsage.last : void 0;
|
|
142
|
+
const usage = last ? normalizeCodexResponseTokenUsage(last) : void 0;
|
|
156
143
|
this.threadUsage = usage ?? this.threadUsage;
|
|
157
144
|
if (!this.responseUsage && usage) this.contextUsage = usage.contextUsage;
|
|
158
145
|
return readCodexThreadContextSnapshot(params);
|
|
@@ -177,4 +164,4 @@ var CodexUsageProjection = class {
|
|
|
177
164
|
}
|
|
178
165
|
};
|
|
179
166
|
//#endregion
|
|
180
|
-
export { isRawFunctionToolOutputCompletionNotification as a,
|
|
167
|
+
export { isRawFunctionToolOutputCompletionNotification as a, readRawResponseToolCallId as c, isCodexTurnAbortMarkerNotification as i, updateActiveTurnItemIds as l, readCodexThreadContextSnapshot as n, isTerminalTurnStatus as o, completePendingOpenClawDynamicToolNotification as r, readCodexNotificationItem as s, CodexUsageProjection as t };
|
package/dist/.setup/{event-projector-values-DTqZHizf.mjs → event-projector-values-CLvG1Hil.mjs}
RENAMED
|
@@ -55,8 +55,7 @@ function codexProviderRefusalDiagnostics(refusal, timestamp) {
|
|
|
55
55
|
}
|
|
56
56
|
function readNullableString(record, key) {
|
|
57
57
|
const value = record[key];
|
|
58
|
-
|
|
59
|
-
return typeof value === "string" ? value : void 0;
|
|
58
|
+
return value === null || typeof value === "string" ? value : void 0;
|
|
60
59
|
}
|
|
61
60
|
function readCodexErrorNotificationMessage(record) {
|
|
62
61
|
const error = record.error;
|
|
@@ -75,11 +74,11 @@ function readHookOutputEntries(value) {
|
|
|
75
74
|
}];
|
|
76
75
|
});
|
|
77
76
|
}
|
|
78
|
-
function
|
|
77
|
+
function extractRawResponseItemText(item, textType = "output_text") {
|
|
79
78
|
const parts = (Array.isArray(item.content) ? item.content : []).flatMap((entry) => {
|
|
80
79
|
if (!isJsonObject(entry)) return [];
|
|
81
80
|
const type = readStringField(entry, "type");
|
|
82
|
-
if (type !==
|
|
81
|
+
if (type !== textType && type !== "text") return [];
|
|
83
82
|
const value = readStringField(entry, "text");
|
|
84
83
|
return value === void 0 ? [] : [value];
|
|
85
84
|
});
|
|
@@ -93,4 +92,4 @@ function readItem(value) {
|
|
|
93
92
|
return value;
|
|
94
93
|
}
|
|
95
94
|
//#endregion
|
|
96
|
-
export { readHookOutputEntries as a, readCodexProviderRefusal as i,
|
|
95
|
+
export { readHookOutputEntries as a, readCodexProviderRefusal as i, extractRawResponseItemText as n, readItem as o, readCodexErrorNotificationMessage as r, readNullableString as s, codexProviderRefusalDiagnostics as t };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region extensions/codex/src/app-server/history-rejection.ts
|
|
2
|
+
/** Only an owning rejection site can supply a diagnostic; exception text is never evidence. */
|
|
3
|
+
var CodexHistoryRejection = class extends Error {
|
|
4
|
+
constructor(reason) {
|
|
5
|
+
super(`Codex history rejected: ${reason}`);
|
|
6
|
+
this.reason = reason;
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
function codexHistoryRejectionReason(error) {
|
|
10
|
+
return error instanceof CodexHistoryRejection ? error.reason : "history_read_failed";
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { codexHistoryRejectionReason as n, CodexHistoryRejection as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as readCodexInferenceMetadata } from "./inference-metadata-
|
|
1
|
+
import { n as readCodexInferenceMetadata } from "./inference-metadata-DCvcG_N_.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
//#region extensions/codex/src/app-server/inference-context.ts
|
|
4
4
|
const MAX_CONTEXT_BYTES = 262144;
|
|
@@ -66,18 +66,17 @@ function createCodexInferenceContext(assertClientCurrent) {
|
|
|
66
66
|
};
|
|
67
67
|
if (!registration || generation !== registration.generation) throw new Error("Codex inference has no current admitted parent generation");
|
|
68
68
|
registration.assertCurrent();
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const instructions = body.instructions;
|
|
75
|
-
if (instructions !== void 0 && typeof instructions !== "string") throw new Error("Codex inference request has invalid top-level instructions");
|
|
76
|
-
return {
|
|
77
|
-
body: registration.text ? {
|
|
69
|
+
let preparedBody = body;
|
|
70
|
+
if (kind !== "compaction") {
|
|
71
|
+
const instructions = body.instructions;
|
|
72
|
+
if (instructions !== void 0 && typeof instructions !== "string") throw new Error("Codex inference request has invalid top-level instructions");
|
|
73
|
+
if (registration.text) preparedBody = {
|
|
78
74
|
...body,
|
|
79
75
|
instructions: instructions === void 0 ? registration.text : instructions + "\n\n" + registration.text
|
|
80
|
-
}
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
body: preparedBody,
|
|
81
80
|
assertCurrent: registration.assertCurrent,
|
|
82
81
|
signal: registration.controller.signal
|
|
83
82
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as isJsonObject } from "./protocol-CANUwXJ3.mjs";
|
|
2
|
-
import { n as readCodexInferenceMetadata } from "./inference-metadata-
|
|
2
|
+
import { n as readCodexInferenceMetadata } from "./inference-metadata-DCvcG_N_.mjs";
|
|
3
3
|
import { promisify } from "node:util";
|
|
4
4
|
import { isUtf8 } from "node:buffer";
|
|
5
5
|
import { zstdCompress, zstdDecompress } from "node:zlib";
|
|
@@ -239,8 +239,9 @@ function createCodexInferenceModelBinding(params) {
|
|
|
239
239
|
/** One preparation path binds both HTTP requests and reusable WebSocket frames. */
|
|
240
240
|
function createCodexInferenceDispatch(params) {
|
|
241
241
|
const { context, assertCurrent } = params;
|
|
242
|
-
const prepare = async (bytes,
|
|
242
|
+
const prepare = async (bytes, path, headers, signal, transport) => {
|
|
243
243
|
assertCurrent();
|
|
244
|
+
const sampling = path === "/responses";
|
|
244
245
|
let execution;
|
|
245
246
|
let released = false;
|
|
246
247
|
const release = () => {
|
|
@@ -297,13 +298,13 @@ function createCodexInferenceDispatch(params) {
|
|
|
297
298
|
throw error;
|
|
298
299
|
}
|
|
299
300
|
};
|
|
300
|
-
const prepareHttp = async (req,
|
|
301
|
+
const prepareHttp = async (req, path, signal, release, retryable = false) => {
|
|
301
302
|
const wire = await readProxyBody(req, MAX_BODY_BYTES);
|
|
302
303
|
const encoding = req.headers["content-encoding"];
|
|
303
304
|
if (encoding && encoding !== "identity" && encoding !== "zstd") throw new Error(FAILURE);
|
|
304
305
|
const decoded = encoding === "zstd" ? await decompress(wire, { maxOutputLength: MAX_BODY_BYTES }) : wire;
|
|
305
306
|
signal.throwIfAborted();
|
|
306
|
-
const prepared = await prepare(decoded,
|
|
307
|
+
const prepared = await prepare(decoded, path, req.headers, signal, "http");
|
|
307
308
|
try {
|
|
308
309
|
const body = prepared.bytes === decoded ? wire : encoding === "zstd" ? await compress(prepared.bytes) : prepared.bytes;
|
|
309
310
|
prepared.assertCurrent();
|
|
@@ -16,24 +16,26 @@ function readCodexInferenceMetadata(body, headers, transport = "http", path) {
|
|
|
16
16
|
const httpHeaders = transport === "http" ? headers : void 0;
|
|
17
17
|
const compatibility = readNativeMetadata(httpHeaders?.["x-codex-turn-metadata"]);
|
|
18
18
|
if (!nested && !compatibility) throw new Error("Codex inference request is missing bounded native metadata");
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
19
|
+
const nativeField = (key) => [nested?.[key], compatibility?.[key]];
|
|
20
|
+
const requestKind = reconcileMetadataStrings("request kind", ...nativeField("request_kind"));
|
|
21
|
+
const generation = readId("parent generation", ...nativeField(CODEX_INFERENCE_GENERATION_KEY));
|
|
22
|
+
const nativeThreadId = readId("thread", ...nativeField("thread_id"));
|
|
22
23
|
if (!nativeThreadId && (requestKind === "turn" || requestKind === "prewarm" && !(body.generate === false && generation === void 0))) throw new Error("Codex inference request has no native thread metadata");
|
|
24
|
+
const readTurnId = (field, key) => readId(field, flat?.[key], ...nativeField(key));
|
|
23
25
|
return Object.freeze({
|
|
24
|
-
sessionId: readId("session", flat?.session_id,
|
|
26
|
+
sessionId: readId("session", flat?.session_id, ...nativeField("session_id"), httpHeaders?.["session-id"]),
|
|
25
27
|
threadId: readId("thread", flat?.thread_id, nativeThreadId, httpHeaders?.["thread-id"]),
|
|
26
|
-
turnId:
|
|
27
|
-
parentThreadId: readId("parent thread", flat?.["x-codex-parent-thread-id"],
|
|
28
|
-
parentTurnId:
|
|
29
|
-
rootTurnId:
|
|
28
|
+
turnId: readTurnId("turn", "turn_id"),
|
|
29
|
+
parentThreadId: readId("parent thread", flat?.["x-codex-parent-thread-id"], ...nativeField("parent_thread_id"), httpHeaders?.["x-codex-parent-thread-id"]),
|
|
30
|
+
parentTurnId: readTurnId("parent turn", "parent_turn_id"),
|
|
31
|
+
rootTurnId: readTurnId("root turn", "root_turn_id"),
|
|
30
32
|
requestKind,
|
|
31
|
-
threadSource: reconcileMetadataStrings("thread source",
|
|
33
|
+
threadSource: reconcileMetadataStrings("thread source", ...nativeField("thread_source")),
|
|
32
34
|
subagent: reconcileMetadataStrings("subagent", flat?.["x-openai-subagent"], headers?.["x-openai-subagent"]),
|
|
33
|
-
subagentKind: reconcileMetadataStrings("subagent kind",
|
|
34
|
-
guardianClassifierSourceThreadId: readId("Guardian classifier source thread",
|
|
35
|
-
autoReviewEnabled: reconcileMetadataBooleans("automatic review",
|
|
36
|
-
nodeReplAutoReviewRequired: reconcileMetadataBooleans("model-required review",
|
|
35
|
+
subagentKind: reconcileMetadataStrings("subagent kind", ...nativeField("subagent_kind")),
|
|
36
|
+
guardianClassifierSourceThreadId: readId("Guardian classifier source thread", ...nativeField("guardian_classifier_source_thread_id")),
|
|
37
|
+
autoReviewEnabled: reconcileMetadataBooleans("automatic review", ...nativeField("auto_review_enabled")),
|
|
38
|
+
nodeReplAutoReviewRequired: reconcileMetadataBooleans("model-required review", ...nativeField("node_repl_auto_review_required")),
|
|
37
39
|
generation
|
|
38
40
|
});
|
|
39
41
|
}
|
|
@@ -41,41 +43,34 @@ function readNativeMetadata(raw) {
|
|
|
41
43
|
if (raw === void 0) return;
|
|
42
44
|
const encoded = readStringValue(raw);
|
|
43
45
|
if (encoded === void 0 || Buffer.byteLength(encoded) > MAX_NATIVE_METADATA_BYTES) throw new Error("Codex inference request is missing bounded native metadata");
|
|
44
|
-
let value;
|
|
45
46
|
try {
|
|
46
|
-
value = JSON.parse(encoded);
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (!isRecord(value)) throw new Error("Codex inference request has invalid native metadata");
|
|
51
|
-
return value;
|
|
52
|
-
}
|
|
53
|
-
function reconcileMetadataStrings(field, ...values) {
|
|
54
|
-
let result;
|
|
55
|
-
for (const value of values) {
|
|
56
|
-
if (value == null) continue;
|
|
57
|
-
const candidate = readStringValue(value);
|
|
58
|
-
if (candidate === void 0 || Buffer.byteLength(candidate) > MAX_METADATA_FIELD_BYTES) throw new Error(`Codex inference ${field} metadata is invalid or exceeds its limit`);
|
|
59
|
-
if (result !== void 0 && candidate !== result) throw new Error(`Codex inference ${field} metadata disagrees`);
|
|
60
|
-
result = candidate;
|
|
61
|
-
}
|
|
62
|
-
return result;
|
|
47
|
+
const value = JSON.parse(encoded);
|
|
48
|
+
if (isRecord(value)) return value;
|
|
49
|
+
} catch {}
|
|
50
|
+
throw new Error("Codex inference request has invalid native metadata");
|
|
63
51
|
}
|
|
52
|
+
const reconcileMetadataStrings = metadataReconciler((value) => {
|
|
53
|
+
const text = readStringValue(value);
|
|
54
|
+
return text !== void 0 && Buffer.byteLength(text) <= MAX_METADATA_FIELD_BYTES ? text : void 0;
|
|
55
|
+
}, "invalid or exceeds its limit");
|
|
56
|
+
const reconcileMetadataBooleans = metadataReconciler(asBoolean, "invalid");
|
|
64
57
|
function readId(field, ...values) {
|
|
65
58
|
const value = reconcileMetadataStrings(field, ...values);
|
|
66
59
|
if (value !== void 0 && (!value || value.trim() !== value)) throw new Error(`Codex inference ${field} metadata has an invalid identity`);
|
|
67
60
|
return value;
|
|
68
61
|
}
|
|
69
|
-
function
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
62
|
+
function metadataReconciler(read, invalid) {
|
|
63
|
+
return (field, ...values) => {
|
|
64
|
+
let result;
|
|
65
|
+
for (const value of values) {
|
|
66
|
+
if (value == null) continue;
|
|
67
|
+
const candidate = read(value);
|
|
68
|
+
if (candidate === void 0) throw new Error(`Codex inference ${field} metadata is ${invalid}`);
|
|
69
|
+
if (result !== void 0 && candidate !== result) throw new Error(`Codex inference ${field} metadata disagrees`);
|
|
70
|
+
result = candidate;
|
|
71
|
+
}
|
|
72
|
+
return result;
|
|
73
|
+
};
|
|
79
74
|
}
|
|
80
75
|
//#endregion
|
|
81
76
|
export { readCodexInferenceMetadata as n, CODEX_INFERENCE_GENERATION_KEY as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as codexWebSocketDataToBuffer } from "./websocket-data-XlRvt8Ys.mjs";
|
|
2
|
-
import { CODEX_INFERENCE_TRANSPORT_FAILURE, authorizationFailure, createCodexInferenceDispatch, isTerminalResponse, n as createUploadAdmission, readProxyBody, t as MAX_BODY_BYTES } from "./inference-dispatch-
|
|
3
|
-
import { t as createCodexInferenceContext } from "./inference-context-
|
|
4
|
-
import { createPermitPool } from "openclaw/plugin-sdk/concurrency-runtime";
|
|
2
|
+
import { CODEX_INFERENCE_TRANSPORT_FAILURE, authorizationFailure, createCodexInferenceDispatch, isTerminalResponse, n as createUploadAdmission, readProxyBody, t as MAX_BODY_BYTES } from "./inference-dispatch-CO6tTs4q.mjs";
|
|
3
|
+
import { t as createCodexInferenceContext } from "./inference-context-DNlGwzwy.mjs";
|
|
4
|
+
import { createDeferred, createPermitPool } from "openclaw/plugin-sdk/concurrency-runtime";
|
|
5
5
|
import { Writable } from "node:stream";
|
|
6
6
|
import { WebSocket, WebSocketServer, rejectWebSocketUpgrade } from "openclaw/plugin-sdk/websocket-runtime";
|
|
7
7
|
import { createServer } from "node:http";
|
|
@@ -159,8 +159,7 @@ async function createCodexInferenceProxy(params) {
|
|
|
159
159
|
for (const [key, value] of incoming.searchParams) target.searchParams.append(key, value);
|
|
160
160
|
return {
|
|
161
161
|
target,
|
|
162
|
-
path: incoming.pathname
|
|
163
|
-
sampling: incoming.pathname === "/responses"
|
|
162
|
+
path: incoming.pathname
|
|
164
163
|
};
|
|
165
164
|
};
|
|
166
165
|
const { prepare, prepareHttp } = createCodexInferenceDispatch({
|
|
@@ -184,7 +183,7 @@ async function createCodexInferenceProxy(params) {
|
|
|
184
183
|
res.once("close", abort);
|
|
185
184
|
(async () => {
|
|
186
185
|
try {
|
|
187
|
-
const { target,
|
|
186
|
+
const { target, path } = resolveTarget(req);
|
|
188
187
|
if (req.method !== "POST") throw new Error(CODEX_INFERENCE_TRANSPORT_FAILURE);
|
|
189
188
|
resident = reserveResident(socket, signal, deadlineAtMs);
|
|
190
189
|
const admitted = resident && await resident.ready;
|
|
@@ -201,7 +200,7 @@ async function createCodexInferenceProxy(params) {
|
|
|
201
200
|
res.writeHead(503, OVERLOAD_HEADERS).end(OVERLOAD_BODY);
|
|
202
201
|
return;
|
|
203
202
|
}
|
|
204
|
-
upload = await prepareHttp(req,
|
|
203
|
+
upload = await prepareHttp(req, path, signal, releasePermit, Boolean(params.oauth));
|
|
205
204
|
const preparedUpload = upload;
|
|
206
205
|
let body = upload.body;
|
|
207
206
|
for (let attempt = 0; attempt < (params.oauth ? 2 : 1); attempt++) {
|
|
@@ -286,10 +285,7 @@ async function createCodexInferenceProxy(params) {
|
|
|
286
285
|
let local;
|
|
287
286
|
let proxyAgent;
|
|
288
287
|
let upstreamClosed = Promise.resolve();
|
|
289
|
-
|
|
290
|
-
const setupSettled = new Promise((resolve) => {
|
|
291
|
-
finishSetup = resolve;
|
|
292
|
-
});
|
|
288
|
+
const { promise: setupSettled, resolve: finishSetup } = createDeferred();
|
|
293
289
|
let resident = null;
|
|
294
290
|
const controller = new AbortController();
|
|
295
291
|
const deadlineAtMs = Date.now() + HANDSHAKE_TIMEOUT_MS;
|
|
@@ -328,9 +324,9 @@ async function createCodexInferenceProxy(params) {
|
|
|
328
324
|
const close = () => finish();
|
|
329
325
|
const failHandshake = () => finish(Date.now() >= deadlineAtMs ? 504 : 502);
|
|
330
326
|
try {
|
|
331
|
-
const { target,
|
|
327
|
+
const { target, path } = resolveTarget(req);
|
|
332
328
|
if (params.oauth) throw new Error(CODEX_INFERENCE_TRANSPORT_FAILURE);
|
|
333
|
-
if (
|
|
329
|
+
if (path !== "/responses" && path !== "/guardian" && path !== "/guardian-classifier") throw new Error(CODEX_INFERENCE_TRANSPORT_FAILURE);
|
|
334
330
|
if (connections.size >= MAX_WEBSOCKETS) idleConnections.values().next().value?.();
|
|
335
331
|
if (connections.size >= MAX_WEBSOCKETS) {
|
|
336
332
|
rejectBusyUpgrade(socket);
|
|
@@ -472,7 +468,7 @@ async function createCodexInferenceProxy(params) {
|
|
|
472
468
|
let prepared;
|
|
473
469
|
try {
|
|
474
470
|
if (binary) throw new Error(CODEX_INFERENCE_TRANSPORT_FAILURE);
|
|
475
|
-
prepared = await prepare(codexWebSocketDataToBuffer(data),
|
|
471
|
+
prepared = await prepare(codexWebSocketDataToBuffer(data), path, req.headers, signal, "websocket");
|
|
476
472
|
prepared.assertCurrent();
|
|
477
473
|
const frame = prepared;
|
|
478
474
|
const onAbort = () => close();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { d as readCodexPluginConfig } from "./config-parsing-
|
|
2
|
-
import { i as resolveCodexAppServerHomeScope } from "./config-options-
|
|
3
|
-
import "./config-
|
|
4
|
-
import { tt as resolveCodexAppServerPreparedAuthHandoff } from "./shared-client-
|
|
5
|
-
import { f as assertCodexPassiveTurnItems } from "./client-
|
|
6
|
-
import { runBoundedCodexAppServerTurn } from "./bounded-turn-
|
|
7
|
-
import { t as resolveCodexBoundedTurnIsolation } from "./bounded-turn-isolation-
|
|
8
|
-
import { a as createAttributedCodexAssistantMessage } from "./event-projector-assistant-message-
|
|
1
|
+
import { d as readCodexPluginConfig } from "./config-parsing-DsWSCPHO.mjs";
|
|
2
|
+
import { i as resolveCodexAppServerHomeScope } from "./config-options-DDzeNQ8m.mjs";
|
|
3
|
+
import "./config-C1YVVLEA.mjs";
|
|
4
|
+
import { tt as resolveCodexAppServerPreparedAuthHandoff } from "./shared-client-BjiqpbC5.mjs";
|
|
5
|
+
import { f as assertCodexPassiveTurnItems } from "./client-zrCKOu_E.mjs";
|
|
6
|
+
import { runBoundedCodexAppServerTurn } from "./bounded-turn-DxtRqV8t.mjs";
|
|
7
|
+
import { t as resolveCodexBoundedTurnIsolation } from "./bounded-turn-isolation-BfDAo-qZ.mjs";
|
|
8
|
+
import { a as createAttributedCodexAssistantMessage } from "./event-projector-assistant-message-CLMKN4x-.mjs";
|
|
9
9
|
//#region extensions/codex/src/app-server/isolated-completion.ts
|
|
10
10
|
/** Runs prompt-only Codex inference on an ephemeral, ring-zero native thread. */
|
|
11
11
|
async function runCodexIsolatedCompletion(params, options) {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
|
+
//#region extensions/codex/src/app-server/local-runtime-attribution.ts
|
|
3
|
+
const OPENAI_PROVIDER_ID = "openai";
|
|
4
|
+
const OPENAI_RESPONSES_API = "openai-responses";
|
|
5
|
+
const OPENAI_CODEX_RESPONSES_API = "openai-chatgpt-responses";
|
|
6
|
+
function resolveCodexLocalRuntimeAttribution(params) {
|
|
7
|
+
const authProfileProvider = normalizeLowercaseStringOrEmpty(params.runtimePlan?.auth?.authProfileProviderForAuth);
|
|
8
|
+
const useCodexResponsesApi = normalizeLowercaseStringOrEmpty(params.runtimePlan?.observability.harnessId) === "codex" && authProfileProvider !== OPENAI_PROVIDER_ID && normalizeLowercaseStringOrEmpty(params.model.provider) === OPENAI_PROVIDER_ID && normalizeLowercaseStringOrEmpty(params.model.api) === OPENAI_RESPONSES_API;
|
|
9
|
+
return {
|
|
10
|
+
provider: useCodexResponsesApi ? OPENAI_PROVIDER_ID : params.provider,
|
|
11
|
+
api: useCodexResponsesApi ? OPENAI_CODEX_RESPONSES_API : params.model.api
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { resolveCodexLocalRuntimeAttribution as t };
|