@openclaw/codex 2026.7.2-beta.7 → 2026.8.1-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/api.js +147 -0
- package/dist/app-server-policy-bg5QPSVP.js +25 -0
- package/dist/attempt-client-cleanup-URjUlCHg.js +735 -0
- package/dist/binding-connection-DAvZwp96.js +45 -0
- package/dist/{bounded-turn-D2ZAgZVz.js → bounded-turn-4BjrZEwW.js} +63 -56
- package/dist/{capabilities-BFDTVYr4.js → capabilities-CH3K57v4.js} +8 -2
- package/dist/cli-metadata.js +1 -1
- package/dist/{command-formatters-C336eRVS.js → command-formatters-D0nZ3qtd.js} +18 -18
- package/dist/{command-handlers-DAHUSry9.js → command-handlers-DC86lgT4.js} +507 -101
- package/dist/command-rpc-xUIIonsO.js +90 -0
- package/dist/{compact-D_uvHurS.js → compact-COqgBRny.js} +234 -214
- package/dist/{session-binding-BXpo9ymA.js → config-CpNeo5AE.js} +284 -1163
- package/dist/context-compaction-activity-BOeJf7yo.js +58 -0
- package/dist/{conversation-binding-data-BHRpYbX3.js → conversation-binding-data-CW2GuupV.js} +6 -10
- package/dist/doctor-contract-api.js +48 -50
- package/dist/{dynamic-tools-D2gYkSBO.js → dynamic-tools-fJZhl4CE.js} +3442 -1433
- package/dist/{effective-mcp-catalog-Bbd98Inw.js → effective-mcp-catalog-4YKn51aG.js} +20 -15
- package/dist/elicitation-input-DMkeki8d.js +71 -0
- package/dist/{event-projector-assistant-message-DTgnPPVF.js → event-projector-assistant-message-BwxV4d6N.js} +11 -23
- package/dist/{attempt-notifications-AP-a-Q5k.js → event-projector-usage-CLwNEJqW.js} +113 -29
- package/dist/harness-DoKQcF8n.js +258 -0
- package/dist/harness.js +2 -160
- package/dist/image-payload-sanitizer-CnfoUPCE.js +65 -0
- package/dist/index.js +730 -256
- package/dist/isolated-completion-DPMtlH9r.js +75 -0
- package/dist/local-runtime-attribution-B_2mnqhb.js +19 -0
- package/dist/managed-binary-By4FZC6i.js +212 -0
- package/dist/media-understanding-provider.js +5 -5
- package/dist/model-catalog-CmGoqVKB.js +48 -0
- package/dist/{models-BBMKU4jA.js → models-CZw1wClT.js} +12 -17
- package/dist/native-subagent-monitor-GGq3RnOo.js +3225 -0
- package/dist/node-exec-server.runtime-Bsu1LdFZ.js +192 -0
- package/dist/{plugin-app-cache-key-DztPafOA.js → plugin-app-cache-key-DMNQ8Zi8.js} +18 -6
- package/dist/plugin-approval-roundtrip-C75Yiiwc.js +95 -0
- package/dist/plugin-marketplace-discovery-CSWDkMrP.js +399 -0
- package/dist/{computer-use-CYEc8U3w.js → plugin-metadata-cache-BXH5NF-4.js} +109 -6
- package/dist/protocol-validators-VAVyEnDp.js +2399 -0
- package/dist/{rate-limits-CU-gVCCS.js → rate-limits-BI1dMHDG.js} +17 -35
- package/dist/{request-qKh331yu.js → request-DSK0W6YI.js} +3 -3
- package/dist/{run-attempt-CY9WlDLc.js → run-attempt-BV3HzuCf.js} +3416 -7194
- package/dist/{runtime-artifact-CmtG_t1L.js → runtime-artifact-BvyT1uyd.js} +11 -29
- package/dist/{sandbox-guard-NuhpXmPB.js → sandbox-guard-C1qEeZ5C.js} +29 -30
- package/dist/session-binding-BTrLf9Qm.js +874 -0
- package/dist/{session-catalog-DyOgR4WH.js → session-catalog-ezP_UcRM.js} +1584 -1289
- package/dist/session-catalog-home-id-BNwAJ9D7.js +18 -0
- package/dist/{session-cli-2PZaFLRh.js → session-cli-B1hKvfkI.js} +20 -7
- package/dist/session-retirement-CE4iMiLh.js +36 -0
- package/dist/{session-upstream-marker-B6U7tLw5.js → session-upstream-marker-D_2npHlA.js} +1 -1
- package/dist/{settled-turn-finalizer-CXY2Z9dT.js → settled-turn-finalizer-Dx1onIqg.js} +40 -28
- package/dist/{shared-client-DTbvH-XV.js → shared-client-Dw-rzii0.js} +1315 -469
- package/dist/{side-question-_ulBk1AL.js → side-question-DbXkJZzg.js} +140 -69
- package/dist/{thread-lifecycle-DF53ogiA.js → thread-lifecycle-DKdrnTMX.js} +927 -768
- package/dist/thread-ownership-i2NBwDUL.js +92 -0
- package/dist/thread-resume-CdJk2Ehf.js +30 -0
- package/dist/transcript-mirror-BU0_LKAL.js +588 -0
- package/dist/{transport-stdio-DXgGZ7Ib.js → transport-stdio-DhoGy33Z.js} +13 -2
- package/dist/upstream-prompt-provenance-CFmsKwr9.js +39 -0
- package/dist/{upstream-session-fork-Dy4Xvuoj.js → upstream-session-fork-BDVJCLAD.js} +14 -8
- package/dist/{usage-CQ6GhD5-.js → usage-9dKJCgcy.js} +3 -3
- package/dist/{web-search-provider.runtime-CCFhg2z5.js → web-search-provider.runtime-DCdx4DGu.js} +8 -9
- package/openclaw.plugin.json +49 -4
- package/package.json +6 -5
- package/dist/app-server-policy-BSaO2JIT.js +0 -49
- package/dist/conversation-control-xsIeXbo4.js +0 -287
- package/dist/event-projector-usage-Xp4AlR2k.js +0 -86
- package/dist/notification-correlation-CU6_AnOb.js +0 -67
- package/dist/transcript-mirror-DzsdNCf5.js +0 -6924
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { embeddedAgentLog, formatErrorMessage } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
2
|
+
import { appendSessionTranscriptMessageByIdentity, publishSessionTranscriptUpdateByIdentity } from "openclaw/plugin-sdk/session-transcript-runtime";
|
|
3
|
+
//#region extensions/codex/src/app-server/context-compaction-activity.ts
|
|
4
|
+
const CONTEXT_COMPACTION_CUSTOM_TYPE = "openclaw.context-compaction";
|
|
5
|
+
async function persistCodexContextCompactionActivity(params) {
|
|
6
|
+
const target = params.sessionTarget;
|
|
7
|
+
if (!target?.sessionId || !target.sessionKey || !target.storePath) return;
|
|
8
|
+
const activityId = `codex-context-compaction:${params.threadId}:${params.turnId}:${params.itemId}`;
|
|
9
|
+
const message = {
|
|
10
|
+
role: "custom",
|
|
11
|
+
customType: CONTEXT_COMPACTION_CUSTOM_TYPE,
|
|
12
|
+
content: "Context compacted",
|
|
13
|
+
display: true,
|
|
14
|
+
excludeFromContext: true,
|
|
15
|
+
details: {
|
|
16
|
+
kind: "context_compaction",
|
|
17
|
+
backend: "codex-app-server",
|
|
18
|
+
threadId: params.threadId,
|
|
19
|
+
turnId: params.turnId,
|
|
20
|
+
itemId: params.itemId,
|
|
21
|
+
...params.runId ? { runId: params.runId } : {}
|
|
22
|
+
},
|
|
23
|
+
...params.runId ? { __openclaw: { runId: params.runId } } : {},
|
|
24
|
+
timestamp: params.timestamp,
|
|
25
|
+
idempotencyKey: activityId
|
|
26
|
+
};
|
|
27
|
+
try {
|
|
28
|
+
const appended = await appendSessionTranscriptMessageByIdentity({
|
|
29
|
+
agentId: target.agentId,
|
|
30
|
+
sessionId: target.sessionId,
|
|
31
|
+
sessionKey: target.sessionKey,
|
|
32
|
+
storePath: target.storePath,
|
|
33
|
+
config: params.config,
|
|
34
|
+
cwd: params.cwd,
|
|
35
|
+
eventId: activityId,
|
|
36
|
+
message
|
|
37
|
+
});
|
|
38
|
+
if (!appended?.appended) return;
|
|
39
|
+
await publishSessionTranscriptUpdateByIdentity({
|
|
40
|
+
agentId: target.agentId,
|
|
41
|
+
sessionId: target.sessionId,
|
|
42
|
+
sessionKey: target.sessionKey,
|
|
43
|
+
storePath: target.storePath,
|
|
44
|
+
update: {
|
|
45
|
+
message: appended.message,
|
|
46
|
+
messageId: appended.messageId,
|
|
47
|
+
...params.runId ? { runId: params.runId } : {}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
} catch (error) {
|
|
51
|
+
embeddedAgentLog.warn("failed to persist codex context compaction activity", {
|
|
52
|
+
error: formatErrorMessage(error),
|
|
53
|
+
itemId: params.itemId
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
export { persistCodexContextCompactionActivity as t };
|
package/dist/{conversation-binding-data-BHRpYbX3.js → conversation-binding-data-CW2GuupV.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
+
import { asOptionalRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
3
|
import { createHash, randomUUID } from "node:crypto";
|
|
3
|
-
import { asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import process from "node:process";
|
|
5
5
|
//#region extensions/codex/src/conversation-binding-data.ts
|
|
6
6
|
var conversation_binding_data_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -77,10 +77,10 @@ function readCodexConversationBindingDataRecord(data) {
|
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
79
|
function readConversationSource(value) {
|
|
80
|
-
const agentId =
|
|
81
|
-
const sessionId =
|
|
82
|
-
const threadId =
|
|
83
|
-
const sessionKey =
|
|
80
|
+
const agentId = normalizeOptionalString(value?.agentId);
|
|
81
|
+
const sessionId = normalizeOptionalString(value?.sessionId);
|
|
82
|
+
const threadId = normalizeOptionalString(value?.threadId);
|
|
83
|
+
const sessionKey = normalizeOptionalString(value?.sessionKey);
|
|
84
84
|
if (!agentId || !sessionId || !threadId) return;
|
|
85
85
|
return {
|
|
86
86
|
agentId,
|
|
@@ -94,11 +94,7 @@ function legacyCodexConversationBindingId(sessionFile) {
|
|
|
94
94
|
return `legacy-${createHash("sha256").update(sessionFile).digest("base64url")}`;
|
|
95
95
|
}
|
|
96
96
|
function resolveCodexDefaultWorkspaceDir(pluginConfig) {
|
|
97
|
-
return
|
|
98
|
-
}
|
|
99
|
-
function readString(record, key) {
|
|
100
|
-
const value = record?.[key];
|
|
101
|
-
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
97
|
+
return normalizeOptionalString(asOptionalRecord(asOptionalRecord(pluginConfig)?.appServer)?.defaultWorkspaceDir) ?? process.cwd();
|
|
102
98
|
}
|
|
103
99
|
function readConversationStart(value) {
|
|
104
100
|
const read = (key) => {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { n as CODEX_APP_SERVER_BINDING_NAMESPACE, t as CODEX_APP_SERVER_BINDING_MAX_ENTRIES } from "./session-binding-meta-B7aEMU7g.js";
|
|
2
|
+
import { asNullableRecord, isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
3
|
import fs from "node:fs/promises";
|
|
3
4
|
import path from "node:path";
|
|
4
|
-
import { listAgentIds, resolveAgentDir, resolveSessionAgentIds } from "openclaw/plugin-sdk/agent-runtime";
|
|
5
5
|
import { isDeepStrictEqual } from "node:util";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { listAgentIds, resolveAgentDir, resolveSessionAgentIds } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
7
|
+
import { pathExists } from "openclaw/plugin-sdk/security-runtime";
|
|
8
|
+
import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
|
|
9
|
+
import { canonicalPathFromExistingAncestor, isPathInside } from "openclaw/plugin-sdk/file-access-runtime";
|
|
9
10
|
import { withFileLock } from "openclaw/plugin-sdk/file-lock";
|
|
10
|
-
import { archiveLegacyStateSource, legacyStateFileExists } from "openclaw/plugin-sdk/runtime-doctor";
|
|
11
|
+
import { archiveLegacyStateSource, legacyStateFileExists } from "openclaw/plugin-sdk/runtime-doctor-migrations";
|
|
11
12
|
//#region extensions/codex/src/migration/session-binding-sidecars.ts
|
|
12
13
|
const LEGACY_BINDING_SUFFIX = ".codex-app-server.json";
|
|
13
14
|
const CODEX_AGENT_HARNESS_ID = "codex";
|
|
@@ -22,6 +23,7 @@ const LEGACY_BINDING_LOCK_OPTIONS = {
|
|
|
22
23
|
stale: 12e4
|
|
23
24
|
};
|
|
24
25
|
async function collectSessionSurfaces(params) {
|
|
26
|
+
const { resolveStorePath } = await import("openclaw/plugin-sdk/session-store-runtime");
|
|
25
27
|
const surfaces = /* @__PURE__ */ new Map();
|
|
26
28
|
const stateRoot = await canonicalPathFromExistingAncestor(params.stateDir);
|
|
27
29
|
const add = async (root, storePath, agentId, scan) => {
|
|
@@ -34,7 +36,7 @@ async function collectSessionSurfaces(params) {
|
|
|
34
36
|
};
|
|
35
37
|
surface.scan ||= scan;
|
|
36
38
|
surface.storePaths.add(path.resolve(storePath));
|
|
37
|
-
surface.agentIds.add(agentId);
|
|
39
|
+
if (agentId) surface.agentIds.add(agentId);
|
|
38
40
|
surfaces.set(canonicalRoot, surface);
|
|
39
41
|
};
|
|
40
42
|
const agentIds = new Set(listAgentIds(params.config));
|
|
@@ -58,8 +60,11 @@ async function collectSessionSurfaces(params) {
|
|
|
58
60
|
await add(root, storePath, agentId, isPathInside(stateRoot, await canonicalPathFromExistingAncestor(root)));
|
|
59
61
|
}
|
|
60
62
|
const legacyRoot = path.join(params.stateDir, "sessions");
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
+
const legacyOwner = tryResolveLegacyBindingOwnerAgentId({
|
|
64
|
+
sessionKey: "",
|
|
65
|
+
config: params.config
|
|
66
|
+
});
|
|
67
|
+
await add(legacyRoot, path.join(legacyRoot, "sessions.json"), legacyOwner, true);
|
|
63
68
|
return [...surfaces.values()].toSorted((a, b) => a.root.localeCompare(b.root));
|
|
64
69
|
}
|
|
65
70
|
async function collectLegacyBindingSources(params, options = {}) {
|
|
@@ -164,6 +169,7 @@ async function* walkSidecars(root) {
|
|
|
164
169
|
}
|
|
165
170
|
}
|
|
166
171
|
async function collectBindingOwners(sources, surfaces, params) {
|
|
172
|
+
const { resolveStorePath } = await import("openclaw/plugin-sdk/session-store-runtime");
|
|
167
173
|
const sourcePaths = new Set(await Promise.all(sources.map((source) => canonicalPathFromExistingAncestor(source.transcriptPath))));
|
|
168
174
|
const owners = /* @__PURE__ */ new Map();
|
|
169
175
|
const storePaths = new Set(surfaces.flatMap((surface) => [...surface.storePaths]));
|
|
@@ -184,11 +190,15 @@ async function collectBindingOwners(sources, surfaces, params) {
|
|
|
184
190
|
const sessionsDir = path.dirname(storePath);
|
|
185
191
|
for (const { sessionKey, entry } of index.entries) {
|
|
186
192
|
const sessionId = entry.sessionId;
|
|
187
|
-
const agentId =
|
|
193
|
+
const agentId = tryResolveLegacyBindingOwnerAgentId({
|
|
188
194
|
sessionKey,
|
|
189
195
|
config: params.config,
|
|
190
196
|
storeAgentIds: storeAgentIds.get(storePath)
|
|
191
197
|
});
|
|
198
|
+
if (!agentId) {
|
|
199
|
+
failures.push(`session index ${storePath} has an ambiguous owner for ${sessionKey}`);
|
|
200
|
+
continue;
|
|
201
|
+
}
|
|
192
202
|
let legacyTranscriptPath;
|
|
193
203
|
let canonicalLegacyTranscriptPath;
|
|
194
204
|
try {
|
|
@@ -234,17 +244,24 @@ async function resolveLegacySessionFileLocator(sessionsDir, entry, sessionId) {
|
|
|
234
244
|
if (!isPathInside(canonicalBase, canonicalCandidate)) throw new Error("legacy session file locator escapes its session directory");
|
|
235
245
|
return candidate;
|
|
236
246
|
}
|
|
237
|
-
function
|
|
247
|
+
function tryResolveLegacyBindingOwnerAgentId(params) {
|
|
238
248
|
if (params.sessionKey.trim().toLowerCase().startsWith("agent:")) return resolveSessionAgentIds({
|
|
239
249
|
sessionKey: params.sessionKey,
|
|
240
250
|
config: params.config
|
|
241
251
|
}).sessionAgentId;
|
|
242
252
|
const storeAgentId = params.storeAgentIds?.size === 1 ? [...params.storeAgentIds][0] : void 0;
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
253
|
+
const configuredAgentId = params.config.agents?.defaults?.systemAgent?.agentId?.trim();
|
|
254
|
+
const systemAgentId = !storeAgentId && configuredAgentId ? normalizeAgentId(configuredAgentId) : void 0;
|
|
255
|
+
const fallbackAgentIds = systemAgentId && listAgentIds(params.config).includes(systemAgentId) ? [void 0, systemAgentId] : [void 0];
|
|
256
|
+
for (const fallbackAgentId of fallbackAgentIds) try {
|
|
257
|
+
return resolveSessionAgentIds({
|
|
258
|
+
sessionKey: params.sessionKey,
|
|
259
|
+
config: params.config,
|
|
260
|
+
...storeAgentId ? { agentId: storeAgentId } : fallbackAgentId ? { fallbackAgentId } : {}
|
|
261
|
+
}).sessionAgentId;
|
|
262
|
+
} catch (error) {
|
|
263
|
+
if (error.code !== "AGENT_SELECTION_REQUIRED") throw error;
|
|
264
|
+
}
|
|
248
265
|
}
|
|
249
266
|
function copyBindingForSession(stored, sessionId) {
|
|
250
267
|
return stored.state === "active" ? {
|
|
@@ -276,7 +293,7 @@ async function migrateSource(source, candidates, params, store) {
|
|
|
276
293
|
return await withFileLock(source.sidecarPath, LEGACY_BINDING_LOCK_OPTIONS, async () => {
|
|
277
294
|
const [contents, stat] = await Promise.all([fs.readFile(source.sidecarPath, "utf8"), fs.stat(source.sidecarPath)]);
|
|
278
295
|
const raw = JSON.parse(contents);
|
|
279
|
-
const [{ bindingStoreKey, createStoredCodexAppServerBinding, normalizeStoredCodexAppServerBindingFingerprints, readStoredCodexAppServerBinding }, { legacyCodexConversationBindingId }] = await Promise.all([import("./session-binding-
|
|
296
|
+
const [{ bindingStoreKey, createStoredCodexAppServerBinding, normalizeStoredCodexAppServerBindingFingerprints, readStoredCodexAppServerBinding }, { legacyCodexConversationBindingId }] = await Promise.all([import("./session-binding-BTrLf9Qm.js").then((n) => n.f), import("./conversation-binding-data-CW2GuupV.js").then((n) => n.t)]);
|
|
280
297
|
const agentId = owner?.agentId ?? (source.agentIds.size === 1 ? [...source.agentIds][0] : void 0);
|
|
281
298
|
const baseStored = createStoredCodexAppServerBinding(raw, {
|
|
282
299
|
now: stat.mtime.toISOString(),
|
|
@@ -398,6 +415,7 @@ async function migrateSource(source, candidates, params, store) {
|
|
|
398
415
|
}
|
|
399
416
|
}
|
|
400
417
|
async function recordSessionOwner(owner, env) {
|
|
418
|
+
const { patchSessionEntry } = await import("openclaw/plugin-sdk/session-store-runtime");
|
|
401
419
|
const currentIndex = await readLegacySessionIndex(owner.storePath);
|
|
402
420
|
if ("failure" in currentIndex) return "its legacy session owner could not be revalidated";
|
|
403
421
|
const currentOwner = currentIndex.entries.find(({ sessionKey }) => sessionKey === owner.sessionKey);
|
|
@@ -509,21 +527,18 @@ const stateMigrations = [{
|
|
|
509
527
|
}];
|
|
510
528
|
//#endregion
|
|
511
529
|
//#region extensions/codex/doctor-contract-api.ts
|
|
512
|
-
function asRecord(value) {
|
|
513
|
-
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
514
|
-
}
|
|
515
530
|
function hasRetiredDynamicToolsProfile(value) {
|
|
516
|
-
return Object.hasOwn(
|
|
531
|
+
return Object.hasOwn(asNullableRecord(value) ?? {}, "codexDynamicToolsProfile");
|
|
517
532
|
}
|
|
518
533
|
function hasLegacyPluginDestructivePolicy(value) {
|
|
519
|
-
const codexPlugins =
|
|
534
|
+
const codexPlugins = asNullableRecord(value);
|
|
520
535
|
if (!codexPlugins) return false;
|
|
521
536
|
if (codexPlugins.allow_destructive_actions === "on-request") return true;
|
|
522
|
-
const plugins =
|
|
523
|
-
return Object.values(plugins ?? {}).some((plugin) =>
|
|
537
|
+
const plugins = asNullableRecord(codexPlugins.plugins);
|
|
538
|
+
return Object.values(plugins ?? {}).some((plugin) => asNullableRecord(plugin)?.allow_destructive_actions === "on-request");
|
|
524
539
|
}
|
|
525
540
|
function hasRetiredOnFailureApprovalPolicy(value) {
|
|
526
|
-
return
|
|
541
|
+
return asNullableRecord(value)?.approvalPolicy === "on-failure";
|
|
527
542
|
}
|
|
528
543
|
/** Legacy Codex config keys that doctor should report or repair. */
|
|
529
544
|
const legacyConfigRules = [
|
|
@@ -564,9 +579,9 @@ const legacyConfigRules = [
|
|
|
564
579
|
* Removes retired Codex plugin config keys while preserving unrelated config.
|
|
565
580
|
*/
|
|
566
581
|
function normalizeCompatibilityConfig({ cfg }) {
|
|
567
|
-
const rawPluginConfig =
|
|
568
|
-
const rawCodexPlugins =
|
|
569
|
-
const rawAppServer =
|
|
582
|
+
const rawPluginConfig = asNullableRecord(asNullableRecord(cfg.plugins?.entries?.codex)?.config);
|
|
583
|
+
const rawCodexPlugins = asNullableRecord(rawPluginConfig?.codexPlugins);
|
|
584
|
+
const rawAppServer = asNullableRecord(rawPluginConfig?.appServer);
|
|
570
585
|
const shouldRemoveDynamicToolsProfile = rawPluginConfig !== null && hasRetiredDynamicToolsProfile(rawPluginConfig);
|
|
571
586
|
const shouldRewriteDestructivePolicy = hasLegacyPluginDestructivePolicy(rawCodexPlugins);
|
|
572
587
|
const shouldRewriteApprovalPolicy = hasRetiredOnFailureApprovalPolicy(rawAppServer);
|
|
@@ -575,7 +590,7 @@ function normalizeCompatibilityConfig({ cfg }) {
|
|
|
575
590
|
changes: []
|
|
576
591
|
};
|
|
577
592
|
const nextConfig = structuredClone(cfg);
|
|
578
|
-
const nextPluginConfig =
|
|
593
|
+
const nextPluginConfig = asNullableRecord(asNullableRecord(asNullableRecord(asNullableRecord(nextConfig.plugins)?.entries)?.codex)?.config);
|
|
579
594
|
if (!nextPluginConfig) return {
|
|
580
595
|
config: cfg,
|
|
581
596
|
changes: []
|
|
@@ -586,17 +601,17 @@ function normalizeCompatibilityConfig({ cfg }) {
|
|
|
586
601
|
changes.push("Removed retired plugins.entries.codex.config.codexDynamicToolsProfile; Codex app-server always keeps Codex-native workspace tools native.");
|
|
587
602
|
}
|
|
588
603
|
if (shouldRewriteDestructivePolicy) {
|
|
589
|
-
const nextCodexPlugins =
|
|
604
|
+
const nextCodexPlugins = asNullableRecord(nextPluginConfig.codexPlugins);
|
|
590
605
|
if (nextCodexPlugins?.allow_destructive_actions === "on-request") nextCodexPlugins.allow_destructive_actions = "auto";
|
|
591
|
-
const nextPluginPolicies =
|
|
606
|
+
const nextPluginPolicies = asNullableRecord(nextCodexPlugins?.plugins);
|
|
592
607
|
for (const plugin of Object.values(nextPluginPolicies ?? {})) {
|
|
593
|
-
const nextPlugin =
|
|
608
|
+
const nextPlugin = asNullableRecord(plugin);
|
|
594
609
|
if (nextPlugin?.allow_destructive_actions === "on-request") nextPlugin.allow_destructive_actions = "auto";
|
|
595
610
|
}
|
|
596
611
|
changes.push("Renamed plugins.entries.codex.config.codexPlugins allow_destructive_actions=\"on-request\" values to \"auto\".");
|
|
597
612
|
}
|
|
598
613
|
if (shouldRewriteApprovalPolicy) {
|
|
599
|
-
const nextAppServer =
|
|
614
|
+
const nextAppServer = asNullableRecord(nextPluginConfig.appServer);
|
|
600
615
|
if (nextAppServer?.approvalPolicy === "on-failure") nextAppServer.approvalPolicy = "on-request";
|
|
601
616
|
changes.push("Renamed plugins.entries.codex.config.appServer.approvalPolicy=\"on-failure\" to \"on-request\".");
|
|
602
617
|
}
|
|
@@ -605,22 +620,5 @@ function normalizeCompatibilityConfig({ cfg }) {
|
|
|
605
620
|
changes
|
|
606
621
|
};
|
|
607
622
|
}
|
|
608
|
-
/** Session/auth ownership metadata used by doctor route-state checks. */
|
|
609
|
-
const sessionRouteStateOwners = [{
|
|
610
|
-
id: "codex",
|
|
611
|
-
label: "Codex",
|
|
612
|
-
providerIds: [
|
|
613
|
-
"codex",
|
|
614
|
-
"codex-cli",
|
|
615
|
-
"openai-codex"
|
|
616
|
-
],
|
|
617
|
-
runtimeIds: ["codex", "codex-cli"],
|
|
618
|
-
cliSessionKeys: ["codex-cli"],
|
|
619
|
-
authProfilePrefixes: [
|
|
620
|
-
"codex:",
|
|
621
|
-
"codex-cli:",
|
|
622
|
-
"openai-codex:"
|
|
623
|
-
]
|
|
624
|
-
}];
|
|
625
623
|
//#endregion
|
|
626
|
-
export { legacyConfigRules, normalizeCompatibilityConfig,
|
|
624
|
+
export { legacyConfigRules, normalizeCompatibilityConfig, stateMigrations };
|