@openclaw/codex 2026.7.2-beta.5 → 2026.7.2-beta.7
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/{app-server-policy-BmDgseo_.js → app-server-policy-BSaO2JIT.js} +1 -1
- package/dist/{attempt-notifications-CMR2_fmR.js → attempt-notifications-AP-a-Q5k.js} +1 -1
- package/dist/{bounded-turn-FEbUXoYT.js → bounded-turn-D2ZAgZVz.js} +29 -22
- package/dist/{capabilities-BHRSI6Cn.js → capabilities-BFDTVYr4.js} +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/{command-formatters-ico4ZFnk.js → command-formatters-C336eRVS.js} +2 -2
- package/dist/{command-handlers-CRmnwI2N.js → command-handlers-DAHUSry9.js} +12 -12
- package/dist/{compact-dEN49UH6.js → compact-D_uvHurS.js} +5 -5
- package/dist/{computer-use-BjGylO-E.js → computer-use-CYEc8U3w.js} +111 -113
- package/dist/{conversation-control-DE7d9DOj.js → conversation-control-xsIeXbo4.js} +6 -6
- package/dist/doctor-contract-api.js +1 -1
- package/dist/{dynamic-tools-LIt9ojep.js → dynamic-tools-D2gYkSBO.js} +438 -51
- package/dist/effective-mcp-catalog-Bbd98Inw.js +114 -0
- package/dist/{event-projector-usage-tvgb1NCX.js → event-projector-usage-Xp4AlR2k.js} +20 -3
- package/dist/harness.js +13 -9
- package/dist/index.js +131 -108
- package/dist/media-understanding-provider.js +1 -1
- package/dist/{models-BA01NEez.js → models-BBMKU4jA.js} +2 -2
- package/dist/{notification-correlation-Bj_Ak_jI.js → notification-correlation-CU6_AnOb.js} +3 -3
- package/dist/{plugin-app-cache-key-DSXX-rXO.js → plugin-app-cache-key-DztPafOA.js} +132 -39
- package/dist/{rate-limits-S_PXs0ul.js → rate-limits-CU-gVCCS.js} +1 -1
- package/dist/{request-CXpPennK.js → request-qKh331yu.js} +3 -3
- package/dist/{run-attempt-C5GTPJOE.js → run-attempt-CY9WlDLc.js} +677 -199
- package/dist/{runtime-artifact-C2ITXdhM.js → runtime-artifact-CmtG_t1L.js} +90 -24
- package/dist/{sandbox-guard-D1Wky__S.js → sandbox-guard-NuhpXmPB.js} +4 -0
- package/dist/{session-binding-DlVQ-Pxs.js → session-binding-BXpo9ymA.js} +60 -7
- package/dist/{session-catalog-CP2oCcEb.js → session-catalog-DyOgR4WH.js} +268 -44
- package/dist/{session-cli-CqZ0Fp2a.js → session-cli-2PZaFLRh.js} +1 -1
- package/dist/{session-upstream-marker-QE-m5QFG.js → session-upstream-marker-B6U7tLw5.js} +1 -1
- package/dist/{settled-turn-finalizer-CA_2QXIE.js → settled-turn-finalizer-CXY2Z9dT.js} +19 -6
- package/dist/{shared-client-BVKE40c-.js → shared-client-DTbvH-XV.js} +166 -49
- package/dist/{side-question-CO12sHxo.js → side-question-_ulBk1AL.js} +10 -10
- package/dist/{thread-lifecycle-DRg_FdzC.js → thread-lifecycle-DF53ogiA.js} +968 -214
- package/dist/{protocol-validators-Dm4eXZmt.js → transcript-mirror-DzsdNCf5.js} +589 -2
- package/dist/{upstream-session-fork-_Vrz4WJr.js → upstream-session-fork-Dy4Xvuoj.js} +3 -3
- package/dist/{usage-UpVbdX5G.js → usage-CQ6GhD5-.js} +3 -3
- package/dist/{web-search-provider.runtime-CaQMYDbp.js → web-search-provider.runtime-CCFhg2z5.js} +3 -3
- package/package.json +6 -7
- package/dist/attempt-client-cleanup-Ia52yRWc.js +0 -127
- package/dist/realtime-voice-api-BPcA1uN9.js +0 -494
- package/dist/realtime-voice-api.js +0 -2
- package/dist/transcript-mirror-uKA-A4tB.js +0 -550
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { embeddedAgentLog, formatErrorMessage, projectAgentHarnessTranscriptMessageForDisplay, runAgentHarnessBeforeMessageWriteHook } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
import { isRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
4
|
import { Compile } from "typebox/compile";
|
|
5
|
+
import { Buffer } from "node:buffer";
|
|
6
|
+
import { withCodexSessionTranscriptMirrorWriteLock } from "openclaw/plugin-sdk/codex-session-transcript-runtime";
|
|
7
|
+
import { publishSessionTranscriptUpdateByIdentity } from "openclaw/plugin-sdk/session-transcript-runtime";
|
|
3
8
|
//#region extensions/codex/src/app-server/protocol-generated/json/DynamicToolCallParams.json
|
|
4
9
|
var DynamicToolCallParams_default = {
|
|
5
10
|
$schema: "http://json-schema.org/draft-07/schema#",
|
|
@@ -1043,6 +1048,11 @@ var ThreadResumeResponse_default = {
|
|
|
1043
1048
|
"description": "Identifier for this thread. Codex-generated thread IDs are UUIDv7.",
|
|
1044
1049
|
"type": "string"
|
|
1045
1050
|
},
|
|
1051
|
+
"isPinned": {
|
|
1052
|
+
"default": false,
|
|
1053
|
+
"description": "Whether the thread has been pinned by the user.",
|
|
1054
|
+
"type": "boolean"
|
|
1055
|
+
},
|
|
1046
1056
|
"modelProvider": {
|
|
1047
1057
|
"description": "Model provider used for this thread (for example, 'openai').",
|
|
1048
1058
|
"type": "string"
|
|
@@ -1266,10 +1276,20 @@ var ThreadResumeResponse_default = {
|
|
|
1266
1276
|
"type": ["integer", "null"]
|
|
1267
1277
|
},
|
|
1268
1278
|
"id": { "type": "string" },
|
|
1279
|
+
"pluginId": {
|
|
1280
|
+
"default": null,
|
|
1281
|
+
"description": "Trusted first-party plugin id when this command resolves to one plugin script.",
|
|
1282
|
+
"type": ["string", "null"]
|
|
1283
|
+
},
|
|
1269
1284
|
"processId": {
|
|
1270
1285
|
"description": "Identifier for the underlying PTY process (when available).",
|
|
1271
1286
|
"type": ["string", "null"]
|
|
1272
1287
|
},
|
|
1288
|
+
"scriptPath": {
|
|
1289
|
+
"default": null,
|
|
1290
|
+
"description": "Safe plugin-relative path when this command resolves to one plugin script.",
|
|
1291
|
+
"type": ["string", "null"]
|
|
1292
|
+
},
|
|
1273
1293
|
"source": {
|
|
1274
1294
|
"allOf": [{ "$ref": "#/definitions/CommandExecutionSource" }],
|
|
1275
1295
|
"default": "agent"
|
|
@@ -2744,6 +2764,11 @@ var ThreadStartResponse_default = {
|
|
|
2744
2764
|
"description": "Identifier for this thread. Codex-generated thread IDs are UUIDv7.",
|
|
2745
2765
|
"type": "string"
|
|
2746
2766
|
},
|
|
2767
|
+
"isPinned": {
|
|
2768
|
+
"default": false,
|
|
2769
|
+
"description": "Whether the thread has been pinned by the user.",
|
|
2770
|
+
"type": "boolean"
|
|
2771
|
+
},
|
|
2747
2772
|
"modelProvider": {
|
|
2748
2773
|
"description": "Model provider used for this thread (for example, 'openai').",
|
|
2749
2774
|
"type": "string"
|
|
@@ -2967,10 +2992,20 @@ var ThreadStartResponse_default = {
|
|
|
2967
2992
|
"type": ["integer", "null"]
|
|
2968
2993
|
},
|
|
2969
2994
|
"id": { "type": "string" },
|
|
2995
|
+
"pluginId": {
|
|
2996
|
+
"default": null,
|
|
2997
|
+
"description": "Trusted first-party plugin id when this command resolves to one plugin script.",
|
|
2998
|
+
"type": ["string", "null"]
|
|
2999
|
+
},
|
|
2970
3000
|
"processId": {
|
|
2971
3001
|
"description": "Identifier for the underlying PTY process (when available).",
|
|
2972
3002
|
"type": ["string", "null"]
|
|
2973
3003
|
},
|
|
3004
|
+
"scriptPath": {
|
|
3005
|
+
"default": null,
|
|
3006
|
+
"description": "Safe plugin-relative path when this command resolves to one plugin script.",
|
|
3007
|
+
"type": ["string", "null"]
|
|
3008
|
+
},
|
|
2974
3009
|
"source": {
|
|
2975
3010
|
"allOf": [{ "$ref": "#/definitions/CommandExecutionSource" }],
|
|
2976
3011
|
"default": "agent"
|
|
@@ -4279,10 +4314,20 @@ var TurnCompletedNotification_default = {
|
|
|
4279
4314
|
"type": ["integer", "null"]
|
|
4280
4315
|
},
|
|
4281
4316
|
"id": { "type": "string" },
|
|
4317
|
+
"pluginId": {
|
|
4318
|
+
"default": null,
|
|
4319
|
+
"description": "Trusted first-party plugin id when this command resolves to one plugin script.",
|
|
4320
|
+
"type": ["string", "null"]
|
|
4321
|
+
},
|
|
4282
4322
|
"processId": {
|
|
4283
4323
|
"description": "Identifier for the underlying PTY process (when available).",
|
|
4284
4324
|
"type": ["string", "null"]
|
|
4285
4325
|
},
|
|
4326
|
+
"scriptPath": {
|
|
4327
|
+
"default": null,
|
|
4328
|
+
"description": "Safe plugin-relative path when this command resolves to one plugin script.",
|
|
4329
|
+
"type": ["string", "null"]
|
|
4330
|
+
},
|
|
4286
4331
|
"source": {
|
|
4287
4332
|
"allOf": [{ "$ref": "#/definitions/CommandExecutionSource" }],
|
|
4288
4333
|
"default": "agent"
|
|
@@ -5499,10 +5544,20 @@ var TurnStartResponse_default = {
|
|
|
5499
5544
|
"type": ["integer", "null"]
|
|
5500
5545
|
},
|
|
5501
5546
|
"id": { "type": "string" },
|
|
5547
|
+
"pluginId": {
|
|
5548
|
+
"default": null,
|
|
5549
|
+
"description": "Trusted first-party plugin id when this command resolves to one plugin script.",
|
|
5550
|
+
"type": ["string", "null"]
|
|
5551
|
+
},
|
|
5502
5552
|
"processId": {
|
|
5503
5553
|
"description": "Identifier for the underlying PTY process (when available).",
|
|
5504
5554
|
"type": ["string", "null"]
|
|
5505
5555
|
},
|
|
5556
|
+
"scriptPath": {
|
|
5557
|
+
"default": null,
|
|
5558
|
+
"description": "Safe plugin-relative path when this command resolves to one plugin script.",
|
|
5559
|
+
"type": ["string", "null"]
|
|
5560
|
+
},
|
|
5506
5561
|
"source": {
|
|
5507
5562
|
"allOf": [{ "$ref": "#/definitions/CommandExecutionSource" }],
|
|
5508
5563
|
"default": "agent"
|
|
@@ -6334,4 +6389,536 @@ function formatValidationErrors(validate, value) {
|
|
|
6334
6389
|
}).join("; ");
|
|
6335
6390
|
}
|
|
6336
6391
|
//#endregion
|
|
6337
|
-
|
|
6392
|
+
//#region extensions/codex/src/app-server/upstream-prompt-provenance.ts
|
|
6393
|
+
const UPSTREAM_USER_TEXT_META_KEY = "upstreamUserText";
|
|
6394
|
+
const MIRROR_IDENTITY_META_KEY = "mirrorIdentity";
|
|
6395
|
+
function attachCodexMirrorIdentity(message, identity) {
|
|
6396
|
+
const record = message;
|
|
6397
|
+
const existing = record["__openclaw"];
|
|
6398
|
+
const baseMeta = existing && typeof existing === "object" && !Array.isArray(existing) ? existing : {};
|
|
6399
|
+
return {
|
|
6400
|
+
...record,
|
|
6401
|
+
__openclaw: {
|
|
6402
|
+
...baseMeta,
|
|
6403
|
+
[MIRROR_IDENTITY_META_KEY]: identity
|
|
6404
|
+
}
|
|
6405
|
+
};
|
|
6406
|
+
}
|
|
6407
|
+
function readMirrorIdentity(message) {
|
|
6408
|
+
const meta = message["__openclaw"];
|
|
6409
|
+
if (!meta || typeof meta !== "object" || Array.isArray(meta)) return;
|
|
6410
|
+
const id = meta[MIRROR_IDENTITY_META_KEY];
|
|
6411
|
+
return typeof id === "string" && id ? id : void 0;
|
|
6412
|
+
}
|
|
6413
|
+
function attachUpstreamUserText(message, text) {
|
|
6414
|
+
const record = message;
|
|
6415
|
+
const existing = record["__openclaw"];
|
|
6416
|
+
const baseMeta = existing && typeof existing === "object" && !Array.isArray(existing) ? existing : {};
|
|
6417
|
+
return {
|
|
6418
|
+
...record,
|
|
6419
|
+
__openclaw: {
|
|
6420
|
+
...baseMeta,
|
|
6421
|
+
[UPSTREAM_USER_TEXT_META_KEY]: text
|
|
6422
|
+
}
|
|
6423
|
+
};
|
|
6424
|
+
}
|
|
6425
|
+
function readUpstreamUserText(message) {
|
|
6426
|
+
const meta = message?.["__openclaw"];
|
|
6427
|
+
if (!meta || typeof meta !== "object" || Array.isArray(meta)) return;
|
|
6428
|
+
const text = meta[UPSTREAM_USER_TEXT_META_KEY];
|
|
6429
|
+
return typeof text === "string" && text ? text : void 0;
|
|
6430
|
+
}
|
|
6431
|
+
//#endregion
|
|
6432
|
+
//#region extensions/codex/src/app-server/transcript-mirror-attestation.ts
|
|
6433
|
+
const MIRROR_ORIGIN_META_KEY = "mirrorOrigin";
|
|
6434
|
+
const MIRROR_SOURCE_FINGERPRINT_META_KEY = "mirrorSourceFingerprint";
|
|
6435
|
+
const CODEX_APP_SERVER_MIRROR_ORIGIN = "codex-app-server";
|
|
6436
|
+
function attachCodexMirrorAttestation(message, sourceFingerprint) {
|
|
6437
|
+
const record = message;
|
|
6438
|
+
const existing = record["__openclaw"];
|
|
6439
|
+
const baseMeta = existing && typeof existing === "object" && !Array.isArray(existing) ? existing : {};
|
|
6440
|
+
return {
|
|
6441
|
+
...record,
|
|
6442
|
+
__openclaw: {
|
|
6443
|
+
...baseMeta,
|
|
6444
|
+
[MIRROR_ORIGIN_META_KEY]: CODEX_APP_SERVER_MIRROR_ORIGIN,
|
|
6445
|
+
...sourceFingerprint ? { [MIRROR_SOURCE_FINGERPRINT_META_KEY]: sourceFingerprint } : {}
|
|
6446
|
+
}
|
|
6447
|
+
};
|
|
6448
|
+
}
|
|
6449
|
+
function readCodexMirrorSourceFingerprint(message) {
|
|
6450
|
+
const meta = message["__openclaw"];
|
|
6451
|
+
if (!meta || typeof meta !== "object" || Array.isArray(meta)) return;
|
|
6452
|
+
const value = meta[MIRROR_SOURCE_FINGERPRINT_META_KEY];
|
|
6453
|
+
return typeof value === "string" && value ? value : void 0;
|
|
6454
|
+
}
|
|
6455
|
+
function serializeCodexMirrorSourceEvidence(message) {
|
|
6456
|
+
const record = message;
|
|
6457
|
+
return JSON.stringify({
|
|
6458
|
+
role: message.role,
|
|
6459
|
+
content: record.content,
|
|
6460
|
+
...message.role === "user" ? { upstreamUserText: readUpstreamUserText(message) } : {},
|
|
6461
|
+
...message.role === "toolResult" ? {
|
|
6462
|
+
toolCallId: record.toolCallId,
|
|
6463
|
+
toolName: record.toolName,
|
|
6464
|
+
isError: record.isError === true
|
|
6465
|
+
} : {}
|
|
6466
|
+
});
|
|
6467
|
+
}
|
|
6468
|
+
function fingerprintCodexMirrorSourceMessage(message) {
|
|
6469
|
+
return createHash("sha256").update(serializeCodexMirrorSourceEvidence(message)).digest("hex").slice(0, 32);
|
|
6470
|
+
}
|
|
6471
|
+
//#endregion
|
|
6472
|
+
//#region extensions/codex/src/app-server/user-prompt-message.ts
|
|
6473
|
+
function buildSenderLabel(params) {
|
|
6474
|
+
const label = params.senderName ?? params.senderUsername ?? params.senderE164 ?? params.senderId;
|
|
6475
|
+
if (!label) return;
|
|
6476
|
+
return !params.senderId || label.includes(params.senderId) ? label : `${label} (${params.senderId})`;
|
|
6477
|
+
}
|
|
6478
|
+
function buildFromPrepared(params, preparedUserMessage) {
|
|
6479
|
+
const senderId = normalizeOptionalString(params.senderId);
|
|
6480
|
+
const senderName = normalizeOptionalString(params.senderName);
|
|
6481
|
+
const senderUsername = normalizeOptionalString(params.senderUsername);
|
|
6482
|
+
const senderE164 = normalizeOptionalString(params.senderE164);
|
|
6483
|
+
const senderLabel = buildSenderLabel({
|
|
6484
|
+
senderId,
|
|
6485
|
+
senderName,
|
|
6486
|
+
senderUsername,
|
|
6487
|
+
senderE164
|
|
6488
|
+
});
|
|
6489
|
+
const sourceChannel = normalizeOptionalString(params.inputProvenance?.sourceChannel ?? params.messageChannel ?? params.messageProvider);
|
|
6490
|
+
return {
|
|
6491
|
+
role: "user",
|
|
6492
|
+
timestamp: Date.now(),
|
|
6493
|
+
...params.inputProvenance ? { provenance: params.inputProvenance } : {},
|
|
6494
|
+
...sourceChannel ? { sourceChannel } : {},
|
|
6495
|
+
...senderId ? { senderId } : {},
|
|
6496
|
+
...senderName ? { senderName } : {},
|
|
6497
|
+
...senderUsername ? { senderUsername } : {},
|
|
6498
|
+
...senderE164 ? { senderE164 } : {},
|
|
6499
|
+
...senderLabel ? { senderLabel } : {},
|
|
6500
|
+
...preparedUserMessage ? preparedUserMessage : { content: params.prompt }
|
|
6501
|
+
};
|
|
6502
|
+
}
|
|
6503
|
+
function buildCodexUserPromptMessage(params) {
|
|
6504
|
+
return buildFromPrepared(params, params.userTurnTranscriptRecorder?.message);
|
|
6505
|
+
}
|
|
6506
|
+
function buildCodexUpstreamPromptMessage(params, identity, upstreamUserText) {
|
|
6507
|
+
const message = attachCodexMirrorIdentity(buildCodexUserPromptMessage(params), identity);
|
|
6508
|
+
return upstreamUserText ? attachUpstreamUserText(message, upstreamUserText) : message;
|
|
6509
|
+
}
|
|
6510
|
+
function promptSnapshot(params, turnId, upstreamUserText) {
|
|
6511
|
+
return params.suppressNextUserMessagePersistence ? [] : [buildCodexUpstreamPromptMessage(params, `${turnId}:prompt`, upstreamUserText)];
|
|
6512
|
+
}
|
|
6513
|
+
async function buildResolvedCodexUserPromptMessage(params) {
|
|
6514
|
+
return buildFromPrepared(params, await params.userTurnTranscriptRecorder?.resolveMessage() ?? params.userTurnTranscriptRecorder?.message);
|
|
6515
|
+
}
|
|
6516
|
+
//#endregion
|
|
6517
|
+
//#region extensions/codex/src/app-server/transcript-mirror.ts
|
|
6518
|
+
function isMirroredAgentMessage(message) {
|
|
6519
|
+
return message.role === "user" || message.role === "assistant" || message.role === "toolResult";
|
|
6520
|
+
}
|
|
6521
|
+
const CODEX_HISTORY_IMPORT_MAX_MESSAGES = 200;
|
|
6522
|
+
const CODEX_HISTORY_IMPORT_MAX_BYTES = 512 * 1024;
|
|
6523
|
+
const CODEX_HISTORY_IMPORT_MAX_MESSAGE_BYTES = 64 * 1024;
|
|
6524
|
+
const CODEX_HISTORY_TRUNCATION_SUFFIX = "\n\n[Message truncated during Codex history import.]";
|
|
6525
|
+
const CODEX_HISTORY_ASSISTANT_API = "openai-chatgpt-responses";
|
|
6526
|
+
const CODEX_HISTORY_ASSISTANT_PROVIDER = "openai";
|
|
6527
|
+
const CODEX_HISTORY_ASSISTANT_MODEL = "native-history";
|
|
6528
|
+
const CODEX_HISTORY_ZERO_USAGE = {
|
|
6529
|
+
input: 0,
|
|
6530
|
+
output: 0,
|
|
6531
|
+
cacheRead: 0,
|
|
6532
|
+
cacheWrite: 0,
|
|
6533
|
+
totalTokens: 0,
|
|
6534
|
+
cost: {
|
|
6535
|
+
input: 0,
|
|
6536
|
+
output: 0,
|
|
6537
|
+
cacheRead: 0,
|
|
6538
|
+
cacheWrite: 0,
|
|
6539
|
+
total: 0
|
|
6540
|
+
}
|
|
6541
|
+
};
|
|
6542
|
+
function isUtf8ContinuationByte(byte) {
|
|
6543
|
+
return byte !== void 0 && (byte & 192) === 128;
|
|
6544
|
+
}
|
|
6545
|
+
function truncateUtf8Prefix(value, maxBytes) {
|
|
6546
|
+
const bytes = Buffer.from(value);
|
|
6547
|
+
if (bytes.byteLength <= maxBytes) return value;
|
|
6548
|
+
let end = Math.max(0, maxBytes);
|
|
6549
|
+
while (end > 0 && isUtf8ContinuationByte(bytes[end])) end -= 1;
|
|
6550
|
+
return bytes.subarray(0, end).toString("utf8");
|
|
6551
|
+
}
|
|
6552
|
+
function normalizeImportedHistoryText(value) {
|
|
6553
|
+
if (typeof value !== "string") return;
|
|
6554
|
+
const text = value.trim();
|
|
6555
|
+
if (!text) return;
|
|
6556
|
+
if (Buffer.byteLength(text, "utf8") <= CODEX_HISTORY_IMPORT_MAX_MESSAGE_BYTES) return text;
|
|
6557
|
+
const suffixBytes = Buffer.byteLength(CODEX_HISTORY_TRUNCATION_SUFFIX, "utf8");
|
|
6558
|
+
return `${truncateUtf8Prefix(text, Math.max(0, CODEX_HISTORY_IMPORT_MAX_MESSAGE_BYTES - suffixBytes))}${CODEX_HISTORY_TRUNCATION_SUFFIX}`;
|
|
6559
|
+
}
|
|
6560
|
+
function projectCodexUserItemText(item) {
|
|
6561
|
+
if (!Array.isArray(item.content)) return;
|
|
6562
|
+
const parts = [];
|
|
6563
|
+
for (const value of item.content) {
|
|
6564
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) continue;
|
|
6565
|
+
const input = value;
|
|
6566
|
+
if (input.type === "text") {
|
|
6567
|
+
const text = normalizeImportedHistoryText(input.text);
|
|
6568
|
+
if (text) parts.push(text);
|
|
6569
|
+
continue;
|
|
6570
|
+
}
|
|
6571
|
+
if (input.type === "image" || input.type === "localImage") {
|
|
6572
|
+
parts.push("[Image attachment]");
|
|
6573
|
+
continue;
|
|
6574
|
+
}
|
|
6575
|
+
if (input.type === "skill" || input.type === "mention") {
|
|
6576
|
+
const name = normalizeOptionalString(input.name);
|
|
6577
|
+
if (name) parts.push(`${input.type === "skill" ? "$" : "@"}${name}`);
|
|
6578
|
+
}
|
|
6579
|
+
}
|
|
6580
|
+
return normalizeImportedHistoryText(parts.join("\n"));
|
|
6581
|
+
}
|
|
6582
|
+
function selectTurnsThroughBoundary(thread, throughTurnId) {
|
|
6583
|
+
if (throughTurnId === null) return [];
|
|
6584
|
+
const turns = thread.turns ?? [];
|
|
6585
|
+
const boundaryIndex = turns.findIndex((turn) => turn.id === throughTurnId);
|
|
6586
|
+
if (boundaryIndex < 0) throw new Error(`Codex history boundary turn not found: ${throughTurnId}`);
|
|
6587
|
+
const boundary = turns[boundaryIndex];
|
|
6588
|
+
if (boundary?.status !== "completed" && boundary?.status !== "interrupted" && boundary?.status !== "failed") throw new Error(`Codex history boundary turn is not terminal: ${throughTurnId}`);
|
|
6589
|
+
return turns.slice(0, boundaryIndex + 1);
|
|
6590
|
+
}
|
|
6591
|
+
function projectCodexThreadHistory(params) {
|
|
6592
|
+
const projected = [];
|
|
6593
|
+
const threadTimestamp = typeof params.thread.createdAt === "number" && Number.isFinite(params.thread.createdAt) ? params.thread.createdAt * 1e3 : params.importedAt;
|
|
6594
|
+
let itemOffset = 0;
|
|
6595
|
+
for (const turn of selectTurnsThroughBoundary(params.thread, params.throughTurnId)) for (const value of turn.items) {
|
|
6596
|
+
const item = value;
|
|
6597
|
+
const itemId = normalizeOptionalString(item.id);
|
|
6598
|
+
const identity = `${turn.id}:${itemId ?? itemOffset}`;
|
|
6599
|
+
const timestampSeconds = item.type === "agentMessage" ? turn.completedAt ?? turn.startedAt : turn.startedAt ?? turn.completedAt;
|
|
6600
|
+
const timestamp = typeof timestampSeconds === "number" && Number.isFinite(timestampSeconds) ? timestampSeconds * 1e3 + itemOffset : threadTimestamp + itemOffset;
|
|
6601
|
+
const text = item.type === "userMessage" ? projectCodexUserItemText(item) : item.type === "agentMessage" ? normalizeImportedHistoryText(item.text) : void 0;
|
|
6602
|
+
const role = item.type === "userMessage" ? "user" : item.type === "agentMessage" ? "assistant" : void 0;
|
|
6603
|
+
itemOffset += 1;
|
|
6604
|
+
if (!text || !role) continue;
|
|
6605
|
+
const message = role === "assistant" ? attachCodexMirrorIdentity({
|
|
6606
|
+
role,
|
|
6607
|
+
content: [{
|
|
6608
|
+
type: "text",
|
|
6609
|
+
text
|
|
6610
|
+
}],
|
|
6611
|
+
api: CODEX_HISTORY_ASSISTANT_API,
|
|
6612
|
+
provider: normalizeOptionalString(params.modelProvider) ?? normalizeOptionalString(params.thread.modelProvider) ?? CODEX_HISTORY_ASSISTANT_PROVIDER,
|
|
6613
|
+
model: CODEX_HISTORY_ASSISTANT_MODEL,
|
|
6614
|
+
usage: CODEX_HISTORY_ZERO_USAGE,
|
|
6615
|
+
stopReason: "stop",
|
|
6616
|
+
timestamp
|
|
6617
|
+
}, identity) : attachCodexMirrorIdentity({
|
|
6618
|
+
role,
|
|
6619
|
+
content: text,
|
|
6620
|
+
timestamp
|
|
6621
|
+
}, identity);
|
|
6622
|
+
const phase = item.phase === "commentary" || item.phase === "final_answer" ? item.phase : void 0;
|
|
6623
|
+
projected.push({
|
|
6624
|
+
message,
|
|
6625
|
+
responseItem: {
|
|
6626
|
+
type: "message",
|
|
6627
|
+
role,
|
|
6628
|
+
content: [{
|
|
6629
|
+
type: role === "assistant" ? "output_text" : "input_text",
|
|
6630
|
+
text
|
|
6631
|
+
}],
|
|
6632
|
+
...role === "assistant" && phase ? { phase } : {}
|
|
6633
|
+
},
|
|
6634
|
+
textBytes: Buffer.byteLength(text, "utf8")
|
|
6635
|
+
});
|
|
6636
|
+
}
|
|
6637
|
+
return projected;
|
|
6638
|
+
}
|
|
6639
|
+
function selectBoundedCodexHistoryTail(projected) {
|
|
6640
|
+
const selected = [];
|
|
6641
|
+
let selectedBytes = 0;
|
|
6642
|
+
for (let index = projected.length - 1; index >= 0; index -= 1) {
|
|
6643
|
+
const candidate = projected[index];
|
|
6644
|
+
if (!candidate) continue;
|
|
6645
|
+
if (selected.length >= CODEX_HISTORY_IMPORT_MAX_MESSAGES || selectedBytes + candidate.textBytes > CODEX_HISTORY_IMPORT_MAX_BYTES) break;
|
|
6646
|
+
selected.push(candidate);
|
|
6647
|
+
selectedBytes += candidate.textBytes;
|
|
6648
|
+
}
|
|
6649
|
+
return selected.toReversed();
|
|
6650
|
+
}
|
|
6651
|
+
/** Projects one terminal Codex history prefix into transcript and Responses API items. */
|
|
6652
|
+
function projectBoundedCodexThreadHistory(params) {
|
|
6653
|
+
const projected = projectCodexThreadHistory({
|
|
6654
|
+
thread: params.thread,
|
|
6655
|
+
throughTurnId: params.throughTurnId,
|
|
6656
|
+
importedAt: params.importedAt,
|
|
6657
|
+
...params.modelProvider ? { modelProvider: params.modelProvider } : {}
|
|
6658
|
+
});
|
|
6659
|
+
const selected = selectBoundedCodexHistoryTail(projected);
|
|
6660
|
+
return {
|
|
6661
|
+
importedMessages: selected.length,
|
|
6662
|
+
omittedMessages: projected.length - selected.length,
|
|
6663
|
+
responseItems: selected.map(({ responseItem }) => responseItem),
|
|
6664
|
+
transcriptMessages: selected.map(({ message }) => message)
|
|
6665
|
+
};
|
|
6666
|
+
}
|
|
6667
|
+
/** Imports a bounded, user-visible Codex history tail into a new OpenClaw transcript. */
|
|
6668
|
+
async function importCodexThreadHistoryToTranscript(params) {
|
|
6669
|
+
const projection = projectBoundedCodexThreadHistory({
|
|
6670
|
+
thread: params.thread,
|
|
6671
|
+
throughTurnId: params.throughTurnId,
|
|
6672
|
+
importedAt: Date.now(),
|
|
6673
|
+
...params.modelProvider ? { modelProvider: params.modelProvider } : {}
|
|
6674
|
+
});
|
|
6675
|
+
if (projection.transcriptMessages.length > 0) await mirror({
|
|
6676
|
+
storePath: params.storePath,
|
|
6677
|
+
sessionId: params.sessionId,
|
|
6678
|
+
sessionKey: params.sessionKey,
|
|
6679
|
+
...params.agentId ? { agentId: params.agentId } : {},
|
|
6680
|
+
...params.cwd ? { cwd: params.cwd } : {},
|
|
6681
|
+
...params.config ? { config: params.config } : {},
|
|
6682
|
+
messages: projection.transcriptMessages,
|
|
6683
|
+
idempotencyScope: `codex-app-server:${params.thread.id}:history`
|
|
6684
|
+
});
|
|
6685
|
+
return {
|
|
6686
|
+
importedMessages: projection.importedMessages,
|
|
6687
|
+
omittedMessages: projection.omittedMessages
|
|
6688
|
+
};
|
|
6689
|
+
}
|
|
6690
|
+
async function mirrorBestEffort(params) {
|
|
6691
|
+
try {
|
|
6692
|
+
const messages = await resolveFinalCodexMirrorMessages({
|
|
6693
|
+
params: params.params,
|
|
6694
|
+
messagesSnapshot: params.result.messagesSnapshot,
|
|
6695
|
+
turnId: params.turnId
|
|
6696
|
+
});
|
|
6697
|
+
const mirrorResult = await mirror({
|
|
6698
|
+
agentId: params.agentId,
|
|
6699
|
+
sessionKey: params.sessionKey,
|
|
6700
|
+
sessionId: params.params.sessionId,
|
|
6701
|
+
storePath: params.params.sessionTarget?.storePath,
|
|
6702
|
+
cwd: params.cwd,
|
|
6703
|
+
messages,
|
|
6704
|
+
idempotencyScope: `codex-app-server:${params.threadId}`,
|
|
6705
|
+
config: params.params.config
|
|
6706
|
+
});
|
|
6707
|
+
for (const message of mirrorResult.userMessagesPresent) try {
|
|
6708
|
+
params.notifyUserMessagePersisted(message);
|
|
6709
|
+
} catch (error) {
|
|
6710
|
+
embeddedAgentLog.warn("failed to notify codex app-server user-message persistence", { error: formatErrorMessage(error) });
|
|
6711
|
+
}
|
|
6712
|
+
const expectedFingerprints = new Map(messages.flatMap((message) => {
|
|
6713
|
+
if (!isMirroredAgentMessage(message)) return [];
|
|
6714
|
+
const identity = readMirrorIdentity(message);
|
|
6715
|
+
return identity ? [[identity, fingerprintCodexMirrorSourceMessage(message)]] : [];
|
|
6716
|
+
}));
|
|
6717
|
+
const mirroredMessages = mirrorResult.messagesPresent.filter((message) => {
|
|
6718
|
+
const identity = readMirrorIdentity(message);
|
|
6719
|
+
return identity !== void 0 && readCodexMirrorSourceFingerprint(message) === expectedFingerprints.get(identity);
|
|
6720
|
+
});
|
|
6721
|
+
const assistantMirrorIdentity = `${params.turnId}:assistant`;
|
|
6722
|
+
const assistantTranscriptOwned = mirrorResult.assistantMirrorIdentitiesOwned.includes(assistantMirrorIdentity);
|
|
6723
|
+
const assistantTranscriptIdempotencyKey = normalizeOptionalString((assistantTranscriptOwned ? mirroredMessages.find((message) => readMirrorIdentity(message) === assistantMirrorIdentity) : void 0)?.idempotencyKey);
|
|
6724
|
+
return {
|
|
6725
|
+
assistantTranscriptOwned,
|
|
6726
|
+
...assistantTranscriptIdempotencyKey ? { assistantTranscriptIdempotencyKey } : {},
|
|
6727
|
+
mirroredMessages
|
|
6728
|
+
};
|
|
6729
|
+
} catch (error) {
|
|
6730
|
+
embeddedAgentLog.warn("failed to mirror codex app-server transcript", { error });
|
|
6731
|
+
return {
|
|
6732
|
+
assistantTranscriptOwned: false,
|
|
6733
|
+
mirroredMessages: []
|
|
6734
|
+
};
|
|
6735
|
+
}
|
|
6736
|
+
}
|
|
6737
|
+
async function resolveFinalCodexMirrorMessages(params) {
|
|
6738
|
+
if (params.params.suppressNextUserMessagePersistence || !params.params.userTurnTranscriptRecorder) return params.messagesSnapshot;
|
|
6739
|
+
const promptSnapshot = params.messagesSnapshot.find((message) => message.role === "user");
|
|
6740
|
+
const resolvedBase = attachCodexMirrorIdentity(await buildResolvedCodexUserPromptMessage(params.params), `${params.turnId}:prompt`);
|
|
6741
|
+
const upstreamUserText = readUpstreamUserText(promptSnapshot);
|
|
6742
|
+
const resolvedPrompt = upstreamUserText ? attachUpstreamUserText(resolvedBase, upstreamUserText) : resolvedBase;
|
|
6743
|
+
const firstUserIndex = params.messagesSnapshot.findIndex((message) => message.role === "user");
|
|
6744
|
+
if (firstUserIndex === -1) return [resolvedPrompt, ...params.messagesSnapshot];
|
|
6745
|
+
const messages = params.messagesSnapshot.slice();
|
|
6746
|
+
messages[firstUserIndex] = resolvedPrompt;
|
|
6747
|
+
return messages;
|
|
6748
|
+
}
|
|
6749
|
+
function createCodexAppServerUserMessagePersistenceNotifier(runParams) {
|
|
6750
|
+
let notified = false;
|
|
6751
|
+
return (message) => {
|
|
6752
|
+
if (notified) return;
|
|
6753
|
+
notified = true;
|
|
6754
|
+
runParams.userTurnTranscriptRecorder?.markRuntimePersisted(message);
|
|
6755
|
+
try {
|
|
6756
|
+
runParams.onUserMessagePersisted?.(message);
|
|
6757
|
+
} catch (error) {
|
|
6758
|
+
embeddedAgentLog.warn("codex app-server user persistence notification failed", { error: formatErrorMessage(error) });
|
|
6759
|
+
}
|
|
6760
|
+
};
|
|
6761
|
+
}
|
|
6762
|
+
async function mirrorPromptAtTurnStartBestEffort(params) {
|
|
6763
|
+
if (params.params.suppressNextUserMessagePersistence) return;
|
|
6764
|
+
try {
|
|
6765
|
+
const mirrorPromise = (async () => {
|
|
6766
|
+
const userPromptMessage = projectAgentHarnessTranscriptMessageForDisplay({
|
|
6767
|
+
hidden: params.params.trigger === "memory",
|
|
6768
|
+
message: attachUpstreamUserText(attachCodexMirrorIdentity(await buildResolvedCodexUserPromptMessage(params.params), `${params.turnId}:prompt`), params.upstreamUserText)
|
|
6769
|
+
});
|
|
6770
|
+
const mirrorResult = await mirror({
|
|
6771
|
+
agentId: params.agentId,
|
|
6772
|
+
sessionKey: params.sessionKey,
|
|
6773
|
+
sessionId: params.params.sessionId,
|
|
6774
|
+
storePath: params.params.sessionTarget?.storePath,
|
|
6775
|
+
cwd: params.cwd,
|
|
6776
|
+
messages: [userPromptMessage],
|
|
6777
|
+
idempotencyScope: `codex-app-server:${params.threadId}`,
|
|
6778
|
+
config: params.params.config
|
|
6779
|
+
});
|
|
6780
|
+
for (const message of mirrorResult.userMessagesPresent) params.notifyUserMessagePersisted(message);
|
|
6781
|
+
})();
|
|
6782
|
+
params.params.userTurnTranscriptRecorder?.markRuntimePersistencePending(mirrorPromise);
|
|
6783
|
+
await mirrorPromise;
|
|
6784
|
+
} catch (error) {
|
|
6785
|
+
embeddedAgentLog.warn("failed to mirror codex app-server prompt at turn start", { error });
|
|
6786
|
+
}
|
|
6787
|
+
}
|
|
6788
|
+
function fingerprintMirrorMessageContent(message) {
|
|
6789
|
+
const payload = JSON.stringify({
|
|
6790
|
+
role: message.role,
|
|
6791
|
+
content: message.content
|
|
6792
|
+
});
|
|
6793
|
+
return createHash("sha256").update(payload).digest("hex").slice(0, 16);
|
|
6794
|
+
}
|
|
6795
|
+
function buildMirrorDedupeIdentity(message) {
|
|
6796
|
+
const explicit = readMirrorIdentity(message);
|
|
6797
|
+
if (explicit) return explicit;
|
|
6798
|
+
return `${message.role}:${fingerprintMirrorMessageContent(message)}`;
|
|
6799
|
+
}
|
|
6800
|
+
async function mirror(params) {
|
|
6801
|
+
const messages = params.messages.filter(isMirroredAgentMessage);
|
|
6802
|
+
if (messages.length === 0) return {
|
|
6803
|
+
assistantMirrorIdentitiesOwned: [],
|
|
6804
|
+
messagesPresent: [],
|
|
6805
|
+
userMessagesPresent: []
|
|
6806
|
+
};
|
|
6807
|
+
const candidates = messages.map((message) => {
|
|
6808
|
+
const dedupeIdentity = buildMirrorDedupeIdentity(message);
|
|
6809
|
+
const sourceFingerprint = fingerprintCodexMirrorSourceMessage(message);
|
|
6810
|
+
return {
|
|
6811
|
+
dedupeIdentity,
|
|
6812
|
+
idempotencyKey: (message.role === "user" ? normalizeOptionalString(message.idempotencyKey) : void 0) ?? (params.idempotencyScope ? `${params.idempotencyScope}:${dedupeIdentity}` : void 0),
|
|
6813
|
+
message,
|
|
6814
|
+
sourceFingerprint
|
|
6815
|
+
};
|
|
6816
|
+
});
|
|
6817
|
+
const candidateIdempotencyKeys = candidates.flatMap(({ idempotencyKey }) => idempotencyKey ? [idempotencyKey] : []);
|
|
6818
|
+
const transcriptTarget = resolveCodexMirrorTranscriptTarget(params);
|
|
6819
|
+
const { appendedUpdates, assistantMirrorIdentitiesOwned, messagesPresent, userMessagesPresent } = await withCodexSessionTranscriptMirrorWriteLock({
|
|
6820
|
+
...transcriptTarget,
|
|
6821
|
+
config: params.config
|
|
6822
|
+
}, async (transcript) => {
|
|
6823
|
+
const nextAppendedUpdates = [];
|
|
6824
|
+
const nextAssistantMirrorIdentitiesOwned = /* @__PURE__ */ new Set();
|
|
6825
|
+
const nextMessagesPresent = [];
|
|
6826
|
+
const nextUserMessagesPresent = [];
|
|
6827
|
+
const mirrorFacts = await transcript.readMessageFacts({ idempotencyKeys: candidateIdempotencyKeys });
|
|
6828
|
+
for (const { dedupeIdentity, idempotencyKey, message, sourceFingerprint } of candidates) {
|
|
6829
|
+
const transcriptMessage = {
|
|
6830
|
+
...attachCodexMirrorAttestation(message, sourceFingerprint),
|
|
6831
|
+
...idempotencyKey ? { idempotencyKey } : {}
|
|
6832
|
+
};
|
|
6833
|
+
if (idempotencyKey && mirrorFacts.existingIdempotencyKeys.has(idempotencyKey)) {
|
|
6834
|
+
const persistedMessage = mirrorFacts.messagesByIdempotencyKey.get(idempotencyKey);
|
|
6835
|
+
if (persistedMessage && isMirroredAgentMessage(persistedMessage)) {
|
|
6836
|
+
nextMessagesPresent.push(persistedMessage);
|
|
6837
|
+
if (persistedMessage.role === "user") nextUserMessagesPresent.push(persistedMessage);
|
|
6838
|
+
}
|
|
6839
|
+
if (message.role === "assistant") nextAssistantMirrorIdentitiesOwned.add(dedupeIdentity);
|
|
6840
|
+
continue;
|
|
6841
|
+
}
|
|
6842
|
+
const nextMessage = params.skipBeforeMessageWriteHooks ? transcriptMessage : runAgentHarnessBeforeMessageWriteHook({
|
|
6843
|
+
message: transcriptMessage,
|
|
6844
|
+
agentId: params.agentId,
|
|
6845
|
+
sessionKey: params.sessionKey
|
|
6846
|
+
});
|
|
6847
|
+
if (!nextMessage) {
|
|
6848
|
+
if (message.role === "assistant") nextAssistantMirrorIdentitiesOwned.add(dedupeIdentity);
|
|
6849
|
+
continue;
|
|
6850
|
+
}
|
|
6851
|
+
let messageToAppend = idempotencyKey ? {
|
|
6852
|
+
...attachCodexMirrorAttestation(nextMessage, sourceFingerprint),
|
|
6853
|
+
idempotencyKey
|
|
6854
|
+
} : attachCodexMirrorAttestation(nextMessage, sourceFingerprint);
|
|
6855
|
+
const mirrorIdentity = readMirrorIdentity(message);
|
|
6856
|
+
if (mirrorIdentity) messageToAppend = attachCodexMirrorIdentity(messageToAppend, mirrorIdentity);
|
|
6857
|
+
messageToAppend = projectAgentHarnessTranscriptMessageForDisplay({
|
|
6858
|
+
hidden: message.display === false,
|
|
6859
|
+
message: messageToAppend
|
|
6860
|
+
});
|
|
6861
|
+
const { messageSeq, result: appended } = await transcript.appendMessageWithMessageSequence({
|
|
6862
|
+
message: messageToAppend,
|
|
6863
|
+
idempotencyLookup: "scan",
|
|
6864
|
+
cwd: params.cwd
|
|
6865
|
+
});
|
|
6866
|
+
if (!appended) continue;
|
|
6867
|
+
const { messageId, message: appendedMessage } = appended;
|
|
6868
|
+
if (isMirroredAgentMessage(appendedMessage)) {
|
|
6869
|
+
nextMessagesPresent.push(appendedMessage);
|
|
6870
|
+
if (idempotencyKey) mirrorFacts.messagesByIdempotencyKey.set(idempotencyKey, appendedMessage);
|
|
6871
|
+
}
|
|
6872
|
+
if (message.role === "assistant") nextAssistantMirrorIdentitiesOwned.add(dedupeIdentity);
|
|
6873
|
+
if (appendedMessage.role === "user") nextUserMessagesPresent.push(appendedMessage);
|
|
6874
|
+
if (appended.appended) nextAppendedUpdates.push({
|
|
6875
|
+
messageId,
|
|
6876
|
+
message: appendedMessage,
|
|
6877
|
+
...messageSeq !== void 0 ? { messageSeq } : {}
|
|
6878
|
+
});
|
|
6879
|
+
if (idempotencyKey) mirrorFacts.existingIdempotencyKeys.add(idempotencyKey);
|
|
6880
|
+
}
|
|
6881
|
+
return {
|
|
6882
|
+
appendedUpdates: nextAppendedUpdates,
|
|
6883
|
+
assistantMirrorIdentitiesOwned: [...nextAssistantMirrorIdentitiesOwned],
|
|
6884
|
+
messagesPresent: nextMessagesPresent,
|
|
6885
|
+
userMessagesPresent: nextUserMessagesPresent
|
|
6886
|
+
};
|
|
6887
|
+
});
|
|
6888
|
+
for (const update of appendedUpdates) try {
|
|
6889
|
+
await publishSessionTranscriptUpdateByIdentity({
|
|
6890
|
+
...transcriptTarget,
|
|
6891
|
+
update: {
|
|
6892
|
+
...params.agentId ? { agentId: params.agentId } : {},
|
|
6893
|
+
message: update.message,
|
|
6894
|
+
messageId: update.messageId,
|
|
6895
|
+
...update.messageSeq !== void 0 ? { messageSeq: update.messageSeq } : {},
|
|
6896
|
+
sessionKey: transcriptTarget.sessionKey
|
|
6897
|
+
}
|
|
6898
|
+
});
|
|
6899
|
+
} catch (error) {
|
|
6900
|
+
embeddedAgentLog.warn("failed to publish codex app-server transcript update", { error: formatErrorMessage(error) });
|
|
6901
|
+
}
|
|
6902
|
+
return {
|
|
6903
|
+
assistantMirrorIdentitiesOwned,
|
|
6904
|
+
messagesPresent,
|
|
6905
|
+
userMessagesPresent
|
|
6906
|
+
};
|
|
6907
|
+
}
|
|
6908
|
+
const codexTranscriptMirrorRuntime = {
|
|
6909
|
+
mirror,
|
|
6910
|
+
mirrorBestEffort
|
|
6911
|
+
};
|
|
6912
|
+
function resolveCodexMirrorTranscriptTarget(params) {
|
|
6913
|
+
const sessionKey = params.sessionKey?.trim();
|
|
6914
|
+
const storePath = params.storePath?.trim();
|
|
6915
|
+
if (!sessionKey || !storePath) throw new Error("Codex transcript mirror requires a runtime session identity");
|
|
6916
|
+
return {
|
|
6917
|
+
...params.agentId ? { agentId: params.agentId } : {},
|
|
6918
|
+
sessionId: params.sessionId,
|
|
6919
|
+
sessionKey,
|
|
6920
|
+
storePath
|
|
6921
|
+
};
|
|
6922
|
+
}
|
|
6923
|
+
//#endregion
|
|
6924
|
+
export { readCodexTurnCompletedNotification as C, readCodexTurn as S, assertCodexThreadStartResponse as _, projectBoundedCodexThreadHistory as a, readCodexErrorNotification as b, fingerprintCodexMirrorSourceMessage as c, attachCodexMirrorIdentity as d, readMirrorIdentity as f, assertCodexThreadResumeResponse as g, assertCodexThreadForkResponse as h, mirrorPromptAtTurnStartBestEffort as i, readCodexMirrorSourceFingerprint as l, assertCodexThreadForkParams as m, createCodexAppServerUserMessagePersistenceNotifier as n, buildCodexUserPromptMessage as o, readUpstreamUserText as p, importCodexThreadHistoryToTranscript as r, promptSnapshot as s, codexTranscriptMirrorRuntime as t, serializeCodexMirrorSourceEvidence as u, assertCodexTurnStartResponse as v, readCodexModelListResponse as x, readCodexDynamicToolCallParams as y };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { d as sessionBindingIdentity } from "./session-binding-BXpo9ymA.js";
|
|
2
|
+
import { h as assertCodexThreadForkResponse } from "./transcript-mirror-DzsdNCf5.js";
|
|
3
3
|
import { t as isIncognitoSessionKey } from "./incognito-session-ET_ufDH-.js";
|
|
4
|
-
import { i as createImportedCodexSession, n as codexUpstreamBaseline, t as codexLastTerminalTurnId } from "./session-upstream-marker-
|
|
4
|
+
import { i as createImportedCodexSession, n as codexUpstreamBaseline, t as codexLastTerminalTurnId } from "./session-upstream-marker-B6U7tLw5.js";
|
|
5
5
|
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { readVisibleSessionTranscriptMessageEntries } from "openclaw/plugin-sdk/session-transcript-runtime";
|
|
7
7
|
import { deleteSessionUpstreamLink, upsertSessionUpstreamLink } from "openclaw/plugin-sdk/session-catalog";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as buildCodexAppServerUsageSnapshot } from "./rate-limits-
|
|
3
|
-
import { t as readCodexAppServerUsage } from "./request-
|
|
1
|
+
import { g as resolveCodexAppServerRuntimeOptions } from "./session-binding-BXpo9ymA.js";
|
|
2
|
+
import { t as buildCodexAppServerUsageSnapshot } from "./rate-limits-CU-gVCCS.js";
|
|
3
|
+
import { t as readCodexAppServerUsage } from "./request-qKh331yu.js";
|
|
4
4
|
import { CODEX_APP_SERVER_AUTH_MARKER } from "openclaw/plugin-sdk/agent-runtime";
|
|
5
5
|
//#region extensions/codex/src/app-server/usage.ts
|
|
6
6
|
/** Handles the synthetic usage credential for a Codex-backed OpenAI route. */
|