@openclaw/codex 2026.6.5 → 2026.6.6-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/{client-kMCtlApt.js → client-DovmVtbr.js} +3 -10
- package/dist/{client-factory-Bt49r45B.js → client-factory-XajDuvQ1.js} +1 -1
- package/dist/{command-handlers-DMn2M7W7.js → command-handlers-DIUFKqaF.js} +11 -9
- package/dist/{compact-CwnPeYnM.js → compact-BWiNkDSs.js} +96 -9
- package/dist/{computer-use-ClweWaMz.js → computer-use-D3pi5csE.js} +3 -2
- package/dist/{config-BT6SLiE6.js → config-DJXpBkGf.js} +214 -13
- package/dist/{conversation-binding-CzpvaBs1.js → conversation-binding-CMwrZrt7.js} +190 -65
- package/dist/harness.js +12 -5
- package/dist/index.js +11 -10
- package/dist/media-understanding-provider.js +6 -6
- package/dist/{models-DXorTaja.js → models-CQGfP7nG.js} +2 -2
- package/dist/{native-hook-relay-DHwz_ICg.js → native-hook-relay-CmUUO3Eu.js} +160 -4
- package/dist/notification-correlation-D-MYfJwV.js +382 -0
- package/dist/{request-D64BfplD.js → plugin-app-cache-key-NpzxEcSR.js} +4 -36
- package/dist/protocol-oeJQu4rs.js +9 -0
- package/dist/{protocol-validators-CIpP8IJ2.js → protocol-validators-B48C6S9O.js} +2296 -2273
- package/dist/provider-Cs6kWhDQ.js +584 -0
- package/dist/provider.js +1 -164
- package/dist/request-Dq0LUOqZ.js +36 -0
- package/dist/{run-attempt-BWdNnok4.js → run-attempt-DG9p9ReO.js} +374 -65
- package/dist/{session-binding-BgTv_YGm.js → session-binding-ElbcSq2o.js} +107 -44
- package/dist/{shared-client-xytpSKD0.js → shared-client-CflavQ_i.js} +3 -3
- package/dist/{side-question-BnvBQPqW.js → side-question-Ctu2VXAG.js} +82 -26
- package/dist/{thread-lifecycle-BJsazZ8j.js → thread-lifecycle-Cq1-IfZB.js} +115 -34
- package/npm-shrinkwrap.json +30 -30
- package/package.json +5 -5
- package/dist/notification-correlation-o8quHmTK.js +0 -656
package/dist/provider.js
CHANGED
|
@@ -1,165 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as readCodexPluginConfig, l as resolveCodexAppServerRuntimeOptions } from "./config-BT6SLiE6.js";
|
|
3
|
-
import { resolveCodexSystemPromptContribution } from "./prompt-overlay.js";
|
|
4
|
-
import { resolvePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
5
|
-
import { normalizeModelCompat } from "openclaw/plugin-sdk/provider-model-shared";
|
|
6
|
-
import { createSubsystemLogger } from "openclaw/plugin-sdk/core";
|
|
7
|
-
//#region extensions/codex/provider.ts
|
|
8
|
-
/**
|
|
9
|
-
* Codex provider plugin and live app-server model catalog discovery.
|
|
10
|
-
*/
|
|
11
|
-
const DEFAULT_DISCOVERY_TIMEOUT_MS = 2500;
|
|
12
|
-
const LIVE_DISCOVERY_ENV = "OPENCLAW_CODEX_DISCOVERY_LIVE";
|
|
13
|
-
const MODEL_DISCOVERY_PAGE_LIMIT = 100;
|
|
14
|
-
const CODEX_APP_SERVER_SETUP_METHOD_ID = "app-server";
|
|
15
|
-
const CODEX_DEFAULT_MODEL_REF = `${CODEX_PROVIDER_ID}/${FALLBACK_CODEX_MODELS[0].id}`;
|
|
16
|
-
const codexCatalogLog = createSubsystemLogger("codex/catalog");
|
|
17
|
-
/**
|
|
18
|
-
* Builds the Codex provider plugin, including setup metadata, catalog discovery,
|
|
19
|
-
* dynamic model resolution, and prompt/thinking hooks.
|
|
20
|
-
*/
|
|
21
|
-
function buildCodexProvider(options = {}) {
|
|
22
|
-
return {
|
|
23
|
-
id: CODEX_PROVIDER_ID,
|
|
24
|
-
label: "Codex",
|
|
25
|
-
docsPath: "/providers/models",
|
|
26
|
-
auth: [{
|
|
27
|
-
id: CODEX_APP_SERVER_SETUP_METHOD_ID,
|
|
28
|
-
label: "Codex app-server",
|
|
29
|
-
hint: "Use the Codex app-server runtime and managed model catalog.",
|
|
30
|
-
kind: "custom",
|
|
31
|
-
wizard: {
|
|
32
|
-
choiceId: CODEX_PROVIDER_ID,
|
|
33
|
-
choiceLabel: "Codex app-server",
|
|
34
|
-
choiceHint: "Use the Codex app-server runtime and managed model catalog.",
|
|
35
|
-
assistantPriority: -40,
|
|
36
|
-
groupId: CODEX_PROVIDER_ID,
|
|
37
|
-
groupLabel: "Codex",
|
|
38
|
-
groupHint: "Codex app-server model provider",
|
|
39
|
-
onboardingScopes: ["text-inference"]
|
|
40
|
-
},
|
|
41
|
-
run: async () => ({
|
|
42
|
-
profiles: [],
|
|
43
|
-
defaultModel: CODEX_DEFAULT_MODEL_REF
|
|
44
|
-
})
|
|
45
|
-
}],
|
|
46
|
-
catalog: {
|
|
47
|
-
order: "late",
|
|
48
|
-
run: async (ctx) => {
|
|
49
|
-
const pluginConfig = resolvePluginConfigObject(ctx.config, "codex") ?? (ctx.config ? void 0 : options.pluginConfig);
|
|
50
|
-
return await buildCodexProviderCatalog({
|
|
51
|
-
env: ctx.env,
|
|
52
|
-
pluginConfig,
|
|
53
|
-
listModels: options.listModels
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
staticCatalog: {
|
|
58
|
-
order: "late",
|
|
59
|
-
run: async () => ({ provider: buildCodexProviderConfig(FALLBACK_CODEX_MODELS) })
|
|
60
|
-
},
|
|
61
|
-
resolveDynamicModel: (ctx) => resolveCodexDynamicModel(ctx.modelId),
|
|
62
|
-
resolveSyntheticAuth: () => ({
|
|
63
|
-
apiKey: CODEX_APP_SERVER_AUTH_MARKER,
|
|
64
|
-
source: "codex-app-server",
|
|
65
|
-
mode: "token"
|
|
66
|
-
}),
|
|
67
|
-
resolveThinkingProfile: ({ modelId }) => ({ levels: [
|
|
68
|
-
{ id: "off" },
|
|
69
|
-
{ id: "minimal" },
|
|
70
|
-
{ id: "low" },
|
|
71
|
-
{ id: "medium" },
|
|
72
|
-
{ id: "high" },
|
|
73
|
-
...isKnownXHighCodexModel(modelId) ? [{ id: "xhigh" }] : []
|
|
74
|
-
] }),
|
|
75
|
-
resolveSystemPromptContribution: ({ config, modelId }) => resolveCodexSystemPromptContribution({
|
|
76
|
-
config,
|
|
77
|
-
modelId
|
|
78
|
-
}),
|
|
79
|
-
isModernModelRef: ({ modelId }) => isModernCodexModel(modelId)
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Builds the Codex model catalog from live app-server discovery, falling back
|
|
84
|
-
* to built-in model records when discovery is disabled or unavailable.
|
|
85
|
-
*/
|
|
86
|
-
async function buildCodexProviderCatalog(options = {}) {
|
|
87
|
-
const config = readCodexPluginConfig(options.pluginConfig);
|
|
88
|
-
const appServer = resolveCodexAppServerRuntimeOptions({ pluginConfig: options.pluginConfig });
|
|
89
|
-
const timeoutMs = normalizeTimeoutMs(config.discovery?.timeoutMs);
|
|
90
|
-
let discovered = [];
|
|
91
|
-
if (config.discovery?.enabled !== false && !shouldSkipLiveDiscovery(options.env)) discovered = await listModelsBestEffort({
|
|
92
|
-
listModels: options.listModels ?? listCodexAppServerModelsLazy,
|
|
93
|
-
timeoutMs,
|
|
94
|
-
startOptions: appServer.start,
|
|
95
|
-
onDiscoveryFailure: options.onDiscoveryFailure
|
|
96
|
-
});
|
|
97
|
-
return { provider: buildCodexProviderConfig(discovered.length > 0 ? discovered : FALLBACK_CODEX_MODELS) };
|
|
98
|
-
}
|
|
99
|
-
function resolveCodexDynamicModel(modelId) {
|
|
100
|
-
const id = modelId.trim();
|
|
101
|
-
if (!id) return;
|
|
102
|
-
const fallbackModel = FALLBACK_CODEX_MODELS.find((model) => model.id === id);
|
|
103
|
-
return normalizeModelCompat({
|
|
104
|
-
...buildCodexModelDefinition({
|
|
105
|
-
id,
|
|
106
|
-
model: id,
|
|
107
|
-
inputModalities: fallbackModel?.inputModalities ?? ["text"],
|
|
108
|
-
supportedReasoningEfforts: fallbackModel?.supportedReasoningEfforts ?? (shouldDefaultToReasoningModel(id) ? ["medium"] : [])
|
|
109
|
-
}),
|
|
110
|
-
provider: CODEX_PROVIDER_ID,
|
|
111
|
-
baseUrl: CODEX_BASE_URL
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
async function listModelsBestEffort(params) {
|
|
115
|
-
try {
|
|
116
|
-
const models = [];
|
|
117
|
-
let cursor;
|
|
118
|
-
do {
|
|
119
|
-
const result = await params.listModels({
|
|
120
|
-
timeoutMs: params.timeoutMs,
|
|
121
|
-
limit: MODEL_DISCOVERY_PAGE_LIMIT,
|
|
122
|
-
cursor,
|
|
123
|
-
startOptions: params.startOptions,
|
|
124
|
-
sharedClient: false
|
|
125
|
-
});
|
|
126
|
-
models.push(...result.models.filter((model) => !model.hidden));
|
|
127
|
-
cursor = result.nextCursor;
|
|
128
|
-
} while (cursor);
|
|
129
|
-
return models;
|
|
130
|
-
} catch (error) {
|
|
131
|
-
params.onDiscoveryFailure?.(error);
|
|
132
|
-
codexCatalogLog.debug("codex model discovery failed; using fallback catalog", { error: error instanceof Error ? error.message : String(error) });
|
|
133
|
-
return [];
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
async function listCodexAppServerModelsLazy(options) {
|
|
137
|
-
const { listCodexAppServerModels } = await import("./models-DXorTaja.js").then((n) => n.r);
|
|
138
|
-
return listCodexAppServerModels(options);
|
|
139
|
-
}
|
|
140
|
-
function normalizeTimeoutMs(value) {
|
|
141
|
-
return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : DEFAULT_DISCOVERY_TIMEOUT_MS;
|
|
142
|
-
}
|
|
143
|
-
function shouldSkipLiveDiscovery(env = process.env) {
|
|
144
|
-
const override = env[LIVE_DISCOVERY_ENV]?.trim().toLowerCase();
|
|
145
|
-
if (override === "0" || override === "false") return true;
|
|
146
|
-
return Boolean(env.VITEST) && override !== "1";
|
|
147
|
-
}
|
|
148
|
-
function shouldDefaultToReasoningModel(modelId) {
|
|
149
|
-
const lower = modelId.toLowerCase();
|
|
150
|
-
return lower.startsWith("gpt-5") || lower.startsWith("o1") || lower.startsWith("o3") || lower.startsWith("o4");
|
|
151
|
-
}
|
|
152
|
-
function isKnownXHighCodexModel(modelId) {
|
|
153
|
-
const lower = modelId.trim().toLowerCase();
|
|
154
|
-
return lower.startsWith("gpt-5") || lower.startsWith("o3") || lower.startsWith("o4") || lower.includes("codex");
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Returns true for Codex models that use the modern reasoning effort enum and
|
|
158
|
-
* reject the legacy CLI `minimal` default.
|
|
159
|
-
*/
|
|
160
|
-
function isModernCodexModel(modelId) {
|
|
161
|
-
const lower = modelId.trim().toLowerCase();
|
|
162
|
-
return lower === "gpt-5.5" || lower === "gpt-5.4" || lower === "gpt-5.4-mini" || lower === "gpt-5.3-codex-spark";
|
|
163
|
-
}
|
|
164
|
-
//#endregion
|
|
1
|
+
import { n as buildCodexProviderCatalog, r as isModernCodexModel, t as buildCodexProvider } from "./provider-Cs6kWhDQ.js";
|
|
165
2
|
export { buildCodexProvider, buildCodexProviderCatalog, isModernCodexModel };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
+
import { a as getLeasedSharedCodexAppServerClient, i as createIsolatedCodexAppServerClient, l as withTimeout, o as releaseLeasedSharedCodexAppServerClient } from "./shared-client-CflavQ_i.js";
|
|
3
|
+
import { t as resolveCodexAppServerDirectSandboxBypassBlock } from "./sandbox-guard-C-Yv9uwY.js";
|
|
4
|
+
//#region extensions/codex/src/app-server/request.ts
|
|
5
|
+
var request_exports = /* @__PURE__ */ __exportAll({ requestCodexAppServerJson: () => requestCodexAppServerJson });
|
|
6
|
+
async function requestCodexAppServerJson(params) {
|
|
7
|
+
const sandboxBlock = resolveCodexAppServerDirectSandboxBypassBlock({
|
|
8
|
+
method: params.method,
|
|
9
|
+
requestParams: params.requestParams,
|
|
10
|
+
config: params.config,
|
|
11
|
+
sessionKey: params.sessionKey,
|
|
12
|
+
sessionId: params.sessionId
|
|
13
|
+
});
|
|
14
|
+
if (sandboxBlock) throw new Error(sandboxBlock);
|
|
15
|
+
const timeoutMs = params.timeoutMs ?? 6e4;
|
|
16
|
+
return await withTimeout((async () => {
|
|
17
|
+
const client = await (params.isolated ? createIsolatedCodexAppServerClient : getLeasedSharedCodexAppServerClient)({
|
|
18
|
+
startOptions: params.startOptions,
|
|
19
|
+
timeoutMs,
|
|
20
|
+
authProfileId: params.authProfileId,
|
|
21
|
+
agentDir: params.agentDir,
|
|
22
|
+
config: params.config
|
|
23
|
+
});
|
|
24
|
+
try {
|
|
25
|
+
return await client.request(params.method, params.requestParams, { timeoutMs });
|
|
26
|
+
} finally {
|
|
27
|
+
if (params.isolated) await client.closeAndWait({
|
|
28
|
+
exitTimeoutMs: 2e3,
|
|
29
|
+
forceKillDelayMs: 250
|
|
30
|
+
});
|
|
31
|
+
else releaseLeasedSharedCodexAppServerClient(client);
|
|
32
|
+
}
|
|
33
|
+
})(), timeoutMs, `codex app-server ${params.method} timed out`);
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { request_exports as n, requestCodexAppServerJson as t };
|